SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
The main components of each GPTM block are: two free-running up and down counters (Timer A and Timer B), two match registers, two prescaler match registers, two shadow registers, and two load and initialization registers and their associated control functions.
The function 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. The prescaler can only be used when the timers are used individually.
PERDMACLK in Figure 17-1 is the system clock connected to the GPTM. The frequency of this clock can be changed through PRCM:GPTCLKDIV.
Table 17-1 lists the available modes for each GPTM block. When counting down in one-shot or periodic modes, the prescaler acts as a true prescaler and contains the least-significant bits (LSBs) of the count. When counting up in one-shot or periodic modes, the prescaler acts as a timer extension and holds the most-significant bits (MSBs) of the count. In input edge count, input edge time, and PWM mode, the prescaler always acts as a timer extension, regardless of the count direction.
Mode | Timer Use | Count Direction | Counter Size | Prescaler Size(1) | Prescaler Behavior (Count Direction) |
---|---|---|---|---|---|
One-Shot | Individual | Up or Down | 16-bit | 8-bit | Timer Extension (Up), Prescaler (Down) |
Concatenated | Up or Down | 32-bit | – | Not applicable | |
Periodic | Individual | Up or Down | 16-bit | 8-bit | Timer Extension (Up), Prescaler (Down) |
Concatenated | Up or Down | 32-bit | – | Not applicable | |
Edge Count | Individual | Up or Down | 16-bit | 8-bit | Timer Extension (Both) |
Edge Time | Individual | Up or Down | 16-bit | 8-bit | Timer Extension (Both) |
PWM | Individual | Down | 16-bit | 8-bit | Timer Extension |
Software configures the GPTM using the GPTM Configuration register (GPT:CFG), the GPTM Timer A Mode register (GPT:TAMR), and the GPTM Timer B Mode register (GPT:TBMR). When in one of the concatenated modes, Timer A and Timer B can operate in one mode only. However, when configured in an individual mode, Timer A and Timer B can be independently configured in any combination of the individual modes.