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

18f452 address question

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



Joined: 05 Aug 2010
Posts: 89

View user's profile Send private message

18f452 address question
PostPosted: Thu Jul 14, 2011 2:45 am     Reply with quote

hello,guys

There is a question, the detail is as follow:

The PORTC register address F82h
but the "18f452.h" set the PIN_C0 address 31760.

This why ? the F82h ---->decimal 3970 not equal to 31760
Who can tell me the reason?

Thank you very much.
Ttelmah



Joined: 11 Mar 2010
Posts: 19505

View user's profile Send private message

PostPosted: Thu Jul 14, 2011 6:25 am     Reply with quote

Pin 'C0',, is only one pin of port C.
Now think - how can I code a pin 'number' and a port address together?.
Answer - take port pin number (0). Take port address (F82). Multiply address by 8 - 31760. Add pin number - 31760.

Best Wishes
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