星期五, 7月 02, 2004

Weird Behave : PIC 18 READ PORTD is not the value as I write..

TRISD = 0; // output
PORTD = 0xFF; // set all pin high
regd = PORTD; // !!!! regd=0xF0, not 0xFF !!!

TRISD =0xFF ; // input
regs = PORTD; // read gain! , still the same !

Max提出的問題。
其實program成input後,PORTD讀到的是PortD後面接541的內容,雖然541 is not enabled !
用電表量PortD0-3,都是high,所以讀取內容與port狀態不符。

Problem Pending !

沒有留言:

網誌存檔