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

Queries on Application Timer functionality

Hello,

 

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flash the image. I am using ‘ble_app_blinky’.

 

I have gone through “Application Timer” tutorial.

https://devzone.nordicsemi.com/nordic/tutorials/b/software-development-kit/posts/application-timer-tutorial

 

I have few queries.

 

1) Using “Application Timer module” how many max timers / handlers can be executed at a time with APP_TIMER_MODE_REPEATED. At application level I need 5 timers. Since RTC1 has CC[0..3] whether I can use only 4 at a time.

  1. a) Whether APP_TIMER_CONFIG_OP_QUEUE_SIZE is for that purpose only ?

 

2) I want to sleep & wakeup periodically for every 30 minutes. For this I need to change PRESCALER. To my understanding there will be only one prescaler for entire timer module. So if I change, will there be any impact on existing timers and SoftDevice (Not sure whether SoftDevice uses Application Timer).

 

3) I want to stop LED after 10 blink automatically. In this case with some conditions whether can I call app_timer_stop() within same handler (repeated_timer_handler()).

        

static void repeated_timer_handler(void * p_context)
{

            :
            :

    err_code = app_timer_stop(m_repeated_timer_id);
    APP_ERROR_CHECK(err_code);
            
            :
}

 

 4) Whether handler will execute in Interrupt context. I want to read data over TWI and write data into Flash. Whether all there can be called within timer handler.

                            

static void repeated_timer_handler_1(void * p_context)
{
        :
        
        // Read sensor data.
        
        :
        :
        
        // Write data into Flash
        nrf_fstorage_write( ... );
        
        :
        :
}

 

Thanks & Regards

Vishnu Beema

Parents
  • 1) Using “Application Timer module” how many max timers / handlers can be executed at a time with APP_TIMER_MODE_REPEATED. At application level I need 5 timers. Since RTC1 has CC[0..3] whether I can use only 4 at a time.

     I am not sure what the maximum amount of timers are, and what the limiting factor is, but I tried adding 6 timers to an application and that worked fine. I don't think APP_TIMER_CONFIG_OP_QUEUE_SIZE is the limiting factor, since I set it to 1 and all the 6 timers still fires. I can look into it further if you would like a more precise answer.


    2) I want to sleep & wakeup periodically for every 30 minutes. For this I need to change PRESCALER. To my understanding there will be only one prescaler for entire timer module. So if I change, will there be any impact on existing timers and SoftDevice (Not sure whether SoftDevice uses Application Timer).

     The APP_TIMER_CONFIG_RTC_FREQUENCY (RTC prescaler) is not used by the Softdevice

     

    3) I want to stop LED after 10 blink automatically. In this case with some conditions whether can I call app_timer_stop() within same handler (repeated_timer_handler()).

     No problem, you can do this

     4) Whether handler will execute in Interrupt context. I want to read data over TWI and write data into Flash. Whether all there can be called within timer handler.

     This shouldn’t be a problem

    Best regards,

    Simon

  • Thank you for your inputs.

    Can you please cross check 4). When I call Flash operations inside handle, code getting hanged. 

    Also please let me know whether handlers will execute in Interrupt context.

Reply Children
Related