One PIC32 timer in each 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 timer ISRs 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 only 1 timer
Timer System Service Simulation Spreadsheet
For your convenience, we have provided this Microsoft Excel 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.
Timer System Service "Under the Covers"
Learn more >