外部晶振25M, HSE_RTC设定为1M, 目前程式感觉RTC没时钟,
RTC_WaitForSynchro里判RSF超时
EnterInitMode里判INITF也超时
麻烦帮忙看看那里有问题?
void CRTC_Config(void)
{
RTC_InitTypeDef RTC_InitStructure;
PWR_BackupAccessCmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET){}
RCC_RTCCLKConfig(RCC_RTCCLKSource_HSE_Div25);
RCC_RTCCLKCmd(ENABLE);
RTC_WaitForSynchro();
RTC_InitStructure.RTC_AsynchPrediv = 124;
RTC_InitStructure.RTC_SynchPrediv = 7999;
RTC_InitStructure.RTC_HourFormat = RTC_HourFormat_24;
if (RTC_Init(&RTC_InitStructure) == ERROR){
printf("\n\r /!\\***** RTC Prescaler Config failed ********/!\\ \n\r");
}
RTC_TimeRegulate();
} |