0

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

2
  • 2
    What's unclear about the official docs?
    – gre_gor
    Oct 16, 2018 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, 2018 at 7:53

1 Answer 1

3

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.

Cheers!

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

3
  • is there is any other way to count in nano seconds or 0.05 micro seconds? Oct 26, 2018 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. Oct 26, 2018 at 20:45
  • 1
    Please accept and mark the question as answered! Oct 26, 2018 at 20:45

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