ethernet shield, sd card makes the board reset

hi, i got a question on the arduino ethernet shield, i'm trying to test the SD examples but the card reset itself if the sd card is inside, it keeps reseting and the program never start really, unless i take out the sd card

Which Arduino are using?

From your post I assume u are using the SD library - have u tried the SdFat library?

does SDfat provide the identical API functions like SD ? i.e.,

SD class

The SD class provides functions for accessing the SD card and manipulating its files and directories.

begin() exists() mkdir() open() remove() rmdir()

File class

The File class allows for reading from and writing to individual files on the SD card.

available() close() flush() peek() position() print() println() seek() size() read() write() isDirectory() openNextFile() rewindDirectory()

?

Yes, SdFat is an “improved version” if you like, of SD.

Below is some code you can try unmodified to see if you can get an answer from the server. The resetting may be due to insufficient power.

//zoomkat 11-04-13
//simple client test
//for use with IDE 1.0.1
//with DNS, DHCP, and Host
//open serial monitor and send an e to test client GET
//for use with W5100 based ethernet shields
//data from myIP server captured in readString 

#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
String readString;

byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address

char serverName[] = "checkip.dyndns.com"; // zoomkat's test web page server
EthernetClient client;

//////////////////////

void setup(){

  Serial.begin(9600); 
  Serial.println("client readString test 11/04/13"); // so I can keep track of what is loaded
  Serial.println("Send an e in serial monitor to test"); // what to do to test
  Serial.println();

  // disable w5100 while setting up SD
  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);
  Serial.println("Starting SD..");
  if(!SD.begin(4)) Serial.println("SD failed or no SD card inserted");
  else Serial.println("ok");

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    while(true);
  }
}

void loop(){
  // check for serial input
  if (Serial.available() > 0) //if something in serial buffer
  {
    byte inChar; // sets inChar as a byte
    inChar = Serial.read(); //gets byte from buffer
    if(inChar == 'e') // checks to see byte is an e
    {
      sendGET(); // call sendGET function below when byte is an e
    }
  }  
} 

//////////////////////////

void sendGET() //client function to send/receive GET request data.
{
  if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET / HTTP/1.1"); //download text
    client.println("Host: checkip.dyndns.com");
    client.println("Connection: close");  //close 1.1 persistent connection  
    client.println(); //end of get request
  } 
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
    readString += c; //places captured byte in readString
  }

  //Serial.println();
  client.stop(); //stop client
  Serial.println("client disconnected.");
  Serial.println("Data from server captured in readString:");
  Serial.println();
  Serial.print(readString); //prints readString to serial monitor 
  Serial.println();  
  Serial.println();
  Serial.println("End of readString");
  Serial.println("==================");
  Serial.println();
  readString=""; //clear readString variable

}