Smallest unit of time in Arduino 2560

Hi all.
I am having a problem with the smallest unit of time which Arduino 2560 can be measured and return.
I have used White LED to transmit data and Photodiode to recieve these data. I am using millis() function, but the value which it return is millisecond. it is too long in communication.
So i would like to ask all of you that having any function which can measure and return value of time smaller than unit of millisecond.
Thanks in advance! :slight_smile:

micros ()

Thank you again and again :smiley:

QuaanNguyeen94:
Hi all.
I am having a problem with the smallest unit of time which Arduino 2560 can be measured and return.
I have used White LED to transmit data and Photodiode to recieve these data. I am using millis() function, but the value which it return is millisecond. it is too long in communication.
So i would like to ask all of you that having any function which can measure and return value of time smaller than unit of millisecond.
Thanks in advance! :slight_smile:

Note that if you change the time scale of the timer you can get your timer resolution down to 1/2 microseconds. Marice Ribble uses that technique in his "Camera Axe" program for Arduino. You can find his source here:

Camera Axe programming Wiki

Measured and return... makes it a bit more difficult but for pure measure there have been discussions on inline pin reads with variable increments down to a few cycles.

If the event could charge a capacitor that could then bleed through a resistor to a pin, the time that would take would be lengthened. But it would need calibrating and might be otherwise prone to some kind of error.