cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Reference Clock (50Hz) worsens the LSE accuracy

Manuel Corrales
Associate II

As indicated by an4759, I am trying to use the 50Hz mains reference to improve the RTC accuracy of an STM32F413ZH.

However, the results I get are much worse than without using the reference:

LSE only: 0.6s/day

LSE+50Hz: 7.5s/day 

(test duration 4 days)

According to an4759, with the reference, you should get an accuracy of about 0.6s/month.

To perform the tests I have started a project activating the reference in CUBEMX, without any calibration.

0693W00000JPqz8QAD.pngI have obtained the 50Hz signal with an optocoupled circuit, and I have introduced this signal by GPIO PB15 of the NUCLEO-413ZH.

0693W00000JPr5FQAT.jpgTheoretically, the reference is working, the question is that it advances the time much faster than without the reference. Here you can also see the measurement of the 1Hz calibration signal measured with a "Frequency Counter".

0693W00000JPr8JQAT.jpg0693W00000JPr8sQAD.jpgIt can be seen how the reference mechanism is acting trying to adjust the 1Hz signal, but the average obtained and therefore the time delay, worsen.

What can I be doing wrong?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

The mains grid frequency fluctuates, based on varying load and changes in supply; this is even more pronounced these days since the indiscriminate spread of the unregulatable pseudo-green power sources.

Here is an example "grid time" deviation graph for the mutually interlocked European grid (source: https://gridradar.net/en/net-time :(

0693W00000JPsdcQAD.pngso, for example if you would start your measurement at around 11.Feb and finished 14.Feb, with perfect locking to the european grid you'd see a >20 sec deviation.

JW

View solution in original post

6 REPLIES 6
Peter BENSCH
ST Employee

Welcome, @Manuel Corrales​, to the community!

AN4759 also states in section 2.7: "The reference clock (50 Hz or 60 Hz) must have a higher precision than the 32.768 kHz LSE clock."

Did you verify the 50Hz signal for its precision?

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.
Manuel Corrales
Associate II

I do not understand exactly what you are referring to precisely in this case. Because the same section you can also read the following:

"The reference clock may have a large local deviation (e.g. in the 500 ppm range), but in the long term it should be much more accurate than 32 kHz quartz".

Thanks!

Correct.

And is the long-term accuracy of the 50Hz signal much more accurate than that of the LSE?

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.

The mains grid frequency fluctuates, based on varying load and changes in supply; this is even more pronounced these days since the indiscriminate spread of the unregulatable pseudo-green power sources.

Here is an example "grid time" deviation graph for the mutually interlocked European grid (source: https://gridradar.net/en/net-time :(

0693W00000JPsdcQAD.pngso, for example if you would start your measurement at around 11.Feb and finished 14.Feb, with perfect locking to the european grid you'd see a >20 sec deviation.

JW

Manuel Corrales
Associate II

Perfect, now I understand everything.

I was really hoping that the network would be less fluctuating or at least more balanced in the short term, but I see that it is not.

I see that using this reference is for the very long term and that there may be days when you end up with many seconds of difference that you will recover several days later, or not.

Thank you!

Best regards!

That's an extremely good summary:

> end up with many seconds of difference that you will recover several days later, or not

For this reason, there are now other ways to synchronise an RTC: NTP time servers, time transmitters such as WWV, JJY or DCF77, the 1PPS signal from a GPS receiver, etc.

When your question is answered, please mark this topic as answered by choosing Select as Best for the preferred answer. This will help other users find that answer faster.

/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.