Multiple SPI devices and EthernetShield

Hello all!

Currently I am working on a project that incorporates four RFID-readers with the MFRC522-library, along with an EthernetShield, connected to an Arduino Mega.

The following behaviour is observed:

-Judging from serial feedback, all four RFID-readers are working correctly.
-The EthernetShield is working, but only when I disconnect the 3.3v to the RFID-readers. Otherwise I cannot even ping it.

Somehow a SS is not working correctly and there is some crosstalk... you would say.
But the strange thing is: Even if I only have the SCK connected to the RFID-readers (MOSI/MISO disconnected, so no MISO crosstalk), the EthernetShield will not work!

When I disconnect the 3.3v to the RFID-readers it works like a charm again!

So basicly it seem the RFID-readers are messing up the ICSP clocksignal, even though all four work properly.

Maybe somebody could help me figure this out, because this is hair-pullingly weirding me out :wink:

Thank you!

Which RFID reader hardware are you using?

SurferTim:
Which RFID reader hardware are you using?

RFID-RC522, EthernetShield W5100

I don't use those, but it appears by the data sheet to that device, the max voltage applied to the input pins (MOSI and SCK) is the supply voltage +0.5v (3.8 volts in your case). The Mega is a 5 volt device.

But besides that, are you setting all SPI slave selects HIGH before starting any of these devices? Which pins are you using for the slave selects?

SurferTim:
I don't use those, but it appears by the data sheet to that device, the max voltage applied to the input pins (MOSI and SCK) is the supply voltage +0.5v (3.8 volts in your case). The Mega is a 5 volt device.

But besides that, are you setting all SPI slave selects HIGH before starting any of these devices? Which pins are you using for the slave selects?

The libraries take care of that themselves, so yes. But the strange thing is that it is not the MOSI/MISO that is giving trouble (I have disconnected them both, to no avail), but the SCK (If I disconnect that one the EthernetShield runs fine). Somehow the RFID-readers, when powered, manipulate the SCK-signal.

For the readers, I am using pins 14 through 21 for SDA/SS, and obviously 50/51/52 for MOSI/MISO/SCK.

Wessel:
The libraries take care of that themselves, so yes.

No, they don't until you run all setup functions, then they take care of the slave selects. Initially the slave selects are floating. I recommend setting all slave selects to HIGH before starting any of those devices. If you start the ethernet shield without disabling the RFID device slave selects, it could cause problems.

I suppose you do not have an o-scope available?