2021-06-28 01:51 AM
I'm using the STM32L431xx mcu.
The current hardware configuration of our design has no external clock source (crystal), so we are using the internal one. And there's a new functionality which demands second-accurate real time clock, over a period of 3 or so months.
According to our previous experience, which could be wrong, there will be roughly 1 second error for every 3 days if we leave the RTC running. This clearly is unacceptable.
I'm trying to find out whether there's a way to compensate/eliminate/offset this error? Without using external clock source of course.
Solved! Go to Solution.
2021-06-28 11:17 PM
What do you mean by "internal clock"?
LSI (and MSI/HSI) error you look up in the datasheet, but it's generally in ones of percent, i.e. about one second in a minute.
LSE with crystal can achieve around 10ppm, with *careful* design, that's roughly one second in a day. You can calibrate it to 1ppm, i.e. 1 second in 10 days, but it will drift with temperature.
JW
2021-06-28 03:07 AM
> And there's a new functionality which demands second-accurate real time clock, over a period of 3 or so months.
3 months, that's roughly 8 million seconds, so you are talking about roughly 0.12 ppm precision. That's not in the domain of common crystal-driven clocks, you are about to enter the realm of high precision TXCO; or maybe even beyond, to atomic clocks.
Be prepared your budget to explode.
JW
2021-06-28 08:01 PM
:face_with_tears_of_joy:
Sorry I haven't done my math.
So what are you sayin? That the internal clock is capable of this task?
No I'm not talking about atomic-clock accuracy, I'm talking about roughly the same as your phone or your smart watch, I get it that both devices gets to sync with the internet, but that's a different story and not really something I'm willing to explore.
So I think the question boils down to if the RTC, powered by the internal clock source, can hold a candle to a smartwatch without internet connection (or a CASIO dumb watch for that matter) in terms of accuracy.
2021-06-28 11:17 PM
What do you mean by "internal clock"?
LSI (and MSI/HSI) error you look up in the datasheet, but it's generally in ones of percent, i.e. about one second in a minute.
LSE with crystal can achieve around 10ppm, with *careful* design, that's roughly one second in a day. You can calibrate it to 1ppm, i.e. 1 second in 10 days, but it will drift with temperature.
JW
2021-06-29 02:37 AM
Hi JW, thank you for your reply as always.
I've looked up the specs, it's a whopping 5%, so the inaccuracy will be a matter of minutes after just one day.
We have lowered our expectation and stopped counting on it to provide a meaningful time reference.