This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RTC accuracy calculation for Tick event

Hi, Nordic team!

I want use RTC with Prescaler 32765 for generating Tick event with 1s interval.
Could you help with calculation of jitter for Tick event in microseconds. I will use external XTAL and PPI for triggering of other Timer.

Also, could you explain about "TASK and EVENT jitter/delay". Does it affect Tick event, routed through PPI?

Parents
  • Hi Vladislav, 

    The "TASK and EVENT jitter/delay" is the un-synchronize  between the LFCLK which the RTC run on and the HFCLK in which the CPU and the bus running on. 
    So as it's explained in the specification, you may have a delay/jitter from the time you trigger the START task until you receive the first COUNTER/TICK event. But this wouldn't affect the distance between the TICK events. 
    The accuracy of the 1s interval is affected by the accuracy of the clock source for the LFCLK. If you are using the internal RC the tolerance can be ±250 ppm

  • Ok, thanks. I understand.
    I notice, that maximum value for Prescaler is 4095. So, Tick event will have interval 125 ms.
    For example, XTAL have ±20ppm. Does it mean, that 125 ms Tick event may have jitter ±2.5 us?

  • Hi Vladislav, 

    Yes you are right. The maximum value for the Prescaler is 4096. And if you have the XTAL with 20ppm tolerance you will have ±2.5 us jitter on each TICK event. So it will accumulate and you will have a larger drift over time if you are syncing it to other devices. 

  • Ok, thanks.
    Could you confirm, that it is no delay/additional jitter between Tasks and Events routed through PPI as inside RTC(EVENTS_COMPARE[0] -> TASKS_CLEAR) and outside (RTC.EVENTS_COMPARE[0] -> Timer.Start)?
    And one more question, please:
    For example, 32MHz XTAL have also ±20ppm. It is running Timer for 16MHz clock with no divider. How can I calculate jitter for signal, that is generated by this timer? In other words, how internal PLL influence to resulting jitter.

  • Hi Valdislav, 

    Could you give some more information on the application ? You haven't mentioned about a TIMER that you use except for the RTC. 
    The PPI is synced up with the HFCLK so it doesn't have the jitter that caused from the LFCLK as in the TASK_START until the first COUNTER event. 

  • I need a some trigger signal generation with fps 120. But it should be integer number of frames in one second. It is allowed to have a some little dead time between frames.
    For generation this signal I will use a timer running at 16MHz.
    16000000 / 120 = 133333.333
    If I use a timer with fixed period(133333), it generates -2.5us offset per every second. So, I want to sync a timer every second with help of RTC.(Timer should be inactive after 120 frames for ~2.5us).
    Also, I have another variant with not fixed timer period(2 frame with period value = 133333 and 1 frame with 133334) it gives no offset.
    So, what about jitter with Timer clock(running at 16 MHz)?

  • Hi Vladislav, 

    Please correct me if I'm wrong. 

    So you will run a TIMER with PRESCALLER = 1, frequency = 16MHz. 

    And you will trigger a COMPARE event when it reach 133333 ? Correct ? 

    In this case I think the solution of doing 2 frame with period 133333 and one frame 133334 is a better idea than using the RTC to sync them. You will have the same tolerance +-20ppm. And it will be less complex. 

    The PPI system working based on the 16MHz oscillator. So it will be sync up with the TIMER. You can find this in the documentation: 

    On each PPI channel, the signals are synchronized to the 16 MHz clock, to avoid any internal violation of setup and hold timings. As a consequence, events that are synchronous to the 16 MHz clock will be delayed by one clock period, while other asynchronous events will be delayed by up to one 16 MHz clock period.

    It will be delayed by 1 clock cycle, but it will happen on each timer event, so in relatively this means there is no jitter/delay between the timer events.

Reply
  • Hi Vladislav, 

    Please correct me if I'm wrong. 

    So you will run a TIMER with PRESCALLER = 1, frequency = 16MHz. 

    And you will trigger a COMPARE event when it reach 133333 ? Correct ? 

    In this case I think the solution of doing 2 frame with period 133333 and one frame 133334 is a better idea than using the RTC to sync them. You will have the same tolerance +-20ppm. And it will be less complex. 

    The PPI system working based on the 16MHz oscillator. So it will be sync up with the TIMER. You can find this in the documentation: 

    On each PPI channel, the signals are synchronized to the 16 MHz clock, to avoid any internal violation of setup and hold timings. As a consequence, events that are synchronous to the 16 MHz clock will be delayed by one clock period, while other asynchronous events will be delayed by up to one 16 MHz clock period.

    It will be delayed by 1 clock cycle, but it will happen on each timer event, so in relatively this means there is no jitter/delay between the timer events.

Children
No Data
Related