View previous topic :: View next topic |
Author |
Message |
Enquirer Guest
|
Device Header File |
Posted: Mon Nov 26, 2007 5:06 am |
|
|
Hi all,
I am a newbie to CCS compiler. I am trying to setup the device header file to point to the specific address and it's not working for me. see example below
e.g for a PIC18F452 CCP1CON
#define CCP1CON (*(volatile unsigned char *)0x0FBD)
I don't want to use the setup_ccp1(CCP_PWM) function as it doesn't give me much info.
Mark |
|
 |
Ttelmah Guest
|
|
Posted: Mon Nov 26, 2007 5:52 am |
|
|
Just use the #byte declaration:
#BYTE CCP1CON=0x0FBD
Your pointer declaraion, ought to be possible to make work, probably with:
#define CCP1CON (*(int8 *)(0x0FBD))
However the byte declaration is easier, especially since it also allows #bit declarations as well. It is the volatile keyword, that will prevent it working.
Best Wishes |
|
 |
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Mon Nov 26, 2007 8:28 am |
|
|
I like these:
#pragma BYTE T0CON = getenv("SFR:T0CON")
#pragma BIT INT0IF = getenv("BIT:INT0IF")
But maybe they're only in V4 ?
Ken |
|
 |
|