cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F051K6 Does have a drift of 7 milli seconds per 1 hour running on HSE

ck.1
Associate III

Hi ,

We are seeing STM32F051K6 have a drift of 7 milli seconds per 1 hour running on HSE .

Time drift of 7milli seconds for 1 hours is 1.944 Parts Per Million ( 7000 micro seconds / 3,600,000,000 Micro seconds = 0.000,001,944 )

The OSCILLATOR has ± 10 PPM (parts per Million ) is there any higher accuracy oscillator recommandation from ST that has .01 PPM or lower .

Thanks ,

8 REPLIES 8
gbm
Lead II

Congrats, You are a lucky guy. BTW, it's not a STM32 drift, it's your quartz oscillator drift and it's surprisingly low. You may get better precision with Cesium atomic clock, or maybe (cheaper) temperature-compensated quartz generator.

Peter BENSCH
ST Employee

As @gbm​ mentioned, it is almost entirely a question of the clock source, in your case an oscillator or otherwise a crystal. Without considerable additional effort, such as the also mentioned TCXO, and without highly precise further references, you will not be able to make the accuracy of the RTC better than the deviation of this clock source, in your case 10ppm. With 1.9ppm, you are already very well on the target frequency.

As soon as you want to be more precise than your current reference, you have to resort to caesium or rubidium references, which are almost prohibitively expensive for normal users. An alternative could be the 1PPS output of GPS modules, which gives a highly accurate 1Hz signal when it sees satellites.

I would also like to draw your attention to the possibility of calibrating the RTC on the STM32, for which there is a function called smooth calibration, among other things, with which you can, however, increase the deviation of the oscillator frequency somewhat with a resolution of about ±0.95ppm. Details can be found in the respective reference manual under smooth calibration or e,g, in this thread.

Hope that helps?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AScha.3
Principal III

>We are seeing STM32F051K6 have a drift of 7 milli seconds per 1 hour running on HSE .

how you test this ?

tell me exact type of test equipment please.

If you feel a post has answered your question, please click "Accept as Solution".
AScha.3
Principal III

take this :

https://news.thomasnet.com/fullstory/new...b-40041199

frequency tolerance of 0.05 ppb

If you feel a post has answered your question, please click "Accept as Solution".

Our Custom Board is based on STM32F051K6 . We sync the time to the Micro Controller and keep comparing the time between the UBUNTU Realtime Clock from 2 different desktop PCs to the time of Microcontroller for about 10 hours and average the deviation in time . the deviation matches to the OSCILLATOR Specification .

Is there any Oscillator available that do not have so high drift of 10ppm and with temperature the drift is more than acceptable

AScha.3
Principal III

10..20ppm is best for crystal clock. when temp. is not too extreme, you can get very good precision with the trimming:

0693W00000Y98AwQAJ.png0693W00000Y97feQAB.pngthis is for setting some correction factor in RTC , but you need to do for every crystal .

If you feel a post has answered your question, please click "Accept as Solution".

Our test setup

There is this feature called NTP services in Ubuntu Linux . So the PC itself can sync every 45 seconds or so from the NTP server to keep its time precise .

on the testing of micro-controller side by accessing data and reading time from MCU (with oscillator connected) and compare this value to PC time and print the deviation or drift of time with respect to PC .

For those without wanting to spend $1000, $2000 or $3000 for atomic level solutions, there's perhaps OCXO or DOCXO.

Better 32-bit MCU have 32-bit counters and timers. You could quantify the time line of the HSE vs GPS/GNSS receiver 1-PPS signal, or Time Stamp using EVENT-IN / TIMEMARK / EXTINT type inputs on those receivers. I could get a very solid 8 MHz out of a u-Blox receiver (10 MHz would have too much jitter as it's not a sub-multiple of the core timing clock)

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