Programmable Interval Timer 8253: Architecture of 8253
Programmable Interval Timer 8253: Architecture of 8253
Programmable Interval Timer 8253: Architecture of 8253
8253 generates accurate time Delays & can be used for applications such as a real-
time clock,an event counter, a square wave generator, acomplex-wave generator, etc.
16-Bit Counters, each with a max. count rate of2.6MHz
Architecture of 8253
PIT 8253
8253 contains three identical 16 bit counters that can operate independently, in any one of
the 6 modes
Three counters are independent of each other in operation but they are identical in
organization
These all are 16 bit, presettable, down counters able to operate in BCD/Hexadecimal
mode.
Each of the three counter has 3 pins associated
CLK: input clock frequency
OUT: can be square wave, or one shot
GATE: Enable (high) or disable (low) the counter
8-bit Data bus, bidirectional data buffer interfaces internal circuit of 8253 to
microprocessor system bus
Data is transmitted or received by the buffer upon the execution of IN or OUT instruction
The READ/WRITE logic controls the direction of the data buffer depending upon
whether it is a READ/WRITE operation. It has 5 signals RD, WR, CS, address lines
A1 & A2
The specialty of the 8253 counter is that they can beeasily read online without disturbing
the clock inputto the counter.
This facility is called On The Fly reading of countersand invoked by a mode control
word.
Modes of Operation
8253 can operate in any one of 6 modes
A control word must be written in the controlword register by the microprocessor to
initializeeach of the counters of 8253 to decides itsoperating mode
Gate of a counter is used to disable or enablecounting
Mode 0: Interrupt on terminal count
Mode 1: HW triggered / programmable one shot
Mode 2: Rate Generator (DividebyN counter)
Mode 3: Square wave rate generator
Mode 4: Software triggered strobe
Mode 5: Hardware triggered strobe
Architecture 8259
Description of 8259
Interrupt Request Register (IRR): The interrupts at IRQinput lines are handled by
Interrupt Request internally.IRR stores all the interrupt request in it in order to servethem
one by one on the priority basis.
In-Service Register (ISR): This stores all the interruptrequests those are being served,
i.e. ISR keeps a trackof the requests being served.
Interrupt Mask Register (IMR): This register stores the bitsrequired to mask the
interrupt inputs. IMR operates onIRR at the direction of the Priority Resolver.
Priority Resolver: This unit determines the priorities of the interruptrequests appearing
simultaneously. The highestpriority is selected and stored into thecorresponding bit of
ISR during INTA pulse.The IR0 has the highest priority while the IR7 has thelowest one,
normally in fixed priority mode.The priorities however may be altered byprogramming
the 8259A in rotating priority mode.
Interrupt Control Logic: This block manages theinterrupt and interrupt acknowledge
signals to be sentto the CPU for serving one of the eight interruptrequests. This also
accepts the interrupt acknowledge(INTA) signal from CPU that causes the 8259A
torelease vector address on to the data bus.
Data Bus Buffer: This tristate bidirectional bufferinterfaces internal 8259A bus to the
microprocessorsystem data bus. Control words, status and vectorinformation pass
through data buffer during read orwrite operations.
Read/Write Control Logic: This circuit accepts anddecodes commands from the CPU.
This block alsoallows the status of the 8259A to be transferred on tothe data bus.
Cascade Buffer/Comparator: This block stores andcompares the IDs all the 8259A
used in system. Thethree I/O pins CASO-2 are outputs when the 8259A isused as a
master. The same pins act as inputs whenthe 8259A is in slave mode.
Interrupt Sequence in an 8086 system
One or more IR lines are raised high that setcorresponding IRR bits.
8259A resolves priority and sends an INTsignal to CPU.
The CPU acknowledge the interrupt withINTA pulse.
Upon receiving an INTA signal from the CPU,the highest priority ISR bit is set and
thecorresponding IRR bit is reset. The 8259Adoes not drive data bus during this
period.
The 8086 will initiate a second INTA pulse.During this period 8259A releases an 8-
bitpointer on to data bus from where it is readby the CPU.
This completes the interrupt cycle.
The ISR bit is reset at the end of the secondINTA pulse if automatic end of
interrupt(AEOI) mode is programmed. Otherwise ISRbit remains set until an
appropriate EOIcommand is issued at the end of interruptsubroutine.
Pin Details
CS: This is an active-low chip select signal forenabling RD and WR operations of
8259A. INTAfunction is independent of CS.
WR: This pin is an active-low write enable input to8259A. This enables it to accept
command wordsfrom CPU.
RD: This is an active-low read enable input to 8259A.A low on this line enables 8259A
to release status ontothe data bus of CPU.
D0-D7: These pins from a bidirectional data bus thatcarries 8-bit data either to control
word or from statusword registers. This also carries interrupt vectorinformation.
CAS0 CAS2 Cascade Lines: A signal 8259A provides eightvectored interrupts. If more
interrupts are required, the8259A is used in cascade mode. In cascade mode, amaster
8259A along with eight slaves 8259A can provideupto 64 vectored interrupt lines. These
three lines act asselect lines for addressing the slave 8259A.
SP/EN (Slave program / enable): This pin is a dual purposepin. When the chip is used in
buffered mode, it can be usedas buffered enable to control buffer transreceivers. If this
isnot used in buffered mode then the pin is used as input todistinguish master/slave PIC
whether the chip is used as amaster (SP =1) or slave (EN = 0).
INT: This pin goes high whenever a valid interruptrequest is asserted. This is used to
interrupt the CPUand is connected to the interrupt input of CPU.
IR0 IR7 (Interrupt requests): These pins act asinputs to accept interrupt request to the
CPU.
INTA ( Interrupt acknowledge ): This pin is an inputused to strobe-in 8259A interrupt
vector data on tothe data bus. In conjunction with CS, WR and RDpins, this selects the
different operations like, writingcommand words, reading status word, etc.