User’s Manual
C166S V1 SubSystem
General Purpose Timer Unit
User’s Manual
12-8
V 1.6, 2001-08
Count Direction Control
The count direction of the core timer can be controlled either by software or by the
external input line, T3EUD. These options are selected by bits T3UD and T3UDE in
control register, T3CON. When the up/down control is set by software (bit T3UDE is
cleared), the count direction can be altered by setting or clearing bit T3UD. When T3UDE
is set, line 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
Table 12-1
. If T3UD is cleared and line T3EUD shows a low level, the timer is counting
up. With a high level at T3EUD, the timer is counting down. If T3UD is set, a high level
at line T3EUD specifies counting up, and a low level specifies counting down. The count
direction can be changed whether or not the timer is running or not.
Note: When line T3EUD is used as external count direction control input, its associated
port pin must be configured as input.
Note: The direction control works the same way for core Timer T3 and for auxiliary
Timers T2 and T4.
Timer 3 Overflow/Underflow Monitoring
An overflow or underflow of Timer T3 will set clock bit T3OTL in control register T3CON.
T3OTL can also be set or reset by software. Bit T3OE (overflow/underflow output
enable) in register T3CON enables the state of T3OTL to be monitored via an external
line, T3OUT. If this line is linked to an external port pin (configured as output), T3OUT
can be used to control external hardware.
Additionally, T3OTL can be used in conjunction with auxiliary Timers T2 and T4. In this
case, T3OTL serves as input for the counter function or as trigger source for the reload
function of T2 and T4. T3OTL is internally connected for this functionality and it is not
necessary to enable overflow/underflow output on T3OUT for this purpose.
Table 12-1
Core Timer T3 Count Direction Control
Line T3EUD
Bit T3UDE
Bit T3UD
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
Содержание C166S V1 SubSystem
Страница 10: ...User s Manual C166S V1 SubSystem User s Manual I 6 V 1 6 2001 08...
Страница 16: ...User s Manual C166S V1 SubSystem Introduction User s Manual 1 6 V 1 6 2001 08...
Страница 126: ...User s Manual C166S V1 SubSystem Central Processing Unit User s Manual 3 96 V 1 6 2001 08...
Страница 178: ...User s Manual C166S V1 SubSystem Memory Organization User s Manual 4 52 V 1 6 2001 08...
Страница 206: ...User s Manual C166S V1 SubSystem Instruction Set User s Manual 5 28 V 1 6 2001 08...
Страница 306: ...User s Manual C166S V1 SubSystem Detailed Instruction Set User s Manual 6 100 V 1 6 2001 08...
Страница 362: ...User s Manual C166S V1 SubSystem The External Bus Interface User s Manual 8 40 V 1 6 2001 08...
Страница 452: ...User s Manual C166S V1 SubSystem General Purpose Timer Unit User s Manual 12 44 V 1 6 2001 08...
Страница 454: ...User s Manual C166S V1 SubSystem Instruction Index User s Manual 13 2 V 1 6 2001 08...
Страница 459: ......