Arduino Micro digital IO pin speed

Hi guys,

I'm having difficulty to identify the digital IO pin speeds. Surprisingly (or I missed it in someway) I couldn' t find it out on google searches. I would like to build a multi counter system using arduino micro and I couldn' t clarify the speed of the digital pins. Could you please anyone tell me or share a link giving detailed in fo related to this.

Best wishes and thank you.

How about the sticky thread in this section? http://forum.arduino.cc/index.php?topic=326944.0

That's for digitalRead/digitalWrite - which are slow.

If you use direct port writes, you can switch pins much faster.
Writing to PINx to toggle the pin, you can change a pin within 1 processor cycle - but if doing it in a loop, it's a bit slower because of the overhead of the test in the loop. Writing to PORTx registers, if you're doing things like PORTA&= and the like to switch only one pin, is a few processor cycles, because you have to read the current contents of the register, do an operation on it, and then write it back.

Dear DrAzzy,

Thak you for your reply.

I' m trying to build a counter system. So I' m curious if I count upto MHz region on any pin. Thus I' m having difficulty to connect your answer with my current issue. How can I use port read operation (I guess you mean something like this) ?

macellan:
I’ m trying to build a counter system. So I’ m curious if I count upto MHz region on any pin. Thus I’ m having difficulty to connect your answer with my current issue. How can I use port read operation (I guess you mean something like this) ?

Read this - Gammon Forum : Electronics : Microprocessors : Timers and counters