• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
:::


Browsing this Thread:   1 Anonymous Users






Re: pic18f46j50 模擬板 RB2按鍵問題
#3
中級會員
中級會員


查看用戶資訊
結果測了許久發現模擬板上的rb2按鍵的輸入都是high

那應該是專門用在看門狗測試用的

另外我還試過ra0、1看到 Data Sheet是用來比較器找不到關掉的地方XD

之後用了rc0、1關掉timer ck就可以了

發表於: 2009/9/24 13:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic18f46j50 模擬板 RB2按鍵問題
#2
版主
版主


查看用戶資訊
看一下 PIC18f46J50 Data Sheet Page-341
PORTB 2 default 設定為 Analog Input,改一下設定。

ANCON1: PCFG<12:8>: Analog Port Configuration bits (AN12-AN8)
1 = Pin configured as a digital port
0 = Pin configured as an analog channel – digital input disabled and reads ‘0’

發表於: 2009/9/23 15:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


pic18f46j50 模擬板 RB2按鍵問題
#1
中級會員
中級會員


查看用戶資訊
#include <p18f46j50.h>
config.........
void main()
{ TRISBbits.TRISB2 = 1;
TRISEbits.TRISE0 = 0;
while(1)
{ if(!PORTBbits.RB2)
PORTEbits.RE0 = 1;}
}

按下板子上的rb2按鍵卻沒有動作,

請問需要再另外宣告其他東西嗎,

我看書和例子都使用tris 來宣告的,

請給我一些提示吧,謝謝。

發表於: 2009/9/22 11:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------