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

sdk 13 app_timer 24 hour long timer

Hi,

there were some significant changes to app_timer in sdk13.

I cannot use now the PRESCALER e.g. to 255 in order to configure the clock in such way to be able to tirgger event every eg. 24 hours.

So how should I do this now?

Any idea? Much appreciate your help/

Best wishes, Jacek

Parents
  • Hi Joakim,

    Yes I did. But in In sdk_config.h there is no PRESCALER = 256 in order to have 128 Hz freq. So I did declare an addition entry there like below.

    #if APP_TIMER_ENABLED // APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler.

    // <0=> 32768 Hz // <1=> 16384 Hz // <3=> 8192 Hz // <7=> 4096 Hz // <15=> 2048 Hz // <31=> 1024 Hz // <255=> 128 Hz

    It will give me:

    fRTC [kHz] = 32.768/(255+1) = 128

    and the timer will wrap around every (2^24) * 1/128 Hz = 131 072 s -> what gives me just over 36h of wrap around.

    Is that the right apporach?

    Best wishes, Jacek

Reply
  • Hi Joakim,

    Yes I did. But in In sdk_config.h there is no PRESCALER = 256 in order to have 128 Hz freq. So I did declare an addition entry there like below.

    #if APP_TIMER_ENABLED // APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler.

    // <0=> 32768 Hz // <1=> 16384 Hz // <3=> 8192 Hz // <7=> 4096 Hz // <15=> 2048 Hz // <31=> 1024 Hz // <255=> 128 Hz

    It will give me:

    fRTC [kHz] = 32.768/(255+1) = 128

    and the timer will wrap around every (2^24) * 1/128 Hz = 131 072 s -> what gives me just over 36h of wrap around.

    Is that the right apporach?

    Best wishes, Jacek

Children
No Data
Related