Hi, I’m trying to create a task that runs periodically every 50 µs.
Due to some design constraints, I need to perform the work inside a task, not in the ISR.
After doing some research, I’ve found two possible approaches
- Increase configTICK_RATE_HZ to 20,000 (50 µs) and use vTaskDelayUntil() to block the task with a 50 µs period.
- Keep configTICK_RATE_HZ at 1000 (1 ms) and instead use a hardware timer that triggers every 50 µs. In the timer ISR, I call vTaskNotifyGiveFromISR() to unblock the task.
I understand increasing configTICK_RATE_HZ will result in more context switch
But in other hand, hardware timer + vTaskNotifyGiveFromISR() also cause context switch
My question is:
Do both methods result in same overhead and CPU load?
I’m trying to confirm the method has fewer drawback and less impact on the system
Many thanks for any leads and help!