CCR0-1
CCR0
0h
Timer Clock
Timer
Set TAxCTL TAIFG
Set TAxCCR0 CCIFG
1h
CCR0-1
CCR0
0h
TAxCCR0
Timer_A Operation
646
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Timer_A
25.2.3 Timer Mode Control
The timer has four modes of operation: stop, up, continuous, and up/down (see
). The
operating mode is selected with the MC bits.
Table 25-1. Timer Modes
MC
Mode
Description
00
Stop
The timer is halted.
01
Up
The timer repeatedly counts from zero to the value of TAxCCR0
10
Continuous
The timer repeatedly counts from zero to 0FFFFh.
11
Up/down
The timer repeatedly counts from zero up to the value of TAxCCR0 and back down to zero.
25.2.3.1 Up Mode
The up mode is used if the timer period must be different from 0FFFFh counts. The timer repeatedly
counts up to the value of compare register
, which defines the period (see
). The
number of timer counts in the period is T 1. When the timer value equals TAxCCR0, the timer
restarts counting from zero. If up mode is selected when the timer value is greater than TAxCCR0, the
timer immediately restarts counting from zero.
Figure 25-2. Up Mode
The
CCIFG interrupt flag is set when the timer
counts
to the TAxCCR0 value. The TAIFG
interrupt flag is set when the timer
counts
from TAxCCR0 to zero.
shows the flag set cycle.
Figure 25-3. Up Mode Flag Setting
25.2.3.1.1 Changing Period Register TAxCCR0
When changing
while the timer is running, if the new period is greater than or equal to the old
period or greater than the current count value, the timer counts up to the new period. If the new period is
less than the current count value, the timer rolls to zero. However, one additional count may occur before
the counter rolls to zero.