I am using watchdog to reset the arduino, in case that some error occurs. It looks something like this:
void setup()
{
wdt_disable();
Serial.begin(4800);
pinMode(4, OUTPUT);
if(SD.begin(4)) Serial.print("OK"); else Serial.println("FAILURE");
wdt_enable(WDTO_8S);
while(1);
}
The initialisation of the SD card works fine for the first time. After the reset triggered by the watchdog, the initialisation does not work anymore. The same problem occurs when the arduino is resetted by opening the Serial-Monitor interface. Funnily enough, after cutting of power supply for a short time, SD.begin() is working fine.
Anyone got a solution, sothat SD.begin() does work after resetting the arduino?