Sources of Interrupts
- Software Error Related Sources:
- Overflow
- Underflow
- Division by zero
- Illegal opcode
- Programmer defined exceptions
- Overflow
- Software code related sources
- Breakpoint
- Debugging trap
- RTC driven software timer
- Input driven software timer
- Semaphore take and release
- Even related
- Task blocking overflow
- Task finished timeouts
- Breakpoint
- Internal Hardware device sources
- Parallel port and UART serial receiver port
- UART transmission complete
- ADC Start of conversion and End of Conversion
- Pulse Accumulator
- Real Time Clock
- Watch Dog Timer Reset
- Timer overflow on timeouts
- Parallel port and UART serial receiver port
- External Hardware with internal vector address
- Maskable pin
- Non Maskable pin
- Maskable pin
- External Hardware with external Vector Address
- INTR (Interrupt Request pin of 80x86
Context Switching
Context
A context of a program includes program counter and stack pointer. But in some special cases, the context also includes status word register and processor registers.
Context saving and restoring
Pushing all the register at the beginning of an interrupt routine is known as the context saving time and popping them at the end as restoring the context.
Questions: Can a microprocessor be interrupted in the middle of an instruction?
Ans: No, the microprocessor will complete the current instruction in which it is running, then only it will act on the interrupt signal.
Interrupt Latency
The amount of time it takes by a system to respond to an interrupt. There are lot of factors that affects the speediness of the latency. So to increase the latency speed,
1) Make the interrupt routine shorter
2) Disabling interrupts for a shorter duration,
Interrupt latency period (Tlat) is nothing but the sum of the following periods.
Tlat = Time taken for the response and initiating the ISR instructions + time needed to service all the interrupt of higher priorities than that of the present source + maximum period of disabling the interrupt services.
Step 1 – Main Program Running x – ISR1 call
Step 2 – ISR1 Running y - ISR1 Suspended, ISR2 (high Priority) call
Step 3 – ISR2 Running z – ISR2 gets CPU
Step 4 – Context Saving (ISR1) a – ISR2 Completed
Step 5 – Context Saving (ISR2) b – ISR1 running
Step 6 – Context restoring (ISR2) c – ISR1 completed
Step 7 – Context Restoring (ISR1)
Comments
Post a Comment