How can we decrease the resolution of the timer to 500 ms in SDK 14? The minimum resolution I could get to was 1 ms by changing the APP_TIMER_CONFIG_RTC_FREQUENCY macro to 31.
Thanks
Atul
How can we decrease the resolution of the timer to 500 ms in SDK 14? The minimum resolution I could get to was 1 ms by changing the APP_TIMER_CONFIG_RTC_FREQUENCY macro to 31.
Thanks
Atul
The app_timer library sets the prescaler for you. Look at the rtc1_init(..) routine in app_timer.c
The APP_TIMER_CONFIG_RTC_FREQUENCY is the prescaler value for app_timer library.
static void rtc1_init(uint32_t prescaler) { NRF_RTC1->PRESCALER = prescaler; NVIC_SetPriority(RTC1_IRQn, RTC1_IRQ_PRI); }
This is called by app_timer_init(...)
ret_code_t app_timer_init(void) { ..... rtc1_init(APP_TIMER_CONFIG_RTC_FREQUENCY); .... }
Cool. Got it! But 500 ms resolution is impossible then? 125 ms is the minimum we could get?
Yes, I believe so. What is the reasoning for having a 500 ms resolution? Just curious!
Want to send the timestamp values in the advertisement packets and I don't want to have large timer values as the packet sizes are very small. About half a second resolution would have been pretty good. But, I guess I will try to work with 125 ms.