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

Help on bitwise manipulation

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



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

Help on bitwise manipulation
PostPosted: Fri Apr 20, 2007 11:56 am     Reply with quote

Dear Freinds,
I want some one to show the best way in using bitwise operators. Here is what I want, Lets say for eg: I have 6 pins such as RA0, RA6, RB0, RC3, RC4, RD2 all configured as input. I am reading the status of each pin and want to insert the values of these pins into a byte. RA0 is the LSB and RD2 being the 5th bit on the byte field. Bit 6 and 7 can be padded to 0. How could I do this.

Is there a forum link similar to what I am looking for. I greatly appreciate your help.
_________________
Thanks

mkr
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 20, 2007 12:10 pm     Reply with quote

Yes, there is a thread on this topic. See the function called
read_spare_bits() in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=18949
mkr



Joined: 08 Aug 2006
Posts: 49

View user's profile Send private message

PostPosted: Fri Apr 20, 2007 12:54 pm     Reply with quote

Thanks PCMP.
_________________
Thanks

mkr
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