You are on page 1of 14

Programmable Devices:

8254 & 8259


Haris Ahmed
Mohd. Nauman
Ashutosh Chauhan
Mohd. Azharuddin

Programmable Interval Timer


PITs perform timing & counting operations.
Can be used to produce time delays & are
used as real time clock , event counter etc.
Trivia: PIT is being used in IBM PC
compatibles since 1981.

Introducing 8254

The Intel 8254 is a programmable counter.


It includes 3 identical 16 bit counters.
It is packaged in a 24-pin DIP.
Six programmable modes.
Gate is used to enable or disable the
counter.

Trivia :Initially designed to work with Intel


80/85. Later, incorporated with x86 family.
3

Architecture
Of 8254
D7-D0

RD
W
R
A0
A1
CS

DATA
BUS
BUFFE
R
READ/
WRITE
LOGIC

CONTROL
WORD
REGISTER

COUNTE
R
0

COUNTER
1

CLK 0
GATE 0
OUT 0

CLK 1
GATE 1
OUT 1

COUNTER
2

CLK 2
GATE 2
OUT 2
4

Into the world of 8254


Data Bus Buffer:
This block contains the logic to buffer the data bus to the
microprocessor and to the internal registers. It has 8 input
pins, usually labelled as D7..D0, where D7 is the MSB.

Control Logic:

The control section has five signals: Read, Write, Chip


select and the address lines A0 and A1.
In peripheral I/O mode read and write signals are
connected to IOR and IOW while in memory mapped
these are connected to MEMR and MEMW.

The control word register and counters are selected


according to signals on lines A0 and A1 as shown below:

CS A1
0
0
0
0
0
1
0
1

A0 Select
0
Counter 0
1
Counter 1
0
Counter 2
1
Control Reg.

Control word Register:


This register is accessed when lines A0 and A1
are at logic 1.
It is used to write command word which specifies
the counter to be used, its mode and either read
or write format.

8253/8254 word format

MODES OF 8254
MODE 0: Interrupt on terminal count.
MODE 1: Programmable 1 shot.
MODE 2: Rate generator.
MODE 3: Square wave generator.
MODE 4: Software triggered strobe.
MODE 5: Hardware triggered strobe.
8

Modes of Operation
of 8254

Mode 0: Interrupt on Terminal Count


The output will start off zero. The count is loaded
and the timer will start to count down.
When the count has reached zero the output will
be set high, and remain high until the next count
has been reloaded.
This can be used as an interrupt.

Mode 1: Programmable One-Shot


The output will go low following the rising edge of
the gate input.
The counter will count and the output will go high
once the counter has reached zero.

10

Mode 2: Rate Generator


This mode is used to generate a pulse equal to
the clock period at a given interval.
When count is loaded the OUT stays high until the
count reaches 1 and the the OUT goes low for one
clock period.
The count is reloaded automatically and the pulse
is generated continuously.

Mode 3: Square Wave Generator


This mode is similar to mode 2. However, the
duration of the high and low clock pulses of the
output will be different from mode 2.
11

Suppose n is the number loaded into the counter (the COUNT


message), the output will be:
high for n/2 counts, and low for n/2 counts, if n is even.
high for (n+1)/2 counts, and low (n-1)/2 for counts, if n is odd

Mode 4: Software Triggered Pulse


The output will remain high until the timer has counted to zero,
at which point the output will pulse low and then go high again.

Mode 5: Hardware Triggered Pulse


The counter will start counting once the gate input goes high,
when the counter reaches zero the output will pulse low and
then go high again.
READ BACK COMMAND : The 8254 allows the read back command
to read the count and the status of the counter, this command
is not available in the 8253.
12

THANK YOU!

References

http://www.circuitstoday.com/
http://www.ti.com/lit/an/slyt145/slyt145.pdf
http://
8085projects.info/page/free-programs-for-8085-microproc
essor.html
http://www.learnabout-electronics.org/index.php
https://www.youtube.com/watch?v=nxAQ1PFEd5U

14

You might also like