One PIC32 Timer in each MPLAB® Harmony application can be set aside as the System Timer using the Harmony Timer System Service. A System Timer allows the application to do the following:
- Schedule multiple Interrupt Service Routines (ISRs) at separate time intervals based on the single System Timer.
- Initiate ISRs as either one-shot or continuous events.
- Disable or enable ISR Timers at run-time.
- Establish a system clock allowing:
- Non-blocking delays in the application code.
- The measurement of timer intervals by the program.
The clock created by the Timer System Service has a 1 ms time resolution with the interrupt latency of a timer with a dynamic driver. The default Interrupt Priority for the system timer is level 1. Application tasks needing a more precise time resolution and/or minimum interrupt latency should use a dedicated PIC32 Timer with a static driver.
The Example Code and Projects link found at the bottom of this page shows examples of Static, Dynamic, and Timer System Service projects.
Initiating Multiple Interrupt Service Routines from a Single Timer
Timer System Services can trigger separate ISRs at different intervals using a single timer
Timer System Service Simulation Spreadsheet
For your convenience, we have provided this file which simulates the Timer System Service. It shows the relationships between MPLAB Harmony Configurator (MHC) inputs, PIC32 Hardware Timer, System Service Timer, and System Service Delay Countdown Timers.