PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 18, 2005 3:10 pm |
|
|
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. |
|