CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

port output/input timing problem?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
websmith



Joined: 08 Nov 2005
Posts: 1
Location: Cape Town South Africa

View user's profile Send private message Visit poster's website

port output/input timing problem?
PostPosted: Mon Nov 14, 2005 5:04 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Nov 14, 2005 9:58 am     Reply with quote

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

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group