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

RTC timer is shiffting after connection/disconnetion

Dear Nordic Devloper Zone,

I am facing a problem with RTC timer.

Here is a scenario :

I have an IOS application which is able to set the current time on the nRF51822.

In the nRF51822 application, I am using a timer on RTC1 (32kHz) which is triggered every seconds to manage time.

In the RTC1 timer interrupt, my application sends a notification to the connected device (IOS app) with the current time (posix format). This time is compared with the IOS app time and the difference must be obviously equal to 0.

It is always true when the device is connected to the device. I have tested during 1 day (connected non-stop), and the difference between nRF51822 time sent to the IOS app and the real time (from iPhone) is always 0.

But, each time a connection/disconnection occurred, the my RTC timer take 0.5 second late : the posix time sent to the IOS app has several seconds late depending on the number of connection/disconnection that I have done.

The RTC interrupt cannot be called to late and miss a second because the next event is planned in the interrupt itself. Therefore, if it is occurred, the interrupt will never be called.

void RTC1_IRQHandler(void)
{
    NRF_RTC1->CC[3] += TICKS_1_SEC;	
    //Some code here ....
}

It is like the RTC1 timer is in "pause" during the BLE connection.

Could you tell me if the RTC timer is stopped during BLE connections?

Best regards

Related