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

access into a register

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



Joined: 11 Jun 2007
Posts: 25

View user's profile Send private message MSN Messenger

access into a register
PostPosted: Mon Oct 12, 2009 2:39 am     Reply with quote

How can i get access into a register/bit??
andyfraser



Joined: 04 May 2004
Posts: 47
Location: UK

View user's profile Send private message

access into a register
PostPosted: Mon Oct 12, 2009 3:12 am     Reply with quote

Read the manual !
Or you could look at this thread http://www.ccsinfo.com/forum/viewtopic.php?t=40398

Andy
giustraman



Joined: 11 Jun 2007
Posts: 25

View user's profile Send private message MSN Messenger

Read, not write..
PostPosted: Mon Oct 12, 2009 3:30 am     Reply with quote

I need to read a bit of a register, for example the bit n°1 of ADCONO register (address: 0x1F)...How can I do it?? Thanks...
andyfraser



Joined: 04 May 2004
Posts: 47
Location: UK

View user's profile Send private message

Read, not write..
PostPosted: Mon Oct 12, 2009 3:34 am     Reply with quote

Well to me it would seem pretty obvious from the link I sent !
In Ronald's example he writes to a bit using GIE = 1 so to read you can do if ( GIE == 1 ). You need to set up a #byte for ADCON0 and a #bit for the bit you want to read.

Andy
dyeatman



Joined: 06 Sep 2003
Posts: 1938
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Oct 12, 2009 6:08 am     Reply with quote

Expanding on what andyfraser said, you really should take time to read the manual. See #bit in the pre-processor section of the manual. It shows how to define a register bit reference.

In the link he cited, rnielsen (Ron) provides a great example that would answer your question if you would just take a look.
_________________
Google and Forum Search are some of your best tools!!!!
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