1. What is interrupt and interrupt latency in embedded system?
In systems programming, an interrupt is a signal to the processor. It can be emitted either by hardware or software indicating an event that needs immediate attention. Interrupts are a commonly used technique in real-time computing and such a system is said to be interrupt-driven.
1. Hardware interrupt
A hardware interrupt is a signal which can tell the CPU that something happen in hardware device, and should be immediately responded. Hardware interrupts are triggered by peripheral devices outside the microcontroller. An interrupt causes the processor to save its state of execution and begin execution of an interrupt service routine.
Unlike the software interrupts, hardware interrupts are asynchronous and can occur in the middle of instruction execution, requiring additional care in programming. The act of initiating a hardware interrupt is referred to as an interrupt request (IRQ).
2. Software interrupt
Software interrupt is an instruction which cause a context switch to an interrupt handler similar to a hardware interrupt. Usually it is an interrupt generated within a processor by executing a special instruction in the instruction set which causes an interrupt when it is executed.
Another type of software interrupt is triggered by an exceptional condition in the processor itself. This type of interrupt is often called a trap or exception.
Unlike the hardware interrupts where the number of interrupts is limited by the number of interrupt request (IRQ) lines to the processor, software interrupt can have hundreds of different interrupts.
Interrupt latency refers primarily to the software interrupt handling latencies. In other words, the amount of time that elapses from the time that an external interrupt arrives at the processor until the time that the interrupt processing begins. One of the most important aspects of kernel real-time performance is the ability to service an interrupt request (IRQ) within a specified amount of time.
2. What is ISR concept?
Interrupt Service Routines (ISR) are the portions of the program code that handle the interrupt requests. When an Interrupt is triggered (either a hardware or software interrupt), the processor breaks away from the current task, moves the instruction pointer to the ISR, and then continues operation. An interrupt service routine (ISR) is a software routine that hardware invokes in response to an interrupt. ISR examines an interrupt and determines how to handle it executes the handling, and then returns a logical interrupt value. If no further handling is required the ISR notifies the kernel with a return value. An Interrupt Service Routine is one that is registered to the hardware via the Operating system at initialisation time in order to process interrupts from a particular device when it generates interrupts, and that happens at I/O termination.
Upon entry, the routine needs to determine the reason for the interrupt and the device status, so as to take appropriate action - enter error recovery if an error. hand control back to the initiating program to process data transferred (input) or initiate another transfer (output) and so on. This is done by setting flags in the operating system: ISRS only process the interrupt and exit as quickly as possible; the OS does task switching.
👉 MODULE -5 👈
Post a Comment
0 Comments