Ethernet Shield and SD Shield Together?

Hello all, I was wondering if it was possible to have an Arduino Uno with an SD card shield on it (SeedStudio SD v4.2), and then put an Ethernet shield on top of that (Generic Ethernet Shield)and have it work with two SD cards and Ethernet? I do not know enough about the ICSP bus to answer this myself so I ask you guys. Any help is appreciated.

I do not know enough about the ICSP bus to answer this myself

So it is lucky that it is nothing to do with that bus.

They all use the SPI bus. Yes you can use them all at the same time just so long as you have a unique chip select pin for each device and modify the software and / or libiary to suit.

Note that once you deselect an SD card to read or write to another device, you loose the point in the SD file you are reading. Not sure if that is what you are seeing.

Ok, so I would just use a different CS and make two instances of the SD library. How do you think I should modify the library?

I haven't tried that, but if I was to try, I think I would use the SdFat library. You might be able to pull off the two instances.

SdFat SD;
SdFat SD2;

edit: You should bend the ethernet shield's D4 so it doesn't insert into the SD shield, then jumper D4 on the ethernet shield to D5. This snippet compiled in my test sketch, so it may work

SdFat SD;
SdFat SD2;

// then in setup
  if(!SD.begin(4)) {
    Serial.println(F("SD failed"));
  else {

  if(!SD2.begin(5)) {
    Serial.println(F("SD2 failed"));
  else {

One would have to wonder why you want to do this. May it's merely for the intellectual exercise but, if you have a real need rather than simply have two files on the one SD, it might be time to move on from Arduino into something more powerful.

Well, yes a decent portion of it was simply to not be bored, to have a challenge; and with the SD card shield between the Arduino and the Ethernet shield it stacks rather quite nicely.

Im trying to figure this out though, if the Ethernet shield has a CS on pin 10 and the SD shield has a CS on pin 4, why doesnt it work? The TwoCard example (below) that came with SDFat, with adjusted CS pin and settings in the header file, gives me this output from the serial monitor:

Serial Output:

FreeRam: 6494
type any character to start
Can't access SD card. Do not reformat.
No Card, wrong CS pin, or SPI problem?
SD errorCode: 0X1, 0X0

sd2 should be the Ethernet shield with a CS on 10, and sd1 should be the SD shield but the serial output doesnt mention it.

The TwoCard example code:

 * Example use of two SD cards.
#include <SdFat.h>
#include <SdFatUtil.h>
#error You must set USE_MULTIPLE_CARDS nonzero in SdFatConfig.h

SdFat sd1;
const uint8_t SD1_CS = 4;  // chip select for sd1

SdFat sd2;
const uint8_t SD2_CS = 10;   // chip select for sd2

const uint8_t BUF_DIM = 100;
uint8_t buf[BUF_DIM];

const uint32_t FILE_SIZE = 1000000;
const uint16_t NWRITE = FILE_SIZE/BUF_DIM;
// print error msg, any SD error codes, and halt.
// store messages in flash
#define errorExit(msg) errorHalt_P(PSTR(msg))
#define initError(msg) initErrorHalt_P(PSTR(msg))
void setup() {
  while (!Serial) {}  // wait for Leonardo
  PgmPrint("FreeRam: ");

  // fill buffer with known data
  for (int i = 0; i < sizeof(buf); i++) buf[i] = i;
  PgmPrintln("type any character to start");
  while ( <= 0) {}
  delay(400);  // catch Due reset problem

  // disable sd2 while initializing sd1
  pinMode(SD2_CS, OUTPUT);
  digitalWrite(SD2_CS, HIGH);
  // initialize the first card
  if (!sd1.begin(SD1_CS)) {
  // create DIR1 on sd1 if it does not exist
  if (!sd1.exists("/DIR1")) {
    if (!sd1.mkdir("/DIR1")) sd1.errorExit("sd1.mkdir");
  // initialize the second card
  if (!sd2.begin(SD2_CS)) {
 // create DIR2 on sd2 if it does not exist
  if (!sd2.exists("/DIR2")) {
    if (!sd2.mkdir("/DIR2")) sd2.errorExit("sd2.mkdir");
  // list root directory on both cards
  PgmPrintln("------sd1 root-------");;
  PgmPrintln("------sd2 root-------");;

  // make /DIR1 the default directory for sd1
  if (!sd1.chdir("/DIR1")) sd1.errorExit("sd1.chdir");
  // make /DIR2 the default directory for sd2
  if (!sd2.chdir("/DIR2")) sd2.errorExit("sd2.chdir");
  // list current directory on both cards
  PgmPrintln("------sd1 DIR1-------");;
  PgmPrintln("------sd2 DIR2-------");;
  // remove RENAME.BIN from /DIR2 directory of sd2
  if (sd2.exists("RENAME.BIN")) {
    if (!sd2.remove("RENAME.BIN")) {
      sd2.errorExit("remove RENAME.BIN");
  // set the current working directory for open() to sd1
  // create or open /DIR1/TEST.BIN and truncate it to zero length
  SdFile file1;
  if (!"TEST.BIN", O_RDWR | O_CREAT | O_TRUNC)) {
  PgmPrintln("Writing TEST.BIN to sd1");
  // write data to /DIR1/TEST.BIN on sd1
  for (int i = 0; i < NWRITE; i++) {
    if (file1.write(buf, sizeof(buf)) != sizeof(buf)) {
  // set the current working directory for open() to sd2
  // create or open /DIR2/COPY.BIN and truncate it to zero length
  SdFile file2;
  if (!"COPY.BIN", O_WRITE | O_CREAT | O_TRUNC)) {
  PgmPrintln("Copying TEST.BIN to COPY.BIN");
  // copy file1 to file2
  uint32_t t = millis();

  while (1) {
    int n =, sizeof(buf));
    if (n < 0) sd1.errorExit("read1");
    if (n == 0) break;
    if (file2.write(buf, n) != n) sd2.errorExit("write2");
  t = millis() - t;
  PgmPrint("File size: ");
  PgmPrint("Copy time: ");
  PgmPrintln(" millis");
  // close TEST.BIN
  // rename the copy
  if (!sd2.rename("COPY.BIN", "RENAME.BIN")) {
void loop() {}

The SeeedStudio SD card and the ethernet shield's SD card both use D4 as the slave select. D10 is the w5100 slave select.

Oh ok, that clears some things up. Recently I found out that by using two cards I use around 1000-1200 extra bytes of SRAM, which essentially makes this whole thing kind of useless as unless I use my 101 or my Due then it won't work with my sketches. I can't use the 101 or the Due much simply because of their operating voltage. On a side note, is it normal for the w5100 chip to get so very hot? It essentially burned me after prolonged contact; should I be using a sort of cooling like a fan or similar?

On a side note, is it normal for the w5100 chip to get so very hot? It essentially burned me after prolonged contact; should I be using a sort of cooling like a fan or similar?

No this is not normal and it implies some sort of fault or miss wiring.

Do you have any ideas on how to correct this fault (if possible)? I gave the board a good visual inspection and found nothing wrong, I would check things with my meter but that is currently broken

@Mike44449, please do not cross-post. Thread locked.