SlideShare a Scribd company logo
1 of 39
Interrupts in 8085
Concept of Interrupt
 A signal that a peripheral send to the CPU in order to
request attention.
 In response to an interrupt, the processor stops what
it is currently doing and executes the service routine.
 When the execution of the service routine is
terminated, the original process may resume its
previous operation.
 The interrupt is initiated by an external device and is
asynchronous.
 The response to and interrupt request is directed or
controlled by the microprocessor.
Er. Sulav Paudel | MSc
Process
 The I/O unit issues an interrupt signal to the
processor.
 The processor finishes execution of the current
instruction before responding to the interrupt.
 The processor test for an interrupt, determines that
there is one, and sends an acknowledgement signal
to the device that issued the interrupt.
 The processor then begins to transfer its control to
the ISR (Interrupt Service Routine) which serves a
interrupt request from the device. ISR resides at a
specified location.
Er. Sulav Paudel | MSc
Process
 Processor saves the information needed to resume
the current program at the point of interrupt.
 The minimum information required is the status of
the processor and location of the next instruction to
be executed.
 The processor then loads the program counter with
the entry location of the ISR that will responds to
this interrupt.
 Once the PC has loaded, the control is transferred to
the interrupt handler program.
Er. Sulav Paudel | MSc
Process
 The fundamental requirement of the ISR is that it
should begin by saving the contents of all the
registers on the stack
 The interrupt handler then proceeds to process the
interrupt.
 When the interrupt processing is completed, the
saved registers value are retrieved from the stack and
restored to the register.
 The final function is to restore the PSW and PC value
from the stack
Er. Sulav Paudel | MSc
Types of Interrupt
 3 major types of interrupt:
External Interrupt
Internal (Exception) Interrupt
Software Interrupt
Er. Sulav Paudel | MSc
External Interrupt
 Initiated via the microprocessor interrupt pins by
external devices such as I/O devices, timing devices,
circuit monitoring the power supply, etc.
 Causes of this interrupt may be:
I/O device requesting transfer of data
I/O device finished transfer of data
Elapsed time of an event or power failure
 Types of external interrupt
Maskable Interrupt
Non-Maskable Interrupt
Er. Sulav Paudel | MSc
Maskable Interrupt
 Enables/Disabled by executing instructions such as
EI (Enable Interrupt) and DI (Disable Interrupt).
 If microprocessor’s Interrupt Enable Flip-Flop is
disabled, it ignores a maskable interrupt.
 In 8085, the 1-byte instruction EI sets the interrupt
enable flip-flop and enable the interrupt process.
 Similarly, 1-byte instruction DI resets the interrupt
flip-flop and disables the interrupt process.
 Maskable interrupts is not recognized by the
processor when the interrupt is disabled.
Er. Sulav Paudel | MSc
Non-Maskable Interrupt
 Can’t be enabled/disabled by instructions.
 Higher priority over the maskable interrupt.
 When both the maskable and non-maskable
interrupt are activated at the same time, then the
processor will service the non-maskable interrupt
first.
 In 8085, TRAP is an example of non-maskable
interrupt.
Er. Sulav Paudel | MSc
Maskable Vs Non-Maskable Interrupt
Non Maskable Interrupt Maskable Interrupt
It cannot be masked off or made
pending.
It can be masked off or make pending.
This interrupt disables all maskable
interrupts.
This interrupt does not disable non-
maskable interrupts.
It is used for emergency purposes like
power failure, smoke detector, etc.
It is used to interface peripherals
Higher priority Lower Priority
Response time is low. Response time is high.
Er. Sulav Paudel | MSc
Internal Interrupt
 Arises from illegal or erroneous use of an instruction
or data.
 Causes may be:
Register overflow
Divide by zero
An invalid operation code
Stack overflow, etc.
 These error conditions usually occur as a result of
