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.