Embedded Systems & Firmware
What is the main purpose of using a microcontroller's sleep mode in a battery-powered embedded device?
- ATo increase processing speed
- BTo stop the CPU and clocks when idle to cut power, waking only when needed, for example on an interrupt
- CTo erase the program
Show answer and explanation
Answer: B. To stop the CPU and clocks when idle to cut power, waking only when needed, for example on an interrupt
A device that reads a sensor once every few seconds has nothing to do most of the time. Sleep mode stops the clocks or power to the CPU and unused peripherals, cutting current to the microampere range. A timer or pin-change interrupt wakes it, and it goes back to sleep as soon as the work is done. Deeper sleep draws less current but takes longer to wake and loses more state.
- A. It is not for speed.
- B. Correct. Battery life improves greatly.
- C. The program is not erased.