2021-12-23 01:14 AM
WB5MMG RTC Inaccurate, RTC increase by 1s requires 10s or more in reality.
32.768 LSE has been used.
RTC_TimeTypeDef sTime = {0};
HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN);
RTC_DateTypeDef sDate = {0};
HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN);
Send_Log("%d %d %d %d% d %d", sDate.Year,sDate.Month,sDate.Date,sTime.Hours,sTime.Minutes,sTime.Seconds);
2021-12-23 01:36 AM
The RTC is just as precise as its settings and clock sources. But since you haven't added any details about your implementation (crystal type, load capacities, layout, LSE settings, clock tree, HAL/LL/direct programming etc.), little information can be given.
Regards
/Peter
2021-12-23 01:46 AM
Thank you for your reply, I have added some information about my settings.
2021-12-23 02:13 AM
OK, where did you assign which value to
What are your RCC settings for LSE?
2021-12-23 06:49 PM
RCC settings for LSE is here. I have tried every option of LSE Driver, but it didn’t work.CFG_RTC_ASYNCH_PRESCALER and
CFG_RTC_SYNCH_PRESCALER is an option of CubeIde, and there are no other options to choose.
#define CFG_RTC_ASYNCH_PRESCALER (0x0F)
#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
2021-12-24 12:09 PM
2021-12-26 06:15 PM
According to your answer, I solved this problem smoothly, thank you very much.
2021-12-29 11:45 AM