5.1.5 Interrupts
The PIC16F, PIC18F and PIC32CM MCUs provide interrupt management systems that enable responsive and efficient handling of asynchronous events from peripherals and external sources. The PIC32CM uses the Arm Nested Vectored Interrupt (NVIC) that allows more complex interrupt nesting, priority management, and relocation. The table below provides a comparison of the features of the PIC16F, PIC18F, and PIC32CM MCUs.
| Feature | PIC16F Interrupt Controller | PIC18F Interrupt Controller | PIC32CM Nested Vectored Interrupt Controller (NVIC) |
|---|---|---|---|
| Interrupt Architecture | Single vector, software context | Multiple vectors, hardware context | NVIC (Nested Vectored Interrupt Controller) |
| Interrupt Prioritization | No hardware priority (handled in software polling) | Two-level hardware priority (high/low) | Four programmable priority levels (M0+) Eight levels (M23 with Secure/Nonsecure split) |
| Non-Maskable Interrupt | N/A | N/A | Supported |
| Vector Table | Single entry (ISR), software dispatch | Multiple entries (ISR per source), hardware dispatch | Multiple entries, hardware dispatch |
| Interrupt Sources | Peripherals External pins | Peripherals External pins | Peripherals External pins |
| Interrupt Flag Handling | Set/cleared in the peripheral and interrupt registers | Set/cleared in the peripheral and interrupt registers | Set/cleared in the peripheral and NVIC registers |
| Global Enable/Disable | Supported | Supported | Supported |
| Response Time (minimum) | 3 cycles | 3 cycles | 12-15 cycles |
| Priority Configuration | Software polling | Fully programmable per interrupt | Fully programmable per interrupt |
| Scheduling Scheme | Sequential polling | Hardware-based preemption | Hardware-based preemption, and tail chaining |
| Security Context | N/A | N/A | Secure/Non-secure split (M23) |
| Nested Interrupts | Not supported | Supported | Fully supported (NVIC) |
| Wake up from Sleep | Supported | Supported | Supported |
| Interrupt Latency | Higher (software vectoring) | Lower (hardware vectoring) | Lowest (hardware vectoring, NVIC) |
