Table of Contents
Overview
Every GPTM (General purpose timer module) block can be used as two 16-bit timers/counters (referred to as Timer A and Timer B) that can be configured to operate independently as timers or event counters, or concatenated to operate as one 32-bit timer. Timers can also be used to trigger µDMA transfers.
Following operating modes are supported:
- 16 or 32-bit programmable one-shot timer
- 16 or 32-bit programmable periodic timer
- 16-bit general-purpose timer with an 8-bit prescaler
Application details
This application showcases the usage of Timer DriverLib APIs. The objective of this application is to showcase the usage of 16 bit timers to generate interrupts which in turn toggle the state of the GPIO (driving LEDs).
Two timers with different timeout value (one is twice the other) are set to toggle two different GPIOs which drive LEDs on the LaunchPad.
Source Files briefly explained
- main.c - contains main function implementing LED blinking using timers.
- gpio_if.c - APIs to get pin number from GPIO number and set them.
- pinmux.c - Pinmux configurations as required by the application.
- timer_if.c - APIs for timer.
Usage
- Run the reference application.
- Open the project in CCS/IAR. Build the application and debug to load to the device, or flash the binary using UniFlash.
- Observe the two LEDs blinking with diffent frequencies (one is twice the other).