OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3164|回复: 0

stml151做在standby下运行RTC时钟

[复制链接]

1

主题

4

帖子

0

精华

初级会员

Rank: 2

积分
59
金钱
59
注册时间
2016-2-26
在线时间
19 小时
发表于 2016-6-13 11:39:20 | 显示全部楼层 |阅读模式
本帖最后由 成千上旺 于 2016-6-13 11:44 编辑

我现在用stml151做在standby下运行RTC时钟,但是我这遇到了一个问题,就是电源备份区域的值,按理来说,在有电源的情况下,被设置了就不应该会被清零吧,但是我进入standby,然后多次用PA0引脚唤醒,就出现了值为0。以下是这3个函数,以及我会在PA0引脚中断设置PA0下降沿中断,这样PA0的电平高就意味着mcu唤醒,PA0为低,就进入复位模式。帮忙解答下,非常感谢。

void My_RTC_Init(void)
{
RTC_InitTypeDef RTC_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
/* Enable PWR clocks */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Allow access to the RTC */
PWR_RTCAccessCmd(ENABLE);
printf("RTC_BKP_DR0==%d",RTC_ReadBackupRegister(RTC_BKP_DR0)); //就是在这里利用串口打印RTC_BKP_DR0这个值,每次复位读取这个 值。
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image003.jpg

file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image005.jpg
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image006.jpg
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image007.jpg


file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/CatchF95E(06-13-11-34-49).jpg
file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/Catch061D(06-13-11-34-49).jpg
file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/Catch4444(06-13-11-34-49).jpg

file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/Catch(06-13-11-34-49).jpg

file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/Catch2A2D(06-13-11-34-49).jpg
file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/Catch0CDB(06-13-11-34-49).jpg
file:///C:/Users/Administrator/AppData/Roaming/Foxmail7/Temp-6224-20160613110932/Catch5C37(06-13-11-34-49).jpg


1.jpg
2.jpg
3.jpg
4.jpg
5.jpg
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-10 09:55

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表