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

Constants used to identify pins in the header files?

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



Joined: 08 Sep 2003
Posts: 105
Location: New Castle, DE

View user's profile Send private message

Constants used to identify pins in the header files?
PostPosted: Tue Feb 06, 2007 3:35 pm     Reply with quote

How does this number work?
I have tried all the ways that I can think of to get this number.
Like for Pin_B3 for the 18F4550 this is at address F81.2
The header file has 31755?
Thank all Tom
kamputty
Guest







PostPosted: Tue Feb 06, 2007 3:50 pm     Reply with quote

F81.2 = memory address F81 bit 2

F81 HEX = 3969 DEC


31755 = number of BITS, so the byte is 31755/8 = 3969.38 or 3969 BYTES with a remainder of 3, or the 3rd bit.

The numbers in the header file are BIT based (at least the pins!)

Yes?

~Kam (^8*
Ttelmah
Guest







PostPosted: Tue Feb 06, 2007 3:56 pm     Reply with quote

The number, is the register address, times 8, plus the bit number. Pin B3, is 0xF81.3, not 0xF81.2.
0xF81, is 3969 in decimal. Times 8 gives 31752. Add three for the bit number, gives 31755.

Best Wishes
Tom-H-PIC



Joined: 08 Sep 2003
Posts: 105
Location: New Castle, DE

View user's profile Send private message

Thanks All
PostPosted: Tue Feb 06, 2007 4:01 pm     Reply with quote

I knew that it had to be straight forward.
Thank
Tom
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