Hi again
I finally wrote a quick and dirty code to test micros() versus HighPrecTimer.
It performs 10000 calls to micros() and same thing to HPrecTimer.
Here is the result :slight_smile:
micros() has a 50ns overhead compared to High Precision Timer call. It is only a delay not a jitter or a lack… Answer from freedom2000 on community.simplefoc.com
GitHub
github.com › espressif › arduino-esp32 › issues › 282
micros() & delayMicroseconds() not good enough · Issue #282 · espressif/arduino-esp32
March 23, 2017 - Calling micros() twice is in a row, takes nearly 50uS. Something line: uint32_t t0 = micros(); uint32_t t1 = micros(); uint32_t delta_t = t1 - t0; printf( "Delta = %u\n", delta_t ); // this prints around 51 on my system. Looking at the i...
Author espressif
Mechatronics LAB
mechatronicslab.net › home › lessons › esp32 arduino programming handbook › chapter 12: timers, delays & interrupts › using micros() for esp32 arduino programming
Using micros() for ESP32 Arduino Programming - Mechatronics LAB
What Is micros() and Why Use It? The micros() function tells you how many microseconds have passed since the ESP32 started running. It’s like having an ultra-fast stopwatch in your program.
Measuring pulse duration more accurately with ESP32
Hi everyone, I would like to measure a pulse duration of 32us (4 clock cycles at 125kHz). Therefor I set an interrupt on the according pin. The interrupt is triggered with the rising and falling edge and store the start & endtime with the funktion micros() in two diffrent variables. More on forum.arduino.cc
strange micros() behavior
Hardware: Board: Adafruit Huzzah32 Feather Core Installation/update date: 19-Feb-2018 IDE name: Arduino 1.8.5 Flash Frequency: 80Mhz Upload Speed: 921600 Description: I am trying to use a run-of-th... More on github.com
Troubles using micros()/millis() form esp-idf
Hardware: Board: ESP32 DEVKITV1 Core Installation/update date: 25/apr/2018 IDE name: Arduino IDE/IDF component Flash Frequency: 80Mhz Upload Speed: 115200 Description: micros() returns strange valu... More on github.com
How to connect Arduino Pro Micro and ESP32 ?
Depends what your goal is, but easiest way is a UART connection. RX to TX, TX to RX. Then you can just use the serial library to send things back and forth. Keep in mind the Micro is 5v and the ESP32 is 3.3v logic, so you will need a logic level converter between the two. You will also need a shared ground connection. More on reddit.com
Videos
SimpleFOC Community
community.simplefoc.com › t › possible-bug-with-esp32-micros-function › 122
Possible "bug" with ESP32 micros() function - SimpleFOC Community
September 16, 2020 - Hi all, Being aware of the following bug with micros() function in ESP32 arduino, I have jumped into the FOCutils.cpp file and seen that the bug is probably called ☹ The bug is explained here: https://github.com/espressif/arduino-esp32/issues/1168 Trust me micros() is not reliable with ESP32.
Arduino Forum
forum.arduino.cc › projects › programming
Measuring pulse duration more accurately with ESP32 - Programming - Arduino Forum
May 31, 2022 - Hi everyone, I would like to measure a pulse duration of 32us (4 clock cycles at 125kHz). Therefor I set an interrupt on the according pin. The interrupt is triggered with the rising and falling edge and store the start & endtime with the funktion micros() in two diffrent variables.
GitHub
github.com › espressif › arduino-esp32 › issues › 1168
strange micros() behavior · Issue #1168 · espressif/arduino-esp32
March 3, 2018 - I am trying to use a run-of-the-mill Arduino e-paper display library that happens to watch a certain "busy" pin, and reports debug info via Serial.printf() when the pin appears busy for too long. The code is a delay(1) spin loop, and it is almost instantly reporting timeout. This caused me to write some of my own debug code to test the behavior of the micros() implementation in the HAL.
Author espressif
GitHub
github.com › espressif › arduino-esp32 › issues › 1357
Troubles using micros()/millis() form esp-idf · Issue #1357 · espressif/arduino-esp32
April 26, 2018 - Hardware: Board: ESP32 DEVKITV1 Core Installation/update date: 25/apr/2018 IDE name: Arduino IDE/IDF component Flash Frequency: 80Mhz Upload Speed: 115200 Description: micros() returns strange values when using arduino-esp32 as component...
Author espressif
ESP32 Forum
esp32.com › viewtopic.php
how to SET esp_timer_get_time() ? - ESP32 Forum
I am using a time critial library (MCCI LMIC), that depends on micros() as monotonic time base. In arduino-esp32 micros() is hardwired to esp_timer_get_time(), which does not persist it's counter value during deep sleep. Thus micros() cannot act as a monotonic counter after waking up from sleep.
GitHub
github.com › espressif › arduino-esp32 › blob › master › cores › esp32 › esp32-hal-misc.c
arduino-esp32/cores/esp32/esp32-hal-misc.c at master · espressif/arduino-esp32
unsigned long ARDUINO_ISR_ATTR micros() { return (unsigned long)(esp_timer_get_time()); } · unsigned long ARDUINO_ISR_ATTR millis() { return (unsigned long)(esp_timer_get_time() / 1000ULL); } · void delay(uint32_t ms) { vTaskDelay(ms / portTICK_PERIOD_MS); } ·
Author espressif
Reddit
reddit.com › r/arduino › how to connect arduino pro micro and esp32 ?
r/arduino on Reddit: How to connect Arduino Pro Micro and ESP32 ?
June 16, 2024 - Bring us your Arduino questions or help answer something you might know! 😉 ... Depends what your goal is, but easiest way is a UART connection. RX to TX, TX to RX. Then you can just use the serial library to send things back and forth. Keep in mind the Micro is 5v and the ESP32 is 3.3v logic, so you will need a logic level converter between the two.
Hackster.io
hackster.io › 514301 › micro-ros-on-esp32-using-arduino-ide-1360ca
Micro ros on ESP32 using arduino IDE - Hackster.io
January 31, 2024 - In this tutorial you will learn how to connect ESP32 with micro-ROS and ROS 2. You will also learn how to install micro-ROS agent in Linux.
Arduino
store-usa.arduino.cc › collections › arduino® nano esp32
Arduino Nano ESP32® – Powerful Board for IoT Projects
Arduino® Nano ESP32
The new member to our iconic Nano family, the Nano ESP32. This board brings all the power of the well-known ESP32-S3 with the full support of the Arduino ecosystem, allowing makers to explore the world of Arduino and MicroPython without any blocker. Introducing the Nano ESP32, a powerful addition to the Arduino ecosystem that brings the popular ESP32-S3 to the world of Arduino and MicroPython programming. Whether you're a beginner stepping into the world of IoT or MicroPython, or an advanced user looking to incorporate it into your next product, the Nano ESP32 is the perfect choice. It covers
Arduino
docs.arduino.cc › language-reference › funções › time › micros
micros()
The official Arduino programming language structure reference pages.
GitHub
github.com › espressif › arduino-esp32 › issues › 5282
Issue with millis and micros with interrupt. · Issue #5282 · espressif/arduino-esp32
June 11, 2021 - //Change the code below by your sketch #define pin 19 volatile unsigned long time_prv = 0; volatile unsigned long time_cur = 0; int time_diff = 0; volatile int counter = 0; void IRAM_ATTR ttt() { time_prv = time_cur; time_cur = micros(); counter++; } void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(pin, INPUT); Serial.println("Wait for 2 Sec Delay"); delay(5000); Serial.println("Over and Start"); counter = 0; attachInterrupt(digitalPinToInterrupt(pin), ttt, FALLING); } void loop() { // put your main code here, to run repeatedly: time_diff = time_cur - time_prv; if(time_diff != 0) { Serial.println((60000000 / time_diff)); } }
Author espressif