1.8.3 Relocatable Alternate Interrupt Table Devices

Most dsPIC33 devices have a relocatable Alternate IVT table when the CodeGuard(tm) module is enabled. This feature can be enabled through a configuration bit when the CodeGuard module is enabled. The CodeGuard module configuration bits define the space allocated for the boot segment and the general segment. The alternate interrupt table is automatically placed at the start of the last erase page of the boot segment. This page is erasable by the bootloader even if the boot segment is not writable/erasable. This allows the application to define new interrupt vectors when it is built and have a way for the bootloader to program it into the hardware interrupt vector table.

Below is the flow of an interrupt and how it ends up in the applications interrupt handler:
  1. An interrupt occurs. When the AIVTEN bit is set, the hardware will look for the vector in the alternate interrupt vector table instead of the normal interrupt vector table.

  2. The PC branches to the address specified in the hardware alternate interrupt vector table jumping immediately to the application UART interrupt service routine (ISR).

Figure 1-13.  Interrupt Code Guard

Since this uses a hardware interrupt table, no additional considerations need to be made when using interrupts in this mode of operation.

To enable this mode of operation, check the "Code Protect Bootloader" box in the bootloader UI. This will enable the CodeGuard module and also enable the AIVT enable feature of the CodeGuard module.

Figure 1-14.  Enable Code Guard