SME
Embedded Systems · Problem type
What happens on an interrupt
Use this for “A timer matches its compare value. Put in order what the CPU does until the main program resumes.”
Put in order
Put the steps from the timer match to the return to the main program in order.
1
?
2
?
3
?
4
?
5
?
6
?
Assumptions
•
The interrupt is enabled and no other interrupt of higher priority is running.
•
The CPU checks for interrupts between instructions, never in the middle of one.
•
The handler’s address comes from the interrupt vector table.
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.
Related lessons
Interrupts and timers
Main lesson
PWM frequency and duty cycle
Use this for “A 16 MHz timer with prescaler 8 counts to TOP = 1999 and compares at 500. Find the PWM frequency, duty and average voltage at 5 V.”
Longest timer period
Use this for “How long can a 16-bit timer at 16 MHz run with prescaler 1024 before it overflows?”
CPU time in an interrupt
Use this for “An interrupt fires at 10 kHz and its ISR takes 20 μs. What share of the CPU does it use?”