Using MPLAB® Harmony v2 to Control Interrupts
The MPLAB® Harmony System Service can be used to control the following types of interrupts:
- System-level interrupts
- Individual peripheral interrupts
- Interrupts generated from an External Input Pin (INTx.)
System-Level Interrupts
The Application Programming Interfaces (APIs) provided in sys-int-pic.c allow the application program to control system interrupt properties. System-level interrupt functions are typically called during an application start-up or initialization process. System interrupt tasks handled by the interrupt System Services include:
- Initializing the interrupt system.
- Enabling and disabling global interrupts.
- Assigning user-written service routines to interrupt vectors.
- Assigning shadow register sets to interrupt priorities.
Individual Peripheral Interrupts
Interrupt System Services provide the ability to modify the properties for interrupt capable peripherals. The APIs provide the ability to:
- Enable/disable individual peripheral interrupts
- Set interrupt priority and sub-priority levels
- Clear/Set an interrupt request flag
External Interrupts with an INTx pin
The PIC® 32 MCU can have several pins configured to generate interrupts. Interrupt System Services allows the programmer to set the parameters controlling these pins.