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: 19504
Posted: Thu Jul 14, 2011 6:25 am
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.
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