Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RTC overflw handler

Hello ,
I am working on the development kit nrf52, i want to know how  i canget  the value of the RTC overflw and then how i can reset the RTC to zero.

thank you in advance
Best regards

  • 1) enable the overflow event and interrupt 

    nrf_drv_rtc_overflow_enable
    2)

    You forgot to clear the even in RTC2 ISR, but that cannot be the reason for the system not to go to deep sleep. Also move the printf to the start of the condition.

     if(NRF_RTC2->EVENTS_OVRFLW==1)
    {

    printf("overflw");

    NRF_RTC2->EVENTS_OVRFLW = 0;
    NRF_RTC2->TASKS_CLEAR = 1;
    sd_power_system_off();
    }

    This is very basic thing to work. Please look at the SDK examples to see how this things work

Related