
A8351601 Series
(July, 2002, Version 1.0)
18
AMIC Technology, Inc.
Timer Set-Up
Tables 3 through 6 give TMOD values that can be used to
set up Timers in different modes.
It assumes that only one timer is used at a time. If Timers 0
and 1 must run simultaneously in any mode, the value in
TMOD for Timer 0 must be ORed with the value shown for
Timer 1 (Tables 5 and 6).
For example, if Timer 0 must run in Mode 1 GATE (external
control), and Timer 1 must run in Mode 2 COUNTER, then
the value that must be loaded into TMOD is 69H (09H from
Table 3 ORed with 60H from Table 6).
Moreover, it is assumed that the user is not ready at this
point to turn the timers on and will do so at another point in
the program by setting bit TRx (in TCON) to 1.
Table 3. Timer/Counter 0 Used as a Timer
TMOD
Mode
Timer 0 Function
Internal
Control
(1)
External
Control
0
13-Bit Timer
00H
08H
1
2
3
16-Bit Timer
8-Bit Auto-Reload
Two 8-Bit timers
01H
02H
03H
09H
0AH
0BH
Table 4. Timer/Counter 0 Used as a Counter
TMOD
Mode
Timer 0 Function
Internal
Control
(1)
External
Control
0
1
2
3
13-Bit Timer
16-Bit Timer
8-Bit Auto-Reload
One 8-Bit Counter
04H
05H
06H
07H
0CH
0DH
0EH
0FH
Notes:
1. The Timer is turned ON/OFF by setting/clearing bit TR0
in the software.
Table 5. Timer/Counter 1 Used as a Timer
TMOD
Mode
Timer 1 Function
Internal
Control
(1)
External
Control
0
1
2
3
13-Bit Timer
16-Bit Timer
8-Bit Auto-Reload
Does Not Run
00H
10H
20H
30H
80H
90H
A0H
B0H
Table 6. Timer/Counter 1 Used as a Timer
TMOD
Mode
Timer 1 Function
Internal
Control
(1)
External
Control
0
1
2
3
13-Bit Timer
16-Bit Timer
8-Bit Auto-Reload
Not Available
40H
50H
60H
-
C0H
D0H
E0H
-
Notes:
1. The Timer is turned ON/OFF by setting/clearing bit TR1
in the software.
2. The Timer is turned ON/OFF by the 1 to 0 transition on
INT1 (P3.3) when TR1 = 1 (hardware control).