This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

timer drift

Hey guys,

I followed this guide and successfully synchronized the timers from two devices(nRF52 DK). But if I let these two synchronized devices keep running all the time, I guess sooner or later they will be non-synchronized again.

I want to estimate how much time the timer drift after a certain time.

In the guide, the NRF_TIMER2 was the target timer to be synchronized. What I thought is this timer is based on (I am not sure about that) the 64 MHz crystal oscillator (HFXO), and I saw the information on infocenter, the 64 MHz crystal oscillator's ppm is +-60. So I did such calculation, for one month, the time drift could be:
(1/64,000,000-1/(64,000,000*(1+0.000,06 ))60seconds60minutes24hours30days = 2.43 * 10^(-6)
Am I right? What else can affect the timer drift? Could somebody give me some hints?

Many thanks.

  • What boards are you using. Are your crystals guaranteed to be that accuracy ?

  • nRF52 DK. I just saw the crystal's ppm on info center(I repaired the link), I am not sure it is guaranteed or not.

  • Hi,

    Here is an online-calculator you can use to calculate the drift. The formula is: Time Drift in Seconds/Day = ( [ Accuracy in PPM ] / 1 Million ) * ( # Seconds Per Day )

  • OK, I got it, thanks! But may I ask that if the NRF_TIMER2 is based on the 64 MHz crystal oscillator or not? In the guide, ''sd_clock_hfclk_request()'' is called, but I am not sure it's internal or external. Also, I found out in the infoceter, ''32.768 kHz synthesized from HFCLK (LFSYNT)'' has the lowest ppm which is 8, so that means by using this one I will get the smallest time drift,right?

  • The NRF_TIMER2 is based on the HFCLK (16 MHz/ PCLK16M) and have a 62.5 ns resolution. The HFCLK is based on the 64 MHz crystal oscillator (HFXO), which is controlled by the 32 MHz external crystal. See the drawing here.

    The 8ppm is the additional HFLCK Frequency tolerance needed when using synthesized clock (not recommended). The HFXO Frequency tolerance is 60ppm, this means that you need a 32 MHz external crystal with at least 60ppm for the radio peripheral to work. On the nRF52-DK the 32 MHz external crystal is 10ppm.

Related