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

RTC not accurate

hi support team,

i have ESB project for customer, and now i have one fundamental question about RTC cc compare event, i am struggled in this problem.

static __INLINE void radio_rtc_compare0_set(uint32_t value)

{

    RADIO_RTC->CC[0] = value -1;

}

I set the value as 16, so the frequent would be 16/32768 == 488us, and it is true, most case, the event happens in about 488us,

But sometime it would be 520us(just power down and power up the device), I could not figure out the reason for this.  

The consequence for this is that, the frequent for the VR gaming handles would not correct (1/2*520 ==960 HZ). 

After the device reset, the frequent changed, so it is not correct. It happens 20% of the chance after resetting.

The debug pin singal is simple "nrf_gpio_pin_toggle(DATA_SENDING_P1)"  from RADIO_RTC_IRQHandler(void)

any idea or suggestion on this? it would be very helpful.

Thanks in advance!

Regards,

William.

Parents
    • Which clock source are you using for the LFCLK? LFRC or LFXO
    • xtal 32K;
    • If using LFRC, do you calibrate the LFCLK after powerup and at regular intervals?
    • Is there any other peripherals running at higher priority that could delay the handling of the RTC event? To get exact timing without being affected by other higher priority peripherals, you can connect the COMPARE event from the RTC to a toggle a GPIO using GPIOTE through PPI. 
    • directly interrupt handler
    • void RADIO_RTC_IRQHandler(void)
      {
      if (RADIO_RTC->EVENTS_COMPARE[0] == 1)
      {
      RADIO_RTC->EVENTS_COMPARE[0] =0; //clear rtc compare event
      }
      nrf_gpio_pin_toggle(DATA_SENDING_P1);
      if(on_radio_rtc_interrupt)
      on_radio_rtc_interrupt();
      }
    • Is the delay in RTC event handling consistent for every event, or does it differ after powerup?
    • no delay in the handler as upper code,sometimes it is correct, sometimes it is not correct, looks like there is one tick delay(randomly) after device resetting.
    • Are you seeing this on multiple devices, or just one device?
    • multi DK boards, i believe it is common phenomenon;

    Regards,

    William.

Reply
    • Which clock source are you using for the LFCLK? LFRC or LFXO
    • xtal 32K;
    • If using LFRC, do you calibrate the LFCLK after powerup and at regular intervals?
    • Is there any other peripherals running at higher priority that could delay the handling of the RTC event? To get exact timing without being affected by other higher priority peripherals, you can connect the COMPARE event from the RTC to a toggle a GPIO using GPIOTE through PPI. 
    • directly interrupt handler
    • void RADIO_RTC_IRQHandler(void)
      {
      if (RADIO_RTC->EVENTS_COMPARE[0] == 1)
      {
      RADIO_RTC->EVENTS_COMPARE[0] =0; //clear rtc compare event
      }
      nrf_gpio_pin_toggle(DATA_SENDING_P1);
      if(on_radio_rtc_interrupt)
      on_radio_rtc_interrupt();
      }
    • Is the delay in RTC event handling consistent for every event, or does it differ after powerup?
    • no delay in the handler as upper code,sometimes it is correct, sometimes it is not correct, looks like there is one tick delay(randomly) after device resetting.
    • Are you seeing this on multiple devices, or just one device?
    • multi DK boards, i believe it is common phenomenon;

    Regards,

    William.

Children
No Data
Related