PIC32 MCUs have up to 8 input pins capable of generating MCU interrupts. These pins are referred to as external I/O pins and are designated on the individual data sheets with the pin name INTx.
This page describes how to configure harmony to use the external interrupts and how to write an Interrupt Service Routine for an external interrupt.
Interrupt Pin Operation
- PIC32 MCUs can have up to 8 pins capable of generating interrupts.
- External Interrupt pins are designated by an INT pin name.
- When configured, these pins can be set to generate interrupts on a rising or a falling edge.
- Each INT pin can be assigned its own interrupt priority and sub-priority.
- Each INT pin has its own interrupt vector and separate ISR.
Setting up External Interrupts
- The MPLAB® Harmony Configurator (MHC) is used to setup external interrupt pins.
- To enable interrupts select the box "Use Interrupt System Service?" AND "Use External Interrupts"under
Harmony Framework Configuration ▶ System Services ▶ Interrupts
- A dialog box will appear allowing the user to select which INT pins to include, and to configure each pin.
- When the Generate Button is clicked, MHC will add the initialization code for the INT pins to system_init.c
Writing the Interrupt Service Routine
- MHC inserts code for stub ISR into system-interrupt.c
- The application developer must then add the desired functionality to the stub ISRs.