Browsing this Thread:
1 Anonymous Users
|
Re: 關於port的預設值
|
|
版主
Joined
: 2004/4/30 10:53 最後登入時間
: 2021/11/30 18:11
From CAE, Microchip
Group:
站務管理者 註冊會員
Level : 75 HP : 744 / 1861 MP : 5367 / 108762 EXP : 45
|
PORTC 設為輸入其輸入值會變來變去,是否忘了接 Pull-Up 電阻了,找 4 個 47Kohm 的電阻接 Vcc 吧。
發表於: 2005/3/9 16:37
|
|
|
關於port的預設值
|
|
新會員
Joined
: 2005/2/4 13:46 最後登入時間
: 2007/7/11 18:29
Group:
註冊會員
Level : 1 HP : 0 / 18 MP : 2 / 1034 EXP : 73
|
我是使用icd2除錯器及picdem2 plus公版..... 我在練習簡單的鍵盤掃描.....因為有問題所以我先try一行四獵的掃描..........我已portb輸出......portc輸入,下面是這一小段的部分程式.......我有疑問的是我利用watch及sfr視窗來監看port .....就目前來說...reset時我監看portc.....她的腳位預設都會一值改變,有時候是oxfc或是0xdc或是0xd8......2; 當我執行程式用step one時....portc的值也會變來變去的(ps:鍵盤完全沒按) 所以在我的if條件判斷時.....有時條件就會自動成立.... 請問是什麼原因呢...... TRISB=0X00; // set PORTB as outputs TRISD=0X00; //SET PORTD AS INPUTS TRISC=0XFF; PORTB=0X0F; PORTD=0X00; while(1){ PORTB=0x0E; if(RC2==0){PORTD=0x00;keyup();} if(RC3==0){PORTD=0x01;keyup();} if(RC4==0){PORTD=0x02;keyup();} if(RC6==0){PORTD=0x03;keyup();}
發表於: 2005/3/9 11:39
|
|
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.