Hello
I am using a PIC 18F8722 and I am having a problem reading PORTF. I ran into a problem reading the portf in a project of mine and this code I am just testing it to see what happens.
In the code below I set portF to a certain value and then make Temp1 = to PortF to display on a LCD. When the program runs I get all 8 outputs of the pic to turn on but I get a value of 128 to display on the lcd. If I change PortF to any value below 128 I get 0 to display on the LCD. No matter what value I put in I always get the right state on the 8 output pins. I have no Idea what is going on.
DEFINE OSC 40 'Define clock freq. 40MHz
pause 1000
TRISF = 0 'Define PortF TRIS Register.
TRISC.0 = 0 'Define PortC TRIS Register.
LCD Var portC.0 ' LCD Data debuging pin.
Temp1 Var word
PortF = 255
Temp1 = PORTF
Serout2 LCD,16468,[12,DEC Temp1 ]
pause 3000
end
Thanks
Shawn
Bookmarks