Arduino DUE cannot initializing SD Card

I have started with Arduino Mega board, but after some upgrades of my code i realised that i will need from more faster calculating processor, as until that moment everything on my code worked. I take a Arduino DUE board and continue with upgrades of my code, until i checked and realised that that controller cannot initializing my SD card.
I started reading at the forum, about this problem at Arduino DUE that it cannot using SD library. I've tried with SDfat library, but again unsuccsessful.
I tried to use just clear examples codes... and again my Arduino DUE cannot initialize my SD card.
I again tried SD card to Arduino Mega and its working correct!

In addition, i using 3.5 inch TFT Display: ILI9486 (16bit) with SD slot (Not touchscreen).
My SD card is SanDisk Ultra: 32GB (Class 10).
I've tried these libraries: SD.h and SDfat.h

Its not solution at my project to use external SD shield.

Thanks in advance, if you can give me solution on my problem!

P.S. I checked about other topics at this forum and at internet, but i didn't found answer of my problem.

realised that i will need from more faster calculating processor,

Without seeing the code I can only assume that you are WRONG! It's a common mistake to assume that 16MHz is slow.

For the rest we need much more detail - does SD even compile for the Due!


Thanks about fast answer, but the problem is that examples of the SDfat library cannot initializing my SD card.
I used this example:

  SD card read/write

 This example shows how to read and write data to and from an SD card file
 The circuit:
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13

 created   Nov 2010
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe

 This example code is in the public domain.


#include <SPI.h>
//#include <SD.h>
#include "SdFat.h"
SdFat SD;

#define SD_CS_PIN 53
File myFile;

void setup() {
  // Open serial communications and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only

  Serial.print("Initializing SD card...");

  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("initialization failed!");
  Serial.println("initialization done.");

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile ="test.txt", FILE_WRITE);

  // if the file opened okay, write to it:
  if (myFile) {
    Serial.print("Writing to test.txt...");
    myFile.println("testing 1, 2, 3.");
    // close the file:
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");

  // re-open the file for reading:
  myFile ="test.txt");
  if (myFile) {

    // read from the file until there's nothing else in it:
    while (myFile.available()) {
    // close the file:
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");

void loop() {
  // nothing happens after setup

I upload it successfully, but when i start Serial screen and write me that can’t initilize my SD card.

Connection of an SPI Slave to the DUE should be done thru the SPI header (the one close to the Sam3x uc).
Search for the Graynomad pinout diagram, very helpful.

Power the SPI slave with 3.3V (not 5V), and SPI CS pin can be either pin 4, or 10 or 52.

I checked Graynomad pinout diagram, but the question is how to solve my problem with this LCD TFT shield ILI9486 16bit ? My SD_CS pin is number 53