ST10R272L - GENERAL PURPOSE TIMER UNITS
213/320
Count direction control
The count direction of the core timer can be controlled either by software, or by the external
input pin T6EUD (Timer T6 External Up/Down Control Input), which is the alternate input
function of port pin P5.10. These options are selected by bits T6UD and T6UDE in control
register T6CON. When the up/down control is done by software (bit T6UDE=‘0’), the count
direction can be altered by setting or clearing bit T6UD. When T6UDE=‘1’, pin T6EUD is
selected to be the controlling source of the count direction. However, bit T6UD can still be
used to reverse the actual count direction, as shown in the table below. If T6UD=‘0’ and pin
T6EUD shows a low level, the timer is counting up. With a high level at T6EUD the timer is
counting down. If T6UD=‘1’, a high level at pin T6EUD specifies counting up, and a low level
specifies counting down. The count direction can be changed regardless of whether the
timer is running or not.
Note
The direction control works the same for core timer T6 and for auxiliary timer T5.
Therefore the pins and bits are named Tx...
1.
For the effects of bits T6UD and T6UDE refer to Table 37 GPT2 core timer T6 count direc-
tion control below.
Timer 6 run bit
The timer can be started or stopped by software through bit T6R (Timer T6 Run Bit). If
T6R=‘0’, the timer stops. Setting T6R to ‘1’ will start the timer.
In gated timer mode, the timer will only run if T6R=‘1’ and the gate is active (high or low, as
programmed).
Pin TxEUD
Bit TxUDE
Bit TxUD
Count Direction
X
0
0
Count Up
X
0
1
Count Down
0
1
0
Count Up
1
1
0
Count Down
0
1
1
Count Down
1
1
1
Count Up
Table 37 GPT2 core timer T6 count direction control