The goal of this chapter is to reduce how much power an embedded system consumes when it has nothing to do. Every program we have written this term keeps the processor running continuously, never idling, which is fine on USB power and wasteful on a battery. The STM32C031C6 offers four low-power modes that stop parts of the chip when they are not needed, and one instruction, __WFI(), that parks the processor until an interrupt arrives. We’ll also introduce the independent watchdog, a hardware timer that resets the processor if the program stops making progress.
This chapter covers one class day, the Wednesday x-hour of the final week. In class we’ll look at where a microcontroller’s power goes, the four low-power modes and how a program enters one, and the independent watchdog.