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:
Formatted my SD card to Fat16
Tried my own images but then switched to the provided images as a test, nothing there
Tried the ISCP header on Mega
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?
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
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.
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!
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.