CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Device Header File

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Enquirer
Guest







Device Header File
PostPosted: Mon Nov 26, 2007 5:06 am     Reply with quote

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







PostPosted: Mon Nov 26, 2007 5:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Nov 26, 2007 8:28 am     Reply with quote

I like these:

#pragma BYTE T0CON = getenv("SFR:T0CON")
#pragma BIT INT0IF = getenv("BIT:INT0IF")

But maybe they're only in V4 ?

Ken
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group