The standard Arduino shield uses the Wiznet5100 chip – this chip has a flaw in that the CS signal does not tri-state the MISO line. The Wiznet application note can be found here. The relevant part is below.
Basically, multiple SPI slave usage is the same as single SPI slave usage. One difference between other SPI slave devices compared to the W5100 is that the MISO output is continuously driven in the W5100 whether the /SCS is asserted as high or as low. As well, when the 5100 /SCS is asserted as high when using multiple slaves, other SPI devices cannot be read or written by the SPI master on the SPI BUS simultaneously. These problems will continue unless the recommendations listed below are followed.
- When accessing another device on the SPI BUS rather than the W5100, assert the SEN pin in the W5100 as low first, then access the other devices.
- When accessing the W5100, the SEN pin should be high.
The W5100?s SEN signal is input from the /SCS through the inverter. If you don?t want to use the inverter, you can control each signal through the I/O port of the MCU.
So by inverting the SS line (Arduino digital 10) and driving SEN from that fixes the issue. Here is a photo of my rather crude fix – using a CMOS 4011 quad 2 input NAND gate chip. Note this is a DFRobot clone – the pads for the PROG jumper (one connected to SEN) are reversed from the normal shield. The wire running underneath connects to the chip select line (Ardunio 10) – I went underneath for this to allow my to cut the line later if I needed another pin for chip select. Small rant – all SPI shields seem to assume they can use CS on pin10 – why cannot this come out to a solder jumper or pads so that I can select any pin as chip select. Using multiple SPI devices is a real pain because of this.
By request the circuit diagram for this is also shown. Note that in the board pics I placed the 4011 upside down (I could then glue it to the board). Also all unused inputs of the 4011 (I only use one gate out of 4) are grounded (because this is good practice with CMOS devices), even here I made one of my many mistakes – the diagram is wrong in fact pins 5&6 are grounded not 4&5.
Any inverter would have done, I just happened to have a 4011 in my ‘bits’ box.
The NueElectronics shield uses a 74HCT08 chip to boost the MISO and INT signals to 5V levels, this chip is not tri-state and so the MISO line is always driven.
Replacing the 74HCT08D with a 74AHC125D is an almost direct replacement – cut the 74HCT08D off and tidy up the pads,
the connection between pins 1&2 and pins 4&5 needs to be broken and then the 74AHC125D soldered in the same place. Then add two small jumper wires: pin1 connected to GND (for the INT line), p4 connected to SS (Arduino digital 10) for the MISO line (Arduino digital 12).