Microcontroller Interrupts Quiz Form.
Microcontroller Interrupts Quiz Form.
1. What is the primary purpose of an interrupt in a microcontroller?
*
To notify the CPU that an event needs attention
To permanently stop the current program
To increase the clock frequency automatically
To store program instructions in nonvolatile memory
2. What is an interrupt service routine (ISR)?
*
A function executed in response to an interrupt
A routine that configures the compiler
A background task that runs only when the device is powered off
A memory area used exclusively for storing constants
3. Which practices are generally recommended when writing an ISR? Select all that apply.
*
Keep execution brief
Defer lengthy processing to the main program when practical
Use shared data carefully between the ISR and main code
Add long blocking delays to ensure the event is handled
4. What does interrupt priority determine on a microcontroller that supports prioritized interrupts?
*
Which interrupt is handled first when multiple requests compete
The order in which source files are compiled
How much flash memory an ISR occupies
The maximum baud rate of every peripheral
5. What is interrupt latency?
*
The time between an interrupt event and the start of its handling
The time required to erase program memory
The total duration of a device's power-on sequence
The delay between two instructions in the source code
6. A peripheral sets an interrupt flag when an event occurs. What is the flag commonly used for?
*
To indicate that an event has occurred and may need servicing or clearing
To select the CPU's operating voltage
To reserve a new block of flash memory
To disable all clock sources permanently
7. Why might shared variables accessed by both an ISR and the main program need special care?
*
An interrupt can occur between operations and expose inconsistent or stale data
The compiler always converts shared variables into constants
Interrupts automatically erase variables after each event
Shared variables can only be stored in external memory
8. A timer interrupt should occur every 1 ms, but sometimes the main program responds late. Which factor could contribute to the delay?
*
Interrupts are disabled for too long, or a higher-priority ISR is running
The program uses a named constant for the timer period
The timer counter is displayed in hexadecimal
The source code contains comments near the timer setup
9. In a short answer, describe one practical use for a GPIO pin-change interrupt and what the ISR should do when the event occurs.
*
10. In a short answer, how would you investigate an interrupt that fires repeatedly when you expect it to fire only once per event?
*
Submit Quiz
Should be Empty: