Go Down

Topic: How many digital pins can I drive with Arduino DUE? (Read 393 times) previous topic - next topic

nedgonaes

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 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?

nedgonaes

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!

CrossRoads

byte pin52 = 52; // or some meaningful name

pinMode (pin52, OUTPUT);

digitalWrite (pin52, HIGH);
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

nedgonaes

OK so basically all of the DXX, sans the D part.  Thanks.  That answers the second question.

nedgonaes


CrossRoads

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
http://www.atmel.com/Images/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy