3.2" TFT LCD with touch screen,SD card slot and Mega Touch LCD Shield Expansion

Hello All,

I am using Arduino Mega 2560 with Proto Shield. Recently i bought 3.2" TFT LCD touch Screen display which has a build in SD card slot,and also bought a Mega Touch LCD Shield Expansion board for my Arduino mega.Exactly these things,

1.This LCD Module with Touch Screen Panel and SD Card slot
http://www.aliexpress.com/item/3-2-TFT-LCD-Module-Display-Touch-Screen-Panel-PCB-Adapter-Blue-SSD1289-with-SD-Card/943009595.html

2.This Mega Touch LCD Shield Expansion v2.2
http://www.aliexpress.com/item/TFT-3-2-Mega-touch-LCD-expansion-board-shield-for-Arduino/770470313.html

Now my questions are,
1.Can i use the touch screen LCD module directly with mega 2560 without the LCD Shield?Will Touch,LCD Screen and SD card all will work fine?
2.Can i use the Library that arduino provided in arduino 1.0.3?
3.Can you provide me some tutorials including demo codes with exactly this LCD?
4.Can you tell me the limitations and features of this LCD? Because i want to be cautious to use this.
5.Can i play video or Flash or any animation using mega 2560 and this TFT Touch Screen LCD?

Thanks in Advance.

LCD Module Picture - More Detailed Picture about 3.2 TFT LCD Module Display + Touch Screen Panel + PCB Adapter Blue SSD1289 with SD Card Slot 65K Colors FZ0527 Picture in LCD Modules from freezone99 co.,Ltd. (1).png

TFT 3.2'' Mega touch LCD Picture - More Detailed Picture about NEW TFT 3.2'' Mega touch LCD Shield Expansion board for Arduino Picture in Other Electronic Components from tudan xu's store.png

1.Can i use the touch screen LCD module directly with mega 2560 without the LCD Shield?Will Touch,LCD Screen and SD card all will work fine? NO
2.Can i use the Library that arduino provided in arduino 1.0.3? Possibly but don't count on it, get the library from your seller
3.Can you provide me some tutorials including demo codes with exactly this LCD? Comes with the file from the sender or find another seller with the same lcd and download that folder
4.Can you tell me the limitations and features of this LCD? Because i want to be cautious to use this. Your limited to what your library can do, unless you can make further functions for the library
5.Can i play video or Flash or any animation using mega 2560 and this TFT Touch Screen LCD? No, not at all, however if you do want to try, go ahead, I can tell you that it will be very slow and choppy.

So what is the solution?

You need to get the correct library from the seller and you need to use the expansion shield.

ronyboss:
1.Can i use the touch screen LCD module directly with mega 2560 without the LCD Shield?Will Touch,LCD Screen and SD card all will work fine?
yes by wires, but I don't know how. I advise you buy from website
http://www.sainsmart.com/home-page-view/sainsmart-mega2560-board-3-5-tft-lcd-module-display-shield-kit-for-atmel-atmega-avr-16au-atmega8u2.html

[ 2.Can i use the Library that arduino provided in arduino 1.0.3?
3.Can you provide me some tutorials including demo codes with exactly this LCD? ]
look the website :
http://www.sainsmart.com/home-page-view/sainsmart-mega2560-board-3-5-tft-lcd-module-display-shield-kit-for-atmel-atmega-avr-16au-atmega8u2.html

5.Can i play video or Flash or any animation using mega 2560 and this TFT Touch Screen LCD?
you can upload images to tft lcd only.
Thanks in Advance.

HazardsMind:
You need to get the correct library from the seller and you need to use the expansion shield.

Thanks.But it is china made,locally brought from Bangladesh and no library provided.I will use the expansion card,as i found it operates in 3.3V and arduino mega 2560 supplies 5V.So expansion board is needed or i have to connect it with wires manually.As i have the expansion board so i will use that.

TTU.ABD:
yes by wires, but I don't know how. I advise you buy from website
http://www.sainsmart.com/home-page-view/sainsmart-mega2560-board-3-5-tft-lcd-module-display-shield-kit-for-atmel-atmega-avr-16au-atmega8u2.html

look the website :
http://www.sainsmart.com/home-page-view/sainsmart-mega2560-board-3-5-tft-lcd-module-display-shield-kit-for-atmel-atmega-avr-16au-atmega8u2.html

you can upload images to tft lcd only.

