Images from SD card tot TFT display with Arduino Due

Hello,

I know many other threads have been about this, but none of the suggestions I found worked out.

I have made my own shield for the Arduino Due and TFT. I also made my own SD card controller and also a direct control to the TFT and Touch chipset (TSC2046), all work (so good display functions and touch also works)

However, I cannot get any pictures from the SD card to the display. Initialisation finds the card, but somehow it does not communicate, not with myFiles.load, or SD.exists, or any other thing i have tried.

I have attached the SD card holder to the SPI pins of the DUE, according to the schematics I found of shields, so using pin 108, 109 and 110, and pin 137 (D4 for CS), all connected directly without pullup or pulldown resistors, only max 5 cm of wiring).

I hope it is a software issue, somehow I do something wrong. I have tried formatting several cards with FAT16, FAT32, all speeds and buffer sizes, but cannot get anything. Alreay am testing 2 days with hardware and software, so I am not asking lightly, hope someone can help me here!

Software I have made (I am from the early days, using Basic, Z80 machinecode, Pascal, Cobolt, etc, not really C++, as you probably can see, sorry :slight_smile: is below.

There is no delay between the myFiles.load and the next line, so it is not reading the file, it seems not to be able to find it...

Any help get very very good kharma! Thanks!

#include <SPI.h>

#include <SdFat.h>
#include <UTFT_SdRaw.h>
#include <UTFT.h>

extern uint8_t SmallFont[];

SdFat SD;

UTFT myGLCD(TFT01_43,15,11,56,57);
UTFT_SdRaw myFiles(&myGLCD);

int DimPin = 2;

void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setFont(SmallFont);

pinMode(DimPin, OUTPUT);

}

void loop() {

analogWrite(DimPin, 255);

bool mysd = 0;
// see if the card is present and can be initialized:
while (!mysd)
{ delay(100);
myGLCD.print("* ", 200, 120);
if (!SD.cardBegin(4, SPI_SIXTEENTH_SPEED)) {
myGLCD.print("
fail ", 200, 120);
}
else
{
mysd = 1;
myGLCD.print("
ok *", 200, 120);
}
}

myFiles.load(0, 0, 240, 240, "WAIT4GPS.RAW", 4, 1);

if (SD.exists("WAIT4GPS.RAW")) {myGLCD.print("* ok2 *", 200, 120);}

}