STM32L051的低功耗初探

STM32L系列提供多种低功耗模式,如睡眠、低功耗运行、低功耗睡眠、停止和待机模式,以适应不同应用的需求。停止模式下可保留RAM内容并关闭大部分时钟,待机模式则切断内核电源导致复位。STM32L还包括对RTC的支持和快速唤醒功能,适合电池供电设备。
摘要由CSDN通过智能技术生成

起因:有个项目需要做低功耗,以前都是用的MSP430。现在想换一个方案。

发现STM32L 系列的数据比较亮眼,与我实测的数据基本一致。

Ultra-low-power platform

– 1.65 V to 3.6 V power supply

– -40 to 125 °C temperature range

– 0.27 μA Standby mode (2 wakeup pins)

– 0.4 μA Stop mode (16 wakeup lines)

– 0.8 μA Stop mode + RTC + 8-Kbyte RAM retention

– 88 μA/MHz in Run mode

– 3.5 μs wakeup time (from RAM)

– 5 μs wakeup time (from Flash memory)

• Core: Arm® 32-bit Cortex®-M0+ with MPU

– From 32 kHz up to 32 MHz max.

– 0.95 DMIPS/MHz

There are three power consumption ranges:

• Range 1 (VDD range limited to 1.71-3.6 V), with the CPU running at up to 32 MHz

• Range 2 (full VDD range), with a maximum CPU frequency of 16 MHz

• Range 3 (full VDD range), with a maximum CPU frequency limited to 4.2 MHz

Seven low-power modes are provided to achieve the best compromise between low-power

consumption, short startup time and available wakeup sources:

• Sleep mode

In Sleep mode, only the CPU is stopped. All peripherals continue to operate and can

wake up the CPU when an interrupt/event occurs. Sleep mode power consumption at

16 MHz is about 1 mA with all peripherals off.

• Low-power run mode

This mode is achieved with the multispeed internal (MSI) RC oscillator set to the lowspeed

clock (max 131 kHz), execution from SRAM or Flash memory, and internal

regulator in low-power mode to minimize the regulator's operating current. In Lowpower

run mode, the clock frequency and the number of enabled peripherals are both

limited.

• Low-power sleep mode

This mode is achieved by entering Sleep mode with the internal voltage regulator in

low-power mode to minimize the regulator’s operating current. In Low-power sleep

mode, both the clock frequency and the number of enabled peripherals are limited; a

typical example would be to have a timer running at 32 kHz.

When wakeup is triggered by an event or an interrupt, the system reverts to the Run

mode with the regulator on.

Stop mode with RTC

The Stop mode achieves the lowest power consumption while retaining the RAM and

register contents and real time clock. All clocks in the VCORE domain are stopped, the

PLL, MSI RC, HSE crystal and HSI RC oscillators are disabled. The LSE or LSI is still

running. The voltage regulator is in the low-power mode.

Some peripherals featuring wakeup capability can enable the HSI RC during Stop

mode to detect their wakeup condition.

The device can be woken up from Stop mode by any of the EXTI line, in 3.5 μs, the

processor can serve the interrupt or resume the code. The EXTI line source can be any

GPIO. It can be the PVD output, the comparator 1 event or comparator 2 event

(if internal reference voltage is on), it can be the RTC alarm/tamper/timestamp/wakeup

events, the USART/I2C/LPUART/LPTIMER wakeup events.

DS10184 Rev 10 15/133

STM32L051x6 STM32L051x8 Functional overview

32

• Stop mode without RTC

The Stop mode achieves the lowest power consumption while retaining the RAM and

register contents. All clocks are stopped, the PLL, MSI RC, HSI and LSI RC, HSE and

LSE crystal oscillators are disabled.

Some peripherals featuring wakeup capability can enable the HSI RC during Stop

mode to detect their wakeup condition.

The voltage regulator is in the low-power mode. The device can be woken up from Stop

mode by any of the EXTI line, in 3.5 μs, the processor can serve the interrupt or

resume the code. The EXTI line source can be any GPIO. It can be the PVD output, the

comparator 1 event or comparator 2 event (if internal reference voltage is on). It can

also be wakened by the USART/I2C/LPUART/LPTIMER wakeup events.

• Standby mode with RTC

The Standby mode is used to achieve the lowest power consumption and real time

clock. The internal voltage regulator is switched off so that the entire VCORE domain is

powered off. The PLL, MSI RC, HSE crystal and HSI RC oscillators are also switched

off. The LSE or LSI is still running. After entering Standby mode, the RAM and register

contents are lost except for registers in the Standby circuitry (wakeup logic, IWDG,

RTC, LSI, LSE Crystal 32 KHz oscillator, RCC_CSR register).

The device exits Standby mode in 60 μs when an external reset (NRST pin), an IWDG

reset, a rising edge on one of the three WKUP pins, RTC alarm (Alarm A or Alarm B),

RTC tamper event, RTC timestamp event or RTC Wakeup event occurs.

• Standby mode without RTC

The Standby mode is used to achieve the lowest power consumption. The internal

voltage regulator is switched off so that the entire VCORE domain is powered off. The

PLL, MSI RC, HSI and LSI RC, HSE and LSE crystal oscillators are also switched off.

After entering Standby mode, the RAM and register contents are lost except for

registers in the Standby circuitry (wakeup logic, IWDG, RTC, LSI, LSE Crystal 32 KHz

oscillator, RCC_CSR register).

The device exits Standby mode in 60 μs when an external reset (NRST pin) or a rising

edge on one of the three WKUP pin occurs.

对于模式的选择和区别总结如下:

睡眠模式

在睡眠模式,系统的CPU也就是Cortex-M内核的时钟被关闭了,但外设是继续保持运转的它整个I/O的引脚状态与运行模式下也是相同的。

低功耗睡眠模式

低功耗睡眠模式是基于睡眠模式下的低功耗模式,是具有极低电流消耗的睡眠模式,它内核的时钟也是被关闭的,同时外设时钟频率受到了限制,因为它的电压调节器属于低功耗状态,内部的FLASH是要被停止的,所以低功耗睡眠模式只能从低功耗运行模式进入,这个是和其他模式不同的,其他模式都可以从运行模式直接做切换。

在低功耗运行和睡眠模式下,可以有一个BAM模式,它的工作方式是通过RTC加一个外设加DMA加SRAM,在不需要CPU干预的情况下就可以自行做数据采集,一旦到了数据采集需要到CPU处理的条件时,然后再把CPU唤醒做处理,所以这整个一个小系统就实现了一个协处理器的功能。

停止模式

在说停止模式之前,为了说清楚停止模式和睡眠模式的区别,我们先说一下Vcore的概念,它是内核的一个供电区域,不仅给CPU内核供电,还会给系统内部的存储器和它的数字外设供电。

停止模式中,除了CPU,也就是Cortex-M内核的时钟被关闭外,内核供电域的时钟也被停止,在停止模式下,内核供电域的时钟全部都停掉,PLL内部、外部的高速时钟全部都停掉,电压调节器为内核供电域供电,保留寄存器和内部SRAM中的内容。

在L4和L4+系列中,停止模式被细分为stop 0、stop 1和stop 2三种模式,按照功耗从低到高来说,stop 2是功耗最低的一个stop模式,它整个Vcore电源域放在了更低的漏电流模式下,使用了低功耗的电压调节器,只有最少的外设可以工作,所以它的功耗相对来说是最低的,但是唤醒时间是最长的。

Stop 1模式提供了更多的外设和唤醒源,唤醒时间也会更长一些;

Stop 0模式主电压调节器打开,可以得到最快的唤醒时间;

在所有的stop模式下,所有的高速振荡器停止,而低速振荡器保持活动,外设设置为active,需要的时候就可以使用这些高速时钟,能保证它在一些特定的事件下去唤醒设备。

待机模式

在待机模式下,内核的供电是直接断电的,电压调节器掉电区寄存器的内容会完全丢失,包括内部的SRAM,所以最大的区别就是说,系统从待机模式下的低功耗唤醒的时候,系统是要复位的。

待机模式下,BOR是始终使能的,这样就保证了供电电压低于所选功能阈值时,器件可以复位。默认条件的待机模式下,SRAM的内容是会丢失的,但是在L4里增加了SRAM 2,如果需要在待机模式后系统唤醒的时候有SRAM能保存一些内容,那就可以使用SRAM 2,它需要有多余220nA的额外电流消耗。

Shutdown模式

在shutdown模式,系统达到了最最低的功耗,电压调节器的供电就被关断了,内核的供电也完全被断开,只有备份域的LSE、RTC可以工作所以在L4器件实现了一个新的模式,这个模式主要实现的目的就是为了延长电池供电之后整个器件的使用寿命,它其实是通过关闭内部的稳压器以及禁止使用耗电的监控,所以这个模式可以达到最低的功耗电流。

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值