STM32L051 低功耗特性分析

STM32L051 低功耗特性分析

32MHz 2.7mW功耗

low power sleep mode大概只有4.5uA

stop mode大概 0.4uA

stop mode能比low power sleep mode功耗低一个数量级。

这个时候是把core还有大部分clk都关闭了

stop mode with rtc 可以定时通过lptimer定时唤醒,执行中断or reumse程序执行。可以满足电池业务需求,同时把功耗降低一个等级

低功耗进入退出流程,通过查看stm32 discovery 例程即可。

cpu is stopped 指的是cpu clk被关闭,但是power up。这个时候pc不走。

power mode分析

sleep mode是只关闭cpu clk

stop mode是关整个vcore domain的clk,包括pll等,关闭的更加彻底

standy mode是把关闭vcore的电源和时钟

1.sleep mode和stop mode都是可以程序都可以resume,但是standby mode需要复位重新初始化;因为standby时,把vcore domain下电(包括cpu ram等),ram register等内容丢失

2.stop和standby mode下只有部分外设在工作,因此提供的唤醒源业有限,特别是stanby mode

具体哪些ip才工作,看下IP function在各个mode下的状态表整理

3.stop mode和standby mode相比,内部regulator一个是low power 状态,一个是关闭状态。

mcu中的功耗大头是 各个ip的clk 还有内部regulator adc pll等;stm32l0 调频调压都支持

power domain分析

可以看出,

  • vdd是给io和flash 还有always on区域供电的,这个的供电电压是3.3V;
  • 同时内部经过一个ldo后,给core memory供电,而core 的工作电压典型范围是1.2-1.8v。
  • adc等模拟部分有单独的电源供电。
  • regulator一般有三种状态,main、low power、power down。

dvfs表

需要注意的是,cpu内部加入了

问题:WFI和WFE的区别

wfi是通过中断机制产生的,需要把中断使能,通过nvic中对应的exti中断需要使能。resume时,会进入到中断服务程序中。

wfe是通过event机制产生的,resume时,会接着执行程序,而不是进入到中断服务程序。

wakeup event管理:

wake up event的目的是去唤醒core,

wake up event的产生方式有两种,

一是对应外设生中断,但是nvic不打开中断(虽然nvic不打开中断,但是nvic对应的pending bit还是会因为外设中断置起而置起),如此产生event后,cpu core需要去清除外设和nvic的中断pending bit。

二是将exti line配置为event mode,如此不产生中断,不会产生nvic pending bit,因此也就不需要再resume后clear

这样exti interrupt可以wakeup core,二是将exti配置为event mode,如此不会产生中断pending。只是产生唤醒信号。

有一些外设,通过连接在exti direct line上,这些外设可以产生一个异步信号,发送给exti,作为唤醒源。

exti实际上既可以产生中断作为唤醒源,也可以产生wakeup event,用来做唤醒源,

wfi一般用于cpu idle

wfe用于spinlock

wfi和wfe的区别在于,wfi等待的是中断,wfe等待的是事件,所以wfe不能进入中断服务函数,而wfe可以。

spinlock是基于wfe机制去实现的。

arm core low-power standby的实现:一般是由实现者定义的,不过一般的额操作是,关闭clk,保持供电。

进入sleep stop standby mode操作步骤

/** * @brief Enters Stop mode. * @note In Stop mode, all I/O pins keep the same state as in Run mode. * @note When exiting Stop mode by issuing an interrupt or a wakeup event, * MSI or HSI16 RCoscillator is selected as system clock depending * the bit STOPWUCK in the RCC_CFGR register. * @note When the voltage regulator operates in low power mode, an additional * startup delay is incurred when waking up from Stop mode. * By keeping the internal regulator ON during Stop mode, the consumption * is higher although the startup time is reduced. * @note Before entering in this function, it is important to ensure that the WUF * wakeup flag is cleared. To perform this action, it is possible to call the * following macro : __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU) * * @param Regulator: Specifies the regulator state in Stop mode. * This parameter can be one of the following values: * @arg PWR_MAINREGULATOR_ON: Stop mode with regulator ON * @arg PWR_LOWPOWERREGULATOR_ON: Stop mode with low power regulator ON * @param STOPEntry: Specifies if Stop mode in entered with WFI or WFE instruction. * This parameter can be one of the following values: * @arg PWR_STOPENTRY_WFI: Enter Stop mode with WFI instruction * @arg PWR_STOPENTRY_WFE: Enter Stop mode with WFE instruction * @retval None */ void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry) { uint32_t tmpreg = 0U; /* Check the parameters */ assert_param(IS_PWR_REGULATOR(Regulator)); assert_param(IS_PWR_STOP_ENTRY(STOPEntry)); /* Select the regulator state in Stop mode ---------------------------------*/ tmpreg = PWR->CR; /* Clear PDDS and LPDS bits */ CLEAR_BIT(tmpreg, (PWR_CR_PDDS | PWR_CR_LPSDSR)); /* Set LPSDSR bit according to PWR_Regulator value */ SET_BIT(tmpreg, Regulator); /* Store the new value */ PWR->CR = tmpreg; /* Set SLEEPDEEP bit of Cortex System Control Register */ SET_BIT(SCB->SCR, SCB_SCR_SLEEPDEEP_Msk); /* Select Stop mode entry --------------------------------------------------*/ if(STOPEntry == PWR_STOPENTRY_WFI) { /* Request Wait For Interrupt */ __WFI(); } else { /* Request Wait For Event */ __SEV(); __WFE(); __WFE(); } /* Reset SLEEPDEEP bit of Cortex System Control Register */ CLEAR_BIT(SCB->SCR, SCB_SCR_SLEEPDEEP_Msk); }

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值