How to dynamic change timer using app_timer ?

Hi, I'm developing an application using app_timer to send data to server.
Detail about my application

1. I get data from server the value of timer

2. dynamic change timer according to the value I have get 

So how can I dynamic change the timer (app_timer) ?

Parents Reply
  • Hi ovrebekk,
    Can I reinit this app timer many time ??
    I'm build an project that change dynamic timer in many times per 1 minute. And sometime seem nRF can not stop and start when I check debug terminal. I checked my code carfully I think the reason is at timer.
    And more, BLE not work stabel like I not use 2 timer before

    I'm using 2 app timer, and ble. Can you suggest for me some attentions when use app timer and change the period continously ?

Children
  • Hi 

    If you are experiencing issues caused by starting and stopping timers too often it could be because the APP_TIMER_CONFIG_OP_QUEUE_SIZE is too small. 

    Can you let me know what this parameter is set to? 
    You should find it in the sdk_config.h file. 

    Could you try to increase it to a larger value and see if it works better?

    Best regards
    Torbjørn

  • Hi ovrebekk, thanks so much for your supports

    Here is my timer setting in sd_config.h
    #define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10


    1. How much do I need to increase?
    2. What is the maximum period I can set if I using app_timer ? I set 6 minuter per update but seem nRF not work correctly. It work perfect if I set 30 second per update

  • Hi 

    John12 said:
    1. How much do I need to increase?

    I would try to double the value first and see if it makes a difference. If this doesn't help then probably the issue is caused by something else. 

    John12 said:
    2. What is the maximum period I can set if I using app_timer ? I set 6 minuter per update but seem nRF not work correctly. It work perfect if I set 30 second per update

    Could you try to increase the APP_TIMER_CONFIG_RTC_FREQUENCY parameter in sdk_config.h?

    Try to set it to 15 for instance, and you should be able to support 6 minute updates without any issues. 

    Best regards
    Torbjørn

Related