• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

BoostC issue, access 16-bit SFR as INT

Status
Not open for further replies.

Mike - K8LH

Well-Known Member
Gentlemen, what am I doin' wrong? I see a definition for ccpr1 in the '2620 header file but I can't seem to access it as an INT. I get an error when trying to assign an integer variable to it;

Code:
  unsigned int match = 2400;

...
  ccpr1 = match;     // update CCPR1 "compare" registers
  match <<= 1;       // match value for next cycle
 

Pommie

Well-Known Member
Most Helpful Member
Hi Mike,

ccpr1 is defined as a char in the header file and so I added,
Code:
volatile int ccpr1w @CCPR1L;
to my main code so I could access it as a word.

I'm not sure why they didn't make it an int in the header.

Mike.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top