English
Language : 

IC80C51 Datasheet, PDF (17/44 Pages) Integrated Circuit Solution Inc – CMOS SINGLE CHIP 8-BIT MICROCONTROLLER
IC80C51
IC80C31
Timer Setup
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
Mode
0
1
2
3
Timer 0
Function
13-Bit Timer
16-Bit Timer
8-Bit Auto-Reload
Two 8-Bit Timers
TMOD
Internal External
Control(1) Control(2)
00H
08H
01H
09H
02H
0AH
03H
0BH
Table 4. Timer/Counter 0 Used as a Counter
Mode
Timer 0
Function
TMOD
Internal External
Control(1) Control(2)
0
13-Bit Timer
04H
0CH
1
16-Bit Timer
05H
0DH
2 8-Bit Auto-Reload
06H
0EH
3 One 8-Bit Counter
07H
0FH
Notes:
1. The Timer is turned ON/OFF by setting/clearing bit TR0
in the software.
2. The Timer is turned ON/OFF by the 1-to-0 transition on
INT0 (P3.2) when TR0=1 (hardware control)
Table 5. Timer/Counter 1 Used as a Timer
Mode
0
1
2
3
Timer 1
Function
13-Bit Timer
16-Bit Timer
8-Bit Auto-Reload
Does Not Run
TMOD
Internal External
Control(1) Control(2)
00H
80H
10H
90H
20H
A0H
30H
B0H
Table 6. Timer/Counter 1 Used as a Counter
Mode
Timer 1
Function
TMOD
Internal External
Control(1) Control(2)
0
13-Bit Timer
40H
C0H
1
16-Bit Timer
50H
D0H
2 8-Bit Auto-Reload
60H
E0H
3
Not Available
—
—
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).
Integrated Circuit Solution Inc.
17
MC001-0B