Example Harmony v2 Projects for the Timer Peripheral

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®

The Timer Driver Example (Static) Using chipKIT® WF32® example project configures Timer1 with a Static Driver to generate an interrupt at 500 ms. It also implements the Interrupt Service Routine (ISR) for the timer to blink an LED attached to an I/O pin.


Timer Driver Example (Dynamic) Using chipKIT WF32

The Timer Driver Example (Dynamic) Using chipKIT WF32 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 LED3.


++Timer System Service Example Using chipKIT WF32

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

  • Execute a callback function to toggle LED3 every 500 ms
  • Execute 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®

The Timer System Service Example Using chipKIT Wi-FIRE® example project uses the Timer System Service Library to execute functions after a specified period of time. MHC is used to configure the Timer System Service. Two different clients of the Timer System Service are then created to:

  • Execute a callback function to toggle LED3 every 500 ms
  • Execute 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

The Timer System Service Example Using PIC32MZ EF Starter Kit example project uses the Timer System Service Library to execute functions after a specified period of time. MHC is used to configure the Timer System Service. Two different clients of the Timer System Service are then created to:

  • Execute a callback function to toggle LED1 every 500 ms
  • Execute a callback function to toggle LED2 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.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
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.