🌐
Medium
aliafshar.medium.com › esp-idf-tutorials-part-2-delay-75a6c29e05e4
ESP-IDF for Arduino Users, Tutorials Part 2: Delay | by Ali Afshar | Medium
January 6, 2021 - https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos.html · Delay doesn’t have to block like Arduino. Delay some milliseconds like this: vTaskDelay(pdMS_TO_TICKS(10)); Since vTaskDelay accepts ticks, the ...
🌐
ESP32 ESP-IDF
esp32tutorials.com › home › esp32 esp-idf freertos timer and delay using esp-idf
ESP32 ESP-IDF FreeRTOS Timer and Delay using ESP-IDF
August 15, 2022 - The output shows that the portTick_PERIOD_MS and portTICK_RATE_MS is predefined as 10 milliseconds. It is suitable for 100 MHz rate set in the processor. Next we will show you how to add delays using FreeRTOS.
🌐
ESP32 Forum
esp32.com › viewtopic.php
freeRTOS microsecond delay - ESP32 Forum
September 23, 2022 - uint64_t microseconds = esp_timer_get_time(); if (0 != number_of_microseconds) { while (((uint64_t) esp_timer_get_time() - microseconds) <= number_of_microseconds) { // Wait } } where number_of_microseconds is an uint64_t and it is your delay, in microseconds.
🌐
Espressif
docs.espressif.com › projects › esp-idf › en › v4.3 › esp32 › api-reference › system › freertos.html
FreeRTOS - ESP32 - — ESP-IDF Programming Guide v4.3 documentation
xTicksToWait: The maximum amount ... in the Blocked state. This is specified in kernel ticks, the macro pdMS_TO_TICSK( value_in_ms ) can be used to convert a time specified in milliseconds to a time specified in ticks....
🌐
GitHub
github.com › esp-rs › esp-idf-hal › blob › master › src › delay.rs
esp-idf-hal/src/delay.rs at master · esp-rs/esp-idf-hal
//! use esp_idf_hal::delay::Ets; //! //! Ets::delay_us(42); //! ``` //! //! Example of a millisecond delay: //! ``` //! use esp_idf_hal::delay::FreeRtos; //! //! FreeRtos::delay_ms(42); //! ``` //! //! Example of an [embedded_hal::delay::DelayNs] consumer with an ·
Author   esp-rs
🌐
ESP32 Forum
esp32.com › viewtopic.php
IDF documentation suggests microsecond delay - should be millisec - ESP32 Forum
December 8, 2018 - For example, when esp_wifi_start returns ESP_ERR_NO_MEM, the recoverable-error code vTaskDelay can be called, in order to get a microseconds’ delay for another try. Suggested change -- change "microseconds" to "milliseconds" because vTaskDelay is based on FreeRTOS time tic which is in multiple ...
🌐
GitHub
github.com › esp-rs › esp-idf-hal › issues › 62
`FreeRtos::delay_us` will block for less than the given time for fractional milliseconds · Issue #62 · esp-rs/esp-idf-hal
April 15, 2022 - embedded_hal states that delay_us: Pauses execution for at minimum us microseconds. Pause can be longer if the implementation requires it due to precision/timing issues. The following line always rounds down, resulting in a much shorter ...
Author   esp-rs
🌐
Esp32developer
esp32developer.com › programming-in-c-c › delays › delays
Delays – ESP32 Developer
We’ve also found instances where (10 / portTICK_PERIOD_MS) results in a delay of 100mS regardless of the value used! Even vTaskDelay(10) does it.
Find elsewhere
🌐
Espressif
docs.espressif.com › projects › esp-idf › en › stable › esp32s2 › api-reference › system › esp_timer.html
ESP Timer (High Resolution Timer) - ESP32-S2 - — ESP-IDF Programming Guide v6.0.1 documentation
Dispatches timer callbacks from a single high-priority ESP Timer task (esp_timer task (notified by ISR) > callback). Suitable for handling timer callbacks that are not time-critical. ... Dispatches timer callbacks directly from an interrupt handler (ISR > callback). Suitable for simple, low-latency timer callbacks which take a few microseconds to run. Ensures shorter delay between the event and the callback execution.
🌐
Espressif
docs.espressif.com › projects › esp-idf › en › stable › esp32 › api-reference › system › esp_timer.html
ESP Timer (High Resolution Timer) - ESP32 - — ESP-IDF Programming Guide v6.0.2 documentation
Dispatches timer callbacks from a single high-priority ESP Timer task (esp_timer task (notified by ISR) > callback). Suitable for handling timer callbacks that are not time-critical. ... Dispatches timer callbacks directly from an interrupt handler (ISR > callback). Suitable for simple, low-latency timer callbacks which take a few microseconds to run. Ensures shorter delay between the event and the callback execution.
🌐
ESP32 Forum
esp32.com › viewtopic.php
How to delay microsecond - ESP32 Forum
March 11, 2017 - kolban wrote:It might be that the function called "ets_delay_us(value)" is what you could use. Its proto type is defined in <rom/ets_sys.h>. I have done it by your support. Thank you so much. ... Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
🌐
TechOverflow
techoverflow.net › 2020 › 04 › 09 › esp-idf-equivalent-to-arduino-delay
ESP-IDF equivalent to Arduino delay() | TechOverflow
May 6, 2026 - This example delays by 500ms: ... You can use vTaskDelay() even if not using FreeRTOS tasks. For a full example, refer to PlatformIO ESP-IDF ESP32 blink example
🌐
ESP32 Forum
esp32.com › viewtopic.php
(solved) how to program sub-tick delays? - ESP32 Forum
#include "rom/ets_sys.h" void delay_milliseconds(uint64_t ms) { uint64_t us = ms * 1000; if (ms < 1000) { ets_delay_us(us); } else { vTaskDelay((ms) / portTICK_PERIOD_MS); } } Thanks, chegewara. Top · Post Reply · Print view · 3 posts • Page 1 of 1 · Return to “ESP-IDF” ·
🌐
ESP32 Forum
esp32.com › viewtopic.php
Wait microsecond - ESP32 Forum
Sat May 04, 2019 11:09 pm The arduino-esp32 core achieves this using the following code for the delayMicroseconds() func.
🌐
ESP32 Forum
esp32.com › viewtopic.php
Understanding the vTaskDelay help - ESP32 Forum
Sometimes it delays for exactly 2 seconds but sometimes it misses 10ms. 1. I have ensured that this is the only task with priority 1. There are other tasks running in the background but they have priority 2 or higher. 2. I have disabled all interrupts. ... If you're using the default settings ...
🌐
Espressif
docs.espressif.com › projects › esp-idf › en › v4.3 › esp32s2 › api-reference › system › esp_timer.html
High Resolution Timer - ESP32-S2 - — ESP-IDF Programming Guide v4.3 documentation
esp_timer is designed to achieve a high-resolution low latency timer and the ability to handle delayed events. If the timer is late then the callback will be called as soon as possible, it will not be lost.
🌐
ESP32 Forum
esp32.com › board index › english forum › discussion forum › esp-idf
[SOLVED] My function for microseconds delay doesn't work properly - ESP32 Forum
September 9, 2021 - The period time is more or less 7us, very far from 40us (it is 3us low and 3us high!!!!). That's not all! If I put delay_us(1000) the result doesn't change... What am I doing wrong? Last edited by filo_gr on Wed Sep 15, 2021 7:25 am, edited 1 time in total. ... https://github.com/espressif/arduino-es ... #L178-L192 https://github.com/espressif/esp-idf/bl ...
🌐
Reddit
reddit.com › r/esp32 › vtaskdelay with long wait times
r/esp32 on Reddit: vTaskDelay with long wait times
October 24, 2023 -

Hello,

I am working on a project in IDF with FreeRTOS. Among all the tasks, the project has one task that needs to run every day at midnight (00:00 UTC). To do this, I have an external RTC with which I calculate how many seconds are left until midnight (I have verified that the calculation is correct). From there, I convert it to milliseconds and calculate the number of ticks to wait using pdMS_TO_TICKS(), passing this tick number to vTaskDelay(). However, the task runs much earlier. Does anyone know why this might be? The Tick rate (Hz) is 1000.

On the other hand, I have verified that when I convert X milliseconds to ticks using pdMS_TO_TICKS() and then calculate how many milliseconds those ticks are with pdTICKS_TO_MS(), the milliseconds value does not match the initial one. Does anyone know why this might be? Here's an example:

43200 seconds to milliseconds: 43200000
43200 seconds to ticks: 250327 
43200000 milliseconds to ticks: 250327 
250327 ticks to milliseconds: 250327

Thank you very much in advance.

🌐
ESP32 Forum
esp32.com › viewtopic.php
esp_timer_get_time() and vTaskDelay() behaviour - ESP32 Forum
Precise timing is not a use case for the FreeRTOS timers. You can use hardware timers or the IDF's 'high resolution timer' to get more accuracy and less uncertainty. ... Mon Mar 04, 2024 4:27 pm As stated in my first post I'm using ESPRESSIF example on evaluating performance, the code I'm using ...