Example Harmony Projects for the Timer Peripheral

Each of the following links contain a downloadable, fully functional example project. Detailed instructions on how the project was created are also provided.


Timer Driver Example (Static) Using chipKIT WF32 >

Configures Timer1 with a Static Driver to generate an interrupt at 500 ms. Implements the ISR for the timer to blink an LED attached to an I/O pin.


Timer Driver Example (Dynamic) Using chipKIT WF32 >

This example project uses the Timer Driver Library (Dynamic Implementation) to execute timer interrupts. The period of these interrupts, and the number of interrupts to count for a given alarm period, are calculated for you. Every 500 ms, a callback function will be executed to toggle LED 3.


Timer System Service Example Using chipKIT WF32 >

This example project uses the Timer System Service Library to execute functions after a specified period of time. The MPLAB Harmony Configurator (MHC) is used to configure the Timer System Service. Two different clients of the Timer System Service are then created:

  • One client executes a callback function to toggle LED3 every 500 ms.
  • The other client executes a callback function to toggle LED4 every 1000 ms.

Another example of running a function after a specified time period, by reading the Timer System Service values directly, is also provided.


Timer System Service Example Using chipKIT Wi-FIRE >

This example project uses the Timer System Service Library to execute functions after a specified period of time. The MPLAB Harmony Configurator (MHC) is used to configure the Timer System Service. Two different clients of the Timer System Service are then created:

  • One client executes a callback function to toggle LED3 every 500 ms.
  • The other client executes a callback function to toggle LED4 every 1000 ms.

Another example of running a function after a specified time period, by reading the Timer System Service values directly, is also provided.


Timer System Service Example Using PIC32MZ EF Starter Kit >

This example project uses the Timer System Service Library to execute functions after a specified period of time. The MPLAB Harmony Configurator (MHC) is used to configure the Timer System Service. Two different clients of the Timer System Service are then created:

  • One client executes a callback function to toggle LED1 every 500 ms.
  • The other client executes a callback function to toggle LED2 every 100 0ms.

Another example of running a function after a specified time period, by reading the Timer System Service values directly, is also provided.

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.