11.3.3 Interrupt Vector Table Address Calculation
MVECEN = 0
When the MVECEN Configuration bit is cleared, the address pointed to by IVTBASE is used as the high-priority interrupt vector address. The low-priority interrupt vector address is offset eight instruction words from the address in IVTBASE.
For PIC18 devices, IVTBASE defaults to 000008h, hence the high-priority interrupt vector address will be 000008h and the low-priority interrupt vector address will be 000018h.
MVECEN = 1
Each interrupt has a unique vector number associated with it, as defined in the IVT. This vector number is used for calculating the location of the interrupt vector for a particular interrupt source.
Interrupt Vector Address = IVTBASE + (2*Vector Number). This calculated interrupt vector address value is stored in the IVTAD register when an interrupt is received.
User-assigned software priority, when assigned using the IPRx registers, does not affect address calculation and is only used to resolve concurrent interrupts.
- The entry for the interrupt in the vector table lies outside the executable program memory area
- ISR pointed by the vector table lies outside the executable program memory area
IVT Address Calculation | Interrupt Priority INTCON0 Register, IPEN Bit | ||
0 |
1 |
||
Multivector Enable, MVECEN Configuration bit |
0 |
IVTBASE | High-priority IVTBASE |
Low-priority IVTBASE + 8 words | |||
1 |
IVTBASE + 2*(Vector Number) |