2020-09-20 04:00 PM
Hello Everyone, I am using the STM32F777 and utilizing its RTC and external 32.768 crystal(LSE).
Currently I am having a drift of 79s in 76 hours. it is a little bit less than a second per hour. It is not that bad but I would like to have a better result like 10h of drift in a year would be okay. And now I have ~150h per year.
I am currently using a Crystal with tolerance of 20ppm. they say that is 20s of error per 12days. But I am not sure about this calculation, anyone knows how to calculate that?
Do you guys think it is achievable? How do I calibrate this CLK? I didn't any sample code or CubeIDE ready calibration method.
Please any help would be very much appreciate.
Cheers,
MM
2020-09-20 04:10 PM
20ppm (20/1000000) is a ratio, so the error over 12 days is going to be 12 days * (20/1000000) = 20.7sec. Just math.
Calibration is done in HAL_RTCEx_SetSmoothCalib. Doesn't seem like it's used in the Cube examples, but the documentation looks pretty simple.