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 support@ccsinfo.com

read tris values

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







read tris values
PostPosted: Fri Oct 07, 2005 1:31 am     Reply with quote

Hi all.
Is it possible to "read" the tris register values of a port to determine
what pins have bees set to Inputs and what are outputs , from within your code.I can create a variable to keep track of what the port has been set to , but was wondering if there is not an easier way.
Cheers
Rob
Ttelmah
Guest







PostPosted: Fri Oct 07, 2005 2:07 am     Reply with quote

Just declare a byte to point to the TRIS register. So for the 18F chips:

#byte TRISA = 0xF92

Then access this when required.
Remember though, that if you are using 'standard_io', the value will be overridden by the compiler whenever the I/O register is accessed.

Best Wishes
guest
Guest







PostPosted: Fri Oct 07, 2005 4:52 am     Reply with quote

Thanks.
Obvious , now you tell me how it's done.
Cheers
Rob
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