Skip to main content
Lars Beiderbecke
Senior III
September 15, 2018
Solved

RTC keeping time, but not advancing clock

  • September 15, 2018
  • 6 replies
  • 1421 views

I attached a battery to my STM32, and my RTC is now keeping the time when the board is not powered.

But when not powered, the clock is also not advancing, which means that when I power on the board, the RTC shoes the time when I powered off the board.

What else do I need to set here so that time remains accurate?

This topic has been closed for replies.
Best answer by waclawek.jan

> I'm using the internal clock generator.

What's that? LSI? LSI does not run from VBAT.

JW

6 replies

waclawek.jan
Super User
September 15, 2018

Nothing, just make sure VBAT is stable and at least 1.8V (what kind of battery are you using?)

Make sure your grounding scheme is solid, all ground pins (especially the analog one) are attached (i.e. make sure there are no bad solder joints), and that your oscillator circuit is designed according to guidelines outlined in AN2867.

JW

Lars Beiderbecke
Senior III
September 16, 2018

Thanks for your suggestions, Jan!

I'm using a CR2032 with 3V, and I added a Schottky diode between battery + and the VBAT pin (band pointing to VBAT), battery - is connected to GND. All Vdd/Vss pins of the STM32 are connected.

The diode is a 1N5817 with a drop-down voltage of 0.45 V.

I've just checked again. The date is shown as 9/11, which is the day I set the clock, but not now.

Is the diode placed incorrectly? Are there any registers I need to set?

Lars Beiderbecke
Senior III
September 16, 2018

Jan, you also mentioned the oscillator ... I'm using the internal clock generator.

waclawek.jan
waclawek.janBest answer
Super User
September 16, 2018

> I'm using the internal clock generator.

What's that? LSI? LSI does not run from VBAT.

JW

Lars Beiderbecke
Senior III
September 16, 2018

You're right, of course, the datasheet mentions only LSE ... This is annoying, but can be fixed easily.

Thanks!

Tesla DeLorean
Guru
September 16, 2018

You don't mention the STM32 model/family, but in most the low power domain doesn't include the LSI, usually a block diagram in the RM

0690X000006C1ynQAC.jpg

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