Interrupts
Interrupts
INTERRUPTS OF 8085
¶ An interrupt is a special condition that arises during the working of a µP.
¶ In response, the µP services the interrupt by executing a subroutine called as the Interrupt
Service Routine.
¶ The µP checks for interrupts during every instruction.
¶ When an interrupt occurs, the µP first finishes the current instruction.
¶ It then Pushes the address of the next instruction (contents of PC) on the STACK.
¶ It resets the INTE flip-flop so that no more interrupts are recognized.
¶ Thereafter the program control transfers to the address of the Interrupt Service Routine (ISR)
and the µP thus executes the ISR.
Software Interrupts:
Interrupts that are initiated through program (software) are called as software interrupts.
8085 supports 8 software interrupts:
RSTn where n = 0,1,2, … 7 i.e. RST0, RST1 … upto RST7.
− This instruction causes a service routine to be Called from the address (n*8).
− Hence, if RST1 occurs then the program control moves to location 0008 (1*8 = 0008).
The respective addresses for software interrupts are given below.
Hardware Interrupts:
Interrupts that are initiated through a hardware pin are called as hardware interrupts.
8085 supports the following hardware interrupts:
− TRAP
− RST 7.5
− RST 6.5
− RST 5.5
− INTR
Vectored Interrupts:
− Interrupts that have a FIXED Address for their ISR (Interrupt Service Routine) are called as
Vectored Interrupts.
− Eg: TRAP is a vectored interrupt. Its vector address is 0024H.
Non-Vectored Interrupts:
− Interrupts that have a Variable Address for their ISR are called as Non-Vectored Interrupts.
− Eg: INTR is a Non-Vectored Interrupt.
MASKING:
− We can prevent an interrupt from occurring by MASKING its individual bit through SIM
Instruction.
− If an interrupt is masked it will not be serviced.
− One of the main advantages of masking as opposed to disabling interrupts is that by masking
we can selectively disable a particular interrupt while keeping other interrupts active,
whereas through DI instruction all interrupts are disabled.
− ONLY RST 7.5, RST 6.5 and RST 5.5 can be masked by this method.
TRAP:
− TRAP has the highest priority.
− It is Edge as well as Level triggered hence the signal must go High and also Remain high for
some time for it to be recognized. This prevents any noise signal from being accepted.
− It is a Non-Maskable Interrupt i.e. it can neither be masked nor be disabled.
− It is a vectored interrupt and has a vector address of 0024H.
RST 7.5:
− RST 7.5 has the priority lower than TRAP.
− It is Edge triggered.
− It is a Maskable Interrupt i.e. it can be masked through the SIM Instruction.
− It can also be disabled though the DI Instruction.
− It is a vectored interrupt and has a vector address of 003CH.
− RST 7.5 can also be reset through the R 7.5 bit in the SIM Instruction irrespective of whether
it is Masked or not.
RST 6.5:
− RST 6.5 has the priority lower than RST 7.5.
− It is Level triggered.
− It is a Maskable Interrupt i.e. it can be masked through the SIM Instruction.
− It can also be disabled though the DI Instruction.
− It is a vectored interrupt and has a vector address of 0034H.
RST 5.5:
− RST 5.5 has the priority lower than RST 6.5.
− It is Level triggered.
− It is a Maskable Interrupt i.e. it can be masked through the SIM Instruction.
− It can also be disabled though the DI Instruction.
− It is a vectored interrupt and has a vector address of 002CH.
INTR:
− INTR has the priority lower than RST 5.5.
− It is Level triggered.
− It can only be disabled though the DI Instruction.
− It cannot be masked through the SIM Instruction.
− It is a Non-Vectored interrupt.
Response to INTR:
− When INTR occurs the µP, in response, issues the first INTA cycle.
− The External Hardware sends an opcode, which can be of RSTn Instruction or of CALL
instruction.
a) If opcode of RSTn is sent by the external hardware
¶ The µP calculates the address of the ISR as n*8.
b) If opcode of CALL is sent:
¶ As Call is a 3-Byte Instruction the µP send 2 more INTA signals
¶ In response to the 2nd and the 3rd INTA cycle the external hardware returns the lower
and the higher byte of the address of the ISR respectively.
EI and DI Instructions:
Method of execution:
− The appropriate byte is formed and loaded into the Accumulator.
− Then the SIM Instruction is executed.
− The µP reads the contents of the accumulator in the above order.
Interrupt Enable
Serial In Data 1 è Interrupts are Enabled
1 è Data AT SID = 1 0 è Interrupts are Disabled
0 è Data AT SID = 0
Respective Interrupt Masked
Pending Interrupts
1 è Respective interrupt masked
1 è Respective interrupt is pending
0 è Respective interrupt unmasked
0 è Respective interrupt is NOT pending
Pending Interrupts:
Pending interrupts are those interrupts, which are waiting to be serviced.
An interrupt becomes pending as a higher priority interrupt is currently being serviced.
RIM Instruction indicates the Pending Status of RST7.5, RST6.5 and RST5.5.
Method of execution:
− Then the RIM Instruction is executed.
− The µP loads the appropriate byte into the Accumulator.
− The programmer reads the contents of the Accumulator.
Interrupt Properties
Get ISR
Address
INTR 5 Level No Yes No from
External
Hardware