In ARM Cortex-M processors, the Nested Vectored Interrupt Controller (NVIC) supports priority grouping. What is the main purpose of priority grouping in NVIC?
Think about how NVIC manages which interrupt can interrupt another.
Priority grouping splits the priority field into pre-emption priority and subpriority bits. Pre-emption priority controls if an interrupt can preempt another, while subpriority controls ordering when two interrupts have the same pre-emption priority. This allows fine control over interrupt nesting and tail-chaining.
Which NVIC register is used to enable a specific interrupt line in ARM Cortex-M processors?
Look for the register that sets or enables interrupts.
NVIC_ISER is used to enable interrupts by setting bits corresponding to interrupt lines. NVIC_ICER disables interrupts, NVIC_IPR sets priority, and NVIC_STIR triggers interrupts by software.
Consider an NVIC priority grouping configuration with 3 bits for pre-emption priority and 1 bit for subpriority. If this grouping is changed to 2 bits for pre-emption priority and 2 bits for subpriority, what is the main effect on interrupt behavior?
Think about how reducing pre-emption bits affects nesting depth and subpriority bits affect ordering.
Reducing pre-emption priority bits from 3 to 2 reduces the number of levels that can preempt each other, so nesting depth decreases. Increasing subpriority bits from 1 to 2 allows finer ordering among interrupts with the same pre-emption priority.
What is the benefit of NVIC tail-chaining when multiple interrupts occur back-to-back?
Consider what happens when one interrupt finishes and another is pending immediately.
Tail-chaining allows the CPU to switch directly from one interrupt handler to another without restoring the main program context in between, reducing latency and overhead.
Which statement correctly compares software-triggered interrupts using NVIC_STIR and hardware interrupts in ARM Cortex-M NVIC?
Think about the difference between software and hardware sources of interrupts.
NVIC_STIR allows software to trigger interrupts as if they came from hardware, but these interrupts have no physical external source and can be triggered anytime by software. Hardware interrupts come from external or internal hardware events. Both are managed by NVIC for priority and masking.
