2023-10-02 11:49 PM
Hello everyone! I have stm32f411ceu6 dev board, and I decided to use RTC. But it's going slower than time on reference clock. I use 32768 oscillator, which is soldered on the board. Can I calibrate this thing?
2023-10-03 12:11 AM
> But it's going slower than time on reference clock.
How much?
> Can I calibrate this thing?
Yes. The details are described in RTC smooth digital calibration subchapter of RTC chapter in RM0383. (There's also "coarse calibration" but there's little reason to use it, it's there for historical reasons).
JW
2023-10-03 12:26 AM - edited 2023-10-03 12:28 AM
Thanks for your answer! In half an hour, the RTC fell behind by 5 minutes.
2023-10-03 12:32 AM - edited 2023-10-03 12:33 AM
This is such a huge deviation that I'm not sure it it can be explained even by using LSI instead of LSE; but at any rate, start with reading out RCC_BDCR and checking whether RTC is set to be clocked from LSI, and if LSE runs at all.
Are you trying to use some of the power-saving modes including the VBAT mode (powering down the mcu while running RTC from battery connected to VBAT?
JW
2023-10-03 12:36 AM
I use STM32CubeMX and PlatformIO. But I think it cannot be a reason. And I don't use any power saving modes
2023-10-03 12:38 AM
which board ? this:
(on one of mine the 32k crystal was damaged ! )
2023-10-03 01:12 AM
Yes, mine is same
2023-10-03 01:34 AM
just check: is the board clean? any flux remains around the 32k crystal + caps is a no go.
if not sure, clean (isopropanol or aceton) .
2023-10-03 01:48 AM
So, during the 30-minute test period, power was on all the time, there was no reset performed, and you don't use any power-save mode, correct?
Read out RCC_BDCR and check whether RTC is set to be clocked from LSI, and if LSE runs at all. You can try to output LSE to MCO if it's a possibility in this mcu and measure its frequency.
For experiments I'd also suggest to use genuine ST boards like Nucleo from reputable source. While black pills are so far not widely known to use counterfeited chips like the blue pills do, I wouldn't exclude that possibility either.
JW