完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
以下是关于该计划目标的简短细节......以及他们面临的问题后我面临的问题...... 我正在使用stm8s005c6t6控制器,我们正在使用基于电容的电源(lm7805)稳压器连接到未调节的直流电源以获得5v电源。我连接了PORTA引脚1来驱动继电器。由于继电器需要30mA的电流....所以当必须切换继电器时,我将控制器发送到主动停止模式,主机频率设置为LSI 128khz,AWU延迟0.5S ......并且在AWU的中断程序中我将首先关闭继电器,然后再将频率切换到HSI-16mhz。 问题: - 当我设置PA1并进入主动停止模式时,PA1自动变为零...并且在AWU唤醒中断后... PA1回到高状态...如果我使用任何其他端口而不是PA1它可以工作很好...但问题只有PA1 .....我无法理解问题....所以最后我使用wfi()指令而不是主动停止...然后它工作.. 。 任何人都可以告诉我问题的原因或任何其他类型的解决方案...... 提前致谢.... #STM8S活性-停止模式 以上来自于谷歌翻译 以下为原文 hello, following is the short details about the objective of the program..and their after the problem what i am facing... I am using stm8s005c6t6 controller and we are using capacitive based power supply (lm7805) regulator is connected at the unregulated dc to get the 5v supply. I have connected PORTA pin 1 to drive the relay. Since relay takes 30mA of current....so when ever relay has to be switched i send the controller to active halt mode with master frequecy set to LSI 128khz and AWU with delay of 0.5S...and in the interrupt routine of AWU i will first switch off the relay and then switch the frequency to again HSI-16mhz. Problem:- when i set PA1 and goes into active halt mode, PA1 automatically goes to zero...and after AWU wakeup interrupt...PA1 come back to high state...if i use any other port instead of PA1 it works fine...but the issue is only with PA1.....i am not able to understand the problem....so finally i am using wfi() instruction instead of active halt...and then it works... can any one suggest me the cause of the problem or any other kind of solution... thanks in advance.... #stm8s-active-halt-mode |
|
相关推荐
3个回答
|
|
你好甲骨文。
PA1也可用于OSCIN。 因此,我认为STM8S005微控制器硬件在主动停止期间或时钟源发生变化时完全控制该引脚。 我建议您检查所有配置选项,并仔细阅读有关活动暂停和时钟源的任何文档。 问候, EtaPhi 以上来自于谷歌翻译 以下为原文 Hello metha. PA1 may be used for OSCIN too. I therefore suppose that STM8S005 microcontroller hardware takes full control of this pin during an active halt or when the clock source changes. I suggest you to check all configuration options and read carefully any documentation about active halt and clock sources. Regards, EtaPhi |
|
|
|
梅塔,
在STM8S103K3,STM8S103F3和STM8S103F2数据表中有这个小小的通知 “ 当MCU处于暂停/活动停止模式时,PA1在输入弱上拉时自动配置,不能用于唤醒器件。在此模式下,不驱动PA1的输出状态。如果在应用程序中使用Halt / Active-halt,建议仅在输入模式下使用PA1“。 STM8S005C6T6数据表中缺少此通知,但它似乎也适用于您的情况。 当微控制器处于调试模式(SWIM)时,它的行为几乎与它在运行模式下的行为一样,但有时会发生奇怪的事情。对于istance,如果您阅读我的帖子“STM8核心错误”,您会看到一个步骤执行错误结果的情况。 因此,您的代码在调试模式下工作并不奇怪,因为在此模式下,HALT指令无法停止微控制器硬件以保持SWIM会话处于活动状态。 EtaPhi 以上来自于谷歌翻译 以下为原文 Metha, in STM8S103K3, STM8S103F3 and STM8S103F2 datasheet there is this little notice “ When the MCU is in Halt/Active-halt mode, PA1 is automatically configured in input weak pull-up and cannot be used for waking-up the device. In this mode, the output state of PA1 is not driven. It is recommended to use PA1 only in input mode if Halt/Active-halt is used in the application”. This notice is missing in STM8S005C6T6 datasheet, but it seems that it also applies to your case. When a microcontroller is in debug mode (SWIM), it behaves almost as it behaves in run mode, but sometimes something strange happens. For istance, if you read my post “STM8 core bug”, you'll see a situation when a single step execution yelds a wrong result. It's therefore not surprising that your code works in debug mode because in this mode an HALT instruction can't stop microcontroller hardware to keep SWIM session active. EtaPhi |
|
|
|
你好梅莎。
我只能告诉你我使用STM8微控制器的经验远非详尽无遗,因为我从未在我的项目中使用过STM8L微处理器(直到现在)。 我喜欢STM8内核,因为它具有8/16位指令集,可以轻松添加或乘法或除以两个16位(无符号)整数。它也在所有STM8微处理器之间共享,它只是...工作。 我觉得STM8L微处理器更脆弱,更难以使用,因为它的软件必须仿效一些设备功能(例如ADC),设计师将其移除以减少电流消耗。相反,他们有一个DMA单元卸载STM8内核,但增加了复杂性。 因此,如果您的应用程序与STM8S005C6T6配合使用,我认为升级到STM8L micro没有任何正当理由,因为如果您的应用程序使用容性电源,它总是连接到电网,因此它不需要耗尽少量电源尽可能使用电池。 此外,STM8S微电源电压可高达5.5 V,而STM8L微电源的最大电源电压为3.6 V. 当存在三相电机时,通常会出现电压尖峰和噪声,这些电压会通过电容性电源。 即使您的应用是为3V3电源设计的,我认为最好设计更宽的操作余量以抵御意外情况...... 这是我的意见,你可以同意或不同意。 但它同意这样的共同智慧......如果没有破坏,就不要修理它! 以上来自于谷歌翻译 以下为原文 Hello Metha. I can only tell you my experience with STM8 microcontrollers which is far from exhaustive because I never used STM8L micros in my projects (until now). I like the STM8 core because of its 8/16 bit instruction set which makes it easy to add or multiply or divide two 16 bit (unsigned) integers. It's also shared between all STM8 micros and it simply … works. I feel that STM8L micros are more fragile and trickier to use because its software must emulate some device functionality (e.g. ADC) which its designers removed to reduce current consumpion. On the contrary, they have got a DMA unit which offloads the STM8 core, but adds complexity. So, if your application works with a STM8S005C6T6, I see no real reason in upgrading to a STM8L micro because if your application uses a capacitive power supply, it's always connected to the power grid and therefore it doesn't need to drain as few power as possible from a battery. Moreover, STM8S micros supply voltage can be as high as 5.5 V, while the maximum supply voltage of STM8L micros is 3.6 V. When there is a three phase motor, there are usually voltage spikes and noise which can pass through your capacitive supply. Even if your application is designed for a 3V3 power supply, I think that it's better to design a wider operation margin to withstand the unexpected... This is my opinion upon which you may agree or not. But it agrees with the common wisdom which says … if it isn't broken, don't fix it! |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2644 浏览 1 评论
3209 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1784 浏览 1 评论
3613 浏览 6 评论
5990 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 18:02 , Processed in 1.408400 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号