# Timing Problem when using Event Groups and Timers

**URL:** <https://forums.freertos.org/t/timing-problem-when-using-event-groups-and-timers/15296>\
**Category:** Kernel\
**Created:** [June 21, 2022, 7:25am UTC](https://forums.freertos.org/t/timing-problem-when-using-event-groups-and-timers/15296 "2022-06-21T07:25:38Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![SaktiPadhy](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@SaktiPadhy](https://forums.freertos.org/u/SaktiPadhy)\
**Post date:** [June 28, 2022, 9:37am UTC](https://forums.freertos.org/t/timing-problem-when-using-event-groups-and-timers/15296/24 "2022-06-28T09:37:37Z")

</div>

Hello @aggarg

I think I found the Issue. Please let me know if this is correct.

**Old Code - Not Working**

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/d/dcc51933645175dc49e882c71ae607db3aedd161.png)

**Updated Code - Working**  
 → update has been highlighted.

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/8/89c54b48f310647397d4af18995d973492f16ac7.png)

→ In the Older Code, I think the problem was when 50ms Task Event Group bit was read then It will clear the 20ms Task Event Group bit as well. Therefore, this will cause the 20ms Task to drop.  
 → In the new code, I am not clearing the Event Group bits on reading but doing it manually as can be seen in the code.

Please let me know if my understanding is correct. Thanks

---

_[View the full topic](https://forums.freertos.org/t/timing-problem-when-using-event-groups-and-timers/15296)._
