Showing results for 
Search instead for 
Did you mean: 

timer in BLE Throughput project example

Associate II


Just wondering in the throughput example provided in the BlueNRG-LP_LPS DK 1.3.0, why a timer is needed in the APP_Tick in throughput.c file. I also noticed in other examples such as SensorDemo project, there is also a timer set for the sensors. 

Can anyone explain why it requires setting a timer in these example application?




Lead II

Hello @Olive 

In the BlueNRG-LP_LPS DK 1.3.0 example, as well as in the SensorDemo project, the timer is likely used for timing and scheduling purposes. Timers are often used in embedded systems to execute specific tasks at regular intervals or after a certain amount of time has passed. 


For the throughput example, the timer in the `APP_Tick` function might be used to regularly check for incoming data or to trigger certain actions periodically, ensuring smooth operation of the application.


In the SensorDemo project, timers could be used to read sensor data at specific intervals, control sensor sampling rates, and manage the overall timing of data collection.


In general, timers are valuable in embedded systems to synchronize tasks, manage energy consumption, and maintain precise timing requirements. They help ensure that various tasks and operations occur at the desired frequencies and intervals.

To understand more the use of timer in the throughput.c, I suggest you to take a look on the UM2058.

Hope this help you. If your question is answered please mark this answer as best answer to be diffused.

Best regards


@Issamos What is the difference then between using a task and a timer? When is it better to use one over the other?

Hello @DS.4 

We use a timer when we want to do something after a calculated période but we use a task when we want to create an order of execution between the parts of the code. (Task 1 start of task 2 is finished and there is no interruptions for exemple).

Best regards.



Thanks for your explanation!


thanks @Olive . When your question is answered close the topic by choosing a best answer.

Best regards.