Event Groups and Timers

Hello,

For my FreeRTOS Application, I am Using Three Tasks, One Timer and using three Event Group bits for triggering the runnables in the tasks.

  1. When TICK Time is 10ms and Timer is made for 10ms and the three event group bits are set every 10ms, 50ms and 100ms inside the timer. Therefore I can see the Runnables executing every 10ms, 50ms and 100ms inside their tasks by using "xEventGroupwaitBits ". This is working Normally.

  2. When TICK Time is 5ms and Timer is made for 10ms and the three event group bits are set every 10ms, 50ms and 100ms. I can see that the “xEventGroupwaitBits” are not being able to read every 10ms, 50ms and 100ms. I can see a deviation like If “xEventGroupSetBits” is set for x times then “xEventGroupwaitBits” can be seen set for x/2 times. This gets even worse when I decrease the TICK Time even further to 2ms. This is Abnormal Operation

Kind Regards,
Sakti

Hi @SaktiPadhy,

Without seeing your code it sounds like you maybe specifying times in ms instead of ticks when passing them to your time functions is it possible you may need the pdMS_TO_TICKS() macro around your parameters?

Just a thought…

Kind Regards,

Pete

Are there other tasks or interrupts firing which might be hindering with the timing? Can you share code snippets?

Hello,
@pete-pjb Thank You for the suggestion. I am passing the parameters as TICKS using the pdMS_TO_TICKS() in the Timer Function. Thanks

@aggarg
Yes, I am testing with making 3 different tasks and also using Interrupts.
Here are snippets of my Code.
Left shows you the three Tasks executing Runnables triggered on “xEventGroupWaitBits”.
Right shows the TimerInit and also Timer Callback with Event Group bits set at every 10ms, 50ms and 100ms using “xEventGroupSetBits”.

Warm Regards