Due with Ethernet Shield and other SPI devices

Hello everyone,

I'm trying to use the Ethernet Shield 2 (https://store.arduino.cc/usa/arduino-ethernet-shield-2 ) with the Due (https://store.arduino.cc/usa/due ) along with a chain of other SPI devices. I'm getting confused by the documentation available as to where the SPI pins are on the Due. It appears that they are the header formerly known as ICSP.

The problem is that the Ethernet Shield covers these pins and does not have female stackable pins for some reason. Where should I wire in the other SPI devices? I see in the Due documentation that there may be another SPI bus available on pins 50, 51, 52??

Does the Ethernet Shield communicate to the Due via SPI? Can I share that SPI with multiple other devices (say 16) that need to communicate pretty quickly (say a few bytes each every 20-30ms).

The Ethernet Shield is currently working perfectly on the Due. Just need to connect in my other SPI devices.

Appreciate any help!

I'm sure the Due has the same pins as Mega, so the SPI bus is indeed also available on pins 50-53. Your link doesn't work, but the Ethernet shield is probably made for Uno and uses the ICSP cluster because it is common to Uno and Mega. I have never seen a shield with male ICSP pins, but you could make one from a proto board. Similarly, you can make a board that just sits on the pins exclusive to Due/Mega. This would handle the other SPI peripherals.

Then DUE SPI pins are on the ICSP header, where they should be.

Unfortunatly Arduino seem keen on publishing documentation (pinout diagrams) for the DUE that do not reflect reality.

Recently, after it was pointed out to them, they did correct one of the pinout diagrams which erroneously showed the SPI pins on 11,12,13.

I note that whilst that error has been corrected the SPI pins are still shown here on 50,51,52;

Which is in complete dissagreement to the actual PCB ...............................

The ONLY pinout diagram you should look at is the one provided by Graynomad in the DUE sub forum.

There are several threads in the arduino forum related to the Ethernet shield with Arduino DUE.

Apart from the ICSP header for SPI, you can select one of the USARTs in SPI (Master or Slave) mode. E.g. for USART0, PA10(MISO), PA11(MOSI° and PB25(CS) are exposed hence usable.

Another shield is very handy when a previous shield prevents access to all pins. There is the Mega Screw Shield (works for DUE too) at Cross Roads Electronics

Thanks for the responses!

@ard_newbie - Could you provide a couple links? I indeed have searched these forums extensively (excellent source of information!) but have not found the items you refer to. I’m especially interested in repurposing the USART0 as SPI??

@srnet - Good to know I’m not crazy! I tried hooking MOSI, MISO, and CLK to those pins and didn’t see any activity.

@Nick_Pyner - Good idea about getting the intermediate board. I will try that. Temporarily I may solder some leads to the ICSP header on the Ethernet Shield for testing.

Just by the way on the matter of intermediate proto boards: ensure that the perf holes are properly aligned. This be done by checking that ICSP pin 1 is in line with pin 36. I don't think this is a common problem, but I believe the Freetronics boards give you an extra line of holes, which means that those over the ICSP cluster don't actually align.

I think you might eventually regret soldering onto shield pins...

Follow up to this:

The Ethernet shield essential takes over the SPI bus. Getting other traffic to flow seems to be very hard/impossible. Maybe that's why the shield cover the pins??

As a workaround, I am now using a bit banging technique using the SoftSPI library. Beware that this library will not compile on a Due without a couple changes. You need to remove the SPIClass reference in SoftSPI.h and change the select case in SoftSPI.cpp to if statements since on Due two of the SPI_CLOCK_DIVxxx values are the same.

Follow-up question: Are all digital pins created equal for bit banging purposes? I need to hook up 16 sensors with 16 CS lines and was wondering if I can just pick 16 digital pins in a nice line or do I need to skip some because they are connected to a UART (for example)??

dbrown1:
Follow up to this:

The Ethernet shield essential takes over the SPI bus. Getting other traffic to flow seems to be very hard/impossible. Maybe that's why the shield cover the pins??

It sounds a good explanation, but I don't think it is right. I have an SD card on the back of a parallel LCD shield which gets its SPI off the end pins. I had that going OK over an Ethernet shield. The Wiznet shields are far from frugal, and you might have had a power problem.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.