Hi Muddy. I am not at all familiar with the PIC you are using except I read a post by someone who had PORTD problems and fixed them with setting the ADCON1 and ADCON2 registers.
Hi Muddy. I am not at all familiar with the PIC you are using except I read a post by someone who had PORTD problems and fixed them with setting the ADCON1 and ADCON2 registers.
Hi Muddy,
First make a short loop blinking the LED's on PORTB to make sure they work and that the port is set up correct. (Which they seem to be since it reflects changes on reset).
Then try to read PortD to a variable first and then write that variable to PortD.Code:For i = 1 to 5 PortB = %00001111 Pause 200 PortB = %00000000 Next
How about that, does that work?Code:Switch VAR Byte Loop: Switch = PortD 'Read PortD, store in Switch PortB = Switch 'Write switch to PortB Pause 10 'Wait 10mS Goto Loop 'Do it again.
/Henrik Olsson. (At work, no board to test with here.)
Gooday Henrik.
Tried that along the way back from final code back to the simplified code described above. No, it doesn't work.
Peter
Thanks to everyone who made suggestions. But I RTFM and came up with the answer, which just may help someone else.....
PORTD is also the PARALLEL SLAVE PORT. To make it a general purpose I/O port, Bit4 of TRISE must be set to 0 IE TRISE.4 = 0
Did that and now seems to be OK. Will spend the next few hours reverting to the final code and see what happens.
Peter Moritz.
Bookmarks