cancel
Showing results for 
Search instead for 
Did you mean: 

rtc & stm32f429

alireza_roozitalab
Associate III
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_Seconds

as time value but they are always zero!

but if i change the clock src to lsi , it works correctly
1 REPLY 1
Posted on August 04, 2014 at 01:20

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Unable%20to%20Set%20RTC%20on%20STM32F4&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20140730%252015%253a01%253a17%26p_ID%3D44718%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41&currentviews=29]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex%5fmx%5fstm32%2fUnable%20to%20Set%20RTC%20on%20STM32F4&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https%3A%2F%2Fmy%2Est%2Ecom%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex%5Fmx%5Fstm32%2FAllItems%2Easpx%3FPaged%3DTRUE%26p%5FStickyPost%3D%26p%5FDiscussionLastUpdated%3D20140730%252015%253a01%253a17%26p%5FID%3D44718%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=29

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..