cancel
Showing results for 
Search instead for 
Did you mean: 

RTC keeping time, but not advancing clock

Lars Beiderbecke
Senior III

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?

1 ACCEPTED SOLUTION

Accepted Solutions

> I'm using the internal clock generator.

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

JW

View solution in original post

6 REPLIES 6

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

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

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

> I'm using the internal clock generator.

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

JW

Lars Beiderbecke
Senior III

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

Thanks!

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 Venmo
Up vote any posts that you find helpful, it shows what's working..