premature termination of the instruction execution
termed as exception.
Er. Sulav Paudel | MSc
Internal Vs External Interrupt
Internal Interrupt External Interrupt
It is initiated by some exceptional
conditions caused by program itself.
It is caused by external event.
These are synchronous with the
program.
These are asynchronous.
If the program is return, the internal
interrupt will occur at the same place
each time.
It depends on the external conditions
that are independent of the program
being executed at the time.
Er. Sulav Paudel | MSc
Software Interrupt
 External and Internal interrupts are initiated from
signal that occur in the hardware of the CPU.
 Initiated by executing an instruction.
 A special call instruction that behaves like an
interrupt rather than a subroutine call.
 Can be used by the programmer to initiate an
interrupt procedure at any desired point in the
program.
 The most common use of software interrupt is
associated with a supervisor call instruction.
Er. Sulav Paudel | MSc
Software Interrupt
 This instruction provides means for switching from a
CPU user mode to the supervisor mode.
 Certain operations in the computer may be assigned
to the supervisor mode only, as for example, a
complex input or output transfer procedure.
 In 8085 the instruction like RST0, RST1, RST2,
RST3, RST4, RST5, RST6, RST7 causes software
interrupt.
Er. Sulav Paudel | MSc
Software Vs Hardware Interrupt
Software Interrupt Hard Interrupt
It is synchronous event. It is asynchronous event.
This interrupt is requested by executing
instruction.
This interrupt is requested by external
device.
PC is incremented. PC is not incremented.
Microprocessor does not execute
interrupt acknowledge cycle or idle
machine cycle to acknowledge this
interrupt. It executes normal
instruction cycle.
Microprocessor executes either
interrupt acknowledge cycle bus or idle
machine cycle to acknowledge this
interrupt.
In 8085, the software interrupt cannot
be disabled or masked.
Hardware interrupt except TRAP can be
disabled or masked.
It has highest priority among all
interrupts.
The priority is lower than that of
software interrupt
Er. Sulav Paudel | MSc
Software Vs Hardware Interrupt
Software Interrupt Hard Interrupt
It does not affect on interrupt control
logic.
It affects on interrupt control logic.
It is not used to interface peripherals
that means it does not improve
throughput of system. It is used in
program debugging.
It is used to interface peripherals in
interrupt driven I/O. It improves
throughput of the system.
Er. Sulav Paudel | MSc
Interrupt Priority
 The first task of the interrupt system is to identify the
source of the interrupt.
 There is also the possibility that several sources will request
service simultaneously.
 In this case the system must also decide which device to
service first.
 An interrupt priority is a system that establishes a priority
over the various sources to determine which condition is to
be serviced first when two or more requests arrive
simultaneously.
 The system may also determine which conditions are
permitted to interrupt the computer while another interrupt
is being serviced.
Er. Sulav Paudel | MSc
Interrupt Priority
Higher-priority interrupt levels are assigned to request
which, if delayed or interrupted, could have serious
consequence.
Devices with higher speed transfers such as magnetic
disks are given high priority, and slow devices such as
keyboards receive low priority.
 When two devices interrupt the processor at the same
time, the processor services the device, with the higher
priority first.
Er. Sulav Paudel | MSc
Service Multiple Interrupt
 Two ways of servicing multiple interrupts:
Polled Interrupt
Chained (Vectored) Interrupt
Er. Sulav Paudel | MSc
Polled Interrupt
 Handled using software and are therefore slower to
vectored (hardware) interrupt.
 One common branch address for all interrupts.
 The program that takes care of interrupts begins at the
branch address and polls the interrupt sources in
sequence.
 The order in which they are tested determines the
priority of each interrupt.
 The highest-priority source is tested first, and if its
interrupt signal is on, control branches to a service
routine for this source.
Er. Sulav Paudel | MSc
Polled Interrupt
 Otherwise the next lower-priority source is tested, and
so on.
 Thus, the initial service routine for all interrupts consist
of a program that tests the interrupt sources in sequence
and branches to one of many possible service routines.
 Polled interrupts are very simple but for large number of
devices, the time required to poll each device may
exceed the time to service the device.
 In such case, the faster mechanism called chained
interrupt is used.
Er. Sulav Paudel | MSc
Chained (Vectored) Interrupt
 Hardware concept of handling the multiple interrupts.
 Devices are connected in a chain fashion as shown in
figure below for setting up the priority system.
Er. Sulav Paudel | MSc
Chained (Vectored) Interrupt
 Here, the device with the highest priority placed at the
first position, followed by lower priority devices.
 Suppose that one or more devices interrupt the
processor at a time.
 In response, the processor saves its current status and
then generates an interrupt acknowledge (INTA) signal
to the highest priority device, which is device 1 in our
case.
 If this device has generated the interrupt, it will accept
the INTA on to the next device until the INTA is
accepted by the interrupting device.
Er. Sulav Paudel | MSc
Chained (Vectored) Interrupt
 Once accepted, the device provides a means to the processor
for finding the interrupt address vector using external
hardware.
 Usually the requesting device responds by placing a word on
the data lines.
 With the help of hardware, it generates interrupt vector
address.
 This word is referred to as vector, which the processor uses
a pointer to the appropriate device service routine.
 This avoids the need to execute a general interrupt service
routine first.
 So this technique is also referred to as vectored interrupts.
Er. Sulav Paudel | MSc
Interrupt Priority
 Based on priority, it has five interrupts:
1. TRAP
2. RST7.5
3. RST6.5 Priority Decreasing
4. RST5.5
5. INTR
 The four interrupts TRAP, RST7.5, RST6.5, RST5.5 are
automatically vectored to specific location without any
external hardware.
 They do not require INTA signal or an input port, the
necessary hardware is already implemented inside the
8085.
Er. Sulav Paudel | MSc
Interrupt Priority
 Interrupts and their call location are:
Interrupts Call Locations
TRAP 0024H
RST7.5 003CH
RST6.5 0034H
RST5.5 002CH
Er. Sulav Paudel | MSc
INTR
 Maskable interrupt
 Can be enabled by instruction EI and can be disabled by
instruction DI.
 Requires external hardware to transfer program
sequence to specific call locations.
 There are 8 numbers of call locations for INTR interrupt.
 The hardware circuit generates RST codes for this
purpose and places that on the data bus externally.
 When the microprocessor is executing a program, it
checks the INTR line ( when interrupt enable flipflop is
enabled using EI instruction) during the execution of
each instruction.
Er. Sulav Paudel | MSc
INTR
 If the line is high and the interrupt is enabled, the
microprocessor completes the current instruction,
disables the interrupt enable flipflop and sends a
INTA signal.
 The processor does not accept any interrupt requests
until the interrupt flipflop is enabled again.
Er. Sulav Paudel | MSc
Er. Sulav Paudel | MSc
Er. Sulav Paudel | MSc
TRAP
 Non maskable interrupt.
 Highest priority among the interrupt signals.
 Need not be enabled and cannot be disabled.
 When triggered the program, control is transferred to
the location 0024H without any external hardware or
the interrupt enable instructions.
 Generally used for critical events like power failure and
emergency shut down.
Er. Sulav Paudel | MSc
RST 7.5, RST6.5, RST5.5
 Maskable interrupt.
 Enabled by software instruction like EI and SIM (Set
Interrupt Mask)
 SIM enables/ disables the interrupts according to the bit
pattern of the accumulator.
Er. Sulav Paudel | MSc
Set Interrupt Mask (SIM)
 1 Byte Instruction
 Has 3 main functions:
 Set mask for RST7.5, 6.5 and 5.5 interrupts. Bit D3 is a
control bit and should be 1 for bits D0, D1 and D2.
 Logic 0 on D0, D1 and D2 will enable the corresponding
