RTC doesn't keep time with VBAT -STM32F107
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-15 05:01 AM
Hello,
I have enabled RTC on my microcontroller (STM32F107). I also have a battery on my VBAT pin. Whenever the Power is on, everything works fine. But when the power is off, rtc doesn't keep the time. I do not use LSE(I just have external clock for HSE), so I use LSI.The voltage of the battery is fine and it is 3.0 V. I have attached my RTC and RCC configs and schematics of Vbat pin.
Thank you in advance!
  
Solved! Go to Solution.
- Labels:
-
RTC
-
STM32F1 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-15 07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-15 05:20 AM
Hello,
this is simple, the VBAT backup domain doesn't power the LSI when the power is removed. Only LSE is supported. It is described somewhere in the DS/RM, can't remember where I saw it. But it was there. So no luck without LSE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-15 07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-15 07:50 AM
It can be found in RM0008, e.g. section 7.2.8:
The LSE clock is in the Backup domain, whereas the HSE and LSI clocks are not.
However, it is very questionable whether the RTC clocked by LSI will provide meaningful results in the long term, as the frequency of the LSI is typically 40kHz, but can be between 30...60kHz within tolerance. This corresponds to a deviation of -25%...+50%, i.e. -6h...+12h per day...
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-16 12:39 AM - edited ‎2025-01-16 12:39 AM
Thanks alot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-16 12:39 AM
Thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-16 12:40 AM
Thank you so much!