I'm testing a chip that our lab built, and I need to drive a lot of IO pins (I think I need at least 55 pins).
I wanted to use an Arduino Due to drive these IO pins, but I'm not sure which pins I can actually use as digital IO pins. So I'm looking at the sweet pin diagram (http://www.robgray.com/temp/Due-pinout.pdf) that shows all of the many names for every pin on the Arduino due. If I count the number of pins that have a digital pin number in grey next to them, I get 72 potential pins.
There are a few pins that appear to be marked as "unsupported" like RXD2 and TXD2, but I'm guessing that just means the arduino libraries don't support using them as a serial port yet (but I can still use them as a digital IO). Is that correct?
I would like to avoid using pins that are also used for other stuff, particularly the tx and rx pins that are used for programming the board, because I don't want those signals propagating to the chip I'm testing. Are there other pins like that which I should avoid?
Do any of the other pins need to be handle specially in order to be used as a plain old digital IO pin?
One more question. When I write an arduino program, which of the labels in the diagram should I use to refer to the pins? I know there are usually macros defined for these types of things in the header files. For example, if I want to set RXD2/SPI-CS2/D52/B.21/92 as an output, would I do pinMode(D52, output), or pinMode(92, output), or something else?
Thanks in advance to whoever can answer these questions!
byte pin52 = 52; // or some meaningful name
pinMode (pin52, OUTPUT);
digitalWrite (pin52, HIGH);
OK so basically all of the DXX, sans the D part. Thanks. That answers the second question.
Can anyone else answer the other questions?
If they're brought out to a header pin you can use them as digital IO. Probably avoid D0, D1 for the serial port.
Read the uC datasheet
to confirm if the analog inputs or DAC outputs support digital IO also.
Or just try them, as digital 54-70, see if code will compile, and try them with a scope, a meter, or an LED/resistor.