interrupts
 Logic 1 will disable the interrupts
 SIM instruction reads the content of accumulator and
enables or disables the interrupts according to the contents
of accumulator.
 E.g. D4 is an additional control bit for M7.5, if D4 = 1, then
RST7.5 is reset.
 To implement the serial input and output. Bit D7 and D6 of
the accumulator are used for serial input and output and don’t
affect the interrupts.
Er. Sulav Paudel | MSc
Set Interrupt Mask (SIM) Instruction
Er. Sulav Paudel | MSc
 Accumulator bit pattern for SIM instruction
0 - Available
1 - Mask
0 – Ignore bit 7
1 – Send bit 7 to SOD pin
MSE
0 – Ignore bits 0-2
1 – Set masks according to bits 0-2
If R7.5 = 0 - Allowed
1 – Not allowed
Set Interrupt Mask (SIM) Instruction
Er. Sulav Paudel | MSc
Example:
 Write instructions to enable interrupt RST 5.5 and
mask other interrupts.
Solution:
Instruction: MVI A, 0EH ; Bits D3 = 1 and D0 = 0
SIM ; Enable RST 5.5
SOD SDE X R7.5 MSE M7.5 M6.5 M5.5
0 0 0 0 1 1 1 0
Pending Interrupt
Er. Sulav Paudel | MSc
 When one interrupt request is being served the other
interrupt may be pending.
 When more than one interrupt occurs
simultaneously the interrupt having higher priority
is served and the interrupts with lower priority
remain pending.
 The 8085 has an instruction RIM using which the
programmer can know the current status of pending
interrupts.
 This instruction gives status of only maskable
interrupts.
Read Interrupt Mask (RIM) Instruction
Er. Sulav Paudel | MSc
 1 byte instruction
 Checks the status of all the pending and maskable
interrupts.
 Transfers serial data bit from SID line to D7 bit of
Accumulator.
 Transfers the contents of interrupt control logic into the
accumulator.
Read Interrupt Mask (RIM) Instruction
Er. Sulav Paudel | MSc
 Bit pattern for RIM instruction
Read Interrupt Mask (RIM) Instruction
Er. Sulav Paudel | MSc
 This instruction loads the accumulator with eight
bits indicating the current status of the interrupt
mask.
 To identify the pending interrupts, bits D4, D5 and
D6 are checked.
 Bits D3, D2, D1, D0 are status of interrupt enable
flipflop, Mask 7.5, Mask 6.5 and Mask 5.5.
 When RIM instruction is executed the status of
masking is loaded at bits D3, D2, D1 and D0.
 To receive serial data, bit D7 is used.

More Related Content

What's hot

Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051SARITHA REDDY
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kVijay Kumar
 
ARM Exception and interrupts
ARM Exception and interrupts ARM Exception and interrupts
ARM Exception and interrupts NishmaNJ
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction SetDr. Pankaj Zope
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerbhadresh savani
 
Interrupts of 8085
Interrupts of 8085Interrupts of 8085
Interrupts of 8085ShivamSood22
 
Embedded System Tools ppt
Embedded System Tools  pptEmbedded System Tools  ppt
Embedded System Tools pptHalai Hansika
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorVikas Gupta
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller pptRahul Kumar
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051ssuser3a47cb
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems VijayKumar5738
 
Timing and control
Timing and controlTiming and control
Timing and controlchauhankapil
 
Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Jay Patel
 

What's hot (20)

Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
RS 232
RS 232RS 232
RS 232
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.k
 
ARM Exception and interrupts
ARM Exception and interrupts ARM Exception and interrupts
ARM Exception and interrupts
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontroller
 
Interrupts of 8085
Interrupts of 8085Interrupts of 8085
Interrupts of 8085
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
Embedded System Tools ppt
Embedded System Tools  pptEmbedded System Tools  ppt
Embedded System Tools ppt
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessor
 
