ST10R272L - GENERAL PURPOSE TIMER UNITS
193/320
Timer 3 run bit
The timer can be started or stopped by software through bit T3R (Timer T3 Run Bit). If
T3R=‘0’, the timer stops, T3R= ‘1’ starts the timer.
In gated timer mode, the timer will only run if T3R=‘1’ and the gate is active (high or low, as
programmed).
Count direction control
The count direction of the core timer can be controlled either by software or by the external
input pin T3EUD the alternate input function of port pin P3.4. Bits T3UD and T3UDE in
control register T3CON set the count direction. When the count direction is controlled by
software (bit T3UDE=‘0’), it can be altered by setting or clearing bit T3UD. When T3UDE=‘1’,
pin T3EUD is count direction controller. However, bit T3UD can still be used to reverse the
actual count direction as shown in the table below. The count direction can be changed
regardless of whether the timer is running or not.
When pin T3EUD/P3.4 is used as external count direction control input, it must be
configured as input, i.e. its corresponding direction control bit DP3.4 must be set to ‘0’.
Note
The direction control works the same for core timer T3 and for auxiliary timers T2
and T4. Therefore the pins and bits are named Tx...
Timer 3 output toggle latch
An overflow or underflow of timer T3 clocks the toggle bit T3OTL in the T3CON control
register. T3OTL can also be set or reset by software. Bit T3OE (Alternate Output Function
Enable) in the T3CON register enables the state of T3OTL to be an alternate function of the
external output pin T3OUT/P3.3. For that purpose, a ‘1’ must be written into port data latch
P3.3, and pin T3OUT/P3.3 must be configured as an output by setting direction control bit
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 31 GPT1 core timer T3 count direction control