省电模式STM32F205RG(Power save mode STM32F205RG)

编程入门 行业动态 更新时间:2024-10-25 12:20:58
省电模式STM32F205RG(Power save mode STM32F205RG)

我正在使用STM32F205RGT6 Cortex-M3微控制器并使用IAR Embedded Workbench进行编码。

我计划在大多数情况下将微控制器保持在省电模式,除非外部组件尝试通过SPI(STM32微控制器是SP从机)或通过USB进行通信。

一个外部组件通过SPI(PB12-15)连接,PC通过USB(PA11-12)连接。 通信工作正常 - 我测试了SPI和USB。 我想,一旦我完成设置SPI和USB,我将调用省电功能并在中断服务程序结束时添加相同的函数调用。 我找到了PWR_EnterSTANDBYMode和PWR_EnterSTOPMode(在stm32f2xx_pwr.h中)我尝试过使用它们。 然而,通过这种安排,我无法与微控制器建立任何通信(SPI或USB)。

是否需要配置额外的东西(例如哪些引脚应该唤醒微控制器)? 我使用了错误的功能吗? 或错误的头文件? 你能指出一个类似这种情况的例子(我在ST的网站上找不到类似的东西)吗?

任何建设性的反馈都会受到欢迎。

I am using STM32F205RGT6 Cortex-M3 microcontroller and coding with IAR Embedded Workbench.

I plan to keep the microcontroller in a power saving mode most of the time except when an external component tries to either communicate via SPI (the STM32 microcontroller is meant to be a SP slave) or via USB.

One external compinent is connected via SPI (PB12-15) and PC is connected via USB (PA11-12). The communication works fine - I have tested both the SPI as well as USB. I figured that once I am done setting up SPI and USB I will call a power saving function and add the same function call at the end of interrupt service routines. I have found PWR_EnterSTANDBYMode and PWR_EnterSTOPMode (in stm32f2xx_pwr.h) both of which I tried using. However with such arrangement I cannot establish any communication (SPI or USB) with the microcontroller.

Is there something extra that needs to be configured (for example which pins should wake the microcontroller up)? Am I using wrong function? Or wrong header file? Can you point me to an example resembling such case (I could not find anything similar on ST's website)?

Any constructive feedback would be welcome.

最满意答案

与此同时,我发现了应用笔记AN3430( http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/DM00033348.pdf ),它在某种程度上更容易消化(只有38页),这给出了很好的概述关于微控制器的省电问题。

由于我无法访问PA0-WKUP(唤醒引脚),因此必须使用待机功能丢弃。 似乎在主循环中只是一个简单的睡眠模式 - 通过调用__WMI(); - 在我的情况下应该降低电流消耗。 如果睡眠模式不够,我可能会考虑停止模式,但是我会读取应用程序注意到的EXTI寄存器配置的数据表片段。

In the mean time I found the application note AN3430 (http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/DM00033348.pdf) which is somehow more digestible (only 38 pages) which gives an excellent overview on power saving in the microcontroller.

Since I don't have access to PA0-WKUP (the wake-up pin) I had to discard using stand-by. Seems that just a simple sleep mode in main loop - by calling __WMI(); - should lower current consumption enough in my case. I might consider stop mode if sleep mode isn't enough but I will have read fragments of datasheet on configuration of EXTI registers that the application notepoints to.

更多推荐

本文发布于:2023-08-05 06:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428787.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:省电   模式   STM32F205RG   mode   save

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!