Thanks buddy u made my day.I was looking for something like that.I will study them and will try today with the help of SainSmart's documents. If more tutorial available please let me know.

Thanks

I puzzled some hours with exactly the same hardware setup and made a quick & dirty, but successfully test script, combining LCD, Touch and SD Card Features.
While googeling I read some hints about wrong Hardware pin mistakes made by the SainSmart V1 Display boards.
I can NOT agree These discusions.
My board is a SainSmart V1.0 and everything works properly with maximum SPI Speed.
The hardes part was to get the SD Card filenames on my TFT Display. (not possible with the sd.h library.)
But with the <tinyFAT.h> it works!
It seems to be a good choice to use These libs.
SD.h comfortable Serial file System features
tinyFAT.h the only way to get filenames on the tft display
UTFT.h easy going Display library
UTouch.h a perfect and easy to use touch screen scanning lib
UTFT_tinyFAT an addon for the tinyFAT.h lib, comes with a Picture Frame demo

and here Comes the quich & dirty test hack:
I hope you apologise my real dirty hack style :slight_smile:

// UTFT_ViewFont (C)2012 Henning Karlsen
// web: Electronics - Henning Karlsen
//
// This program is a demo of the included fonts.
//
// This demo was made for modules with a screen resolution
// of 320x240 pixels.
//
// This program requires the UTFT library.
//

// set up variables using the SD utility library functions:
#include <SD.h>
#include <tinyFAT.h>
#include <UTFT.h>
#include <UTouch.h>

Sd2Card card;
SdVolume volume;
SdFile root;

const int chipSelect = 53;

int x, y;
int bg[] = {
0, 0, 255};
int fg[] = {
255, 255, 255};

// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];

// Uncomment the next line for Arduino 2009/Uno
//UTFT myGLCD(ITDB32S,19,18,17,16); // Remember to change the model parameter to suit your display module!

// Uncomment the next line for Arduino Mega
UTFT myGLCD(ITDB32S,38,39,40,41); // Remember to change the model parameter to suit your display module!
UTouch myTouch(6,5,4,3,2);

byte initres;
byte res;
byte input;

void setup()
{
START:
// Initialize serial communication
Serial.begin(115200);
Serial.println("press the ENTER button on your Touch Screen!");
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(SmallFont);
myGLCD.print("Initializing SD card...", CENTER, 0);
pinMode(chipSelect, OUTPUT);

if (!card.init(SPI_HALF_SPEED, chipSelect)) {
myGLCD.print("initialization failed. Things to check:", CENTER, 16);
myGLCD.print("* is a card inserted?", CENTER, 32);
myGLCD.print("* Is your wiring correct?", CENTER, 48);
myGLCD.print("* Is your CS pin setting correct?", CENTER, 64);
delay(5000);
goto START;
}
else {
myGLCD.print("Wiring is correct and a card is present.", CENTER, 16);

String CT = "Card type: ";
switch(card.type()) {
case SD_CARD_TYPE_SD1:
CT = CT + " SD1";
break;
case SD_CARD_TYPE_SD2:
CT = CT + " SD2";
break;
case SD_CARD_TYPE_SDHC:
CT = CT + " SDHC";
break;
default:
CT = CT + "Unknown";
}
myGLCD.print(CT, CENTER, 32);

// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
if (!volume.init(card)) {
myGLCD.print("Could not find FAT16/FAT32 partition.Make sure you've formatted the card", CENTER, 48);
delay (5000);
goto START;
}
else{
// print the type and size of the first FAT-type volume
myGLCD.print("Volume type is FAT "+(String)volume.fatType(), CENTER, 48);
uint32_t volumesize;
volumesize = volume.blocksPerCluster(); // clusters are collections of blocks
volumesize *= volume.clusterCount(); // we'll have a lot of clusters
volumesize *= 512; // SD card blocks are always 512 bytes
myGLCD.print("Volume size (bytes): "+(String)volumesize, CENTER, 64);
volumesize /= 1024;
myGLCD.print("Volume size (Kbytes): "+(String)volumesize, CENTER, 80);
volumesize /= 1024;
myGLCD.print("Volume size (Mbytes): "+(String)volumesize, CENTER, 96);
myGLCD.print("Files found on the card", CENTER, 112);
myGLCD.print("Open the Serial Monitor", CENTER, 128);
myGLCD.print("and wait for instructions!", CENTER, 144);
myGLCD.setFont(BigFont);
myGLCD.setBackColor(bg[0], bg[1], bg[2]);

initres=file.initFAT();
if (initres!=NO_ERROR)
{
myGLCD.print("***** ERROR: ",CENTER,144);
while (true) {
};
}
drawButtons();
}
}
}

