Changing Ethernet 2 shield SD Chip Select pin...

OK, narrowing down the possibilities...

I have an Arduino Ethernet 2 shield. Th CS pin to select the on-board SD card reader is pin 4. This seems to be either hardwired into the shield or perhaps in the firmware. I can easily change the LOGICAL CS pin in file Sd2Card.h, and the SD library will faithfully attempt to use whatever pin you have programmed. If you change nothing, the default is pin 53, and I have tried most of the others. Only when one uses pin 4 does the SD card reader HW successfully initialize.

So, how to I change the pin and actually get it to work? Can this be modified by updating the shields firmware? Has anyone successfully moved this shield's SD CS pin off of pin 4?

Thanks! :confused:

It's hardwired. There is no way to change this via software.

There are two options for changing the CS pin:

Connect the shield to your Arduino board using jumper wires. Then you can connect pin 4 on the shield to any pin you like on your Arduino board.

The second option is less "messy", but it will definitely void the warranty on your shield, so use at your own risk:

  • Remove the shield from the Arduino board.
  • Bend pin 4 on the shield out a little bit away from the board. Be careful to not bend the pin more than necessary. Too sharp a bend and/or repeated bending will weaken the metal and eventually cause it to break.
  • Plug the shield in to the Arduino board. Pin 4 should not go into the header on the Arduino board. Don't push the shield down all the way on the Arduino board, as this will cause the pin to be bent more sharply than necessary. Just plug it in far enough to get a good electrical connection.
  • Use a jumper wire to connect pin 4 on the shield to any other unused pin on the shield. That pin will be the new CS pin.

odlumb:
I can easily change the LOGICAL CS pin in file Sd2Card.h

There's no need to modify the library. You can set the CS pin via the library's API:

or use external SD card adapter module, not the adapter on the Ethernet shield.
or make pin 4 free for SD card CS.

Thank you both for your great suggestions! Great forum...

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per