Question
rtc & stm32f429
Posted on August 03, 2014 at 19:10
hello every one i need to use lse for rtc clock src. because i want it still working at the power of( with vbat)
my lse circuit work correctly because i use the mco1 as lse clock src and i have 32.768 khz this pin (pa8).my sample code is : RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); PWR_BackupAccessCmd(ENABLE); RCC_LSEConfig(RCC_LSE_ON); while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET) { } RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE); RCC_RTCCLKCmd(ENABLE); RTC_WaitForSynchro(); RTC_TimeStampCmd(RTC_TimeStampEdge_Falling, ENABLE); RTC_InitStructure.RTC_AsynchPrediv = 0xff; RTC_InitStructure.RTC_SynchPrediv =0x7f; RTC_InitStructure.RTC_HourFormat = RTC_HourFormat_24;and use : RTC_GetTime(RTC_Format_BIN, &RTC_TimeStructure); RTC_TimeStructure.RTC_Hours, RTC_TimeStructure.RTC_Minutes, RTC_TimeStructure.RTC_Secondsas time value but they are always zero!but if i change the clock src to lsi , it works correctly