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

Make the RTC count every 1 ms

Hi everybody! I am here again bothering you with probably silly questions. I have, on my smart beacon kit, an application that uses an ADC and then sends the converted value; i want it convert at 1 kHz, that is to say make the RTC i am currently using count every ms. The problem is that if i put:

APP_TIMER_TICKS(1,0)

as wrote in the example code from which i started, it seems not to respond correctly (i lose samples and at some point it doesn't even sends samples anymore) while from 2 ms and upper, there is no problem. It seems that it has really a problem with 1 ms. I first thought that it could not reach the minimum of 5 ticks required; if i understood correctly, the RTC uses the 32.768 kHz oscillator, so every tick with 0 prescaler should be around 30.5 microseconds and the minimum of 5 ticks should be largely respected! I am a bit confused, can you help me fix this?

main.c

Parents Reply Children
No Data
Related