Hi ,
What we want is a accurate ms.
below is what we do
1. Set the prescaler
config.prescaler = 31;
2.When I need the Elapsed ms,
First ,I get the elapsed rtc counter by nrf_drv_rtc_counter_get(&m_rtc)
And ,the elapsed ms =elapsed rtc *1000/1024.
3.I test it like this:
1). I set a REPEATED apptimer by value 10 000(10 s)
2)And I get the ms in the apptimer event,
It work well , I get 10000ms !
test_timer=76386
test_timer=86386
... ...
3)But when I add some code (include some other apptimer、interrupt....)
test_timer=126386
(add code .................)
test_timer=136375
the Elapsed ms is 136375-126386=9989,
3.My question
1)why the Elapsed ms (Elapsed rtc counter )become smaller?
2)How can I get a Elapsed ms?
3)I donot know wether the apptimer or rtc counter is wrong or both?
thanks and regards!