Lecture 12 - Power Consumption and Calculations
Power is Energy consumption per unit time:
We have two types:
- Static Power Consumption: Leakage Current, Sub Threshold Currents, Passive Pull-up and Pull-down paths
- Dynamic Power Conumption: Switch Transient Current, Charging and Discharging Capacitive Loads
Here:
and:
all of these are considered in designing the chip itself. Doping the chip contents changes based on our requirements here.
Reducing
To reduce the power consumption, we can:
- Reduce
- Multiple
domains for different power loads - Use smaller trasistors (feature size)
- Reduce
- Layout to minimize load capacitance.
- Reduce frequency (ie: clock speeds)
- Operating circuits at multiple speeds
- Reduce the activity factor
- Logic Gating (turn off parts of the logic)
- Eliminate Glitches and Hazards
Consequently
- Run as fast as we can for a short time
- Shut off as quickly as possible
Embedded Systems Power Management
You've probably seen that you have to turn on each and every single device/peripheral you want to use. As such, we can shut off parts of the chip we aren't using. This is a double edged sword since if you actually need the data in a part you're turning off, then you may waste power on trying to get that information back.
The STM32 handles these power handing techniques by doing:
- Clock Gating (turn on/off clock to places)
- Power Gating (turn on/off power to places)
The STM32L4xxx can do both
The voltages for our STM32L4xxx is:
- ... (there's a lot of reference voltages you can look up)
In high performance mode we get up toMHz operation at . We also have our low power modes:
Low Power Modes
The modes are:
- Sleep - CPU clock off (only woken by interrupts or events)
- Low Power Run Mode - Max 2Hhz operation
- Low Power Sleep Mode - entered from LP run mode
- Stop 0, 1, 2 modes - core off, register values retained, RTC on, other peripherals off depending on stop 0/1/2
- Standby mode - SRAM 1 off (SRAM 2 on)
- Shutdown
- Run Mode (lower clock freq. / V)
See [[rm0351-stm32l47xxx-stm32l48xxx-stm32l49xxx-and-stm32l4axxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=160]] up to page 180. The mode transitions are:
Entering Low Power Mode
Most modes require you to execute:
__wfi(); // enter new mode
// or
__wfe(); // exit mode
For Sleep (core off): Use wfi
or wfe
. For LP Sleep: use the same as sleep mode but set:
SCB->SCR_SCB_SCR_SLEEPDEEP
Stop modes require you to manually turn off more parts of the periphery.
One of the mastery exercises is to mess to the parameters here for another project and see how low you can get the power, which is pretty cool!
- WFI: Waits for an intterupt
- WFE: Waits for an
__SEV()
instruction (ie: an event)
How Much Power is Saved?
Why is this all worth it? The data sheet has a lot of details, but some highlights are:
- Run Mode: 25C at 26Mhz gives 2.88 mA
- LP Run Mode: 25C at 2Mhz gives 272 uA
- Sleep: same config gives 0.92 mA
- LPSleep: same config gives 96 uA
- Stop 1: ~100 uA
- Stop 2: ~6.5 uA
- Stop 3: ~1.5 uA
The important thing is that if you're in sleep mode 90% of the time, and in run mode 10%, you'd get:
So notice that we can have great power savings, while still being able to use our more advanced power modes.
Interested?
If you want to do this as a mastery exercise, you can look at the reference manual, chapter 5 (PWR), as well as the ARM programming model Chapter 4.4 (SCB).