I read somewhere about 100 ticks per second but the whole esp-idf document is over 1600 pages long. In that case task for HTTP / HTTPS request will wait for datas almost 50 days. Hello, I am trying to provide delay between the RGB colors of an led. {"payload":{"allShortcutsEnabled":false,"fileTree":{"components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos":{"items":[{"name":"portmacro. The API is slightly different than that for the ESP32. Post by filo_gr » Thu Sep 09, 2021 6:57 am . I dont get any delay even if I add some different delays. The exact hardware timer implementation used will depend on the target, where LAC timer is used for ESP32. The write phase. Joined: Wed Aug 29, 2018 3:17 pm. Till Now, we have used ets_delay_us FreeRTOS API to get microseconds delay but that is not recommend to use. These ESP32 Hardware Timers, using Interrupt, still work even if other functions are blocking. Sometimes it delays for exactly 2 seconds but sometimes it misses 10ms. For example, some device drivers require a delay implementation, and might use it to sleep anywhere from a few dozen microseconds to a few hundred milliseconds. Hello, I am trying to provide delay between the RGB colors of an led. But there is problem with only microseconds return value by esp_timer. ESP-IDF ESP-BOX ESP-ADF ESP-MDF ESP-WHO ESP-SkaiNet ESP32 Arduino IDEs for ESP-IDF ESP-AT ESP IoT Solution ESP. Optimizing execution speed is a key element of software performance. Force hold signal is enabled before going into deep sleep for pins which are used for EXT1 wakeup. , reducing overall power consumption. The exact hardware timer implementation used depends on the target, where LAC timer is used for ESP32. 4. py monitor target uses the esp-idf-monitor tool to display serial output from Espressif SoCs. It is number of milliseconds from start of CPU. Joined: Wed Jul 28, 2021 12:25 pm Location: Italy [SOLVED] My function for microseconds delay doesn't work properly. The following line always rounds down, resulting in a much shorter delay: The delay has to be configurable to sub microsecond resolution. Board index English Forum Discussion Forum ESP-IDF; IDF documentation suggests microsecond delay - should be millisec. It is also possible to use the standard Unix gettimeofday () and utime () functions, although the overhead is slightly higher. For the ESP-IDF board, we have chosen the custom board option. In vTaskDelayUntil you say the time at which you want to be woken. void esp_rom_delay_us (uint32_t us) Pauses execution for us microseconds. While I would love the function to return quickly, having a more constant return time would probably be just as beneficial. 3. To delete the timer when it is no longer needed, call esp_timer_delete (). Please note that ESP AP and ESP-NOW share the same encryption hardware keys, so the max_connection parameter will be affected by the :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`. You can find the API for that feature here. On ESP32, micros() takes about 150 cycles. ESP_Sprite, to me, "the company gang" is a term of respect. Inter-Processor Call (IPC) Interrupt Allocation. Release v5. 0, the functionality is not limited to the “main” SPI. 3. The spi_flash component contains API functions related to reading, writing, erasing, memory mapping for data in the external flash. The actual time that the task remains blocked depends on the tick rate. I am trying the run stepper motor with the tmc2208 driver and ı want to delay in microseconds like 5uS or 10 uS. The two hardware timers are: RTC timer: This timer allows time keeping in various sleep modes, and can also persist time keeping across any resets (with the exception of power-on resets. void esp_rom_delay_us (uint32_t us) ¶ Pauses execution for us microseconds. lets call it C hz. I don't want to use the vTaskDelay () since it effects also other part of. This depends on the setting of divider, that will be used as divisor of the incoming 80 MHz APB_CLK clock. If a wakeup source is not configured already then the board remains in deep sleep mode until the external Reset button is pressed. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE. The esp products use the standard POSIX time library functions. ducalex commented Jul 19,. This is the second part of a series of ESP-IDF tutorials that I will complete as I learn stuff. 3, 11. On a congested wireless channel (meaning lots of other devices broadcasting) you'd routinely see 100+ ms latencies as your devices have to wait for a free radio slot. I guess the system timer runs with a resolution of 1 ms. In deep sleep mode, CPUs, most of the RAM, and all the. We have named our project ‘ESP32_GPIO_INTERRUPT. Code: Select all. High Resolution Timer (ESP Timer) Internal and Unstable APIs. This will take about 30 microseconds to execute: int samp = adc1_get_raw((adc1_channel_t)channel2);. The application task (code) generally calls Wi-Fi driver APIs to initialize Wi-Fi and handles Wi-Fi events when. So your clock processor clock should be > 1 MHZ. std::this_thread::sleep_for(std::chrono::microseconds(1000)); works, but any delay below 1000 us results in the same behavior as the yield call. It is same as millis() from view of usage. 9 posts. The LSBs of the 64-bit system tick count will be padded with 0 if the system does not support microsecond resolution. delay does not block on esp32!I am trying the run stepper motor with the tmc2208 driver and ı want to delay in microseconds like 5uS or 10 uS. The ESP32 can go into deep sleep mode, and then wake up at predefined periods of time. 13 us. However, this crashes my ESP32 every time. Github repository with HTTPS connectivity sensor node under ESP-IDF framework:. It allows to set this: 1, 2 or 3 level (by default 1). According to the documentation esp_sleep_enable_timer_wakeup accepts a uint64_t type for its requested duration parameter. Hello community, I made a. I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there. この部分もESP-IDF側のAPIに切り替えるため、vTaskDelay ()関数を使ったのだが. StefanRvO Posts: 16 Joined: Sun Mar 06, 2016 9:25 pm. source ·. The source files attached to this release will not work due to our use of git submodules. ↩1- It's not Arduino related. Then return. Obtaining v5. I've spotted the delay ets_delay_us(50) in the led_strip_flush function introduced in 4642ea3. Post by filo_gr » Thu Sep 09, 2021 6:57 am . Post by ESP_Sprite » Sun Feb 12, 2023 2:24 pm I honestly don't quite know if the Arduino SDK has any support for this (don't know that SDK that well), but ESP-IDF does; on the ESP32, you use the I2S peripheral to DMA data from the ADC. I am trying the run stepper motor with the tmc2208 driver and ı want to delay in microseconds like 5uS or 10 uS. Step 4: Connect the potentiometer to the ESP32. I have some code running as a FreeRTOS task on my ESP32. There are a few tasks with priorities higher than that of esp_timer (like WiFi task), so while those tasks are running, esp_timer will not dispatch callbacks. Code that executes faster can also have other positive effects, e. There are a thousand microseconds in a millisecond and a million microseconds in a second. esp_err_t esp_timer_stop (esp_timer_handle_t timer) ¶ Stop the timer. I dont get any delay even if I add some different delays. Code that executes faster can also have other positive effects, e. Whenever i compile the code for the esp32, the compiler generated the following error:ESP32-S3 GPIO interrupt latency is too high. Parameters. 5% of the province. esp_timer set of APIs provides one-shot and periodic timers, microsecond time resolution, and 64-bit range. How can I add delay in microseconds? Also it seems that core 1 task is executed rarely. Inkplate esp-idf. Will memory leak occur when ESP32 TCP repeatedly closes and rebuilds socket (IDF 3. 9 posts. 13 posts 1; 2; Next; Ritesh Posts: 1327 Joined: Tue Sep 06, 2016 9:37 am. Top. The interrupt is triggered with the rising and falling edge and store the start & endtime with the funktion micros() in two diffrent variables. 4, 10 MHz and lower are available. To create a timer, call esp_timer_create (). I encountered the following problem when using it: if I use a value such as delay_us(20), it doesn't work! Driving a pin (from high to low and vice. There are two units available on-board of ESP32 and enumerated in mcpwm_unit_t. So I measured delay between input signal (on the pin 4) and ISR processing point (pin 18) by an oscilloscope and I see the delay between an input event and output event is 4 microseconds!!!! It's unbelivieble too long!!!Get time in uS since powerup int64_t esp_timer_get_time() esp_timer_get_time() returns 64-bit time since startup, in microseconds. Each group has two general-purpose hardware timers. unless delay actually calls vTaskDelay on esp32, which it does. When ı create a task using xTaskCreate() function and adding some delay in the task function. h library that controls SPI peripherals of ESP32 when they act as a masters. Correct, the default esp-idf settings. The ESP32, on the other hand, is built on the esp-idf. I would like to toggle an output pin in the order of microseconds so use the function delayMicroseconds. Tested making a call and saving values. They are all 64-bit (54-bit for ESP32-C3) generic timers based on 16-bit pre-scalers and 64-bit (54-bit for ESP32-C3) up / down counters which are capable of being auto-reloaded. This function can be used by periodic tasks to ensure a constant execution frequency. For that, you can use the following function: esp_sleep_get_ext1_wakeup_status() This function returns a number of base 2, with the GPIO number as an exponent: 2^ (GPIO). TimTapMan August 2, 2022, 7:42pm 1. 1 (also occurs on master as. In this ESP32 PWM tutorial with ESP-IDF, we will learn how to generate PWM or pulse width modulation module with ESP32 using ESP-IDF. As we saw by the coding. Till Now, we have used ets_delay_us FreeRTOS API to get microseconds delay but that is not recommend to use. Currently, ESP32 Wi-Fi supports the Modem-sleep mode which refers to the legacy power-saving mode in the IEEE 802. (adc1_channel_t)channel2); } It goes without saying that this a workaround. Delay a task for a given number of ticks. The second ISR would be connected to the Timer. Thus, all ESP-IDF applications and many ESP-IDF components are written based on FreeRTOS. Parameters. 2. This discussion on sub-microsecond ESP timing seems well worth reading FYI. In particular the following timer’s parameters may be set: Divider: How quickly the timer’s counter is “ticking”. If I take 64 readings with a 1ms interval for stability that's 64 milliseconds. Engineering Climate Datasets. Timer callbacks can be dispatched by two methods: As you can see from the logs, the time keeps deviating. This feature is specially useful if you are running projects that require time stamping or daily tasks, while maintaining low power consumption. It is located at mid-low elevations in the southern Rocky Mountain Trench to the east, on the southern portion of. In this tutorial we are going to learn how to configure the system time on the ESP32 and how to obtain the current time, using the Arduino core. Inter-Processor Call (IPC) Interrupt Allocation. Board index English Forum Discussion Forum ESP-IDF; Need API support to provide micro seconds delay. Points (x) show quantiles associated with (from bottom to. management agency) on updating IDF curves and incorporating climate change into IDF curves • Early work with Insurance Bureau of Canada (Canadian P&C insurance. ESP-IDF v5. In ESP-IDF you will use esp_timer_get_time() function. [ −] pub struct Ets; Espressif built-in delay provider for small delays. 9 posts. There are the following two time sources: RTC timer: Allows keeping the system time during any resets and sleep modes, only the power-up reset leads to resetting the. many colors. This is the documentation for Espressif IoT Development Framework ( esp-idf ). When ı create a task using xTaskCreate() function and adding some delay in the task function. To delete the timer when it is no longer needed, call esp_timer_delete (). This function stops the timer previously started using. 9 posts. Actually, we have connected one module over UART with ESP32 chip in our product. To start the timer in one-shot mode, call esp_timer_start_once (), passing. Click ‘Choose Template’ button to proceed forward. For 2 sensors thats ~ 128 milliseconds. Post by jhinkle » Sat Dec 08, 2018 5:00 pm . Board index English Forum Discussion Forum ESP-IDF; Need API support to provide micro seconds delay. The ESP8266EX microcontroller integrates a Tensilica L106 32-bit RISC processor, which achieves extra-low power consumption and reaches a maximum clock speed of 160 MHz. Currently, the largest value that will produce an accurate delay is 16383; larger values can produce an extremely short delay. The following optimizations will improve the execution of nearly all code - including boot times, throughput, latency, etc: Set CONFIG_ESPTOOLPY_FLASHFREQ to 80 MHz. {"payload":{"allShortcutsEnabled":false,"fileTree":{"components/esp_timer/include":{"items":[{"name":"esp_private","path":"components/esp_timer/include/esp_private. Therefor, I read a lot, especally about xSemaphoreGiveFromISR which seems to be the most efficiant way to deal with this problem. Internal 8. Multiply 0. Board index English Forum Discussion Forum ESP-IDF; Need API support to provide micro seconds delay. unless delay actually calls vTaskDelay on esp32, which it does. For ESP-IDF target, we have chosen ESP32 module. I would like to toggle an output pin in the order of microseconds so use the function delayMicroseconds. So I am trying to find some timer which I can reset and esp_timer functions esp_timer_delete() and esp_timer_create() I can. We will demonstrate GPIO Interrupts through an example that uses a push button and an LED. Click ‘Choose Template’ button to proceed forward. ESP_OK on success. Heap Memory Debugging. Let us now assume that 1/C is faster than the delay you want to wait. delay () will stop every other code from execution. Okay what you said is correct. Need API support to provide micro seconds delay. Post by filo_gr » Thu Sep 09, 2021 6:57 am . Board index English Forum Discussion Forum ESP-IDF; Need API support to provide micro seconds delay. 9 posts. Top 1 post • Page 1 of 1 ESP-IDF ESP-BOX ESP-ADF ESP-MDF ESP-WHO ESP-SkaiNet ESP32 Arduino IDEs for ESP-IDF ESP-AT ESP IoT Solution ESP RainMaker Rust ESP8266 Report Bugs Showcase; Chinese Forum 中文社区 活动区 乐鑫活动专区 讨论区 ESP-IDF 中文讨论版 《ESP32-C3 物联网工程开发实战》书籍讨论版 ESP-AT 中文讨论版 ESP-BOX 中文讨论版 It appears that simply using taskENTER_CRITICAL (); and taskEXIT_CRITICAL (); from the FreeRTOS docs does not work because of the way FreeRTOS is modified for ESP32. Before ESP-IDF V2. Dimming Neopixels, Delays<Microseconds. void esp_rom_delay_us (uint32_t us) ¶ Pauses execution for us microseconds. Optimizing execution speed is a key element of software performance. h file allows an application to use a read only timer for timing measurements done at and below 1 microsecond level. ESP32 is capable of light sleep and deep sleep power saving modes. us – Number of microseconds to pause . zip. しかし最近色々調べてみると、実はESP32にもμs単位でのdelayを行う関数が存在していることを発見したので記録しておこうと思った. That is also how esp-idf's own usleep() works. However, improving execution speed may have trade-offs with other aspects of performance such as Minimizing Binary Size. e. Currently, the largest value that will produce an accurate delay is 16383. 9 posts. println (sensorValue); vTaskDelay ( 1 ); // one tick delay (15ms) in. When a user enters the IP address in a web browser, an HTTP get request is sent to. :cpp:member:`mcpwm_carrier_config_t::first_pulse_duration_us` indicates the duration of the first pulse in microseconds. Posted by rtel on December 24, 2014. Post by filo_gr » Thu Sep 09, 2021 6:57 am . After searching. ESP Wi-Fi supports up to {IDF_TARGET_MAX_CONN_STA_NUM} (``ESP_WIFI_MAX_CONN_NUM``) Wi-Fi connections. Original example request there is for GET request only, so I need to change REQUEST type there and it was also required to add there some HTTP headers such as encoding of datas that is required for that type of request. Hi everyone! I want to implement a timing delay of 1us in my program. For a full example, refer to PlatformIO ESP-IDF ESP32 blink example. ESP-IDF ESP-BOX ESP-ADF ESP-MDF ESP-WHO ESP-SkaiNet ESP32 Arduino IDEs for ESP-IDF ESP-AT ESP IoT Solution ESP RainMaker Rust. 10 posts • Page 1 of 1. Turned out that vTaskDelay (2/portTICK_PERIOD_MS) wasn't waiting long enough. It is completely independent from the ESP-IDF and does not use any ESP-IDF tools or files. For example, some device drivers require a delay implementation, and might use it to sleep anywhere from a few dozen microseconds to a few hundred milliseconds. You will get a notification that the project has been created. Till Now, we have used ets_delay_us FreeRTOS API to get microseconds delay but that is not recommend to use. Overview. Code that executes faster can also have other positive effects, like reducing overall power consumption. Timer callbacks can be dispatched by two methods: embedded_hal states that delay_us: Pauses execution for at minimum us microseconds. The sdk for the chip needed 2msec. This function would load the correct interval (delay) into the pre-configured timer. If the Modem-sleep mode is enabled, station will switch between active and sleep state periodically. The ESP32 will communicate with the PCF8574, which uses I2C communication, and this in turn will control the LCD. In deep sleep mode, CPUs, most of the RAM, and all the. 9 posts. I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there. 0, however some functions of FreeRTOS v9. The application task (code) generally calls Wi-Fi driver APIs to initialize Wi-Fi and handles Wi-Fi events when. This method is set to be called every ~5sec as a software WDT, you should move EVERYTHING out of this method and have a background task that is woken up by this method. Note that this is busy-waiting, so unlike vTaskDelay it does not allow other tasks to run (it just burns CPU cycles. 0, the functionality is not limited to the “main” SPI. Because there are more interrupt sources than interrupts, sometimes it makes sense to share an interrupt in multiple drivers. py -p [PORT] flash idf. 9 posts. 3, every time a socket is created, a lock will be assigned, given that this internal socket array has not been assigned any lock before. ESP-IDF ESP-BOX ESP-ADF ESP-MDF ESP-WHO ESP-SkaiNet ESP32 Arduino IDEs for ESP-IDF ESP-AT ESP IoT Solution. A delay provider that uses `Ets` for delays below a certain threshold and `FreeRtos` for delays equal or above the threshold. Note that this is busy-waiting, so. Where do you get the Delay() function from? It's not part of ESP-IDF. Improving Overall Speed ¶. The Wi-Fi driver can be considered a black box that knows nothing about high-layer code, such as the TCP/IP stack, application task, and event task. Introduction. Top. I am trying the run stepper motor with the tmc2208 driver and ı want to delay in microseconds like 5uS or 10 uS. As you pointed out delay works fine in Arduino IDE, if you consider Arduino as component to be unsupported then please close this issue!. source ·. 2. I also used portTICK_RATE_MS but the speed didnt change . 0 and later versions, please refer to examples in the esp-protocols repo. Board index English Forum Discussion Forum ESP-IDF [SOLVED] My function for microseconds delay doesn't work properly. period: timer period, in microseconds . I am trying to measure the duty cycle interval (from falling to rising edge) in microseconds of an incoming PWM signal of 20 KHz. Down at the very bottom you'll see two core task. Merged Copy link Contributor Author. esp_timer set of APIs provides one-shot and periodic timers, microsecond time resolution, and 64-bit range. Ideally, 500ns or less. 1 post • Page 1 of 1. 2. esp_timer set of APIs provides one-shot and periodic timers, microsecond time resolution, and 52-bit range. Parameters. Unfortunately that's far from ideal when dealing with variable delays. At 240 Mhz, with a 32 bit ccount register, we will see overflow every 17. 1. LEDC channels are divided into two groups of 8 channels each. I promise this one is definitely about dual core issues and not my crappy array management. You can update the period at runtime by calling mcpwm_timer_set_period() function. print output. Now let us discuss the SPI Master driver library and its functions provided by ESP-IDF that will be used in this tutorial. You should see different times if you wait for the serial output to finish:Board index English Forum Discussion Forum ESP-IDF [SOLVED] My function for microseconds delay doesn't work properly. ESP32 is capable of light sleep and deep sleep power saving modes. Struct esp_idf_hal :: delay :: Ets. The timer_u32() is an alternative for the esp_timer_get_time() function as described in Epressif Documentation. h> ets_delay_us(10); //Stalls execution for #uS Exact delaysThis discussion on sub-microsecond ESP timing seems well worth reading FYI. For instance UART and I2C. I think you can use it in Arduino IDE too, because Arduino Core for ESP32 is just a "interface" that is running ESP-IDF functions. We will look at how to produce the PWM signals with LEDC hardware of ESP32 and attach those signals to any of the GPIO pins. Using esp_timer_get_time () generates “wall clock” timestamps with microsecond precision, but has moderate overhead each time the timing functions are called. ’. 0. Post by peterglen » Tue Oct 06, 2020 7:46 pm . The resolution of the first pulse duration is determined by the carrier frequency you set in the :cpp:member:`mcpwm_carrier_config_t::frequency_hz`. h) will allow you to busy-wait for a correct number of microseconds. A positive number or. Delay in mS vTaskDelay(2000 / portTICK_PERIOD_MS); The RTOS tick period is (by default) 10ms. Top. 240. ESP32 PWM ESP-IDF LED Brightness Control Example. I would definitely advise you to switch from Arduino to the esp-idf framework. Board index English Forum Discussion Forum ESP-IDF [SOLVED] My function for microseconds delay doesn't work properly. The idf. ST7789とのSPI通信プログラムを実装していて、初期化関数の中でコマンド送信後delay ()でちょっとだけ時間調整をしている部分があった。. ESP_OK on success. August 15, 2022. Top. source ·. Board index English Forum Discussion Forum ESP-IDF [SOLVED] My function for microseconds delay doesn't work properly. The event loop library keeps a copy of event_data and manages the copy’s lifetime automatically (allocation + deletion); this ensures that the data the handler receives is always valid. The main idea is to start a timer for a given amount of time (say 5 seconds) whenever an external button is pushed. Raising the level, the interrupt handler can reduce the timer processing delay. When using a bootloader from these early ESP-IDF versions and building a new app, enable the config option CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS. Joined: Wed Aug 29, 2018 3:17 pm. Now click ‘ Create project using template esp_timer . 13 posts 1; 2; Next; Ritesh Posts: 1332 Joined: Tue Sep 06, 2016 9:37 am. ). uint64_t microseconds = esp_timer_get_time (); // Starting the count, it exits. microseconds micros : 10814 HPtimer = 10814 --> 10000 calls of micros() on core 1 (500µs longer) but value measured by the two functions give the same result microseconds micros core0 : 10835 microseconds HighPrecTimer: 10216 microseconds HighPrecTimer core0: 10504 microseconds micros : 10795 HPtimer = 10795 microseconds micros core0 : 10783 Delay in uS. I also used portTICK_RATE_MS but the speed didnt change . Dimming Neopixels, Delays<Microseconds. The dummy phase. The delayMicroseconds function, on the other hand, does not yield to other tasks, so using it for delays more than 20 milliseconds is not recommended. change "microseconds" to "milliseconds" because vTaskDelay is based on FreeRTOS time tic which is in multiple milliseconds. This will take about 30 microseconds to execute:. Using Arduino Programming Questions. Hello community, I made a. Hello community, I made a. Parameters. I check the time using esp_timer_get_time() at the beggining of my task and again at the end of my task. You guys have made an extremely impressive platform, to say the least. So in that module, we need exact delay of 10 and 40 microseconds of delay interval in some interval to update firmware into that module using one wire communication over GPIO pins. Hello World, I am trying to control a servo using the ESP32_Servo Library on my ESP32 S2 Board. Code: [Select all] [Expand/Collapse] void delay_us (uint64_t number_of_us){. It looks to be an unnecessary delay since the previous function, rmt_wait_tx_done, takes. To create a timer, call esp_timer_create (). Board index English Forum Discussion Forum ESP-IDF [SOLVED] get timestamp in milliseconds. get current time in millis() Post by Saskia » Fri Jul 21, 2017 9:58 am . In light sleep mode, digital peripherals, most of the RAM, and CPUs are clock-gated, and supply voltage is reduced. Sets how quickly the timer counter is “ticking”. Not a typo; an empathetic nod to Jesús Gris. If I take 64 readings with a 1ms interval for stability that's 64 milliseconds. For ESP-IDF v5. 1. The code here presented is IDF only related. IDF documentation suggests microsecond delay - should be millisec. Our ESP32 will host a web server that serves the HTML/CSS files to a web client which is a web browser. When ı create a task using xTaskCreate() function and adding some delay in the task function. A delay of "a few microseconds" on a 20-microsecond pulse is different from the original request of "introduce 20us of delay to input pulse". g. In Light-sleep mode, the digital peripherals, most of the RAM, and CPUs are clock-gated and their supply voltage is reduced. Joined: Wed Jul 28, 2021 12:25 pm Location: Italy [SOLVED] My function for microseconds delay doesn't work properly. 13 posts 1; 2; Next; Ritesh Posts: 1335 Joined: Tue Sep 06, 2016 9:37 am. However, improving execution speed may have trade-offs with other aspects of performance such as Minimizing Binary Size. Post by filo_gr » Thu Sep 09, 2021 6:57 am . Joined: Wed Jul 28, 2021 12:25 pm Location: Italy [SOLVED] My function for microseconds delay doesn't work properly. Post by guillermop ». ’. change "microseconds" to "milliseconds" because vTaskDelay is based on FreeRTOS time tic which is in multiple milliseconds. Turned out that vTaskDelay (2/portTICK_PERIOD_MS) wasn't waiting long. IDF version. Because all the callbacks are dispatched from the same task, it is recommended to only do the minimal. I also used portTICK_RATE_MS but the speed didnt change .