Page 1 of 1

Difference between esp-idf timer and

Posted: Thu Apr 09, 2020 9:45 am
by ice.bob
I am wondering what is the difference between the esp-idf timers (see example: https://github.com/espressif/esp-idf/tr ... imer_group) and the FreeRTOS timer (see here: https://www.freertos.org/FreeRTOS-timer ... reate.html). What are the dis-/advantages? When should I use what timer?

Re: Difference between esp-idf timer and

Posted: Thu Apr 09, 2020 3:06 pm
by ESP_Sprite
A timer group (what you describe as 'esp-idf timer') is a hardware thing; the code you're pointing at is a driver for it. Hardware timers generate interrupts and have near infinite precision (well, 1/80MHz), but you only have a limited amount of them. The FreeRTOS timer is a software construct, which is only precise to about one FreeRTOS tick time (max 1/1000 sec, depending on your configuration) but you can have infinite of them. For a go-between, look at esp-timer.

Re: Difference between esp-idf timer and

Posted: Thu Apr 09, 2020 3:29 pm
by ice.bob
Thank you for clarification. One last questions: Qhat du you mean by "esp-timer"? Probably this: https://github.com/espressif/esp-idf/bl ... ple_main.c ?

Re: Difference between esp-idf timer and

Posted: Fri Apr 10, 2020 7:37 am
by ESP_Sprite
Yes. Docs for it are here if you need it.

Re: Difference between esp-idf timer and

Posted: Fri Apr 10, 2020 8:24 am
by ice.bob
Okay, according the the docs esp-timer is superior the FreeRTOS timers. I guess, I will use the esp-timer.