Sie sind auf Seite 1von 11

8051

Timer
Timer-Counters
The 8051 has 2 Timer-Counters for:
Interval timing
Outside event counting

Timer 0 and Timer 1

Each is 16-bit made up of two 8-bit


registers, Timer High and Timer Low.
TH0/TL0 TH1/TL1
TCON- Timer Control Register
Byte Address: 88 Bit
Addressable
TMOD- Timer Mode Set Register
Byte Address: 89H
Not Bit Addressable

Gate- Enable Timer/Counter : 0-Enabled if TR bit of TCON is set


1 Enabled if INTx pin is high and
TR bit of TCON
= 0is Timer
set Function (Counting Internal Clock)
C /T = 1 Counter Function (Counting External
Clock/Event)
Timer/Counter Control Logic

(T0)P3.4 Pin14
(T1)P3.5 Pin15

(INT0)P3.2 Pin 12
(INT1)P3.3 Pin 13
MODE 0- 13 Bit Timer
Counter
Pu m r
fro nt
ls
e
Co ol c
Lo
gi
MODE 1- 16 Bit Timer
Pu m r
Counter
fro nt
ls
e
Co l c
o
Lo
gi
Mode 2 Auto Reload of TL
Pu m r
from TH
fro nt
ls
e
Co l c
o
Lo
gi
Mode 3 Two 8 Bit Timers
e
ls
Pu m r
fro nt
Co l c
o
gi
Lo

Das könnte Ihnen auch gefallen