Interrupts in 8085 Microprocessor
Interrupts in 8085 Microprocessor
Interrupts in 8085 Microprocessor
Interrupts in 8085
Basically
whenever a software interrupt is generated then its vector
address is calculated by:
4 × 8 = 32 = 20H
Thus 0020H will be the vector address of RST 4
Types of Interrupts in 8085:
1. Hardware
2. Software
Hardware :
(a) TRAP (b) RST 7.5 (c) RST 6.5 (d) RST 5.5 (e) INTR
When any of these ping, except INTR, is active, the internal
control circuit of the 8085 produces a CALL to a predetermined
memory location. This memory location, where the subroutine
starts is referred to as vector location and such interrupts are
called vectored interrupts. The INTR is not a vectored interrupt.
It receives the address of the subroutine from the external device.
As shown in the Fig. 5.3, the positive edge of TRAP signal sets the
D flip-flop. However, due to the AND gate, it is necessary to
sustain high level on the TRAP input.
There are two ways to clear TRAP interrupt :
The positive edge signal on the RST 7.5 pin sets the D flip flop. If
the mask bit M 7.5 is 0 i.e. RST 7.5 is unmasked then 8085
completes its, current instruction. It then pushes the address of
the next instruction onto the stack and loads PC with the fixed
vector address 003CH. Due to this, 8085 starts execution of
instructions from address 003CH which is the starting address of
an interrupt service routine for RST 7.5.
RST 6.5 and RST 5.5 : The RST 6.5 and RST 5.5 both are level
triggered. These Types of Interrupts in 8085 can be masked
using SIM instruction. The RST 6.5 has the third priority whereas
RST 5.5 has the fourth priority. The vector addresses of RST 6.5
and RST 5.5 are 0034H and 002CH respectively. After recognition
of RST 6.5 or RST 5.5 interrupt, 8085 completes its current
instruction; pushes the address of next instruction onto the stack
and loads PC with corresponding vector address.
The 8085 has eight software interrupts from RST 0 to RST 7. The
vector address for these interrupts can be calculated as follows.
DI : Disable Interrupt
The DI instruction resets the interrupt enable flip flop, as shown in
Fig. 5.2. Thus it disables RST 7.5, RST 6.5, RST 5.5 and INTR
interrupts.
Bits 0 – 2 will set/reset the mask bits for RST 5.5, RST 6.5, and RST
7:5 of the interrupt mask register.
Bit 7 decides the data to be sent on the serial output pin of 8085.
5. Pending Interrupts:
The Read Interrupt Mask, RIM, instruction loads the status of the
interrupt mask, the pending interrupts and the contents of the
serial input data line, SID, into the accumulator. Thus, it is possible
to monitor status of interrupt mask, pending interrupts and serial
input. There are number of Types of Interrupts in 8085. When one
interrupt is being serviced, other interrupt requests may occur. If
the interrupt requests are of higher priority, 8085 branches
program control to the requested interrupt service routines. But
when the interrupt requests are of lower priority, 8085 stores the
information about these interrupt requests. Such interrupts are
called pending interrupts. The status of pending interrupts can be
monitored using RIM instruction.
Bits 0-2 give the status of interrupt mask. Logic 1 indicates the
interrupt is masked.
Bit 3 gives the status of interrupt enable flag. If 1, interrupts are
enabled.