# 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
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.

#### Mike - K8LH

##### Well-Known Member
Now I see where it's defined as type char further down in the header file. Thanks Mike.

Status
Not open for further replies.

Replies
0
Views
540
Replies
2
Views
1K
Replies
2
Views
910
Replies
6
Views
951
Replies
5
Views
6K