Interrupts in 8085 Microprocessor

Interrupt is a process where an external device can get the attention of the microprocessor. Interrupts in 8085 microprocessor are of software and hardware types.

The process starts from the I/O device and is asynchronous. An interrupt is considered to be an emergency signal that may be serviced. The Microprocessor may respond to it as soon as possible.

What happens when Microprocessor is interrupted?

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.

Hardware and Software Interrupts in 8085 Microprocessor

Microprocessor 8085 supports two types of interrupts.

  • Hardware
  • Software

Software interrupts

  • The software interrupts are program instructions. These instructions are inserted at desired locations in a program.
  • The 8085 has eight software interrupts from RST 0 to RST 7. The vector address for these interrupts can be calculated as follows.
  • Interrupt number * 8 = vector address.
  • For RST 5, 5 * 8 = 40 = 28H.
  • Vector address for interrupt RST 5 is 0028H.

The Table shows the vector addresses of all interrupts.

InterruptsVector address
RST 00000H
RST 10008H
RST 20010H
RST 30018H
RST 40020H
RST 50028H
RST 60030H
RST 70038H

Hardware Interrupts

  • An external device initiates the hardware interrupts and placing an appropriate signal at the interrupt pin of the processor.
  • If the interrupt is accepted then the processor executes an interrupt service routine.

The 8085 has five hardware interrupts

(1) TRAP (2) RST 7.5 (3) RST 6.5 (4) RST 5.5 (5) INTR

Maskable and Non-Maskable Interrupts in 8085

Interrupts can be classified into two types:
Maskable Interrupts :- These are the interrupts that can be delayed or Rejected. RST 5.5, RST 6.5, and RST 7.5 are all maskable. INTR is maskable using the EI/DI instruction pair.
Non-Maskable Interrupts :- These are the interrupts that can not be delayed or Rejected.

  • TRAP is the only non-maskable interrupt in the 8085
  • The ‘EI’ instruction is a one byte instruction and is used to Enable the non-maskable interrupts.
  • The ‘DI’ instruction is a one byte instruction and is used to Disable the non-maskable interrupts.
  • The 8085 has a single Non-Maskable interrupt (TRAP). The non-maskable interrupt is not affected by the value of the Interrupt Enable flip flop.

Vectored Interrupts and Non-Vectored Interrupts

Vectored: The address of the subroutine is already known to the Microprocessor. It is as follows.

InterruptsVector address
RST 7.5003CH
RST 6.50034H
RST 5.5002CH
TRAP0024H

Non Vectored: The device will have to supply the address of the subroutine to the Microprocessor. The INTR input is the only non-vectored interrupt.

The 8085 has 5 interrupt inputs:


1- The INTR input.
The INTR input is the only non-vectored interrupt.
INTR is maskable using the EI/DI instruction pair.

2,3,4- RST 5.5, RST 6.5, RST 7.5 are all automatically vectored.
RST 5.5, RST 6.5, and RST 7.5 are all maskable.

5- TRAP is the only non-maskable interrupt in the 8085
TRAP is also automatically vectored

Hardware Structure of Interrupts in 8085

  • Interrupt is signals send by an external device to the processor, to request the processor to perform a particular task or work.
  • Mainly in the microprocessor-based system the interrupts are used for data transfer between the peripheral and the microprocessor.
  • The processor will check the interrupts always at the 2nd T-state of last machine cycle.
  • If there is any interrupt it accepts the interrupt and send the INTA (active low) signal to the peripheral.
  • The vectored address of particular interrupt is stored in program counter.
  • The processor executes an interrupt service routine (ISR) addressed in program counter.
  • It returned to main program by RET instruction.
Interrupt typeTriggerPriorityMaskableVector address
TRAPEdge and Level1stNo0024H
RST 7.5Edge2ndYes003CH
RST 6.5Level3rdYes0034H
RST 5.5Level4thYes002CH
INTRLevel5thYes

TRAP

  • This interrupt is a non-maskable interrupt. It is unaffected by any mask or interrupt enable.
  • TRAP bas the highest priority and vectored interrupt.
  • TRAP interrupt is edge and level triggered. This means that the TRAP must go high and remain high until it is acknowledged.
  • In sudden power failure, it executes a ISR and send the data from main memory to backup memory.
  • The signal, which overrides the TRAP, is HOLD signal. (i.e., If the processor receives HOLD and TRAP at the same time then HOLD is recognized first and then TRAP is recognized).
  • There are two ways to clear TRAP interrupt.

 1.By resetting microprocessor (External signal)

 2.By giving a high TRAP ACKNOWLEDGE (Internal signal)

RST 7.5

  • The RST 7.5 interrupt is a maskable interrupt.
  • It has the second highest priority.
  • It is edge sensitive i.e. Input goes to high and no need to maintain high state until it recognized.
  • Maskable interrupt. It is disabled by,
    1. DI instruction
    2. System or processor reset.
    3. After reorganization of interrupt.
  • Enabled by EI instruction.

RST 6.5 and 5.5

  • The RST 6.5 and RST 5.5 both are level triggered. . ie. Input goes to high and stay high until it recognized.
  • Maskable interrupt. It is disabled by,
    1. DI, SIM instruction
    2. System or processor reset.
    3. After reorganization of interrupt.
  • Enabled by EI instruction.
  • The RST 6.5 has the third priority whereas RST 5.5 has the fourth priority.

INTR

  • INTR is a maskable interrupt. It is disabled by,
    1. DI, SIM instruction
    2. System or processor reset.
    3. After reorganization of interrupt.
  • Enabled by EI instruction.
  • Non- vectored interrupt. After receiving INTA (active low) signal, it has to supply the address of ISR.
  • It has lowest priority.
  • It is a level sensitive interrupt. i.e. Input goes to high and it is necessary to maintain high state until it recognized.
  • The following sequence of events occurs when INTR signal goes high.
    1. The 8085 checks the status of INTR signal during execution of each instruction.
    2. If INTR signal is high, then 8085 complete its current instruction and sends active low interrupt acknowledge signal, if the interrupt is enabled.
    3. In response to the acknowledge signal, external logic places an instruction OPCODE on the data bus. In the case of multibyte instruction, additional interrupt acknowledge machine cycles are generated by the 8085 to transfer the additional bytes into the microprocessor.
    4. On receiving the instruction, the 8085 save the address of next instruction on stack and execute received instruction.

SIM and RIM for interrupts in 8085

  • The 8085 provide additional masking facility for RST 7.5, RST 6.5 and RST 5.5 using SIM instruction.
  • The status of these interrupts can be read by executing RIM instruction.
  • The masking or unmasking of RST 7.5, RST 6.5 and RST 5.5 interrupts can be performed by moving an 8-bit data to accumulator and then executing SIM instruction.
  • The format of the 8-bit data is shown below.
SIm instruction format of 8085 microprocessor
  • The status of pending interrupts can be read from accumulator after executing RIM instruction.
  • When RIM instruction is executed an 8-bit data is loaded in accumulator, which can be interpreted as shown in figure.
RIM instruction format of 8085 Microprocessor
Figure: RIM instruction format of 8085 Microprocessor

Recent posts

2 thoughts on “Interrupts in 8085 Microprocessor”

Leave a Comment

Your email address will not be published. Required fields are marked *