Difference between esp-idf timer and

ice.bob
Posts: 7
Joined: Thu Jan 30, 2020 10:31 pm

Difference between esp-idf timer and

Postby ice.bob » Thu Apr 09, 2020 9:45 am

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?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Difference between esp-idf timer and

Postby ESP_Sprite » Thu Apr 09, 2020 3:06 pm

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.

ice.bob
Posts: 7
Joined: Thu Jan 30, 2020 10:31 pm

Re: Difference between esp-idf timer and

Postby ice.bob » Thu Apr 09, 2020 3:29 pm

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 ?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Difference between esp-idf timer and

Postby ESP_Sprite » Fri Apr 10, 2020 7:37 am

Yes. Docs for it are here if you need it.

ice.bob
Posts: 7
Joined: Thu Jan 30, 2020 10:31 pm

Re: Difference between esp-idf timer and

Postby ice.bob » Fri Apr 10, 2020 8:24 am

Okay, according the the docs esp-timer is superior the FreeRTOS timers. I guess, I will use the esp-timer.

Who is online

Users browsing this forum: Bing [Bot] and 111 guests