We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I'm working on the XC164CM. I have a problem concerning the interrupt routine.
To declare an interrupt we have several ways to do it.
void itFunc (void) interrupt vectorNb
or
void itFunc (void) interrupt NONE=CACHED
when I declare my interrupt with the first one "void itFunc (void) interrupt vectorNb" I dont have any problem.
but when using the second declaration "void itFunc (void) interrupt NONE=CACHED" keil generate errors. to use this declaration is there any directive to use?
can you help me please
Thanks
First of all, is your target XC2267, as listed in the title, or XC164CM, as listed in your question? And what are the error messages you get?
Anyway, the syntax for an interrupt procedure is
void funcname (void) interrupt vector_def [using rbank_id]
So you can define your interrupt e.g. as
void asc0rint(void) interrupt 0x2B
void asc0rint(void) interrupt ASC0RINT=0x2B
void asc0rint(void) interrupt ASC0RINT
When using the last choice, you must tell the linker how to resolve the symbolic name ASC0RINT by using directive INTNO:
L166 myfile.obj INTNO (ASC0RINT (2bH))
I.e. in your example you must ensure that the symbol CACHED is defined as valid trap number in your code.
When using the CACHED directive then no entry is placed in the vector table for this vector and it is up to you to define the values in the registers FINTxCSP and FINTxADDR where x can be either 0 or 1. This is explained in the help file when searching on CACHED.
Thus this gives you the option to define two interrupts that would save you the time from going to the vector table and then jumping again to your interrupt service routine (.i.e directly jumping to your ISR)