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

RTC counter is not running

I plan to use RTC for a simple counter. No need for interrupt nor event. I don't use SoftDevice. It's 52840.

I just need to set it to run, and periodically read the counter. No need to detect overflow, just need to let it wrap around.

Below is my simple initialization. To my surprise, whenever I read the counter value, it's always 0.

Any idea what I missed?

NRF_RTC1->TASKS_STOP  = 1;
delay_mS(0.1);
NRF_RTC1->TASKS_CLEAR = 1;
NRF_RTC1->PRESCALER   = 0;
   
NRF_RTC1->EVTEN = 0x000F0003;
NRF_RTC1->INTENCLR = 0;
NRF_RTC1->EVTENCLR = 0x000F0003;
 
NRF_RTC1->TASKS_START = 1;
delay_mS(0.1);

Thank you in advance.

Related