Seeed TFT 2.8" v2 on Mega and Micro SD issue

Greetings all,

I have been spending lots of time trying to get the SD card to work on this shield.
Arduino 2.8" TFT Touch Shield V2.0

Made by Seeedstudio and sold by NanuNani through Amazon.com

The component side of the shield states

TFT Touch Shield
v2.1 07/27/2012 01A15

On the shield it has the following print near the bottom
QR4 5265S01 G4/8 TP28017

Here is the wiki
http://www.seeedstudio.com/wiki/2.8''_TFT_Touch_Shield_V2.0

The TFT part (display ) works as advertised. This tells me that the SPI pins are correctly mapped with the default setup. Pins 11,12,13 appear to be disconnected and it inserts directly into the Mega 'as-is'.
The library TFTv2 works fine with text (good enough for me)

The MicroSD card support however refuses to work despite many attempts to redefine pins in source code as per all the info I have read (thus far) in these forums etc.

If anyone has figured this please share what you have learned to get it working.

Right now I cannot tell if it is the card itself but the SC card does work in another SD card reader on a bare MEGA.

Well, it looks as if the shield will fit a Uno, Mega, Leonardo, Due, Zero, ...
The Library looks as if it uses the regular <SPI.h>. So it should work without change on all Arduinos.

You should be able to use the microSD with SD.begin(4) and SPI.beginTransaction(settings)

Have you tried the tftbmp.ino example sketch?

I do not have this shield, but it looks pretty straightforward. Just remember to only enable one SPI device at any one time. And to use beginTransaction() if the settings are different for your SD and TFT. (I use mode#3 for a TFT)

Note that most SD examples will expect pin #53 for the SD chip-select on a Mega. Your shield uses pin #4.

David.

Thank you David.

I managed to isolate my problem by finding the 'tftbmp.ino' as you suggested and this actually worked so I was at least able to move forward from that point. Thank you!

To others who may be looking for a clue make sure you load and use the right shield example first before trying out other things.
For my issue it was that the tft had to be initialized in the code first before the the SD card (being part of the shield) would not work without this initialization first.

I imagine that other pins needed to be set as output high to effectively keep them away from the SD card chip select pin. I did try to set all other chip select pins high myself but this did not work for me. But since the example works I can safely determine what is the cause of my error, eventually.)

Best Regards,

You always need to make sure that SPI devices are un-selected. e.g. each /CS pin is high.

Most well-designed hardware will have an external pull-up resistor to ensure that the default state is un-selected.
The AVR does not "control" anything until it s running.

The AVR does the "control" by making each /CS pin an output high.
Then it selects one device by making its /CS pin low.

e.g. TFT, Touch, SD card are all de-selected when the AVR starts running its program.

David.