Re: 關於PORTF的問題
|
||||
---|---|---|---|---|
高級會員
|
版主真是謝謝你~~~真的可以正常動作了咧~~~
謝謝你常常幫我解決一下很基本的東西~~~ 辛苦了~~
發表於: 2005/2/22 8:35
|
|||
|
Re: 關於PORTF的問題
|
||||
---|---|---|---|---|
版主
|
再加入一行 CMCON=0x07; 將 PORTF<3:6> 的比較器功能關掉。
發表於: 2005/2/18 18:12
|
|||
|
Re: 關於PORTF的問題
|
||||
---|---|---|---|---|
高級會員
|
那為什麼我用MPLAB ICD2
做起來卻是不正常的情形ㄋ 一樣的程式碼應該要有一樣的反應啊~~~ 我真是想不懂了?? 為什麼只要我設DATA的值是HIGH只要遇到WR變成HIGH DATA就會自動變成LOW勒 用了老半天還是這樣勒
發表於: 2005/2/18 17:18
|
|||
|
Re: 關於PORTF的問題
|
||||
---|---|---|---|---|
高級會員
|
結果還是一樣ㄋ~~還有什麼沒注意到的嗎~~
還是程式該如何改才會正常動作啊??
發表於: 2005/2/18 16:01
|
|||
|
Re: 關於PORTF的問題
|
||||
---|---|---|---|---|
版主
|
PORTF 與 AD 輸入共用,而Power-on的 default setting 是AD 輸入。 請先設定一下 ADCON1 暫存器將沒用的AD關掉。
發表於: 2005/2/18 15:27
|
|||
|
關於PORTF的問題
|
||||
---|---|---|---|---|
高級會員
|
型號:P18F6520
#define CS PORTFbits.RF7 #define RD PORTFbits.RF6 #define WR PORTFbits.RF5 #define LCDDATA PORTFbits.RF4 void main(void) { TRISFbits.TRISF7=0 TRISFbits.TRISF6=0 TRISFbits.TRISF5=0; TRISFbits.TRISF4=0; while(1) { for(i = 0;i<=11;i++) { WR = 0; Delay10TCYx(2); LCDDATA = 1; Delay10TCYx(2); WR = 1; Delay10TCYx(2); } } 在WHILE(1)裡面的那個FOR迴圈 為什麼會有當WR變成HIGH時LCDDATA會變為LOW呢 我有設定錯誤嗎還是PORTF有些特殊的功能呢?
發表於: 2005/2/18 11:22
|
|||
|