Texas Instruments MSP430x1xx User Manual page 240

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

Timer_B Operation
Up Mode
The up mode is used if the timer period must be different from TBR
The timer repeatedly counts up to the value of compare latch TBCL0, which
defines the period, as shown in Figure 12−2. The number of timer counts in
the period is TBCL0+1. When the timer value equals TBCL0 the timer restarts
counting from zero. If up mode is selected when the timer value is greater than
TBCL0, the timer immediately restarts counting from zero.
Figure 12−2. Up Mode
TBR (max)
TBCL0
0h
The TBCCR0 CCIFG interrupt flag is set when the timer counts to the TBCL0
value. The TBIFG interrupt flag is set when the timer counts from TBCL0 to
zero. Figure 11−3 shows the flag set cycle.
Figure 12−3. Up Mode Flag Setting
Timer Clock
Timer
Set TBIFG
Set TBCCR0 CCIFG
Changing the Period Register TBCL0
When changing TBCL0 while the timer is running and when the TBCL0 load
mode is immediate, 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.
12-6
Timer_B
TBCL0−1
TBCL0
0h
1h
TBCL0−1
TBCL0
counts.
(max)
0h

Advertisement

Table of Contents
loading

Table of Contents