Sainsmart TFT-320qvt SD Reader Issues

Hey guys, here's what I have:

I am using the Sainsmart TFT-320qvt (40pin) LCD with my Mega2560 and hit a brick wall trying to display images from the SD card. I am using the UTFT, UTFT_tinyFAT, and tinyFAT libraries which are well documented, and have worked for me so far (mainly displaying text, and bitmaps from program memory).

I believe there is a missing link in communication, since no matter what I do I get:

Image Not Found
"imagename.raw"

Which sounds to me like arduino isn't reading S@#$.

I have:

  1. Formatted my SD card to Fat16
  2. Tried my own images but then switched to the provided images as a test, nothing there
  3. Tried the ISCP header on Mega
  4. Tried reversing MOSI and SCK (I believe are the two), as per some other forums with a similar problem

I am under the impression that either I wired the SD reader incorrectly OR this ancient 2565MB sd card I found is unsupported.

Anyone have particular experience with MEGA and this display?

Did you have to tweek anything to get it working?

What brand and size SD did you use?

Thanks for any pointers guys, I'm learning here.:grin:

You fail to mention which tft shield you are using... Presumably Sainsmart V1.00? As you may or may not be aware, the Sainsmart MEGA2560/TFT Shield/TFT 3.2" bundle has caused many people many problems. I was lucky, in so much as mine all worked out the box :wink:

I would suggest you try the SD library and examples such as cardinfo and listfiles before you go much further. Your CS pin should be 53 if you have the full Sainsmart bundle.

Another suggestion from what you say, that SD card is pretty dinosaurish, maybe SPI_FULL_SPEED is being WAAAAYYY optimistic, did you try SPI_HALF_SPEED, or even SPI_QUARTER_SPEED ?

All the best,

Graham

Edit:

dbugs:

Image Not Found

"imagename.raw" <== that would be a problem since imagename.raw is 9.3... MUST be 8.3 !!





Anyone have particular experience with MEGA and this display? <====Yep, works a treat

Did you have to tweek anything to get it working? <==== Nope, was lucky :P 

What brand and size SD did you use? Samsung 4Gb, 32Gb Kingston 8Gb <==== All work fine

You fail to mention which tft shield you are using...

Sorry to misinform. I'm not actually using a shield just connecting via jumper wires.

The pinout I followed is here:

It's not for my exact module, but it worked for the LCD. Tracing the lines on the board the SD pins are at least in the right spot. I also haven't found any other pinouts for a 40pin LCD. Sainsmart is not the best about documentation I've found...

Just tried the built in SD library, listfile example with no luck.

Found this article on slowing down SPI speed, will try this and a different SD card and report back.
http://forum.arduino.cc/index.php?topic=108017.0

EDIT***: From your post I take it SD library is not limited to 2gb?

Guess I will be learning more about SD card stuff then I planned on......

dbugs:
I'm not actually using a shield just connecting via jumper wires.

Sainsmart is not the best about documentation I've found...

Just tried the built in SD library, listfile example with no luck.

Found this article on slowing down SPI speed, will try this and a different SD card and report back.
SD library mod for SPI_QUARTER_SPEED - Storage - Arduino Forum

EDIT***: From your post I take it SD library is not limited to 2gb?

  • I'm not actually using a shield just connecting via jumper wires. <--- This is likely to be a problem and will DEFINITELY limit your SPI speed. Not only that but what have you done about level translation? Mega being 5V, SD card being 3.3V. If you use resistor translation, again, MAJOR detriment to SPI speed.
  • Sainsmart is not the best about documentation I've found... Sooner or later you will realise that Sainsmart are just not the best!!
  • Just tried the built in SD library, listfile example with no luck. <--- Start with cardinfo... You can adjust SPI speed in that sketch!
  • SD library mod for SPI_QUARTER_SPEED - Storage - Arduino Forum <--- Good place to start, but once you got the hardware sorted, you will want to dump the built in SD library and progress to the WONDERFUL SdFat!
  • EDIT***: From your post I take it SD library is not limited to 2gb? <----- SdFat is capable of 128Gb... But don't run before you can walk....

My advice to you, is buy a shield.... preferably NOT Sainsmart!! The Coldtears shield will save you a whole heap of trouble.... http://www.ebay.com/itm/TFT-SD-Shield-for-Arduino-MEGA-2560-LCD-Module-SD-level-translation-2-8-3-2-DUE-/121161179201?

Regards,

Graham

Update:

ghlawrence2000 thanks for all the info first off!

As of 2am last night I switched to Seeed's SD card shield, and was able to verify that both my 256MB Lexar and 16GB Kingston cards work with the SDfat library as per ghlawrence2000's suggestion to use the new library. Both cards work at SPI-FULL-SPEED, even when the shield is jumper wired to MEGA

I did not know about the voltage difference, and assumed the tft device was set-up to handle this. To the best of my knowledge this must be the reason I was getting initialization errors.

As mentioned above, I have since switched to an SD shield from Seeed since it works without a hitch, and occupies a total of 6 pins. SDfat library but looks complicated, not sure how I (being this green) will implement it so far.

TLDR; SD slot on the TFT was taking forever to troubleshoot, and a shield isn't optimal because of space requirements. The slot on the TFT isn't in a very accessible place for my needs anyway.

Found a link to the hardware wiki, if anyone cares :slight_smile:
http://www.elecfreaks.com/wiki/index.php?title=3.2"_TFT_LCD_Screen_Module