POWER POINT PRESENTATION ON
INTERRUPTS & INTERRUPT SERVICE ROUTINES
SUBMITTED TO
Dr. Amarjit Roy
FOR CA1
SUBJECT NAME: MICROPROCESSOR & MICRO CONTROLLER
SUBJECT CODE: PC-EE-602
SUBMITTED BY
Anuradha Maity
BRANCH: ELECTRICAL ENGINEERING IN B. TECH SEMESTER: 6th
ROLL NO.: 35501622038
REG. NO.: 223550110007 SESSION: 2024-25
GHANI KHAN CHOUDHURY INSTITUTE OF ENGINEERING AND TECHNOLOGY
INTRODUCTION
 An interrupt is a signal that temporarily halts the processor’s current execution to
address a high-priority event, allowing efficient handling of asynchronous tasks.
Interrupts can be hardware-based (triggered by external devices like timers and sensors)
or software-based (generated by programs). Unlike polling, which continuously checks
for events, interrupts improve system responsiveness and reduce CPU workload by
executing only when needed. They are essential for real-time systems, enabling
multitasking and efficient resource management in embedded applications.
 Benefits:
 Improves system responsiveness.
 Reduces CPU workload by eliminating the need for polling.
 Enables multitasking in embedded systems.
TYPES OF INTERRUPTS
Software Interrupts –
A sort of interrupt called a software interrupt is one that is produced by software or a
system as opposed to hardware. That is Triggered by programs using special instructions to
request system services or handle errors. These are used in operating systems for process
management. Traps and exceptions are other names for software interruptions. They serve
as a signal for the operating system or a system service to carry out a certain function or
respond to an error condition. Generally, software interrupts occur as a result of specific
instructions being used or exceptions in the operation. In our system, software interrupts
often occur when system calls are made.
A particular instruction known as an “interrupt instruction” is used to create software
interrupts. When the interrupt instruction is used, the processor stops what it is doing and
switches over to a particular interrupt handler code. The interrupt handler routine completes
the required work or handles any errors before handing back control to the interrupted
application.
Example: A system call requesting memory allocation from the OS.
Hardware Interrupts – Generated by external devices such as keyboards, timers, or
sensors to request immediate attention from the processor. The processor temporarily halts
execution and processes the interrupt. In a hardware interrupt, all the devices are connected
to the Interrupt Request Line. A single request line is used for all the n devices. To request
an interrupt, a device closes its associated switch. When a device requests an interrupt, the
value of INTR is the logical OR of the requests from individual devices.
Example: A keyboard press triggering an interrupt to register input.
Hardware interrupts are further divided into two types of interrupt:
 Maskable Interrupt: It can be enabled or disabled by the processor based on priority.
Hardware interrupts can be selectively enabled and disabled thanks to an inbuilt interrupt
mask register that is commonly found in processors. A bit in the mask register corresponds to
each interrupt signal; on some systems, the interrupt is enabled when the bit is set and
disabled when the bit is clear, but on other systems, the interrupt is deactivated when the bit
is set.
 Example: A power failure signal triggering system backup procedures.
 Spurious Interrupt: A hardware interrupt for which there is no source is known as a
spurious interrupt. This phenomenon might also be referred to as phantom or ghost
interrupts. When a wired-OR interrupt circuit is connected to a level-sensitive processor
input, spurious interruptions are typically an issue. When a system performs badly, it could
be challenging to locate these interruptions.
FLOWCHART OF INTERRUPT HANDLING MECHANISM
 The Image below depicts the flowchart of interrupt handling mechanism
 Step 1:- Any time that an interrupt is raised, it may either be an I/O interrupt or a system interrupt.
 Step 2:- The current state comprising registers and the program counter is then stored in order to
conserve the state of the process.
 Step 3:- The current interrupt and its handler is identified through the interrupt vector table in the
processor.
 Step 4:- This control now shifts to the interrupt handler, which is a function located in the kernel
space.
 Step 5:- Specific tasks are performed by Interrupt Service Routine (ISR) which are essential to
manage interrupt.
 Step 6:- The status from the previous session is retrieved so as to build on the process from that
point.
 Step 7:- The control is then shifted back to the other process that was pending and the normal
process continues.
INTERRUPT SERVICE ROUTINE
An interrupt service routine (ISR) is a function that runs when a hardware device triggers an interrupt. ISRs are used to
perform time-critical operations before normal program execution.
How ISRs work
 When a hardware event occurs, like a button press or timer, it sends an interrupt signal to the processor
 The processor jumps to a specific address to execute the ISR
 The ISR clears the interrupt and restores the processor context
 The ISR resumes the main program
