Bird
0
0

Identify the error in this code snippet that tries to enable SysTick interrupts:

medium📝 Analysis Q6 of 15
ARM Architecture - Exception and Interrupt Model
Identify the error in this code snippet that tries to enable SysTick interrupts:
SysTick->LOAD = 5000;
SysTick->VAL = 0;
SysTick->CTRL = 3;
ACTRL value 3 disables interrupts
BVAL should not be set to zero
CLOAD value should be one less than the desired count
DNo error, code is correct
Step-by-Step Solution
Solution:
  1. Step 1: Check LOAD register usage

    LOAD should be set to desired count minus 1 because counting starts from zero.
  2. Step 2: Validate other registers

    VAL=0 is correct to clear current count; CTRL=3 enables counter and interrupt.
  3. Final Answer:

    LOAD value should be one less than the desired count -> Option C
  4. Quick Check:

    LOAD = desired count - 1 [OK]
Quick Trick: LOAD register = count minus one for SysTick [OK]
Common Mistakes:
  • Setting LOAD to exact count value
  • Thinking VAL=0 is invalid
  • Misunderstanding CTRL bits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes