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

changing compiler to ccs

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



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

changing compiler to ccs
PostPosted: Tue Oct 18, 2005 12:28 pm     Reply with quote

Hi there

I was writing code in c using the compiler cc5x for the PIC16F873 device and now if i want to change the code to using the ccs compiler, is it very difficult? I have written a lot of code.

Please let me know asap.
thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 18, 2005 3:10 pm     Reply with quote

Look at this example file on the CC5x website:
http://www.bknd.com/files/int16xx.txt

CCS automatically inserts the interrupt dispatcher code. You don't
write any code for it, as CC5x does with the "interrupt_server()" routine.
Also, the CCS dispatcher does all the tests for the interrupt flags.
All you have to do is write a routines like:

Code:
#int_rtcc
void int_rtcc_isr(void)
{
// Put your user code here

}

#int_ext
void int_ext_isr(void)
{
// Put your user code here

}

#int_rb
void int_rb_isr(void)
{
// Put user code here.
// Also read Port B to clear the "change condition".

}


In main(), the CC5x code writes to individual registers to set up
various PIC peripheral modules. You can still do it that way in CCS,
or you can use the built-in CCS functions. CCS doesn't provide a
header file with all the register addresses already defined in it, but
other people have made such files for the 16F877 and 18F452, and
posted them to this forum. So they are available.

Also, CC5x uses pragma's for all non-standard stuff, such as defining
bit variables. The syntax is a little bit different, but similar, for CCS.
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