6.2 Timer Example (Driver) - dsPIC

6.2.1 Running the Timer Toggle LED Example

Running the Timer Toggle LED example shows the LED on the board flash at a 100 ms period interval.

  • Example 100 ms:

6.2.2 Running the Timer Switch Frequency Example

An initial run of the Timer Switch Frequency example shows the LED on the board flash at a 500 ms period interval. Pressing the assigned button will swap the period between 500 ms and 100 ms.

  • Example 500 ms:

  • Example 100 ms:

6.2.3 Running the Timer 125 Hz Output Signal Example

When running the Timer 125 Hz Output Signal Example, an 125 Hz output can be measured on the selected pin.

  • Output:

6.2.4 Example Board for the Timer Examples

The Timer example can be run on Curiosity Nano boards, such as the dsPIC33CK64MC105. In the image below, the circled LED on the Curiosity Nano is toggled according to the set timer period. An LED on the Curiosity Nano Explorer will flash alongside as it is wired up to the dsPIC LED.

All three Timer examples were tested using the hardware setup presented below.