Functional Description
300
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
M3 General-Purpose Timers
Table 2-1. Available CCP Pins
Timer
16-Bit Up/Down Counter
Even CCP Pin
Odd CCP Pin
Timer 0
TimerA
CCP0
-
TimerB
-
CCP1
Timer 1
TimerA
CCP2
-
TimerB
-
CCP3
Timer 2
TimerA
CCP4
-
TimerB
-
CCP5
Timer 3
TimerA
CCP6
-
TimerB
-
CCP7
2.3
Functional Description
The main components of each GPTM block are two free-running up/down counters (referred to as Timer A
and Timer B), two match registers, two prescaler match registers, two shadow registers, and two
load/initialization registers and their associated control functions. The exact functionality of each GPTM is
controlled by software and configured through the register interface. Timer A and Timer B can be used
individually, in which case they have a 16-bit counting range. In addition, Timer A and Timer B can be
concatenated to provide a 32-bit counting range. Note that the prescaler can only be used when the timers
are used individually.
The available modes for each GPTM block are shown in
. Note that when counting down, the
prescaler acts as a true prescaler and contains the least-significant bits of the count. When counting up,
the prescaler acts as a timer extension and holds the most-significant bits of the count
(1)
The prescaler is only available when the timers are used individually
Table 2-2. General-Purpose Timer Capabilities
Mode
Timer Use
Count Direction
Counter Size
Prescaler Size
(1)
One-shot
Individual
Up or Down
16-bit
8-bit
Concatenated
Up or Down
32-bit
-
Periodic
Individual
Up or Down
16-bit
8-bit
Concatenated
Up or Down
32-bit
-
RTC
Concatenated
Up
32-bit
-
Edge Count
Individual
Down
16-bit
8-bit
Edge Time
Individual
Down
16-bit
-
PWM
Individual
Down
16-bit
-
Software configures the GPTM using the GPTM Configuration (GPTMCFG) register, the GPTM Timer A
Mode (GPTMTAMR) register, and the GPTM Timer B Mode (GPTMTBMR) register. When in one of the
concatentated modes, Timer A and Timer B can only operate in one mode. However, when configured in
an individual mode, Timer A and Timer B can be independently configured in any combination of the
individual modes.
2.3.1 GPTM Reset Conditions
After reset has been applied to the GPTM module, the module is in an inactive state, and all control
registers are cleared and in their default states. Counters Timer A and Timer B are initialized to all 1s,
along with their corresponding load registers: the GPTM Timer A Interval Load (GPTMTAILR) register and
the GPTM Timer B Interval Load (GPTMTBILR) register; and shadow registers: the GPTM Timer A Value
(GPTMTAV) register and the GPTM Timer B Value (GPTMTBV) register. The prescale counters are
initialized to 0x00: the GPTM Timer A Prescale (GPTMTAPR) register, and the GPTM Timer B Prescale
(GPTMTBPR) register .