15.3 Specifying the Interrupt Vector

All DSC devices have a primary interrupt vector table. Some DSC devices have a fixed alternate vector table, some have no alternate vector table and some have an alternate vector table which may be disabled and moved.

Note: A device Reset is not handled through the interrupt vector table. Instead, on device Reset, the program counter is cleared (dsPIC33C/E/F and dsPIC30F) or refreshed from the Reset Vector (dsPIC33A). This causes execution to restart. By convention, the linker script constructs an either a GOTO statement or creates the Reset Vector to the C run-time startup module.

The alternate vector name is used when the ALTIVT bit is set in the INTCON2 register. For devices with alternate vector tables which may be disabled and moved, AIVT support is configured via configuration words, notably:

  • AIVTDIS to enable the vector table
  • BSLIM to locate the vector table

On these devices, the tool chain will inspect the values of these configuration words to determine whether or not to allocate space and fill in the value of the alternate vector tables. Simply specify device appropriate values for these configuration words:

#pragma config AIVTDIS = ON

#pragma config BSLIM = 0x1FFD

and define the alternate vectors in the normal way, i.e.:

void __attribute__((interrupt)) _AltT1Interrupt(void) {}

Each exception vector occupies a program word. For tables of interrupt vectors by device family, see the 15.3.2 Interrupt Vector Tables section.