打印

stm8s活跃停机模式醒来后自动切换到内部时钟

[复制链接]
4902|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
小孩飞啊飞|  楼主 | 2012-6-1 15:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我用的stm8s105单片机,初始时将时钟切换到了外部晶振。我开始上电时进入active halt模式,然后由外部中断唤醒后串口打出乱码,不休眠时打印数据很正常,我想可能是波特率变了。然后发现时钟频率变成了内部时钟的频率。而且一开始就用内部时钟时唤醒后工作正常。
唤醒后会自动使用内部时钟吗?有没有办法可以让它继续使用外部晶振?我可不想每次唤醒都要切换一下时钟。谢谢各位了
沙发
vigia| | 2012-6-1 16:36 | 只看该作者
参考手册上是这么写的:
Fast clock wakeup
As described for Halt mode, in order to get the shortest wakeup time, it is recommended to
select HSI as the fMASTER clock source. The FHWU bit is also available to save switching
time.
A fast wakeup time is very important in Active-halt mode. It supplements the effect of CPU
processing performance by helping to minimize the time the MCU stays in Run mode
between two periods in low power mode, and thus reduces the overall average power
consumption.
Since the clock is not automatically switched to the original master clock, the application
must restore the clock source before entering Halt/Active-halt mode as soon as it is ready.

推荐使用内部时钟来提高运行时的速度,降低2个活跃停机模式之间的功耗。也就是说不会自动切换到内部时钟了。

使用特权

评论回复
板凳
小孩飞啊飞|  楼主 | 2012-6-4 10:06 | 只看该作者
谢谢楼上,这个我也看过了,可是我要比较精确的时钟,内部时钟不太准。那这样是不是就没有办法唤醒后自动为外部时钟了呢?

使用特权

评论回复
地板
小孩飞啊飞|  楼主 | 2012-6-4 10:09 | 只看该作者
还有,我写错了,我用的halt模式。除了不可以定时唤醒应该也和活跃停机差不多

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

44

帖子

1

粉丝