CS Electrical And Electronics
@cselectricalandelectronics
All PostsElectronicsEmbedded SystemWhat Is

What Is Interrupt, Interrupts Handling, Interrupt Service Routine

Hello guys, welcome back to my blog. In this article, I will discuss what is interrupt, how to handle interrupts, applications of interrupts, types of interrupts, and what is software & hardware interrupt.

If you have any doubts related to electrical, electronics, and computer science, then ask question. You can also catch me @ Instagram – Chetan Shidling. 

Also, read:

What Is Interrupt

The instruction which needs immediate attention or execution is called the interrupt. In the early days of computing, the higher-order function to be performed in the controller or processor will lead to the time taking process as they have the order signal processing. To eliminate this and to decrease the slow response of the processors the Interrupt_technology had been introduced to perform the sudden or high priority instructions.

When the interrupt occurs in the processor or controller they will execute the present instruction and will look after that instruction which is interrupting through the interrupt_handler or interrupt service routine (ISR).

The interrupt handler or the ISR is used to indicate to the processor or controller that the interrupt occurs and should be executed. There are two types of interrupts in the embedded systems such as the hardware interrupt and software_interrupt.

Hardware Interrupt

The instruction or the electronic signal from the externally connected device is given to the processor then it is considered as the hardware interrupt as we know that external devices are connected through the external access of the processor or controller then the external devices will be controlled by the processor by receiving and sending the instructions.

For example in our computer or laptop when we press the button on our keyboard then the processor will receive the interrupt hence the function of the key is executed. These types of instructions are called hardware interrupts. The hardware interrupts are mainly divided into two types such as,

Maskable interrupts: The processor should activate the mask register which will be used to the enabling and disabling of the hardware_interrupts. Every signal has the bit value in the mask register. If the bit is set then the_interrupt is enabled and if it is not set then the interrupt is disabled vice versa. These types of interrupts are called maskable interrupts.

Non–maskable interrupts: Non-maskable interrupts are the type of instructions that should be executed immediately. These are called as highest priority interrupts which need to be executed without any time delay.

Software interrupt

The software interrupt is the special condition or the special instruction from the instruction set of the controller or processor. It is the special instruction occurred in the controller or processor when the other instruction is executed.

For example, the arithmetic logic unit consists of its own instruction set then while performing the ALU operation the Boolean instruction appears then it is called the software_interrupt. Which will display the error message or the instruction interpretation then they come under the software interrupts.

01. Normal interrupts: the interrupts that occurred due to the software instruction are called normal interrupts.

02. Exceptional interrupts: the unplanned instruction interrupting during the execution then this type of instructions are called the exceptional interrupts.

How To Handle Interrupt

How To Handle Interrupt

Normally the cycle of the controller or the processor is like fetch, decode and execute. If the cycle will be disturbed due to the unplanned instruction then it is called an interrupt. To handle this type of interrupts we need different tools. The interrupt_handler is used to handle the sudden and important instructions that should be executed immediately.

The interrupt_handler will be activated when the interrupt occurs and the cycle of the processor or controller is disturbed or stopped. The interrupt handler will recognize the type of interrupt and then it will execute the instruction immediately.

Most of the interrupts are of asynchronous type. This interrupt_handler is popularly known as the Interrupt Service Routine (ISR). The interrupt handlers are classified according to the types of interrupts occurrence. Every device will have different types of interrupt handlers.

Key features of Interrupt service routine:

01. ISR had the capability of disabling the other devices’ interrupts while enabling the present device interrupts and it can re-enable the other device interrupts after completion of execution.

02. Interrupt_Service Routines are always ready to act because the maximum number of interrupts is of asynchronous type.

03. This interrupt_service mechanism can make the ISR work for multiple sources.

04. The ISR can handle both non-maskable and maskable interrupts. The program line can be used to enable or disable the handler.

05. The ISR can also be used for the diversion of unimportant instructions.

The interrupt handler is mainly divided into two types namely,

01. Fast Interrupt Handler:

The Fast_interrupt handler is also called a first-level0 interrupt_handler. Due to high interrupt speed execution, these handlers will undergo the uncontrolled way while the process of execution. The interrupt_execution is very fast but the control is somewhat miserable.

02. Slow Interrupt Handler:

The slow_interrupt handler is also called as Second level interrupt_handler. Due to slow interrupt_speed execution, these handlers will be in control during the process of execution. The interrupt_execution is very slow but the controlling is somewhat good and provides high efficiency in execution.

Applications

01. Interrupts can be used for communication purposes from externally connected devices.

02. Timers, I/O disks, traps, and power-off signals are examples of interrupts.

03. The external interrupts are used to transfer the data using the UARTs or Ethernet according to the usage.

04. The periodic interrupts in the computer are used for the rescheduling of the priorities of the processor.

05. The interrupts are used for buffering events like keystrokes.

06. The power-off_interrupt while working due to low power in the battery is one of the best examples of the interrupt.

This is about the Interrupts in embedded systems and how efficiently they can be handled and where they are applicable. I hope this article may help you all a lot. Thank you for reading.

Also, read:

Author Profile

CS Electrical And ElectronicsChetu
Interest's ~ Engineering | Entrepreneurship | Politics | History | Travelling | Content Writing | Technology | Cooking
Share Now

CS Electrical And Electronics

Interest's ~ Engineering | Entrepreneurship | Politics | History | Travelling | Content Writing | Technology | Cooking