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

The fastest way to set and clear multible ports ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Apr 12, 2005 4:35 pm     Reply with quote

James Bolver wrote:
Does the output state reset every time or does it stay in memory ?

IE: If I set the trisc to half low and half high then make portc inputs then switch back to outputs are all low again?
Hard to tell, not all PICs are the same in this respect, even different ports on the same chip may be different. Again, study the manual, especially the schematics in the chapters on the I/O-ports. Some of the chips I studied have data latches on both the inputs and outputs so ports will remember the previous state even when switching from output to input and back again.
This is quiet tricky and has caused many people problems while some others make good use of it by combining an input and output on the same pin. I've seen sample code of a single pin RS-232 receiver/transmitter.
Also notice that the PIC18 and PIC16 are different here, the PIC16 has strange behaviour when using read/modify/write instructions (BSF, BCF, XORWF) on the TRIS register in combination with peripherals overriding the TRIS bits. To avoid these problems a latch register was introduced in the PIC18 series.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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