MIT Unit 3 Notes
MIT Unit 3 Notes
Overview of Interrupt:
Interrupts are the signals generated by the external devices to request the microprocessor to perform a
task. For transferring data between the peripheral and the microprocessor, interrupts are mainly used.
An interrupt is considered to be an emergency signal that may be serviced. The Microprocessor may
respond to it as soon as possible.
When the Microprocessor receives an interrupt signal, it suspends the currently executing program and
jumps to an Interrupt Service Routine (ISR) to respond to the incoming interrupt. Each interrupt will most
probably have its own ISR.
If an interrupt occurs, it accepts the interrupt and sends the INTR’ signal to the peripheral. The
microprocessor executes an interrupt service routine (ISR) stored in memory. It returns to the main
program by RET instruction, after the ISR is executed. The interrupt process is shown in figure.
Interrupt process
Microprocessor & Interfacing techniques Unit 3 Notes
Types of Interrupts:
1. Hardware interrupts: These interrupts are given by the peripheral devices to the interrupt pin
(hardware) of the microprocessor. Hardware interrupts are also called external interrupts.
2. Software interrupts: These interrupts are internally generated within the microprocessor using
software instructions. Software interrupts are also called internal interrupts.
3. Maskable interrupts (Can be delayed or rejected): These external interrupts can be delayed or
rejected by the microprocessor.
4. Non-maskable interrupts (Cannot be delayed or rejected): These external
interrupts cannot be delayed or rejected by the microprocessor. Non-maskable
interrupts are used for handling emergency situations.
5. Vectored interrupts: When the address of the Interrupt Service Routine (ISR) is fixed within the
microprocessor itself, then the interrupt is called Vectored interrupt.
6. Non-vectored interrupts: When the address of the Interrupt Service Routine (ISR) is supplied by
the peripheral device, then the interrupt is called Non-vectored interrupt.
In additional to these hardware interrupts, 8085 microprocessor has eight software interrupts.
Maskable Interrupts:
Maskable interrupts are those interrupts which can be enabled or disabled. Enabling and disabling is
done by software instructions. The interrupts can be masked by moving an appropriate data to
accumulator and then executing SIM instruction. (SIM - Set Interrupt Mask). The status of maskable
interrupts can be read into accumulator by executing RIM instruction (RIM - Read Interrupt Mask).
List of Maskable Interrupts: RST 7.5, RST 6.5 ,RST 5.5 ,INTR
Non-Maskable Interrupts:
The interrupts which are always in enabled mode are called non maskable interrupts. These interrupts
can never be disabled by any software instruction. TRAP is a non-maskable interrupt.
Microprocessor & Interfacing techniques Unit 3 Notes
Vectored Interrupts:
The interrupts which have fixed memory location for transfer of control from normal execution.
List of vectored interrupts:
1. RST 7.5
2. RST 6.5
3. RST 5.5
4. TRAP
The addresses to which program control goes for vectored interrupts:
Name Vectored Address
Non-Vectored Interrupts:
The interrupts which don't have fixed memory location for transfer of control from normal execution
is called Non-Vectored Interrupts. The address of the memory location is sent along with the interrupt.
INTR is a non-vectored interrupt.
Interrupt priority:
The microprocessor can respond to only one interrupt at one time. When multiple (more than one)
interrupts occur simultaneously, the microprocessor will service the interrupts in their fixed priority
order. Interrupt having the highest priority level will be serviced first.
In 8085, TRAP interrupt has the highest priority and INTR has the lowest priority.
TRAP
This interrupt can be considered as a non-maskable interrupt. Any mask or interrupt enable cannot
affect this.
It is a vectored interrupt. The interrupt vector address is 0024H.
TRAP has the highest priority level.
Microprocessor & Interfacing techniques Unit 3 Notes
We can say that TRAP interrupt is level and edge triggered. This means that till the
acknowledgement, the TRAP must go high and remain high.
In emergency situations like sudden power failure, it executes an ISR and sends the data from main
memory to backup memory.
RST 7.5
The RST 7.5 can be considered as a maskable interrupt.
It is a vectored interrupt. The interrupt vector address is 003CH.
It has second highest priority.
It is edge triggered. ie. Input attains at high and no need to retain the high state until it is recognized
and acknowledged.
RST 6.5
The RST 6.5 interrupt is a maskable interrupt.
It is a vectored interrupt. The interrupt vector address is 0034H.
It has the third highest priority.
It is level triggered. ie. Input goes to high and stays high until it is recognized and acknowledged.
RST 5.5
The RST 5.5 interrupt is a maskable interrupt.
It is a vectored interrupt. The interrupt vector address is 002CH.
It has the fourth highest priority.
It is level triggered. ie. Input goes to high and stays high until it is recognized and acknowledged.
INTR
• INTR is a maskable interrupt.
It is a non- vectored interrupt.
It has the lowest priority.
It is a level triggered. ie. Input goes to high and it is necessary to maintain high state until it is
recognized and acknowledged.
DI (Disable Interrupt)
This instruction resets the Interrupt Enable Flip-flop inside the microprocessor. All the interrupts
except the TRAP are disabled.
EI (Enable Interrupt)
Inside the microprocessor, this instruction sets the Interrupt Enable Flip-flop also all the interrupts
are enabled.
SIM (Set Interrupt Mask)
This instruction is used to selectively mask (disable) and unmask (enable) RST 7.5, RST 6.5 and RST
5.5 interrupts. For serial data output, we can use this instruction. The SIM the instruction uses the
accumulator contents for masking and unmasking the interrupts.
RIM (Read Interrupt Mask)
This instruction is used to read the status of RST 7.5, RST 6.5 and RST 5.5 interrupts like pending
and enable / disable details. This instruction is also used for reading the serial data. When the RIM
instruction is given, the microprocessor loads the details into the accumulator.
Because the RST 7.5 interrupt is vectored, Microprocessor knows , in which memory location it has to go
using a call instruction to get the ISR address.
RST7.5 is known as Call 003Ch to Microprocessor. Microprocessor goes to 003C location and will get a
JMP instruction to the actual ISR address. The Microprocessor will then, jump to the ISR location.
RST 0 – 0000H
RST 1 – 0008H
RST 2 – 0010H
RST 3 – 0018H
RST 4 – 0020H
RST 5 - 0028H Software interrupt
RST 6 – 0030H Vectored interrupt
RST instruction RST 7 – 0038H - Maskable interrupt