Interrupt Controller
Interrupt Controller
Interrupt Controller
1. This IC is designed to simplify the implementation of the interrupt interface in the 8088
and 8086 based microcomputer systems.
2. This device is known as a ‘Programmable Interrupt Controller’ or PIC.
3. It is manufactured using the NMOS technology and It is available in 28-pin DIP.
4. The operation of the PIC is programmable under software control (Programmable)and it
can be configured for a wide variety of applications.
5. 8259A is treated as peripheral in a microcomputer system.
6. 8259A PIC adds eight vectored priority encoded interrupts to the microprocessor.
7. This controller can be expanded without additional hardware to accept up to 64
interrupt request inputs. This expansion required a master 8259A and eight 8259A
slaves.
8. Some of its programmable features are:
· The ability to accept level-triggered or edge-triggered inputs.
· The ability to be easily cascaded to expand from 8 to 64 interrupt-inputs.
· Its ability to be configured to implement a wide variety of priority schemes.
ASSINGMENT OF SIGNALS FOR 8259:
1. D7- D0 is connected to microprocessor data bus D7-D0 (AD7-AD0).
2. IR7- IR0, Interrupt Request inputs are used to request an interrupt and to connect to a slave in a
system with multiple 8259As.
3. WR - the write input connects to write strobe signal of microprocessor.
4. RD - the read input connects to the IORC signal.
5. INT - the interrupt output connects to the INTR pin on the microprocessor from the master, and is
connected to a master IR pin on a slave.
6. INTA - the interrupt acknowledge is an input that connects to the INTA signal on the system. In a
system with a master and slaves, only the master INTA signal is connected.
7. A0 - this address input selects different command words within the 8259A.
8. CS - chip select enables the 8259A for programming and control.
9. SP/EN - Slave Program/Enable Buffer is a dual-function pin.
When the 8259A is in buffered mode, this pin is an output that controls the data bus
transceivers in a large microprocessor-based system.
When the 8259A is not in buffered mode, this pin programs the device as a master
(1) or a slave (0).
CAS2-CAS0, the cascade lines are used as outputs from the master to the slaves for
cascading multiple 8259As in a system.
8259A PIC- PIN DIGRAM
8259
8259A PIC- BLOCK DIAGRAM
Slave 8259A
Interrupt controller
External e device 00
……..… IR0
……..…
INT
IR7
External e device 07
Microprocessor
Master 8259A
Interrupt controller
INTR
IR0
………………
……..…
INT INT
IR7
…
Slave 8259A
Interrupt controller
External e device 53
IR0
……..…
……..…
INT
Control Logic
INT (Interrupt) Output
Selects the vector number used with the interrupt request inputs.
For example, if we decide to program the 8259A so that it functions at vector
locations 08H-0FH, we place a 08H into this command word.
Likewise, if we decide to program the 8259A for vectors 70H-77H, we place a
70H in this ICW.
ICW3:
Is used only when ICW1 indicates that the system is operated in cascade mode.
This ICW indicates where the slave is connected to the master.
For example, if we connected a slave to IR2, then to program ICW3 for this
connection, in both master and slave, we place a 04H in ICW3.
Suppose we have two slaves connected to a master using IR0 and IR1. The
master is programmed with an ICW3 of 03H; one slave is programmed with an
ICW3 of 01H and the other with an ICW3 of 02H.
ICW4:
AEOI:
Selects automatic or normal end of interrupt. The EOI commands of OCW2 are used
only if the AEOI mode is not selected by ICW4. If AEOI is selected, the interrupt
automatically resets the interrupt request bit and does not modify priority. This is the
preferred mod of operation for the 8259A and reduces the length of the interrupt service
procedure.
Operation Command Words
OCW1:
Is programmed only when the AEOI mod is not selected for the 8259A.
In this case, this OCW selects how the 8259A responds to an interrupt.
The modes are listed as follows in next slide:
Nonspecific End-of-Interrupt:
A command sent by the interrupt service procedure to signal the end of the interrupt.
The 8259A automatically determines which interrupt level was active and resets the
correct bit of the interrupt status register. Resetting the status bit allows the interrupt to
take action again or a lower priority interrupt to take effect.
Specific End-of –Interrupt:
A command that allows a specific interrupt request to be reset. The exact position is
determined with bits L2-L0 of OCW2.
Rotate-on-Nonspecific EOI:
A command that function exactly like the nonspecific end-of-interrupt command except
that it rotates interrupt priorities after resetting the interrupt status register bit. The
level reset by this command becomes the lowest priority interrupt. For example, if IR4
was just serviced by this command, it becomes the lowest priority interrupt and IR5
becomes the highest priority.
Rotate-on-Automatic EOI:
A command that selects automatic EOI with rotating priority. This command must be
sent to the 8259A only once if this mode is desired. If this mode must be turned off, use
the clear command.
Rotate-on-Specific EOI:
Functions as the specific EOI, except that it selects rotating priority.
Set Priority:
Allows the programmer to set the lowest priority interrupt input using the L2-L0 bits.
OCW3:
Selects the register to be read, the operation of the special mask register, and
the poll command.
If polling is selected, the P-bit must be set and then output to the 8259A. The
next read operation would read the poll word. The rightmost three bits of the
poll word indicate the active interrupt request with the highest priority.
The leftmost bit indicates whether there is an interrupt, and must be checked
to determine whether the rightmost three bits contain valid information.
Status Register: -
Three status registers are available in the 8259A:
Both the IRR and ISR are read by programming OCW3 and IMR is read
through OCW1. To read the IMR, A0 = 1, to read IRR or ISR, A0 = 0. Bit positions
D0 and D1 of OCW3 select which register (IRR or ISR) is read when A0 = 0.
Modes of 8259A PIC
Fully Nested mode
Nonspecific Rotating
Specific Rotating
Special Mask
Polling
Poll command
The INT output is neglected, though it functions normally by not connecting INT output