void drawButtons()
{
// Draw the ENTER buttons
myGLCD.setColor(bg[0], bg[1], bg[2]);
myGLCD.fillRoundRect (90, 180, 220, 230);
myGLCD.setColor(fg[0], fg[1], fg[2]);
myGLCD.drawRoundRect (90, 180, 220, 230);
myGLCD.print("Enter", 115, 195);
myGLCD.setBackColor (0, 0, 0);
myTouch.InitTouch();
myTouch.setPrecision(PREC_MEDIUM);
}

// Draw a red frame while a button is touched
void waitForIt(int x1, int y1, int x2, int y2)
{
myGLCD.setColor(255, 0, 0);
myGLCD.drawRoundRect (x1, y1, x2, y2);
while (myTouch.dataAvailable()){
}
delay(20);

root.openRoot(volume);
// list all files in the card with date and size
root.ls(LS_R | LS_DATE | LS_SIZE);
ListFiles();
myGLCD.setColor(fg[0], fg[1], fg[2]);
myGLCD.drawRoundRect (x1, y1, x2, y2);
}

void loop()
{
if(Serial.available()){
int ib = Serial.read();
String is = (String)(char)ib;
myGLCD.print(" ",CENTER,160);
myGLCD.print(is, CENTER,160);
}
if (myTouch.dataAvailable())
{
delay(10);
int xt;
int yt;
myTouch.read();
x=myTouch.getX();
y=myTouch.getY();

if (x>=90 && x<=220 && y >=180 && y<=230) // Button: Enter
{
waitForIt(90, 180, 220, 230);
}
else {
if (y >= 5 && y <= 235 && x >= 5 && x <= 315){
myGLCD.print(" ",260,160);
int x1 = ((x-5)/72+1)*72-72+4;
int x2 = x1 + 65;
int y1 = ((y-5)/10+1)*10-10+5;
int y2 = y1 + 10;
myGLCD.print((String)((y-5)/10+1),260,160);
myGLCD.print((String)((x-5)/72+1),280,160);
myGLCD.setColor(255, 0, 0);
myGLCD.drawRoundRect (x1, y1, x2, y2);
while(myTouch.dataAvailable()){
}
delay(20);
myGLCD.setColor(0, 255, 0);
myGLCD.drawRoundRect (x1, y1, x2, y2);
}
}
}
}

void ListFiles(){
int x = 5;
int y = 5;
String FN;
String EX;
myGLCD.clrScr();
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(SmallFont);

res = file.findFirstFile(&file.DE);
if (res==NO_ERROR)
{
EX = (String)file.DE.fileext;
EX.trim();
if(EX == "RAW"){
myGLCD.print(file.DE.filename, x, y);
myGLCD.drawRoundRect (x-1, y, x+64, y+10);
y+=10;
}
}
else
{
myGLCD.print("No files found...",CENTER,144);
}
while (res==NO_ERROR)
{
res = file.findNextFile(&file.DE);
if (res==NO_ERROR)
{
EX = (String)file.DE.fileext;
EX.trim();
if(EX == "RAW"){
myGLCD.print(file.DE.filename, x, y);
myGLCD.drawRoundRect (x-1, y, x+64, y+10);
y+=10;
if (y > 230){
y = 5;
x+=72;
}
}
}
}
}

rolfmeurer:
I puzzled some hours with exactly the same hardware setup and made a quick & dirty, but successfully test script, combining LCD, Touch and SD Card Features.
While googeling I read some hints about wrong Hardware pin mistakes made by the SainSmart V1 Display boards.
I can NOT agree These discusions.
My board is a SainSmart V1.0 and everything works properly with maximum SPI Speed.
The hardes part was to get the SD Card filenames on my TFT Display. (not possible with the sd.h library.)
But with the <tinyFAT.h> it works!

Thanks a lot. :slight_smile: But I already solved the problem. I am using all UTFT libs. ITDB02 Libs also works perfectly.

Hi Rony

Im interested in using a TFT for realtime user interface, whilst the arduino handles analog and digital inputs and provides serial Tx outputs to Midi.
I have all the A i/o and Midi stuff working. I wonder if you would recommend this TFT for realtime fast visual feedback?

thanks

Vahakn

For real-time display, a faster processor might be needed,
like the Due. I have been using the ColdTears Electronics
CTE32HR, CTE35, CTE40, CTE50, and CTE70 with the Due.
CTE has one shield for the Due, and another for the Mega.

I have modified the UTFT, UTFT_CTE, and UTouch libraries
to support them all, and my Sketch, for the Due, supports
various touch buttons, etc.

Cheers, Gary

Thanks for your interest. Please find pictures, demo code and video for TFT touch screen with arduino mega. make sure you download UTFT library from internet.

Md. Rashedul Amin
Embedded System Engineer
SinePulse GmbH

Hi Amin, I tried your code and lcd display works fine. But it is not sensing touches. Can you also share the libraries that you tried?

You just want EVERYTHING related to UTFT from here :- Rinky-Dink Electronics

And just for future reference to anybody coming across this thread at a later date.......... Saincrap is DEFINITELY not the best supplier to be dealing with!! Pick an alternative, pick ANY alternative!!! Thats my advice!!

Regards,

Graham

garygid:
For real-time display, a faster processor might be needed,
like the Due. I have been using the ColdTears Electronics
CTE32HR, CTE35, CTE40, CTE50, and CTE70 with the Due.
CTE has one shield for the Due, and another for the Mega.

I have modified the UTFT, UTFT_CTE, and UTouch libraries
to support them all, and my Sketch, for the Due, supports
various touch buttons, etc.

Cheers, Gary

They are supported directly by UTFT now. As is the CPLD display.

Incidentally, Coldtears would be top of the list of alternatives to Sainsmartcrap I was talking about, you can find their store only on ebay.com and the seller id is wkws20, if not wkws20, is NOT official Coldtears!! Coldtears store is here :- MWC electronics store | eBay Stores

Buy the genuine article ONCE, and it will work without problems FIRST time, take your chances with OTHER less reputable(Sainsmart) suppliers!!

I can HIGHLY recommend the TFT shields from Coldtears, they are pretty much the best. Of course you could buy a copy from Saincrap costing $13.19 OR you could buy the GENUINE item from Coldtears for $9.99?? Why so many people buy from THAT company I have no idea, they used to sell cheap crap at one point, now they just sell crap :wink: :stuck_out_tongue:

The number of threads on the Arduino forums relating to 'I bought this from Sainsmart and it don't work' is seriously tiresome now............ Spread the word............. buy once, buy Coldtears!

Regards,

Graham

ronyboss:
Thanks for your interest. Please find pictures, demo code and video for TFT touch screen with arduino mega. make sure you download UTFT library from internet.

TFT LCD with Mega

Md. Rashedul Amin
Embedded System Engineer
SinePulse GmbH

Don't bother downloading that RAR.............. it is is just 63MB of useless crap!! Get the UTFT libraries from the link I gave in the earlier post.

Regards,

Graham

Edit: My 800th Post!! :smiley: wow seems only like yesterday was 500, 600, 700....

Hi, I'm beginner here and I need helping from you. I looked for decision here but unsuccessfully.
I've bought 3.2" TFT LCD Display with ILI 9341 Control IC + TFT LCD Mega shield v2.2.
The Screen include a controller SSD1289. It's designed with a touch controller in it. The touch IC is XPT2046, and

touch interface is included in the 40 pins breakout.
This all right, next.
I use latest Arduino Software (IDE) for Windows and latest UTFT library.
I wrote UTFT myGLCD(CTE32HR, 38, 39, 40, 41);- is it ok?
extern uint8_t BigFont[];
Graphic drawing seems right but letters seems "head down"
The seller is Chinese and he couldn't help me.


Hi narduo,

Welcome to the forums! ;D

From your item description you are obviously confused as are many of the sellers as to which controller your display has since they are mentioning both.

The old TFT_320QVT was a SSD1289 controller, the new TFT_320QVT(_9341) is an ILI9341 controller. Unfortunately, that particular model of display is not yet supported directly by UTFT.

Try searching the forums for TFT_320QVT_9341 or just 9341, there are several fixes that will help you.

Regards,

Graham

Thanks, I understood. I've ili9341 controller.

Hi!
ghlawrence2000

I have downloaded all library from you modifyed but i become some errors from buttons library.
i'm using ITBD43, arduino due, sd card, external flash.
The button library tell about use a new version of UTFT 2.0 or more.