Skip to main content

Interrupts

Interrupts


Interrupts are the signal to the microcontroller or processor to mark the event that requires immediate attention. An interrupt is “requesting" the processor to stop to perform the current program and to “make time” to execute a special code(interrupt code). Whenever any device needs its interrupt service, the device notifies the microcontroller by sending it an interrupt signal. Upon receiving an interrupt signal, the microcontroller program_counter will go to the Interrupt vector table in that it will fetch the ISR address (interrupt service routine) and it will execute the ISR program and it will return to the main program where it stopped and it will start executing main program .




Interrupts
Interrupts





An interrupt is an exception, a change of the normal progression, or interruption 
in the normal flow of program execution.  

An interrupt is essentially a hardware generated function call.

Interrupts are caused by both internal and external sources.

An interrupt causes the normal program execution to halt and for the interrupt service routine (ISR) to be executed.

At the conclusion of the ISR, normal program execution is resumed at the point where it was last.






interrupt service routine (ISR)
ISR

Interrupts should be used for infrequent events (1000's of clock cycles)
-keyboard strokes 
-1ms clock ticks 
-serial data (USART, SPI, TWI)
-analog to digital conversion

uC response time to interrupts is very fast
-AVR: 4 cycles max
-80386:  59 cycles min, 104 cycles max;

If response time is really critical, a “tight” polling loop is used.
-polling can be faster than interrupts......, 
            but further processing is on hold!



Comments

Popular posts from this blog

CAN INTERVIEW QUESTIONS

Qualifiers and Modifier in C

RTOS Real time operating system interview questions

CAN INTERVIEW QUESTIONS 2

What is UDS protocol

Memory mapping in c

TOP IOT PLATFORMS