Hi Simon,
However I get an "initialization failed" error message from the code, which means that the DUE failed to write to the SD card. After reading several documentations, I suspect that pin 4 and 10 are indeed the right ports to read/write, but I could be wrong...
There "initialization failed" error message does NOT mean the DUE failed to write to the SD card, it did not even get past initialization.......
"I suspect that pin 4 and 10 are indeed the right ports to read/write", clearly you have misunderstood how SPI access to the SD card works, MISO/MOSI are the data in/out ports and are NOT pins 4 or 10. You should read up some more about SPI SPI - Arduino Reference but in a nutshell, the gist of it is this, you have a clock, data in and data out which go to ALL SPI devices, the only pin that changes and thus allows you to access a specific device is the CS(SS) pin
There are a couple of things you need to check.
Taken from "DUE_Shield_readme.txt"
Shipping default jumper configuration:
The TFT/SD Shield for arduino DUE is shipped with the following jumper config, if you use TFT modules in our store, you do not need to reconfig the jumpers.
LCD Vcc - 3.3V (JP2 shorted)
LCD backlight (LEDA+) - 3.3V (JP4 shorted)
arduino Pin32 to TP_DIN (JP10 opened)
On board SD - disabled (JP8 opened)
NOTE JP8 opened/on board SD - disabled. !!!!! Did you put a solder blob on JP8?
Assuming you did, the next thing to check is that you changed both entries relating to CS(SS) in your SD code :-
Serial.print("Initializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// Note that even if it's not used as the CS pin, the hardware SS pin
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
// or the SD library functions will not work.
pinMode(10, OUTPUT);
if (!SD.begin(4)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
As a self-confessed newbie, did you pick up on the misleading error in the example??
pinMode(10, OUTPUT); & if(SD.begin(4)) { ??
The 10, and 4 relate to the same pin and therefor SHOULD at least be the same, in your case 53!
The coldtears shield is exactly what I have if you read the very post before yours, and it works fine with both SD and SDFATLIB once you bridge JP8, and use pin 53 as SS.
Best wishes,
Graham