8254 Programmableinterval Timer
8254 Programmableinterval Timer
Thane: 1, Vagholkar Apts, Behind Nagrik Stores, Near Rly Stn, Thane (W). Tel: 022 2540 8086 / 809 701 8086
st
Nerul: E-103, 1 Floor, Railway Station Complex, Nerul (W), Navi Mumbai. Tel: 022 2771 8086 / 865 509 8086
8254
PROGRAMMABLE
INTERVAL TIMER
Architecture of 8254
M2 M1 M0 Mode Selection
0 0 0 Mode 0 --- Interrupt On Terminal Count
0 0 1 Mode 1 --- Monostable Multivibrator
X 1 0 Mode 2 --- Rate Generator
X 1 1 Mode 3 --- Square Wave Generator
1 0 0 Mode 4 --- Software Triggered Strobe
1 0 1 Mode 5 --- Hardware Triggered Strobe
The Control Word Register is an 8-bit register that holds the Control Word as shown above.
It is selected when A1 – A0 contain 11.
It has a different format when a Read Back command is given for 8254, as shown below
Read Operations
There are 3 ways in which the µP can read the current count:
A) Ordinary Read
In this method, the counting is stopped by controlling the gate input of a selected counter.
The Counter is then selected by A1 – A0 and IO Read operation is performed.
First IO Read will give the Lower byte of the Count value, and the second IO Read will give the
higher byte. For doubts contact Bharat Sir on 98204 08217
The disadvantage here is that counting is disturbed/stopped.
B) Read on Fly
In this method, the µP reads the count value while the counting is still in progress.
Thus, it is called as Read On Fly.
The appropriate value is written in the control word, and IO Read operation is performed.
The current value of the Count is "latched" internally and returned to the µP.
The advantage here is that counting is not disturbed.
− The Read Back Command is available only for 8254 and not for 8253.
− The Read Back Command reads the Count value in the same manner as Read On Fly.
− In addition to the Count, the current Status can also be latched using the Read Back command.
− Thus, the appropriate value (for latching the Count and/or Status of the selected counter) is placed
in the Control word as shown above.
− The advantage here is that the Count and the Status both can be read without disturbing the
counting.
1 = Null Count
0 = Count is present Same as Control Word
4) 3 Independent Counters
− 8254 has 3 Independent, 16-bit down counters.
− Each counter can operate have a Binary or BCD count.
− Each counter can be in one of the six possible modes.
− Each counter can have a max count of 216 = 65535 i.e. FFFFH.
− Each counter has the following signals: