cancel
Showing results for 
Search instead for 
Did you mean: 

I am having trouble getting the RTC to work with battery backup. I am using LSE as the clock and I have enabled the backup domain. I can set the date/time values as expected.

BBert
Associate III

 But when I remove power (with the 3V battery still connected to Vbat) the date/time values freeze. That is, they remain where they were when to power was removed. How do I make the RTC continue to run during power down? Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
BBert
Associate III

Problem SOLVED!

I disconnected the battery (with power off) from Vbat and then ran the code. I then reconnected the battery (with power off) and ran the code again. This fixed the problem. Apparently whatever state the RTC was in was being maintained by the battery so removing the battery solved the problem.

View solution in original post

4 REPLIES 4
AScha.3
Chief II

Hello Bert,

maybe LSE clock has not enough power -> set (in cube)  in RCC -> LSE clock setting : LSE drive -> high drive cap.

If you feel a post has answered your question, please click "Accept as Solution".
BBert
Associate III

@AScha.3​  Thanks for the reply. I changed the LSE to high power but it did not help.

AScha.3
Chief II

so.. have you some cap on this supply? i made 10uF cer. cap par to Vbat . shure , that your supply is okay? never seen this problem, if hardware ok.

we had problems with starting up, but all related to too low drive setting. otherwise it working fine.

maybe, you should read the AN about the LSE / oszillators .

https://www.st.com/resource/en/application_note/cd00221665-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf

If you feel a post has answered your question, please click "Accept as Solution".
BBert
Associate III

Problem SOLVED!

I disconnected the battery (with power off) from Vbat and then ran the code. I then reconnected the battery (with power off) and ran the code again. This fixed the problem. Apparently whatever state the RTC was in was being maintained by the battery so removing the battery solved the problem.