Interrupts Flashcards
define overflow
when there are not enough bits for a large number so it appears as 0
What is the interrupt enable register?
this register is respobsible for enabling/disabling the interrupt.
What is the purpose of interrupts?
A method of communication to request an action
What is used to implement an interrupt?
-Interrupt vector table IVT
-Interrupt service routine ISR
-Interrupt enable/mask
How is an interrupt enabled?
Enable an interrupt
-low on one of the interrupt ports
-go to address in IVT
-execute code at address (RETI - return from interrupt)
-retrieve the stored address for next instruction
How do timer/counter interrupts work?
-When timer is enabled, clock cycles are counted and sends an interrupt when specific value or overflow
What are the 3 main stages of interrupts?
-Find interrupt in IVT
-write interrupt service routine in the vector
-enable interrupt
What are the 3 actions when an interrupt occurs?
-Program state is saved
-Microcontroller jumps to ISR in the IVT
-RETI
Define polling
-microcontroller continuously checks to the status checks the status of another device to determine if it needs attention
-easy to implement
What is the difference between polling and interrupts?
-Polling continuosly checks for status updates which is inefficient
-Interrupts are signals sent to the microcontroller to indicate it needs attention which is efficient but complex to implement (we need ISR, IVT etc)
What are advantages of interrupts?
-interrupts solve problems quickly
-improve systems robustness and reliability
What are disadvantages of interrupts?
-The number of interrupts is limited by external input pins
-response time to an interrupt might affect real-time applications where reliable response times are essential
(i.e having to repsond to an interrupt in the middle of doing a task)
Define the interrupt vector table (IVT)
The addresses of different interrupt service routines (ISRs) are stored in the IVT
What do the memory addresses in the IVT signify?
-the memory addresses of each ISR points to the program memory linked to each ISR start