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

Decrease the timer resolution of SDK 14

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

Parents
  • Hi Atul,

    I believe this link will be helpful for you. Since you want a resolution of 500 ms, this is the same as 1/.5 s = 2 Hz. Therefore f_RTC = 2Hz.

    Solving for the equation gives you a prescaler value of:

    PRESCALER = round(32768 Hz/ 2 Hz) - 1 = 16383.

  • Hi Bjorn

    I knew it already that I have to change the PRESCALER to get the resolution I want. But, I am working with SDk 14.2 and I found that they have removed the PRESCALER argument from the APP_TIMER_TICKS function which was threre in SDK 13. The details can be found here

    Thus, I need to know the code or any command which will change the PRESCALER value. As far as I searched, I can only find that I need to change the APP_TIMER_CONFIG_RTC_FREQUENCY macro present in sdk_config.h file and that too it's maximum value was 31. If I change it to 16383, my device stops advertising. 

    Atul

Reply
  • Hi Bjorn

    I knew it already that I have to change the PRESCALER to get the resolution I want. But, I am working with SDk 14.2 and I found that they have removed the PRESCALER argument from the APP_TIMER_TICKS function which was threre in SDK 13. The details can be found here

    Thus, I need to know the code or any command which will change the PRESCALER value. As far as I searched, I can only find that I need to change the APP_TIMER_CONFIG_RTC_FREQUENCY macro present in sdk_config.h file and that too it's maximum value was 31. If I change it to 16383, my device stops advertising. 

    Atul

Children
No Data
Related