ISR considerations
 ISRs can be challenging to program
 Interrupts can occur in any order
 Errors in ISRs can be difficult to debug
 It's important to keep the ISR as short as possible
 The ISR should ideally only collect data and reset the interrupt source
 ISR applications Motor control and Precision interrupt timing.
What is Interrupt Latency?
 The amount of time between the generation of an interrupt and its handling is known as interrupt latency. The
number of created interrupts, the number of enabled interruptions, the number of interrupts that may be
handled, and the time required to handle each interrupt all affect interrupt latency. When the device generating
the interrupt needs a specific length of time to generate the interrupt, interrupt latency is required. For
instance, if a printer is printing paper, the computer needs to stop the printing program and wait for the
document to finish printing. The interrupt latency is the amount of time the computer has to stop the program
from operating.
Triggering Methods of Interrupts:
Interrupts can be triggered in two ways:
 Level-Triggered Interrupts – The interrupt remains active as long as the signal is at a
certain level (high or low). The CPU responds when it detects the signal and clears it after
handling the request.
Example: A key pressed on a keyboard and held down continuously generates a signal.
 Edge-Triggered Interrupts – The interrupt is triggered only when the signal changes from
low to high or high to low. It happens once per change and is cleared automatically.
Example: A doorbell press sends a short pulse; once released, the signal disappears.
Level-triggered interrupts are useful for continuous signals, while edge-triggered interrupts are
used for short, event-driven signals.
INTERRUPT VECTOR TABLE
The interrupt vector table (IVT) in the Intel 8086 microprocessor is a table
of addresses that point to the start of interrupt service routines (ISRs). The
IVT is also known as the interrupt pointer table (IPT).
 A table storing addresses of ISRs.
 Used by the processor to quickly locate and execute the correct ISR.
 Different architectures have different IVT implementations.
 How it works:
 The IVT is located in the first 1 kilobyte of memory in the 8086.
 Each entry in the IVT is 4 bytes long and contains the starting address
of an ISR.
 The starting address is made up of the segment (CS) and offset (IP) of
the ISR.
 The 8086 automatically goes to the IVT to find the starting address of
the ISR when it responds to an interrupt.
Benefits of Interrupt
 Real-time Responsiveness: Interrupts permit a system to reply promptly to outside events or
signals, permitting real-time processing.
 Efficient Resource usage: Interrupt-driven structures are more efficient than system that depend on
busy-waiting or polling strategies. Instead of continuously checking for the incidence of event,
interrupts permit the processor to remain idle until an event occurs, conserving processing energy
and lowering energy intake.
 Multitasking and Concurrency: Interrupts allow multitasking with the aid of allowing a processor to
address multiple tasks concurrently.
POLLING Vs. INTERRUPTS
Advantages and Disadvantages of Interrupts
Advantages:
 Increases CPU efficiency.
 Enables real-time response to events.
 Reduces power consumption (processor remains idle until needed).
Disadvantages:
 Complex to implement and debug.
 Improper handling can lead to unpredictable behavior.
 Can cause priority inversion if not managed properly
Common Applications of Interrupts
 Real-time clock updates.
 Handling external I/O events (e.g., button presses, sensor data).
 Motor control in embedded systems.
 Networking and communication protocols.
CONCLUSION
Interrupts and Interrupt Service Routines (ISRs) play a crucial role in microprocessors by
allowing efficient handling of tasks without constant CPU monitoring. Interrupts enable the
processor to respond immediately to important events, improving system performance and
multitasking. ISRs ensure quick execution of interrupt tasks and then return control to the
main program. This mechanism makes microprocessors more efficient, responsive, and
suitable for real-time applications like embedded systems and automation.
REFERENCE
1. "Microprocessors and Interfacing: Programming and Hardware" by S. V. N. Rao
(Chapter 6: Interrupts), 3rd edition, 2017
2. "Embedded Systems: Real-Time Operating System for ARM Cortex-M
Microcontrollers" by Jonathan W. Valvano (Chapter 6: Interrupts), 3rd edition, 2020
3. https://www.geeksforgeeks.org/interrupts/
4. https://www.tutorialspoint.com/embedded_systems/es_interrupts.htm
5. https://embeddedwala.com/EmbeddedSystems/embedded-c/what-is-isr
THANK YOU