Interrupts of microprocessor 8085
Interrupts of microprocessor  8085Interrupts of microprocessor  8085
Interrupts of microprocessor 8085
 
Pin diagram 8085
Pin diagram 8085 Pin diagram 8085
Pin diagram 8085
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems
 
Timing and control
Timing and controlTiming and control
Timing and control
 
Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051
 

Similar to Interrupts in 8085

Similar to Interrupts in 8085 (20)

Interrupts
InterruptsInterrupts
Interrupts
 
Interrupt 8085
Interrupt 8085Interrupt 8085
Interrupt 8085
 
Interrupts in CPU
Interrupts in CPUInterrupts in CPU
Interrupts in CPU
 
Timing n interrupt.pptx
Timing n interrupt.pptxTiming n interrupt.pptx
Timing n interrupt.pptx
 
IO organization.ppt
IO organization.pptIO organization.ppt
IO organization.ppt
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organization
 
Interrupts
InterruptsInterrupts
Interrupts
 
Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003
 
INTERRUPTS
INTERRUPTS INTERRUPTS
INTERRUPTS
 
Interrupts
Interrupts Interrupts
Interrupts
 
420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx
 
Io pro
Io proIo pro
Io pro
 
Interrupts
InterruptsInterrupts
Interrupts
 
Mca admission in india
Mca admission in indiaMca admission in india
Mca admission in india
 
chapter7-io organization.pptx
chapter7-io organization.pptxchapter7-io organization.pptx
chapter7-io organization.pptx
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
unit-5 ppt.ppt
unit-5 ppt.pptunit-5 ppt.ppt
unit-5 ppt.ppt
 
IO hardware
IO hardwareIO hardware
IO hardware
 
Interrupt
InterruptInterrupt
Interrupt
 
Interrupts
InterruptsInterrupts
Interrupts
 

Recently uploaded

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Interrupts in 8085

  • 2. Concept of Interrupt  A signal that a peripheral send to the CPU in order to request attention.  In response to an interrupt, the processor stops what it is currently doing and executes the service routine.  When the execution of the service routine is terminated, the original process may resume its previous operation.  The interrupt is initiated by an external device and is asynchronous.  The response to and interrupt request is directed or controlled by the microprocessor. Er. Sulav Paudel | MSc
  • 3. Process  The I/O unit issues an interrupt signal to the processor.  The processor finishes execution of the current instruction before responding to the interrupt.  The processor test for an interrupt, determines that there is one, and sends an acknowledgement signal to the device that issued the interrupt.  The processor then begins to transfer its control to the ISR (Interrupt Service Routine) which serves a interrupt request from the device. ISR resides at a specified location. Er. Sulav Paudel | MSc
  • 4. Process  Processor saves the information needed to resume the current program at the point of interrupt.  The minimum information required is the status of the processor and location of the next instruction to be executed.  The processor then loads the program counter with the entry location of the ISR that will responds to this interrupt.  Once the PC has loaded, the control is transferred to the interrupt handler program. Er. Sulav Paudel | MSc
  • 5. Process  The fundamental requirement of the ISR is that it should begin by saving the contents of all the registers on the stack  The interrupt handler then proceeds to process the interrupt.  When the interrupt processing is completed, the saved registers value are retrieved from the stack and restored to the register.  The final function is to restore the PSW and PC value from the stack Er. Sulav Paudel | MSc
  • 6. Types of Interrupt  3 major types of interrupt: External Interrupt Internal (Exception) Interrupt Software Interrupt Er. Sulav Paudel | MSc
  • 7. External Interrupt  Initiated via the microprocessor interrupt pins by external devices such as I/O devices, timing devices, circuit monitoring the power supply, etc.  Causes of this interrupt may be: I/O device requesting transfer of data I/O device finished transfer of data Elapsed time of an event or power failure  Types of external interrupt Maskable Interrupt Non-Maskable Interrupt Er. Sulav Paudel | MSc
  • 8. Maskable Interrupt  Enables/Disabled by executing instructions such as EI (Enable Interrupt) and DI (Disable Interrupt).  If microprocessor’s Interrupt Enable Flip-Flop is disabled, it ignores a maskable interrupt.  In 8085, the 1-byte instruction EI sets the interrupt enable flip-flop and enable the interrupt process.  Similarly, 1-byte instruction DI resets the interrupt flip-flop and disables the interrupt process.  Maskable interrupts is not recognized by the processor when the interrupt is disabled. Er. Sulav Paudel | MSc
  • 9. Non-Maskable Interrupt  Can’t be enabled/disabled by instructions.  Higher priority over the maskable interrupt.  When both the maskable and non-maskable interrupt are activated at the same time, then the processor will service the non-maskable interrupt first.  In 8085, TRAP is an example of non-maskable interrupt. Er. Sulav Paudel | MSc
  • 10. Maskable Vs Non-Maskable Interrupt Non Maskable Interrupt Maskable Interrupt It cannot be masked off or made pending. It can be masked off or make pending. This interrupt disables all maskable interrupts. This interrupt does not disable non- maskable interrupts. It is used for emergency purposes like power failure, smoke detector, etc. It is used to interface peripherals Higher priority Lower Priority Response time is low. Response time is high. Er. Sulav Paudel | MSc
  • 11. Internal Interrupt  Arises from illegal or erroneous use of an instruction or data.  Causes may be: Register overflow Divide by zero An invalid operation code Stack overflow, etc.  These error conditions usually occur as a result of premature termination of the instruction execution termed as exception. Er. Sulav Paudel | MSc
  • 12. Internal Vs External Interrupt Internal Interrupt External Interrupt It is initiated by some exceptional conditions caused by program itself. It is caused by external event. These are synchronous with the program. These are asynchronous. If the program is return, the internal interrupt will occur at the same place each time. It depends on the external conditions that are independent of the program being executed at the time. Er. Sulav Paudel | MSc
  • 13. Software Interrupt  External and Internal interrupts are initiated from signal that occur in the hardware of the CPU.  Initiated by executing an instruction.  A special call instruction that behaves like an interrupt rather than a subroutine call.  Can be used by the programmer to initiate an interrupt procedure at any desired point in the program.  The most common use of software interrupt is associated with a supervisor call instruction. Er. Sulav Paudel | MSc
  • 14. Software Interrupt  This instruction provides means for switching from a CPU user mode to the supervisor mode.  Certain operations in the computer may be assigned to the supervisor mode only, as for example, a complex input or output transfer procedure.  In 8085 the instruction like RST0, RST1, RST2, RST3, RST4, RST5, RST6, RST7 causes software interrupt. Er. Sulav Paudel | MSc
  • 15. Software Vs Hardware Interrupt Software Interrupt Hard Interrupt It is synchronous event. It is asynchronous event. This interrupt is requested by executing instruction. This interrupt is requested by external device. PC is incremented. PC is not incremented. Microprocessor does not execute interrupt acknowledge cycle or idle machine cycle to acknowledge this interrupt. It executes normal instruction cycle. Microprocessor executes either interrupt acknowledge cycle bus or idle machine cycle to acknowledge this interrupt. In 8085, the software interrupt cannot be disabled or masked. Hardware interrupt except TRAP can be disabled or masked. It has highest priority among all interrupts. The priority is lower than that of software interrupt Er. Sulav Paudel | MSc
  • 16. Software Vs Hardware Interrupt Software Interrupt Hard Interrupt It does not affect on interrupt control logic. It affects on interrupt control logic. It is not used to interface peripherals that means it does not improve throughput of system. It is used in program debugging. It is used to interface peripherals in interrupt driven I/O. It improves throughput of the system. Er. Sulav Paudel | MSc
  • 17. Interrupt Priority  The first task of the interrupt system is to identify the source of the interrupt.  There is also the possibility that several sources will request service simultaneously.  In this case the system must also decide which device to service first.  An interrupt priority is a system that establishes a priority over the various sources to determine which condition is to be serviced first when two or more requests arrive simultaneously.  The system may also determine which conditions are permitted to interrupt the computer while another interrupt is being serviced. Er. Sulav Paudel | MSc
  • 18. Interrupt Priority Higher-priority interrupt levels are assigned to request which, if delayed or interrupted, could have serious consequence. Devices with higher speed transfers such as magnetic disks are given high priority, and slow devices such as keyboards receive low priority.  When two devices interrupt the processor at the same time, the processor services the device, with the higher priority first. Er. Sulav Paudel | MSc
  • 19. Service Multiple Interrupt  Two ways of servicing multiple interrupts: Polled Interrupt Chained (Vectored) Interrupt Er. Sulav Paudel | MSc
  • 20. Polled Interrupt  Handled using software and are therefore slower to vectored (hardware) interrupt.  One common branch address for all interrupts.  The program that takes care of interrupts begins at the branch address and polls the interrupt sources in sequence.  The order in which they are tested determines the priority of each interrupt.  The highest-priority source is tested first, and if its interrupt signal is on, control branches to a service routine for this source. Er. Sulav Paudel | MSc
  • 21. Polled Interrupt  Otherwise the next lower-priority source is tested, and so on.  Thus, the initial service routine for all interrupts consist of a program that tests the interrupt sources in sequence and branches to one of many possible service routines.  Polled interrupts are very simple but for large number of devices, the time required to poll each device may exceed the time to service the device.  In such case, the faster mechanism called chained interrupt is used. Er. Sulav Paudel | MSc
  • 22. Chained (Vectored) Interrupt  Hardware concept of handling the multiple interrupts.  Devices are connected in a chain fashion as shown in figure below for setting up the priority system. Er. Sulav Paudel | MSc
  • 23. Chained (Vectored) Interrupt  Here, the device with the highest priority placed at the first position, followed by lower priority devices.  Suppose that one or more devices interrupt the processor at a time.  In response, the processor saves its current status and then generates an interrupt acknowledge (INTA) signal to the highest priority device, which is device 1 in our case.  If this device has generated the interrupt, it will accept the INTA on to the next device until the INTA is accepted by the interrupting device. Er. Sulav Paudel | MSc
  • 24. Chained (Vectored) Interrupt  Once accepted, the device provides a means to the processor for finding the interrupt address vector using external hardware.  Usually the requesting device responds by placing a word on the data lines.  With the help of hardware, it generates interrupt vector address.  This word is referred to as vector, which the processor uses a pointer to the appropriate device service routine.  This avoids the need to execute a general interrupt service routine first.  So this technique is also referred to as vectored interrupts. Er. Sulav Paudel | MSc
  • 25. Interrupt Priority  Based on priority, it has five interrupts: 1. TRAP 2. RST7.5 3. RST6.5 Priority Decreasing 4. RST5.5 5. INTR  The four interrupts TRAP, RST7.5, RST6.5, RST5.5 are automatically vectored to specific location without any external hardware.  They do not require INTA signal or an input port, the necessary hardware is already implemented inside the 8085. Er. Sulav Paudel | MSc
  • 26. Interrupt Priority  Interrupts and their call location are: Interrupts Call Locations TRAP 0024H RST7.5 003CH RST6.5 0034H RST5.5 002CH Er. Sulav Paudel | MSc
  • 27. INTR  Maskable interrupt  Can be enabled by instruction EI and can be disabled by instruction DI.  Requires external hardware to transfer program sequence to specific call locations.  There are 8 numbers of call locations for INTR interrupt.  The hardware circuit generates RST codes for this purpose and places that on the data bus externally.  When the microprocessor is executing a program, it checks the INTR line ( when interrupt enable flipflop is enabled using EI instruction) during the execution of each instruction. Er. Sulav Paudel | MSc
  • 28. INTR  If the line is high and the interrupt is enabled, the microprocessor completes the current instruction, disables the interrupt enable flipflop and sends a INTA signal.  The processor does not accept any interrupt requests until the interrupt flipflop is enabled again. Er. Sulav Paudel | MSc
  • 31. TRAP  Non maskable interrupt.  Highest priority among the interrupt signals.  Need not be enabled and cannot be disabled.  When triggered the program, control is transferred to the location 0024H without any external hardware or the interrupt enable instructions.  Generally used for critical events like power failure and emergency shut down. Er. Sulav Paudel | MSc
  • 32. RST 7.5, RST6.5, RST5.5  Maskable interrupt.  Enabled by software instruction like EI and SIM (Set Interrupt Mask)  SIM enables/ disables the interrupts according to the bit pattern of the accumulator. Er. Sulav Paudel | MSc
  • 33. Set Interrupt Mask (SIM)  1 Byte Instruction  Has 3 main functions:  Set mask for RST7.5, 6.5 and 5.5 interrupts. Bit D3 is a control bit and should be 1 for bits D0, D1 and D2.  Logic 0 on D0, D1 and D2 will enable the corresponding interrupts  Logic 1 will disable the interrupts  SIM instruction reads the content of accumulator and enables or disables the interrupts according to the contents of accumulator.  E.g. D4 is an additional control bit for M7.5, if D4 = 1, then RST7.5 is reset.  To implement the serial input and output. Bit D7 and D6 of the accumulator are used for serial input and output and don’t affect the interrupts. Er. Sulav Paudel | MSc
  • 34. Set Interrupt Mask (SIM) Instruction Er. Sulav Paudel | MSc  Accumulator bit pattern for SIM instruction 0 - Available 1 - Mask 0 – Ignore bit 7 1 – Send bit 7 to SOD pin MSE 0 – Ignore bits 0-2 1 – Set masks according to bits 0-2 If R7.5 = 0 - Allowed 1 – Not allowed
  • 35. Set Interrupt Mask (SIM) Instruction Er. Sulav Paudel | MSc Example:  Write instructions to enable interrupt RST 5.5 and mask other interrupts. Solution: Instruction: MVI A, 0EH ; Bits D3 = 1 and D0 = 0 SIM ; Enable RST 5.5 SOD SDE X R7.5 MSE M7.5 M6.5 M5.5 0 0 0 0 1 1 1 0
  • 36. Pending Interrupt Er. Sulav Paudel | MSc  When one interrupt request is being served the other interrupt may be pending.  When more than one interrupt occurs simultaneously the interrupt having higher priority is served and the interrupts with lower priority remain pending.  The 8085 has an instruction RIM using which the programmer can know the current status of pending interrupts.  This instruction gives status of only maskable interrupts.
  • 37. Read Interrupt Mask (RIM) Instruction Er. Sulav Paudel | MSc  1 byte instruction  Checks the status of all the pending and maskable interrupts.  Transfers serial data bit from SID line to D7 bit of Accumulator.  Transfers the contents of interrupt control logic into the accumulator.
  • 38. Read Interrupt Mask (RIM) Instruction Er. Sulav Paudel | MSc  Bit pattern for RIM instruction
  • 39. Read Interrupt Mask (RIM) Instruction Er. Sulav Paudel | MSc  This instruction loads the accumulator with eight bits indicating the current status of the interrupt mask.  To identify the pending interrupts, bits D4, D5 and D6 are checked.  Bits D3, D2, D1, D0 are status of interrupt enable flipflop, Mask 7.5, Mask 6.5 and Mask 5.5.  When RIM instruction is executed the status of masking is loaded at bits D3, D2, D1 and D0.  To receive serial data, bit D7 is used.