Keil Logo

Cached Vectors

The 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

funcname is the name of the function.
interrupt indicates that the function is an interrupt function.
name may be any name you choose for the interrupt vector.
CACHED specifies that the interrupt is a fast interrupt.
using specifies which register bank the function uses.
bankname is the register bank name.

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);
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.