完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我不太清楚STM8L是如何工作的,当启用模块时我们必须启用时钟源模块然后启用模块本身,这没关系。 对于模块配置(寄存器访问),似乎必须禁用模块并启用时钟。 如果我想在不丢失配置的情况下暂停模块一段时间,我该如何处理? 例如,我启用LCD显示消息,一段时间后我想禁用它以备用电源。我是不是该: - 停止时钟(PCKEN23 = 0)但启用模块(LCD_CR3_LCDEN = 1)? - 停止时钟(PCKEN23 = 0)并禁用(LCD_CR3_LCDEN = 0)? - 或者让时钟(PCKEN23 = 1)和禁用(LCD_CR3_LCDEN = 0)? 这是所有模块的相同问题,这是STM8L的全局原则? 希望有人能帮助我;) 以上来自于谷歌翻译 以下为原文 Hello, I don't understand well how the STM8L works, when enabling a module we have to enable the clock sourcing the module and then enable the module itself, that's OK. For module configuration (register access) it seems that the module has to be disabled and the clock enabled. If I want to disable a module for a while without loosing the configuration, how do I proceed? For example I enable the LCD to display a message, after some time I want to disable it to spare power. Should I: - Stop the clock (PCKEN23=0) but let the module enabled (LCD_CR3_LCDEN=1)? - Stop the clock (PCKEN23=0) and disable (LCD_CR3_LCDEN=0)? - Or let the clock (PCKEN23=1) and disable (LCD_CR3_LCDEN=0)? This is the same question for all module, which is the global principle for the STM8L? Hoping someone will help me;) |
|
相关推荐
4个回答
|
|
Argail,
我忽略了每个模块的实现细节。 然而,我告诉我什么经验教我。 如果启用并且时钟信号被应用于每个模块,则每个模块都有效。 如果禁用模块,则断开其输入和输出与微控制器引脚的连接。 某些模块通过其电源启用/禁用,但它们的配置寄存器应保持其值,即如果代码可以读取和写入所有位,则它们可以用作RAM。 当你移除他们的时钟信号时,他们会冻结,他们绘制的功率会减少。 至于外围模块的功耗,它与核心节能模式相似: 启用和计时的模块与正在运行的核心相似。 启用但未经时钟的模块与等待核心相似。 禁用和时钟模块与停止的核心相似。 禁用和非时钟模块与断电核心相似。 如果模块必须尽可能省电,则应禁用并取消时钟。 正如您所知(我看到您的其他帖子),禁用的模块不会驱动其输出,因此您的代码必须将输出设置为您的应用程序所期望的值。 问候, EtaPhi 以上来自于谷歌翻译 以下为原文 Argail, I ignore the implementation details of each module. I however tell what experience taught me. Every module works if it's enabled and a clock signal is applied to it. If you disable a module, you disconnect its inputs and outpus from the microcontroller pins. Some modules are enabled/disabled through their power supply, but their configuration registers should keep their value, i.e. they can be used as a RAM if the code can read and write all their bits. When you remove their clock signal, they freeze and the power they draw decreases. As regards peripheral module power consumption, it's alike to the core power saving modes: An enabled and clocked module is alike to a running core. An enabled, but unclocked module is alike to a waiting core. A disabled and clocked module is alike to a stopped core. A disabled and unclocked module is alike to a powered down core. If a module must save as power as possible, it should be disabled and unclocked. As you already know (I saw your other post), a disabled module doesn't drive its outputs, so your code must set the outputs to the values that your application expects. Regards, EtaPhi |
|
|
|
亲爱的EtaPhi,
感谢您的留言和简洁的解释,事情开始变得清晰(至少更清楚:))。 我疯了,因为我不知道引脚配置没有保存,我很困惑。 这些设备有一些很棒的功能,我今天正在玩WFE和WFI;)我有点难过没有硬件AES的UFQFN48。 以上来自于谷歌翻译 以下为原文 Dear EtaPhi, Thank you for your message and neat explanation, the things began to be clear (clearer at least:)) for me. I was coming crazy because I didn't know that the pin configuration was not saved and I was confused. There is some great features in those devices, I was playing with WFE and WFI today;) I'm only a bit sad there is not UFQFN48 with hardware AES. |
|
|
|
亲爱的Argail,
我给你一些建议:WFI和WFE指令使调试变得非常困难(有时候这是不可能的)。 这些调试问题的症状是“无法连接到设备”错误。 我想这是因为当核心执行WFI / WFE指令时,SWIM硬件也在休眠。 因此,在核心和SWIM接口重新启动其正常操作之前,IDE的调试接口无法响应其请求。 我只在项目的发布版本中使用WFI或WFE指令。 我通常使用预处理器指令#ifdef #endif将它们从调试版本中排除。 EtaPhi 以上来自于谷歌翻译 以下为原文 Dear Argail, I give you a bit of advice: WFI and WFE instructions make debugging very difficult (sometimes it's impossible). The symptom of these debugging troubles is an ''unable to connect to the device'' error. I suppose that this happens because the SWIM hardware is sleeping too when the core executes a WFI / WFE instruction. For this reason, the debugging interface of an IDE gets no answer to its requests until the core and the SWIM interface restart their normal operation. I only use WFI or WFE instructions in the release version of my projects. I usually exclude them from the debug version by using the pre-processor instructions #ifdef #endif. EtaPhi |
|
|
|
感谢这些信息,随时可以听到任何其他信息;)
以上来自于谷歌翻译 以下为原文 Thank for this information, ready to hear any other;) |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2730 浏览 1 评论
3239 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1808 浏览 1 评论
3647 浏览 6 评论
6035 浏览 21 评论
1339浏览 4评论
198浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 10:53 , Processed in 1.388871 second(s), Total 82, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号