Digital I/O Bandwidth on the Diecimila


For some reason I can't seem to locate the spec on the bandwidth of the digital I/O of the Diecimila board. Does anyone know what it is?

I spent a long time searching, I apologize if the answer was right under my nose somewhere.

Thanks, Andrew


Hi Andrew, I am not sure what you are asking. could you say a little more about what you want to know.

If you are asking about how quickly the arduino can input and output to the digital ports then that depends on what you want to do and how you do it.

digitalWrite takes about 5 microseconds to turn on and off a pin, but using direct port commands reduces that to around 120 nanoseconds. I haven't measured the response of digitalRead but you can use hardware support for input capture to measure pulses approaching the cycle time of the clock (16mhz).

What is it you want to do?


Thanks for responding.

I want to read the pulse trains from three quadrature encoders, ie: 6 inputs with a maximum frequency response of 200KHz. Ideally I would like to measure the phase difference of each encoder pulse train pair and output either step-dir messages or absolute position to a pc via the serial port.



Andrew, I would guess that it would be difficult to achieve what you want on an arduino without some additional hardware support. I don't think the ATmega168 can capture 6 external interrupts and I don't think polling would be fast enough, assuming the three encoders are not synchronised.

But perhaps something like the Microchip MCP23017/MCP23S17 IO expander IC might help.

Anyway, I am regularly amazed with the unexpected things I see people achieve with the arduino so perhaps someone that has tackled a similar challenge can comment.

I don’t think polling would be fast enough,

Its just over 13 instructions in between polls.
Doable but it is cutting it rather fine.
Using a 20mhz crystal allows for 16 instructions between polls.

Its possible but it wouldn’t be able to do much other than relay the raw data to something else.
It would be impossible to check direction or figure out the absolute position on the chip.