6.5.7.3 Programmable Timers
Programmable timers can be used to count or time external events that drive the Timer input pins. Each 16- or 32-bit General-Purpose Timer Module (GPTM) block provides two 16-bit timers/counters that can be configured to operate independently as timers or event counters. These two timers/counters can also be configured to operate as one 32-bit timer or one 32-bit RTC. Timers can also be used to trigger analog-to-digital conversions and DMA transfers.
The GPTM contains eight 16- or 32-bit GPTM blocks with the following functional options:
- Operating modes
- 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
- 32-bit RTC when using an external 32.768-kHz clock as the input
- 16-bit input-edge count- or time-capture modes with an 8-bit prescaler
- 16-bit PWM mode with an 8-bit prescaler and software-programmable output inversion of the PWM signal
- Count up or down
- Sixteen 16- or 32-bit capture/compare PWM (CCP) pins
- Daisy-chaining of timer modules lets one timer initiate multiple timing events
- Timer synchronization lets selected timers start counting on the same clock cycle
- ADC event trigger
- User-enabled stalling when the MCU asserts the CPU halt flag during debug (excluding RTC mode)
- Can determine the elapsed time between the assertion of the timer interrupt and entry into the ISR
- Efficient transfers using µDMA
- Dedicated channel for each timer
- Burst request generated on timer interrupt