Joined: 08 Nov 2005 Posts: 1 Location: Cape Town South Africa
port output/input timing problem?
Posted: Mon Nov 14, 2005 5:04 am
I had some broken code (keypad scan routine) over the weekend that I realy strugled with and after several (probably 50) attempts and changes got it to work but then lost track of what I fixed!
I'm writing out on half of port C and listening on the other half for a key press.
Is there any timing danger in doing this:
#use standard_io(c)...etc
output_c(0b11110111);
dummy = input_c();
compared to this approach:
set_tris_c(0b11110000);
PORTC = 0b11110111;
dummy = PORTC;
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
Posted: Mon Nov 14, 2005 9:58 am
This will not work, you really need to be using fast_IO. If you are using an 18F series PIC then you should write to the latch (LATC) and read from the port. _________________ Regards, Andrew
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum