- 2079 Jestha · 4 marks
How interrupts interface with microprocessor
Short answer
Peripherals connect to the microprocessor through an interrupt controller like the 8259 PIC, which manages multiple IRQ lines, priority, and masking. The controller asserts INT to the CPU; when the CPU sends INTA, the controller places the interrupt vector on the data bus, allowing the CPU to fetch the ISR address from the IVT.
How do interrupts interface with a microprocessor? Explain it.
A microprocessor has one or a few interrupt input pins (such as INTR, NMI), while a system has many devices that can interrupt. The devices are connected to the processor through an interrupt controller (e.g. the Intel 8259 PIC).
Device 0 -- IRQ0 --+
Device 1 -- IRQ1 --+--> +-------------+ INT +-----------+
Device 2 -- IRQ2 --+ | Interrupt |------->| |
... | controller | INTA | Micro- |
Device 7 -- IRQ7 --+ | (priority, |<-------| processor |
| mask) | D0-D7 | |
+------+------+<======>+-----------+
(vector on data bus)
Operation
- A device raises its IRQ line. The controller checks the mask and priority and sends INT to the processor.
- The processor finishes the current instruction, saves the PC and flags on the stack, and sends INTA.
- The controller puts the interrupt vector number (or the call instruction with the ISR address) on the data bus.
- The processor uses the vector to look up the IVT, loads the ISR address into the PC and runs the ISR.
- At the end, a return-from-interrupt instruction (IRET/RETI) restores the PC and flags and the main program continues.
The interrupt controller thus provides many interrupt lines, priority resolution, masking and the vector, and so interfaces many devices with the single INT pin. Non-maskable interrupt (NMI) cannot be disabled and is used for critical events such as power failure.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Interface circuit with 2 RAMs and 2 ROMs · Embedded System, chapter 5
- Maskable vs non-maskable interrupts · Microprocessor, chapter 5 · asked 2×
- Software interrupts of 8085 · Microprocessor, chapter 5
- Hardware interrupts available in 8086 · Microprocessor, chapter 5
- Hardware vs software interrupts · Microprocessor, chapter 5