8259 Complete Notes

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 34

8259

PROGRAMMABLE INTERRUPT
CONTROLLER
INTERRUPT
• An interrupt is an event which informs the CPU that its
service (action) is needed. An interrupt is a hardware-
initiated procedure that interrupts whatever program is
currently executing.
• Sources of interrupts:
– internal fault (e.g.. divide by zero, overflow)
– software
– external hardware :
• maskable
• nonmaskable
– reset
INTERRUPTS
• Intel processors include two hardware pins (INTR and
NMI) that request interrupts.
• And one hardware pin (INTA) to acknowledge the
interrupt requested through INTR.
• The processor also has software interrupts INT, INTO,
INT 3, and BOUND.
• Flag bits IF (interrupt flag) and TF (trap flag), are also
used with the interrupt structure and special return
instruction IRET
– IRETD in the 80386, 80486, or Pentium
BASIC PROCEDURE FOR PROCESSING
INTERRUPTS
• When an interrupt is executed, the mp:
– finishes executing its current instruction (if any).
– saves (PUSH) the flag register, IP and CS register in
the stack.
– goes to a fixed memory location.
– reads the address of the associated ISR.
– Jumps to that address and executes the ISR.
– gets (PULL) the flag register, CS:IP register from the
stack.
– continues executing the previous job (if any).
PIN DIAGRAM
PIN DESCRIPTION (contd.)
• The interrupts at the IR input
lines are handled by two
LOGIC DIAGRAM registers in cascade, the IRR and
ISR.
• IRR indicates all interrupt levels
which are requesting service,
and the ISR stores all interrupt
levels which are currently being
serviced.
• PR determines the priorities of
the bits set in lRR. The highest
priority is selected and strobed
into the corresponding bit of the
lSR during the INTA sequence.
• lMR stores the bits which disable
the interrupt lines to be masked.
It operates on the output of the
IRR.
• Masking of a higher priority
input will not affect the interrupt
request lines of lower priority.
FEATURES

• The PIC manages eight levels of requests and


has built-in features for expandability to other
PIC (up to 64 levels).
• It is programmed by system software as an I/O
peripheral.
• The priority modes can be changed or
reconfigured dynamically at any time during
main program operation
INTERFACING 8259 IN STAND-ALONE
MODE
INTERFACING 8259s IN CASCADE
INTERFACING 8259s IN CASCADE
(contd.)
PROGRAMMING THE 8259
PROGRAMMING THE 8259 (contd.)
ICW1
PROGRAMMING THE 8259 (contd.)
ICW2

ICW3 If it is initialised
as a master, (the SP/EN
(bar) pin is high in non-
buffered environment or
M/S(bar)=1 in ICW4 in
buffered environment)
each bit in ICE3 is used to
specify to the master
whether it has a slave
8259 attached to its
corresponding IR pin.
PROGRAMMING THE 8259 (contd.)
ICW3 If it is initialised
as a slave, (the SP/EN
(bar) pin is low in non-
buffered environment or
M/S(bar)=0 in ICW4 in
buffered environment)
bits D0 – D2 of ICW3 are
used to assign a slave
identification code (slave
ID) to the 8259. the slave
ID is equivalent to the
master IR input to which
the INTR output of the
slave is connected.
PROGRAMMING THE 8259 (contd.)
ICW4
INITIALIZATION PROCEDURE
OPERATIONAL COMMAND WORDS
OCW1

OCW2
OPERATIONAL COMMAND WORDS
(contd.)
OPERATIONAL COMMAND WORDS
(contd.)
OPERATIONAL COMMAND WORDS
(contd)
• OCW3
OPERATIONAL COMMAND WORDS
(contd)
BUF
• This is used to indicate to the 8259 whether it is
in buffered or non-buffered mode. If BUF=1, the
SP/EN (bar) pin is used as an output to enable
the data bus buffer of the system.
M/S(bar)
• In the buffered mode, this pin when 1 and sets
up the 8259 to be initialized as a master and
when 0, sets up as a slave.
MODES

• Fully Nested mode


• Special Fully Nested mode
• Nonspecific Rotating
• Specific Rotating
• Special Mask
• Polling
MODES (contd.)
• Fully Nested Mode
• The highest priority is assigned to IR0 and
lowest to IR7.
ROTATION
PROBLEMS RELATED TO ICWs
PROBLEMS RELATED TO ICWs
INTERFACING AND PROGRAMMING
8259
INTERFACING AND PROGRAMMING
8259 (contd.)
INTERFACING AND PROGRAMMING
8259 (contd.)
INTERFACING AND PROGRAMMING
8259 (contd.)
INTERFACING AND PROGRAMMING
8259 (contd.)
INTERFACING AND PROGRAMMING
8259 (contd.)
INTERFACING AND PROGRAMMING
8259 (contd.)

You might also like