Interfacing Peripherals (I/O) and Applications
Interfacing Peripherals (I/O) and Applications
Interfacing Peripherals (I/O) and Applications
Applications
Interrupt:
• Interrupt is a process where an external device can get the attention of the microprocessor.
• The process is asynchronous, means can occur at any time during execution of program.
• Interrupt is signal send by an external device to the microprocessor to request the processor to
perform a particular task or work.
• It is a simple routine program that keeps a check for the occurrence of the interrupt.
• If the μP accept the interrupt and send the INTA (active low) signal to the peripheral.
• When interrupt is received, μP suspends its current activity and upon completion, it resumes the
suspended activity.
• The processor executes an interrupt service routine (ISR) addressed in program counter.
• There are eight software interrupt available in μP that are RST0 to RST7.
• The vector address for these interrupts can be calculate as Interrupt number * 8 = vector address.
• These instruction allow transfer of program control from the main program to predefined service
routine is also referred to as ISR.
Hardware Interrupt
This interrupt is caused by sending a signal on one of the interrupt pins of the
microprocessor.
The 8085 has five hardware interrupts (1)TRAP (2)RST7.5 (3)RST6.5 (4)RST5.5
(5)INTR (address is supplied externally)
The hardware interrupts are classified Two types–
Maskable Interrupts (Can be delayed or Rejected) : An interrupt which can be disabled by
software that means we can disable the interrupt by sending appropriate instruction, is called a
maskable interrupt. RST 7.5, RST 6.5, RST 5.5 , INTR are the example of Maskable Interrupt.
Non-Vectored (address of the service routine needs to be supplied externally by the device):
In non-vectored interrupts the interrupted device should give the address of the interrupt service
routine(ISR). The INTR is a non-vectored interrupt. Hence when a device interrupts through INTR,
it has to supply the address of ISR after receiving interrupt acknowledge signal.
• When a device interrupts, it actually wants the MP to give a service which is equivalent
to asking the MP to call a subroutine. This subroutine is called ISR (Interrupt Service
Routine).
• This interrupts can be enable and disable by using EI (enable interrupt) & DI (disable
interrupt) instructions.
• The ‘EI’ instruction is a one-byte instruction and is used to Enable interrupts.
• The ‘DI’ instruction is a one-byte instruction and is used to Disable interrupts.
TRAP
• 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.
When RIM instruction is executed an 8-bit data is loaded in accumulator, which can be interpreted
as shown in fig.
Practice problem
If the 8085 microprocessor is interrupted while executing a 3-byte instruction (assuming the
interrupt is enabled), the processor will acknowledge the interrupt request immediately, even
before the completion of the instruction.
b. When an 8085 system is Reset, all the interrupts including the TRAP are disabled.