cancel
Showing results for 
Search instead for 
Did you mean: 

RTC doesn't keep time with VBAT -STM32F107

Tandis
Visitor

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!

Clock.JPG

RTC Config.JPG

  

SCH.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
filipxsikora
Associate III

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.

waclawekjan_0-1736955720827.png

 

Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.