Hi all,
I want to get the total captured contents of the CCPR1L (low byte) and CCPR1H (high byte) registers.
Should I do it like this: CCPR1L + (CCPR1H<<8).
Or just like this: CCPR1L + CCPR1H.
Thanks for any help.
Adding CCP1 (CCPR1L CCPR1H) registers.
Hello,
It can be CCPR1L + (CCPR1H<<8 ) or (CCPR1H*256) + CCPR1L or get them direct from define address 0x15 unsigned varible
CCPR1 always contains CCPR1H:CCPR1L
It can be CCPR1L + (CCPR1H<<8 ) or (CCPR1H*256) + CCPR1L or get them direct from define address 0x15 unsigned varible
Code: Select all
unsigned CCPR1 absolute 0x15;
Nick
[url]http://www.pic_examples.byethost3.com/[/url]
[url]http://www.pic_examples.byethost3.com/[/url]
Hi Nick,
Thanks for your answer.
I like your idea about reading data straight from the address however 0x15 is only for CCPR1L right?. Would I need to read 0x16 (CCPR1H) also and then add them together and name it CCPR1? I guess if I did that it would be easier for me to use the register names. Sorry for what I'm guessing are silly questions.
I forgot to mention, this is for a 16F88.
Thanks again for your help.
Sparky.
Thanks for your answer.
I like your idea about reading data straight from the address however 0x15 is only for CCPR1L right?. Would I need to read 0x16 (CCPR1H) also and then add them together and name it CCPR1? I guess if I did that it would be easier for me to use the register names. Sorry for what I'm guessing are silly questions.
I forgot to mention, this is for a 16F88.
Thanks again for your help.
Sparky.