WorksheetsEmbedded Systems Situational MCQs - Basic to Intermediate
Total questions: 40
Worksheet time: 20mins
A temperature sensor connected to a microcontroller gives fluctuating values. What’s the first step to stabilize readings?
Reduce microcontroller speed
Add a capacitor and apply software filtering
Use a smaller sensor
Change baud rate
Your LED connected to a GPIO pin stays ON after turning OFF in code. What might be wrong?
GPIO pin configured as input
Using pull-down resistor
Delay function missing
LED polarity reversed
The microcontroller resets unexpectedly after uploading code. What might be the issue?
Too many print statements
Watchdog timer not reset properly
Code size too small
ADC not used
Your embedded system fails to boot with an SD card inserted. What’s the probable reason?
SD card uses too much power during startup
Sensor interference
Weak GPIO drive
No Wi-Fi available
A sensor connected to an analog input shows incorrect values. What should you check first?
Change to digital pin
ADC resolution and voltage reference
Increase sensor range
Use PWM
UART communication between two devices fails intermittently. What’s a common cause?
GPIO mode
Baud rate mismatch
Too many interrupts
SPI interference
A user presses a button and the LED toggles multiple times. What’s likely the issue?
Overvoltage
Button debounce not handled
Delay too long
LED wattage
You're using an 8-bit microcontroller for a large sensor matrix. It runs slowly. What can you do?
Change to SPI display
Optimize ISR and use port-level operations
Reduce sensor count
Use larger wires
The PWM fan in your embedded device spins at full speed regardless of code. What could be wrong?
Frequency mismatch
Incorrect PWM duty cycle or configuration
Fan is digital
Too much delay in loop
The microcontroller behaves erratically near high-current motors. Why?
Wrong code
Electromagnetic interference; needs shielding or snubber
Wi-Fi channel conflict
ADC overflow
Which memory is used to store the bootloader in most microcontrollers?
EEPROM
Flash memory
RAM
Cache
You want to store user preferences in a system that persists even after power is lost. Where should you store it?
SRAM
DRAM
EEPROM or Flash
UART buffer
A timer-based interrupt routine sometimes delays output generation. What may help?
Increase baud rate
Reduce ISR code length and prioritize interrupts
Add pull-up resistor
Use higher ADC resolution
You detect overheating in your microcontroller during operation. What is the best remedy?
Increase program memory
Use power-saving sleep modes and reduce clock speed
Remove bypass capacitor
Switch to USB power
Which tool is best suited for debugging embedded software?
Logic gate
IDE with built-in debugger or JTAG
Multimeter
Compiler
You want to update firmware on your microcontroller remotely. What method is ideal?
Serial cable
ISP only
OTA (Over-the-Air) update
Reprogram EEPROM manually
What’s the typical use of the watchdog timer in microcontrollers?
Reduce speed
Prevent brownout
Reset system in case of software hang
Log errors
What happens if your ISR takes too long to execute?
Program speeds up
Timer accuracy improves
Other interrupts may be missed or system may hang
Code runs twice
Which communication protocol is best suited for short-distance, low-speed, multi-device communication?
SPI
I2C
UART
Bluetooth
An LED controlled via PWM flickers visibly. What can be the cause?
PWM duty cycle too high
PWM frequency too low
LED polarity wrong
Resistor too large
You’re experiencing missed UART data when your embedded system is multitasking. What is the optimal remedy?
Disable interrupts
Increase baud rate
Use DMA for UART data handling
Increase buffer size only
A sensor gives correct readings when tested alone but fails when combined with other sensors. Likely cause?
Wrong baud rate
Improper power supply decoupling and ground bounce
ADC bit mismatch
Incorrect for-loop
Your embedded Linux device hangs after extended runtime. Which diagnostic tool is most helpful?
Ping
dmesg and top
GPIO scope
EEPROM viewer
During interrupt execution, the system behaves unpredictably. What is likely missing?
Global variable usage
Interrupt flag clearing or context preservation
Correct loop syntax
SPI clock sync
You want your embedded system to perform periodic tasks accurately over time. What mechanism do you use?
delay() in main loop
Polling sensors manually
Hardware timer interrupt
printf statements
In a real-time application, the use of floating-point arithmetic slows your system. What should you do?
Replace float with integer math using fixed-point representation
Use delayMicroseconds
Reduce baud rate
Switch to 64-bit processor
An embedded system must react to an external pulse within 5μs. What’s the most reliable strategy?
Use main loop polling
GPIO input
External interrupt and inline ISR
printf debugging
You want to reduce power in a battery-operated microcontroller. What approach helps most?
Increase clock speed
Run infinite loop
Enter sleep modes and reduce peripheral usage
Use watchdog reset
A real-time sensor array occasionally reports zero. What could improve stability?
Reduce I2C clock
Use averaging/filtering and FIFO buffer
Disable ADC
Increase EEPROM writes
You’re using FreeRTOS and two tasks are accessing the same variable. What’s the correct solution?
Disable one task
Add semaphores or mutexes to protect shared resources
Run tasks in parallel
Use larger stacks
Your system communicates with multiple SPI devices. The second device malfunctions. Likely issue?
Shared MISO line
Incorrect slave select pin handling
Incorrect baud rate
ADC conflict
Why is cooperative multitasking often preferred in small embedded RTOS environments?
Better speed
Reduced memory and control overhead compared to preemptive scheduling
Better sensor accuracy
No need for interrupts
An embedded device fails at certain environmental conditions. What testing is recommended?
Regression testing
HAL testing
Environmental Stress Testing (thermal, vibration, EMI)
EEPROM loop test
Your code behaves differently in debug mode. What might be the cause?
Compiler version
Optimizations disabled or interrupts masked differently
RAM overflow
GPIO swapped
A microcontroller peripheral seems unresponsive after a power event. What's the design improvement?
Add delay
Implement brown-out reset or power-on-reset circuitry
Enable UART
Switch to SPI
An ISR triggers too frequently, starving other processes. What can you adjust?
Increase loop speed
Use GPIO toggle
Adjust timer prescaler or reduce interrupt priority
Disable sensor
You're building a wearable device with data logging. What memory type fits best?
DRAM
NOR Flash
EEPROM
SRAM
A shared resource accessed in ISR and main loop corrupts data. What’s the fix?
Use delay()
Use critical section protection or disable interrupts during access
Use UART print
Increase heap size
A new microcontroller does not support floating point unit (FPU). What’s the workaround?
Add external FPU chip
Use fixed-point arithmetic for efficiency
Use SPI for math
Reduce code size
Two peripherals using the same timer conflict. How to resolve?
Use different pins
Disable one peripheral
Use separate timers or virtualize timer via software
Shift to higher clock