MICROPROCESSOR_Anurad gor systej ndjksauduiha MAITY.pptx

  • 1.
    POWER POINT PRESENTATIONON INTERRUPTS & INTERRUPT SERVICE ROUTINES SUBMITTED TO Dr. Amarjit Roy FOR CA1 SUBJECT NAME: MICROPROCESSOR & MICRO CONTROLLER SUBJECT CODE: PC-EE-602 SUBMITTED BY Anuradha Maity BRANCH: ELECTRICAL ENGINEERING IN B. TECH SEMESTER: 6th ROLL NO.: 35501622038 REG. NO.: 223550110007 SESSION: 2024-25 GHANI KHAN CHOUDHURY INSTITUTE OF ENGINEERING AND TECHNOLOGY
  • 2.
    INTRODUCTION  An interruptis a signal that temporarily halts the processor’s current execution to address a high-priority event, allowing efficient handling of asynchronous tasks. Interrupts can be hardware-based (triggered by external devices like timers and sensors) or software-based (generated by programs). Unlike polling, which continuously checks for events, interrupts improve system responsiveness and reduce CPU workload by executing only when needed. They are essential for real-time systems, enabling multitasking and efficient resource management in embedded applications.  Benefits:  Improves system responsiveness.  Reduces CPU workload by eliminating the need for polling.  Enables multitasking in embedded systems.
  • 3.
    TYPES OF INTERRUPTS SoftwareInterrupts – A sort of interrupt called a software interrupt is one that is produced by software or a system as opposed to hardware. That is Triggered by programs using special instructions to request system services or handle errors. These are used in operating systems for process management. Traps and exceptions are other names for software interruptions. They serve as a signal for the operating system or a system service to carry out a certain function or respond to an error condition. Generally, software interrupts occur as a result of specific instructions being used or exceptions in the operation. In our system, software interrupts often occur when system calls are made. A particular instruction known as an “interrupt instruction” is used to create software interrupts. When the interrupt instruction is used, the processor stops what it is doing and switches over to a particular interrupt handler code. The interrupt handler routine completes the required work or handles any errors before handing back control to the interrupted application. Example: A system call requesting memory allocation from the OS. Hardware Interrupts – Generated by external devices such as keyboards, timers, or sensors to request immediate attention from the processor. The processor temporarily halts execution and processes the interrupt. In a hardware interrupt, all the devices are connected to the Interrupt Request Line. A single request line is used for all the n devices. To request an interrupt, a device closes its associated switch. When a device requests an interrupt, the value of INTR is the logical OR of the requests from individual devices. Example: A keyboard press triggering an interrupt to register input.
  • 4.
    Hardware interrupts arefurther divided into two types of interrupt:  Maskable Interrupt: It can be enabled or disabled by the processor based on priority. Hardware interrupts can be selectively enabled and disabled thanks to an inbuilt interrupt mask register that is commonly found in processors. A bit in the mask register corresponds to each interrupt signal; on some systems, the interrupt is enabled when the bit is set and disabled when the bit is clear, but on other systems, the interrupt is deactivated when the bit is set.  Example: A power failure signal triggering system backup procedures.  Spurious Interrupt: A hardware interrupt for which there is no source is known as a spurious interrupt. This phenomenon might also be referred to as phantom or ghost interrupts. When a wired-OR interrupt circuit is connected to a level-sensitive processor input, spurious interruptions are typically an issue. When a system performs badly, it could be challenging to locate these interruptions.
  • 5.
    FLOWCHART OF INTERRUPTHANDLING MECHANISM  The Image below depicts the flowchart of interrupt handling mechanism  Step 1:- Any time that an interrupt is raised, it may either be an I/O interrupt or a system interrupt.  Step 2:- The current state comprising registers and the program counter is then stored in order to conserve the state of the process.  Step 3:- The current interrupt and its handler is identified through the interrupt vector table in the processor.  Step 4:- This control now shifts to the interrupt handler, which is a function located in the kernel space.  Step 5:- Specific tasks are performed by Interrupt Service Routine (ISR) which are essential to manage interrupt.  Step 6:- The status from the previous session is retrieved so as to build on the process from that point.  Step 7:- The control is then shifted back to the other process that was pending and the normal process continues.
  • 6.
    INTERRUPT SERVICE ROUTINE Aninterrupt service routine (ISR) is a function that runs when a hardware device triggers an interrupt. ISRs are used to perform time-critical operations before normal program execution. How ISRs work  When a hardware event occurs, like a button press or timer, it sends an interrupt signal to the processor  The processor jumps to a specific address to execute the ISR  The ISR clears the interrupt and restores the processor context  The ISR resumes the main program ISR considerations  ISRs can be challenging to program  Interrupts can occur in any order  Errors in ISRs can be difficult to debug  It's important to keep the ISR as short as possible  The ISR should ideally only collect data and reset the interrupt source  ISR applications Motor control and Precision interrupt timing.
  • 7.
    What is InterruptLatency?  The amount of time between the generation of an interrupt and its handling is known as interrupt latency. The number of created interrupts, the number of enabled interruptions, the number of interrupts that may be handled, and the time required to handle each interrupt all affect interrupt latency. When the device generating the interrupt needs a specific length of time to generate the interrupt, interrupt latency is required. For instance, if a printer is printing paper, the computer needs to stop the printing program and wait for the document to finish printing. The interrupt latency is the amount of time the computer has to stop the program from operating.
  • 8.
    Triggering Methods ofInterrupts: Interrupts can be triggered in two ways:  Level-Triggered Interrupts – The interrupt remains active as long as the signal is at a certain level (high or low). The CPU responds when it detects the signal and clears it after handling the request. Example: A key pressed on a keyboard and held down continuously generates a signal.  Edge-Triggered Interrupts – The interrupt is triggered only when the signal changes from low to high or high to low. It happens once per change and is cleared automatically. Example: A doorbell press sends a short pulse; once released, the signal disappears. Level-triggered interrupts are useful for continuous signals, while edge-triggered interrupts are used for short, event-driven signals.
  • 9.
    INTERRUPT VECTOR TABLE Theinterrupt vector table (IVT) in the Intel 8086 microprocessor is a table of addresses that point to the start of interrupt service routines (ISRs). The IVT is also known as the interrupt pointer table (IPT).  A table storing addresses of ISRs.  Used by the processor to quickly locate and execute the correct ISR.  Different architectures have different IVT implementations.  How it works:  The IVT is located in the first 1 kilobyte of memory in the 8086.  Each entry in the IVT is 4 bytes long and contains the starting address of an ISR.  The starting address is made up of the segment (CS) and offset (IP) of the ISR.  The 8086 automatically goes to the IVT to find the starting address of the ISR when it responds to an interrupt.
  • 10.
    Benefits of Interrupt Real-time Responsiveness: Interrupts permit a system to reply promptly to outside events or signals, permitting real-time processing.  Efficient Resource usage: Interrupt-driven structures are more efficient than system that depend on busy-waiting or polling strategies. Instead of continuously checking for the incidence of event, interrupts permit the processor to remain idle until an event occurs, conserving processing energy and lowering energy intake.  Multitasking and Concurrency: Interrupts allow multitasking with the aid of allowing a processor to address multiple tasks concurrently. POLLING Vs. INTERRUPTS
  • 11.
    Advantages and Disadvantagesof Interrupts Advantages:  Increases CPU efficiency.  Enables real-time response to events.  Reduces power consumption (processor remains idle until needed). Disadvantages:  Complex to implement and debug.  Improper handling can lead to unpredictable behavior.  Can cause priority inversion if not managed properly Common Applications of Interrupts  Real-time clock updates.  Handling external I/O events (e.g., button presses, sensor data).  Motor control in embedded systems.  Networking and communication protocols.
  • 12.
    CONCLUSION Interrupts and InterruptService Routines (ISRs) play a crucial role in microprocessors by allowing efficient handling of tasks without constant CPU monitoring. Interrupts enable the processor to respond immediately to important events, improving system performance and multitasking. ISRs ensure quick execution of interrupt tasks and then return control to the main program. This mechanism makes microprocessors more efficient, responsive, and suitable for real-time applications like embedded systems and automation. REFERENCE 1. "Microprocessors and Interfacing: Programming and Hardware" by S. V. N. Rao (Chapter 6: Interrupts), 3rd edition, 2017 2. "Embedded Systems: Real-Time Operating System for ARM Cortex-M Microcontrollers" by Jonathan W. Valvano (Chapter 6: Interrupts), 3rd edition, 2020 3. https://www.geeksforgeeks.org/interrupts/ 4. https://www.tutorialspoint.com/embedded_systems/es_interrupts.htm 5. https://embeddedwala.com/EmbeddedSystems/embedded-c/what-is-isr
  • 13.