
The general purpose timer units
UM0404
DocID13284 Rev 2
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. Setting T3R to ‘1’ will start 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 (Timer T3 External Up/Down Control Input), which is the alternate input
function of port pin P3.4.
These options are selected by bit T3UD and T3UDE in control register T3CON. When the
up/down control is done by software (bit T3UDE = ‘0’), the count direction can be altered by
setting or clearing bit T3UD.
When T3UDE = ‘1’, pin T3EUD is selected to be the controlling source of the count
direction. However, bit T3UD can still be used to reverse the actual count direction, as
shown in
.
If T3UD = ‘0’ and pin T3EUD is at low level, the timer is counting up. With a high level at
T3EUD the timer is counting down.
If T3UD = ‘1’, a high level at pin T3EUD 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.
When pin T3EUD/P3.4 is used as external count direction control input, it must be
configured as input, its corresponding direction control bit DP3.4 must be set to ‘0’.
T3UDE
Timer 3 External Up/Down Enable
T3OE
Alternate Output Function Enable
T3OE = ‘0’:Alternate Output Function Disabled - T3OE = ‘1’: Alternate Output Function
Enabled
T3OTL
Timer 3 Output Toggle Latch
- Toggles on each overflow / underflow of T3. Can be set or
reset by software.
1.
For the effects of bit T3UD and T3UDE refer to
Table 33: GPT1 core timer T3 count direction control
.
Table 33. GPT1 core timer T3 count direction control
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
Bit
Function