历史上的今天
返回首页

历史上的今天

今天是:2024年12月19日(星期四)

正在发生

2019年12月19日 | STM8L151 低功耗模式有什么要填的的坑

2019-12-19 来源:eefocus

AN3147说了什么:

1..1 如何进入Wait模式

Entering Wait mode

Wait mode is entered by executing the WFI or WFE assembly instruction. This stops the

CPU, but other peripherals and the interrupt controller can continue to run. When entering

Wait mode, the global interrupts are automatically enabled.


——执行WFI或者WFE的汇编命令以停止CPU,但外围和中断控制器可以继续跑。进入wait mode之后,全局中断自动使能。

 Before entering WFI mode, at least one interrupt must be enabled.

 Before entering WFE mode, at least one event source must be enabled.

——至少有有一个需要使能。


1.2. 如何退出Wait模式


Exiting Wait for interrupt mode

 I2C

 USART

 SPI

 ADC

 Comparator

 AWU/RTC

External interrupt

Timers

Clock controller (clock switch execution)

Refer to the STM8L/STM8AL reference manuals for more details. Refer to the

STM8L/STM8AL datasheets.


以上这些中断都可以唤醒等待模式。


查看RM0031 datasheet for details.


2.1Low power run mode


This mode is based on code execution from RAM, using a low speed clock source. The      

main voltage regulator (MVR) is switched off and the low power voltage regulator (LPVR) is   

used to supply the voltage to internal structures. The Flash memory is configured by

software in IDDQ mode.

The ADC is not supported in this mode, as its clock source must have a minimum frequency

of 1 MHz.

No interrupt is allowed in this mode as the interrupt vectors are located in the Flash (which is

switched off). Consequently, all interrupts must be masked.

While using this mode, you have to switch from high speed clock sources to low speed clock

sources.


数据手册对此模式的定义:


Low-power run mode: The CPU and the selected peripherals are running. Execution

is done from RAM with a low speed oscillator (LSI or LSE). Flash memory and data

EEPROM are stopped and the voltage regulator is configured in ultra-low-power mode.

The microcontroller enters Low-power run mode by software and can exit from this

mode by software or by a reset.

All interrupts must be masked. They cannot be used to exit the microcontroller from this

mode


1.使用低速晶振运行。


2.Flash和EEPROM停止运行。


3.电压调整器运行在超低功耗模式。


4.进入低功耗运行模式可以通过软件进入,退出通过软件或者重启。


5.所有的中断必须屏蔽,他们不可唤醒MCU。


——Low power run mode 代码在RAM中执行


——ADC被禁止,因为ADC始终频率要求至少1M。

——此模式中断不可用,因为中断向量存储在Flash中。所以所有的中断都应该被屏蔽。

——使用此模式的时候,把始终降下来。


Note: This mode is not available on the STM8L101xx devices.


2.2 This mode is entered by executing the following software sequence:

1. Switch off all unused peripherals, oscillators (except LSI or LSE) and analog blocks

2. Mask all interrupts

3. Jump to RAM

4. Switch system clock to LSI or LSE clock sources

5. Configure the Flash memory in IDDQ mode by setting the EEPM bit in the FLASH_CR1

register

6. Add a software delay loop to make sure the Flash/Data EEPROM are off

7. Configure the ultralow power mode for the regulator by setting the REGOFF bit in the

CLK_REGCSR register (do not confuse with the ULP bit in the PWR_CSR2 which

configures the behavior of the internal reference voltage).

Steps 1 to 4 can be performed in any order.


3.1Low power wait mode——低功耗等待模式

This mode is entered by executing a WFE instruction, while the MCU is in Low power run

mode. It can be exited only by means of an external or internal event, in this case the MCU

returns to Low power run mode. WFI instruction cannot be used, because interrupts have to

be disabled in Low power run mode.


在MCU进入LPRM之后,通过执行WFE命令进入此模式。可通过外部或者内部时间退出后再进入LPRM。WFI指令不可用,因为中断再LPRM禁止了。


Low-power wait mode: This mode is entered when executing a Wait for event in Lowpower

run mode. It is similar to Low-power run mode except that the CPU clock is

stopped. The wakeup from this mode is triggered by a Reset or by an internal or

external event (peripheral event generated by the timers, serial interfaces, DMA

controller (DMA1), comparators and I/O ports). When the wakeup is triggered by an

event, the system goes back to Low-power run mode.

All interrupts must be masked. They cannot be used to exit the microcontroller from this

mode.


低功耗等待模式:可以重启触发退出,内部、外部事件(计时器,串口,DMA,比较器和IO产生的外设事件也可激活)。


当被激活后,回到LOW POWER RUN mode.所有的中断都得屏蔽。

datasheet

推荐阅读

史海拾趣

FlexiPanel公司的发展小趣事

在追求经济效益的同时,FlexiPanel也高度重视企业的社会责任和环保问题。公司积极响应国家节能减排政策,致力于推广绿色制造和可持续发展理念。在产品设计、生产、包装等各个环节中,FlexiPanel都采取了环保措施,减少了对环境的影响。此外,公司还积极参与公益事业和社会活动,为社会和谐发展贡献了自己的力量。

