What is the least value of time that I could measure(count) using micros()?

closed as unclear what you're asking by gre_gor, VE7JRO, sempaiscuba, Greenonline, per1234 Oct 17 '18 at 7:57

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What's unclear about the official docs? – gre_gor Oct 16 '18 at 18:43
  • Which board? I know you added the arduino-micro tag but I suspect you didn't add that because you're using an Arduino Micro board. – per1234 Oct 17 '18 at 7:53

What is the least value of time that I could measure(count) using micro() in Arduino board?

The answer is 64 clock cycles or 4 us @ 16 MHz. Please see the Arduino AVR core[1] for more details.


Ref. [1] https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/wiring.c#L25

  • is there is any other way to count in nano seconds or 0.05 micro seconds? – krishnamoorthi jayakumar Oct 26 '18 at 12:09
  • @krishnamoorthijayakumar yes, by using a Timer and setting the prescaling to 1 (no prescaling). This will give a counter with 62.5 ns per tick @ 16 MHz. – Mikael Patel Oct 26 '18 at 20:45
  • Please accept and mark the question as answered! – Mikael Patel Oct 26 '18 at 20:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.