Getting Started with the dsPIC33A Interrupt Controller
Peripheral Interrupts
| Interrupt Sources | External Interrupts |
Peripheral Interrupts
Click Play ► to listen to the commentary.
| Priority Order | Interrupt "Vector" Source | Vector Number | Maskable |
|---|---|---|---|
| Highest | Reset Vector | No | |
| Traps | 2 - 8 | ~No | |
| Common Collapsed Vector | 9 | Yes | |
| FPU | 10 | Yes | |
| XRAM ECC SE | 11 | Yes | |
| YRAM ECC SE | 12 | Yes | |
| PBU Parity Error | 13 | Yes | |
| NVM ECC SE | 14 | Yes | |
| NVM Program/Erase Com. | 15 | Yes | |
| NVM CRC Complete | 16 | Yes | |
| Combined Clock Fail | 18 | Yes | |
| Peripheral/Feat. 10 - 271 | 19 - 363 | Yes | |
| Lowest | APWM Event D (272) | 364 | Yes |
The system enables up to 272 different peripheral interrupt sources, providing extensive flexibility for complex and diverse applications.
All peripheral interrupts are maskable, meaning you can enable or disable them as needed for your application.
Many peripherals, such as Analog-to-Digital Converters (ADCs) and Pulse-Width Modulation (PWM) modules, use multiple interrupt vectors to support their wide range of features.
For example, ADC1 through ADC5 can generate up to 96 interrupt sources, while the PWM module offers 18.
Unlike traps, you only need to add interrupt handlers for the specific peripheral features your application is actually using.
Calculating Vector Address
Click Play ► to listen to the commentary.
The vector address is calculated using both the interrupt request number and the value of the base register, IVTBASE.
IVTBASE provides an offset that determines the starting address of the Interrupt Vector Table (IVT). This allows interrupt vector addresses to be flexibly mapped to any location within user Flash or user RAM, giving developers control over where interrupt vectors reside in memory.
To calculate the address in the vector table where a particular peripheral interrupt vector resides, refer to Example 1 and Example 2 as shown.
Example 1: Interrupt #33 -> External INTO Interrupt
Resultant address = (0x80A000(hex) + 33x4 (dec) (convert to hex) + 24(hex) = 0x80A0A8(hex)
Example 2: Interrupt #33 -> Default After a Device Reset
Resultant address = (0x800000(hex) + (33x4(dec) (convert to hex)) + 24(hex) = 0x8000A8(hex)