Go Down

Topic: Shield and library compatibility with the due? (Read 195 times) previous topic - next topic

Jan 04, 2015, 05:06 pm Last Edit: Jan 04, 2015, 05:07 pm by bestanamnetnogonsin
Until now I have only been using an arduino uno, but now I have got a due.
I got it from a friend but im not sure it is the latest version of the due (it says "Board model: Due R3" on the back). Have there been different versions of the due? If yes: Has the positions of the pins changed?. The reason im asking is because the pins I circled on the picture aren't labeled as on the picture, they aren't labeled at all. ( the picture is the one of the due from the arduino site). otherwise everything seems to be identical. I want to use it with the adafruit motor shield, and im afraid it may not be compatible.

My second question: can i use any usb plug that fits (Ive found one at home), or do I have to buy an official one?

And at last: How do I know if a library works with the due? Does the Adafruit motor library word with the due?


The "R3" layout of the pins was introduced on the Uno and is now the standard layout. It specifies things like the SPI lines on the SPI header (the 6x2 patch of pins near the middle.) All Dues should conform to this layout.

It seems strange that the pins aren't labelled on the board, but the function of the pins is almost certainly exactly the same as the R3 spec.

Yes, any micro-USB plug will work.

I assume the Adafruit library you are looking at is this one: https://github.com/adafruit/Adafruit-Motor-Shield-library ? That doesn't look like it will work on the Due. It will work on a PIC32 chip, which seems odd but there must be reasons for that. It looks like that library was written before the Due was available and it hasn't been updated. There must be a newer library available?

Most libraries do work on the Due. Hopefully what you're doing isn't too complex and you can write your own library. Remember one advantage of the Due is PWM works on all pins.

Thanks a lot!! Thats exactly what I needed to know  :) .

I didn't know it had pwm on ALL digital out pins. Very useful to know.

 actually theres a new version of the library and I think it works. But im probably using a mega anyway as its tricky to get the shield work with 3.3 V.

One last question: To use the due, can I just treat it like an uno (that has max input and output of 3.3V) with more pins for programming purposes? Is there any (major) difference in the way you program it?


The major difference that affects my programs on the Due is the serial output is not buffered. If you send a more than one character the Arduino code must sit and wait until the transmission is finished before your code can continue.

Other than that, just try to use all the standard Arduino functions instead of attacking the registers directly. If you always use digitalWrite() then you know it will work on every Arduino. It's a good way of forcing you to think at the higher level rather than trying to optimise a few clock cycles out of something that is fast enough for 99% of uses.


Jan 05, 2015, 11:25 pm Last Edit: Jan 05, 2015, 11:26 pm by bad_crc
The DUE only supports PWM on 12 of its digitalIO pins.


 Also there will be differences on how you program it depending on how low-level you go, as MorganS mentioned, since the underlying controllers are completely different :)
check out my arduino interactive LED table

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!

via Egeo 16
Torino, 10131