// enable w5100 SPI
pinMode(10,OUTPUT);
// now enable the SD SPI at the same time
while (!SD.begin(chipSelect)) {
// now disable the w5100 SPI after the SD fail
digitalWrite(10, HIGH);
Serial.println("Card failed, or not present");}
That will cause problems. You are enabling the w5100 SPI, then calling the SD.begin() function using the SPI.
I think this is what you said worked.
pinMode(10,OUTPUT);
digitalWrite(10, HIGH);
while (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
}