Bird
0
0

Consider the following code snippet for ARM Cortex-M NVIC:

medium📝 Analysis Q13 of 15
ARM Architecture - Exception and Interrupt Model
Consider the following code snippet for ARM Cortex-M NVIC:
NVIC_SetPriority(TIM2_IRQn, 2);
NVIC_EnableIRQ(TIM2_IRQn);
NVIC_SetPriority(USART1_IRQn, 1);
NVIC_EnableIRQ(USART1_IRQn);
Which interrupt has higher priority?
AUSART1_IRQn has higher priority
BTIM2_IRQn has higher priority
CBoth have equal priority
DPriority cannot be determined
Step-by-Step Solution
Solution:
  1. Step 1: Understand priority values

    Lower numeric priority value means higher priority in NVIC.
  2. Step 2: Compare priorities set

    TIM2_IRQn is set to 2, USART1_IRQn is set to 1, so USART1_IRQn has higher priority.
  3. Final Answer:

    USART1_IRQn has higher priority -> Option A
  4. Quick Check:

    Lower number = higher priority = USART1_IRQn [OK]
Quick Trick: Lower priority number means higher priority [OK]
Common Mistakes:
  • Assuming higher number means higher priority
  • Ignoring priority values and focusing on enable order
  • Confusing IRQ names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes