Hi everyone, I just purchased a TFT touch display and shield frombuydisplay and I am not having any luck trying to get the Micro SD card to work. It has two SD card slots, one on the shield and one on the display. It did come with example code that I can play with but none for the SD Card. However, they did not have any code for the SD Card NOR will they give me any when asking them.
I am really new to programming and the way that I have been learning is taking example code and making changes to get things the way that I want them. I have not made any changes to Libraries yet but have no trouble with the basics.
I have been able to read the card from the sample readers in SDFat through the Micro SD in the shield but haven't been able to figure out how to load them into the TFT screen as of yet.
One of the things that have me confused is the Software SPI because it shares pins with the touch screen and when I read the SD Card, it turns off the touch screen, which wont turn on again unless I reset the Mega and/or shield.
If you have any example code to show us, we would appreciate it tremendously. BuyDisplay is not very helpful in the SD code department. If not any help will still be appreciated!
Are you saying that the on board SD slot will not work or that it would just be easier to buy another and have a dedicated pin for it? That seems like a complete waste to me because this thing has two (2) SD Card Slots already!
I got it to load pictures using the Micro SD on the shield. I will try to include my code but it is my first time doing so, so try to bear with me.
// I am using Arduino IDE 1.6.11 and the Libraries Below
// The Date is 9/16/2016
// This is an Example of how I managed, with help from the Arduino forum, to use the Micro SD card on the ER-TFTM050-5-4124 SHIELD from BuyDisplay.
// However, in order to make this sketch work a library !!!MUST BE MODIFIED!!!
// In the SdFat Library, go to the "src" folder and open up the SdFatConfig file.
// Add the definitions below to get the SD Card to work.
/////////// Add definitions below to SdFatConfig file //////////////////////////////////////////////////
/*
#define SD_SPI_CONFIGURATION 2
uint8_t const SOFT_SPI_MOSI_PIN = 44;
uint8_t const SOFT_SPI_MISO_PIN = 45;
uint8_t const SOFT_SPI_SCK_PIN = 43;
*/
/////////// Add definitions above to SdFatConfig file //////////////////////////////////////////////////
#include <SdFat.h>
#include <UTFT_SdRaw.h>
#include <UTFT.h>
#include <SPI.h>
UTFT myGLCD(SSD1963_800480, 38, 39, 40, 41);
UTFT_SdRaw myFiles(&myGLCD);
const uint8_t SD_CS = 47; // SD chip select pin
extern uint8_t BigFont[];
SdFat sd;
////////// Below is a list of VGA Colors they can be used for Fill Screen and Fonts in UTFT ///////////
// VGA_BLACK
// VGA_SILVER
// VGA_GRAY
// VGA_WHITE
// VGA_MAROON
// VGA_RED
// VGA_PURPLE
// VGA_FUCHSIA
// VGA_GREEN
// VGA_LIME
// VGA_OLIVE
// VGA_YELLOW
// VGA_NAVY
// VGA_BLUE
// VGA_TEAL
// VGA_AQUA
void setup()
{
myGLCD.InitLCD(); //Initialize Screen
myGLCD.clrScr(); //Clear Screen
/////////////////////////////////////////////////////////////////////////////////////
pinMode(8, OUTPUT); // These two lines turn on the backlight /////
digitalWrite(8, HIGH); // Without them, the screen will look BLANK /////
/////////////////////////////////////////////////////////////////////////////////////
myGLCD.fillScr(VGA_LIME); // Fill Screen ///////////////////////
/////////////////////////////////////////////////////////////////////////////////////
myGLCD.setFont(BigFont); // Set Font ///////////////////////
myGLCD.setColor(VGA_BLACK); // Set font color here //////////////////////
myGLCD.setBackColor(VGA_LIME); // Set font backcolor here //////////////////////
/////////////////////////////////////////////////////////////////////////////////////
sd.begin(SD_CS, SPI_FULL_SPEED); // Have to begin SD or it wont work! ///////////
/////////////////////////////////////////////////////////////////////////////////////
myFiles.load( 0, 0, 257, 320, "tryit.raw", 1 , 0); // Load A PICTURE! ///////////
/////////////////////////////////////////////////////////////////////////////////////
}
void loop()
{
myGLCD.print("SD Werkz", CENTER, 395);
}
I forgot to mention that I had to convert my .bmp's to .raw to get them to work on the Shield. An Image converter can be found on the Rinky Dink Website.
In addition, I have my Micro SD Card formatted in FAT32 and I have tested it with Two (2), 32GB Micro SD Cards, one class 6 and one class 10.
There is another hurdle with this Shield! After being able to load an Image from the SD Card, the touch stops working. The only way That I can get the touchscreen to work again is by Unplugging the power to the Arduino and plugging it back in. I hope this is something simple and someone on the forums can help me to make this work as intended.
In the meantime while waiting for them to come in the mail, I am bored and have nothing to do but look at my buydisplay shield and hoping I can get the stupid thing to work as intended!
I'll bet its something simple that I am missing in the Software SPI library but I cant find any tutorials for that...yet.
So if anyone wants to help me to alleviate my boredom, by all means chime in?
Now I got this Display working well with the SD Card and the touch screen, I would like to go further and begin using the FONT and FLASH Chips. However, I am not sure where to start, although I have soldered them onto the Shield and did a good job for a novice at soldering SMD's
I would appreciate any help getting these chips working so I can play around with this Display.
I would like to know what libraries that I should use for the font chip and the flash chip. They are on the software SPI bus as well. While waiting for my other stuff, it will give me an opportunity to learn more about the Arduino DUE, which by the way loads a picture a lot faster than when using the MEGA 2560! Thanks for your suggestion of getting a DUE, I am very happy with it.
So set it up for hardware SPI!!!!............... it is only a matter of jumpers?............ And THEN, you will see what the DUE is REALLY capable of!!