AnsweredAssumed Answered

rtc & stm32f429

Question asked by roozitalab.alireza on Aug 3, 2014
Latest reply on Aug 4, 2014 by Clive One
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_Seconds

as time value but they are always zero!

but if i change the clock src to lsi , it works correctly

Outcomes