Programmable Interval Timer - 8254
Programmable Interval Timer - 8254
Programmable Interval Timer - 8254
8254/8253
Prepared By,
Tanjum Rahi Akanto
Lecturer,Dept. of EEE
Daffodil International University
Outline:
• Basics of 8254/8253
• Control Signals of 8254/8253
• Block diagram of 8254/8253
• Control register
• Applications of 8254/8253
Basics of 8254/8253:
• 16-bit count is loaded in it’s register. (At first lower byte, then higher
byte as the data bus is of 8 bit)
• On command ,it begins to decrement until it reaches 0.
• At the end of the count it generates a pulse that can be used to
interrupt MPU.
• The counter either in binary or BCD.
Control Signals of 8254/8253:
A1 A0 Selection
0 0 Counter 0
0 1 Counter 1
1 0 Counter 2
1 1 Control Register
Block Diagram:
8254 is consist of a total of 3 counters of 16-bit each and adequate programming is
performed so that each one operates properly in one of the six possible modes. It has 2
inputs namely clock and gate while 1 output i.e., counter. The counter operates in a way
that initially a count value is stored in the count register and at this time gate signal will
be high and input is provided through clock input. After each cycle of the clock input,
the counter decrements the value by 1, and output is obtained according to the mode
of operation.
Here overall 8 data lines are there through which 8254 communicates with the
processor. Through the data bus buffer, registers store the control words and count
values. The read and write operations are performed through control signals RD’ and
WR’. Out of the four internal devices i.e., the three counters and a control register,
anyone is selected using address lines A0 and A1.
It is to be noted here that there is another timer called Intel 8253 which offers a clock
frequency of 2.6 MHz. Thus is regarded as a low clock version of 8254. Both of these
function in a similar manner however, the only difference exists in their operating clock
frequency.
Control Word Selection Format:
D7 D6 D5 D4 D3 D2 D1 D0
BCD:
If BCD=1; BCD counter
If BCD=0; Binary counter of 16 bit
M-mode:
M2 M1 Mo Selected Mode
0 0 0 Mode 0
0 0 1 Mode 1
1 0 Mode 2
×
1 1 Mode 3
×
1 0 0 Mode 4
1 0 1 Mode 5
SC-Select Counter:
SC1 SC0 Selected Counter
0 0 Counter 0
0 1 Counter 1
1 0 Counter 2
1 1 Read Back Command
RW—Read/Write
1 1 Count Status C2 C1 Co 0
Hints: Mode 3 produces square wave. Find count and control word first.
𝑰𝒏𝒑𝒖𝒕 𝑭𝒓𝒆𝒒𝒖𝒆𝒏𝒄𝒚
Count=
𝑶𝒖𝒕𝒑𝒖𝒕 𝑭𝒓𝒆𝒒𝒖𝒆𝒏𝒄𝒚
Applications:
• Real time clock
• Digital one shot
• Square wave generator
• Event counter
Thank You