| |||||||||||||
On-Line Manuals C166 User's Guide | Cached VectorsThe C166 Compiler allows you to create cached interrupts in C. These interrupts execute more quickly than standard interrupts and are declared as follows: void funcname (void) interrupt name=CACHED « using bankname » Where
When you define a fast interrupt using CACHED, you must specify interrupt address details (using the FINTxCSP and FINTxADDR SFRs) to the MCU. For example:
/* Macros to get the function segment and offset */
#define SEG(func) (unsigned int)(((unsigned long)((void (far *) (void))func) >> 16))
#define SOF(func) (unsigned int)(((void (far *) (void))func))
/* The fast interrupt service routine */
void serial_TX_irq (void) interrupt S0TINT=CACHED
{
ASC0_TBUF = 'A';
}
.
.
.
/* Configure the FINT0... SFRs to use serial_TX_irq */
FINT0CSP = 0x8800 | SEG(serial_TX_irq);
FINT0ADDR = SOF(serial_TX_irq);
| ||||||||||||
| |||||||||||||