STM32 RTC时钟源LSE
时间:11-17
来源:互联网
点击:
- 存器1的值为0XA5A5*/
- BKP_WriteBackupRegister(BKP_DR1,RTC_SEQ_ID);
- }else
- {
- /*CheckifthePowerOnResetflagisset*/
- //RCC_GetFlagStatus(RCC_FLAG_PORRST)!=RESET
- //printf("\r\n\nPowerOnResetoccurred....");
- /*CheckifthePinResetflagisset*/
- //elseif(RCC_GetFlagStatus(RCC_FLAG_PINRST)!=RESET)
- //printf("\r\n\nExternalResetoccurred....");
- if(RCC_GetFlagStatus(RCC_FLAG_LSERDY)==RESET)
- {
- //RCC->CSR|=0x1;//开启内部低速晶振
- //while(RCC_GetFlagStatus(RCC_FLAG_LSIRDY)==RESET);
- //RCC_RTCCLKConfig(RCC_RTCCLKSource_LSI);//使用LSI提供RTC时钟
- //RCC_RTCCLKConfig(RCC_RTCCLKSource_HSE_Div128);
- RTC_Configuration();
- }
- //printf("\r\nNoneedtoconfigureRTC....");
- /*WaitforRTCregisterssynchronization*/
- RTC_WaitForSynchro();
- /*EnabletheRTCSecond*/
- RTC_ITConfig(RTC_IT_SEC,ENABLE);
- /*WaituntillastwriteoperationonRTCregistershasfinished*/
- RTC_WaitForLastTask();
- }
- #ifdefRTCClockOutput_Enable
- /*EnablePWRandBKPclocks*/
- RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR|RCC_APB1Periph_BKP,ENABLE);
- /*AllowaccesstoBKPDomain*/
- PWR_BackupAccessCmd(ENABLE);
- /*DisabletheTamperPin*/
- BKP_TamperPinCmd(DISABLE);/*TooutputRTCCLK/64onTamperpin,thetamper
- functionalitymustbedisabled*/
- /*EnableRTCClockOutputonTamperPin*/
- BKP_RTCOutputConfig(BKP_RTCOutputSource_CalibClock);
- #endif
- /*Clearresetflags*/
- RCC_ClearFlag();
- }
实际测试,RTC效果还行,然后配合上位机隔一定的时间后同步时间基本上能够满足要求。
万恶的LSE晶振,这东西简直不能忍受......
STM32RTC时钟源LS 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)
