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

def Files for CCS compiler?

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



Joined: 02 Jun 2010
Posts: 74

View user's profile Send private message

def Files for CCS compiler?
PostPosted: Tue May 15, 2012 2:22 pm     Reply with quote

Hi

I know that most of the functionalities in PIC's are accessible via use of CCS built in library functions.

However, sometimes it is necessary to manipulate a specific Special Function Register myself manually.

As a solution, I include a "Special Function Register definition header file" that contains definitions such as below
Code:

#DEFINE POSTINC0 0XFEE
#DEFINE POSTDEC0 0XFED
#DEFINE PREINC0 0XFEC
#DEFINE PLUSW0 0XFEB
#DEFINE FSR0H 0XFEA
#DEFINE FSR0L 0XFE9
#DEFINE WREG 0XFE8
#DEFINE INDF1 0XFE7
#DEFINE POSTINC1 0XFE6
#DEFINE POSTDEC1 0XFE5


So that I can write directly to register such as ADCON1.

However, creating such file is too tedious and time consuming so I am wondering if the compiler provides some method as to I can access special functions by name without definining it's mapping.

Thank you
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 15, 2012 2:31 pm     Reply with quote

The CCS IDE (PCWH, PCWHD) has the ability to make it for you.
See the screenshots in this section:
Quote:
Ability to Generate Customized Include Files with SFR Definitions

on this page:
http://www.ccsinfo.com/content.php?page=ideoverview

You need the IDE version of the compiler to do this.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue May 15, 2012 3:30 pm     Reply with quote

Apart from mentioning the option to generate a SFR definition file automatically, it should be said,
that the syntax understood by the CCS C compiler uses #byte and #word statements. Just review the compiler help.
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