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

NOOB HELP: want to access one bit at a certain address

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








NOOB HELP: want to access one bit at a certain address
PostPosted: Sat Sep 08, 2007 5:57 pm     Reply with quote

We are using TIMER1 as a Timer on the 16F877A. What we are trying to do is count the number of times the Timer over flows by polling bit 0 of PIR1, which is TMR1IF. The question is how do we poll/read this one bit at a certain address or what is the code for polling/reading one bit at a certain location? There is a Bit_Test() function but how can we specify which byte/address to bit test?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Sep 08, 2007 9:35 pm     Reply with quote

You can use the #bit directive to make the TMR1IF flag into an accessible
variable. Then just write C code to test it. See near the end of this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=17174&highlight=bit+TMR1IF&start=4
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