0
0
Embedded Cprogramming~20 mins

Standby mode behavior in Embedded C - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Standby Mode Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output when MCU enters standby mode?
Consider the following embedded C code snippet for a microcontroller. What will be the output on the debug console before the MCU enters standby mode?
Embedded C
#include <stdio.h>
#include "mcu.h"  // hypothetical MCU header

int main() {
    printf("System initializing...\n");
    MCU_EnterStandbyMode();
    printf("This line after standby\n");
    return 0;
}
ASystem initializing...\nThis line after standby\n
BSystem initializing...\n
CNo output at all
DSystem initializing...\nError: Standby mode failed
Attempts:
2 left
💡 Hint
Think about what happens to the CPU after entering standby mode.
🧠 Conceptual
intermediate
1:30remaining
Which event wakes the MCU from standby mode?
In embedded systems, what kind of event typically wakes the microcontroller from standby mode?
AAn external interrupt or a configured wake-up source
BA reset triggered by the watchdog timer
CCompletion of the current instruction
DA software command executed after entering standby
Attempts:
2 left
💡 Hint
Think about what can physically interrupt the MCU when it is in low power.
🔧 Debug
advanced
2:30remaining
Why does the MCU not wake up after standby mode?
Given this code snippet, the MCU never wakes up from standby mode. Identify the bug.
Embedded C
#include "mcu.h"

int main() {
    MCU_EnableWakeupPin();
    MCU_EnterStandbyMode();
    while(1) {
        // MCU should wake up and run here
    }
    return 0;
}
AMCU_EnterStandbyMode() is called before enabling the wakeup pin
BMissing a delay before entering standby mode
CThe infinite loop prevents the MCU from waking up
DWakeup pin is enabled but not configured as an interrupt source
Attempts:
2 left
💡 Hint
Enabling a pin alone may not be enough to wake the MCU.
📝 Syntax
advanced
1:30remaining
Identify the syntactically correct standby mode code
Which option does NOT contain a syntax error preventing compilation?
Embedded C
void enter_standby() {
    MCU_EnterStandbyMode()
    printf("Entered standby\n");
}
A
void enter_standby() {
    MCU_EnterStandbyMode();
    printf("Entered standby\n");
}
B
void enter_standby() {
    MCU_EnterStandbyMode()
    printf("Entered standby\n");
}
C
void enter_standby() {
    MCU_EnterStandbyMode();
    printf("Entered standby\n")
}
D
void enter_standby() {
    MCU_EnterStandbyMode;
    printf("Entered standby\n");
}
Attempts:
2 left
💡 Hint
Check for missing semicolons.
🚀 Application
expert
2:00remaining
How many bytes of RAM remain powered in standby mode?
An MCU has 64KB RAM. In standby mode, only the backup SRAM of 4KB remains powered. How many bytes of RAM are lost (powered off) during standby?
A4,096 bytes
B60,000 bytes
C61,440 bytes
D64,000 bytes
Attempts:
2 left
💡 Hint
Remember 1KB = 1024 bytes.