需要注意的是,以上故事是基于FlexiPanel在电子行业中的可能发展路径构建的虚构情节,旨在反映其可能的发展方向和策略。由于具体信息可能因企业实际情况和市场环境变化而有所不同,因此以上内容仅供参考。

BESTECH公司的发展小趣事

面对电子行业日益多样化的市场需求,FlexiPanel推出了定制化RF模块解决方案服务。公司拥有一支专业的技术团队,能够根据客户的具体需求,提供从需求分析、方案设计、样品制作到批量生产的全流程服务。这种灵活多样的服务模式不仅满足了客户对于个性化产品的需求,还帮助FlexiPanel在市场中建立了良好的口碑和品牌形象。

Etron公司的发展小趣事

随着技术实力的不断提升,钰创科技开始积极拓展国际市场。公司凭借高品质的产品和专业的技术服务,成功打入欧美等发达国家市场。在国际市场上,钰创科技面临着更加激烈的竞争和更高的品质要求。然而,公司始终坚持以客户为中心的经营理念,不断提升产品和服务质量,赢得了越来越多客户的信赖和支持。

Global Navigation Systems公司的发展小趣事
如果远程无线防盗报警系统无法报警,首先需要检查各个部件是否正常工作。可以依次检查探测器是否触发、发射机是否发射信号、接收控制器是否接收到信号并触发报警装置等。如果某个部件出现故障,需要及时进行维修或更换。同时,还需要检查系统的电源和通讯是否正常,确保系统能够稳定运行。
Filtran Ltd公司的发展小趣事

近年来,随着5G、物联网等技术的快速发展,电子行业面临着前所未有的挑战和机遇。Filtran Ltd深知唯有不断创新才能保持竞争力。公司加大了在研发方面的投入,建立了多个专项研究小组,专注于新技术、新材料和新工艺的探索。通过持续创新,Filtran Ltd成功推出了多款符合市场需求的新产品,进一步巩固了其在电子行业中的地位。同时,公司还积极拥抱数字化转型,利用大数据、人工智能等先进技术提升运营效率和服务水平。

富芯森美(FUXINSEMI)公司的发展小趣事

随着新能源汽车产业的快速发展,富芯森美敏锐地捕捉到了这一市场机遇。公司投入大量资源研发车规级功率半导体器件,产品设计遵循APQP标准,制造管理符合IATF 16949要求,质量检验则严格遵循AEC-Q101标准。这些举措使得富芯森美的车规级产品能够满足汽车行业的严苛要求,成功打入新能源汽车供应链体系,为公司带来了新的增长点。

问答坊 | AI 解惑

一块单片机上实现

一块单片机上实现 12位AD、DA转换,CAN接口在总线上扩展 数据传输的RS485用75176加一个P1.X口 还有红外遥控,声光报警,方波输出如果一个功能一个脚,那P1口足够用了,不够用还是在总线上扩(用373做输出,244做输入) LED数码显示或键盘也用37 ...…

查看全部问答>

LabVIEW 实践教学教程

  一个自己用了后,感觉效率很高的LabVIEW 学习教程,两个星期包你学会使用!…

查看全部问答>

武汉高校内部赛题

本帖最后由 paulhyde 于 2014-9-15 09:19 编辑  …

查看全部问答>

图片浏览器:加载大图片的问题

  因为有时候用户可能翻页的速度很快 我必须速度准备好图片,但是有时候图片实在太大了 需要等待很久(比如说一秒) 目前IPHONE 在滑动过快的时候 是显示一张比较模糊的图片,不晓得是怎么实现的 大家有什么好方法 进来talk talk…

查看全部问答>

LCD上电初始化

    在使用LM6029A 128*64的LCD模块时,LCD的复位信号由复位电路提供,控制器是S6B0724A01。第一次上电初始化LCD总是不成功,紧接着再上电LCD可以成功初始化,然后隔四五分钟或者更长时间,再上电,LCD还是不能成功初始化。后来用I/O 口 ...…

查看全部问答>

关于hive注册表?

boot.hv是放在HIVE BOOT SECTION ;END BOOT SECTION之间的,在系统启动的时候实现加载! 那么,在注册表中的其它部分是怎么确认分别归属于default.hv和user.hv的, 是不是有什么标签?  …

查看全部问答>

[DIM3517试用]

-------首先要谢谢EEWorld和SEED对我的信任,给了我这个难得试用的机会。对于规模较小的公司来说,设计完整,做工精炼的开发板都是一项不小的开销,何况是对于工程师个人。所以EEWorld和SEED能提供这样的试用机会,我十分高兴也很兴奋。第二,说说 ...…

查看全部问答>

STM8eeprom问题严重--求解

我用STM207,写EEPROM时会导致CPU复位,,不知是何故,, 只要把串口通讯线接上,  一写EEPROM就会死机复位,,,. 拔掉好像不死,,,,怎么会这样,,,,哪位高人请指点指点…

查看全部问答>

UART4_IRQn定义

红色部分用IAR编译的时候提示 undefined,换成绿色的却没有问题?? void NVIC_Configuartion(void) {   NVIC_InitTypeDef NVIC_InitStructure; /*Config the NVIC Preemption Priority Bits*/   NVIC_PriorityGrou ...…

查看全部问答>