Help Arduino Mega 2560 + 3.2" TFT LCD

I have Arduino Mega 2560 + TFT LCD Mega Shield V2.2 + 3.2" TFT LCD 240*400

I test with this code:

#include <SPI.h>
#include <TFT.h> // Arduino LCD library

#define cs 7
#define dc 6
#define rst 5

TFT screen = TFT(cs, dc, rst);

void setup() {
// initialize the screen
screen.begin();

// make the background white
screen.background(0,0,255);
}

void loop() {

}

But nothing happen, the screen still be white (see picture)

Please help me

Help me please =(

Hi I have faced similar problem with other hardware (mine is SmartGPU2 3.5") and I am still not able to boot up the screen but I have made many steps, it might help 1- make sure the input voltage to your device is correct 2- make sure you have the right libraries to operate the screen 3- read the document sheet of your device and connect the wires based on it.

I hope this might help, keep us updated

hamzehhirzallah: Hi I have faced similar problem with other hardware (mine is SmartGPU2 3.5") and I am still not able to boot up the screen but I have made many steps, it might help 1- make sure the input voltage to your device is correct 2- make sure you have the right libraries to operate the screen 3- read the document sheet of your device and connect the wires based on it.

I hope this might help, keep us updated

Tks for your help But my LCD not better, =(

nothing changed

Suggest you try the utft librasry more options on the device / screen configurations.

Just google utft.

cheers

You need to use the UTFT and UTouch libraries not the regular TFT library.

The display was made for the pin-outs of the Uno not the Mega.

Even though the display plugs into the Mega, doesn’t mean it will work.
The Mega moves some of the I/O pins you need to other locations.

I had this same issue. Once I rewired the display to connect to the pins
on the Mega, it worked great.

There are many topics on this, just search the forum.

No need for wiring changes if you use utft.

Work out which pins on Mega are which Then the utft constructor accepts these pins..

Hello, guys.

I'm thinking of buying this screen + shield kit for my Mega 2560 (http://www.ebay.com/itm/3-2-TFT-LCD-Module-Touch-Panel-TFT-3-2-LCD-Shield-Expansion-Board-For-arduino-/310796373380?pt=LH_DefaultDomain_0&hash=item485ce84d84)

However, I couldn't find this information: how many available pins will be left in the Mega after plugging the shield?

In my project, I will need a few more pins, because I will still be using other devices (such as sensors and motors).

Thank you!

Did you click the link on that page, Data Download?

[quote author=Erick Moraes link=topic=240409.msg1740735#msg1740735 date=1401192931] Hello, guys.

I'm thinking of buying this screen + shield kit for my Mega 2560 (http://www.ebay.com/itm/3-2-TFT-LCD-Module-Touch-Panel-TFT-3-2-LCD-Shield-Expansion-Board-For-arduino-/310796373380?pt=LH_DefaultDomain_0&hash=item485ce84d84)

However, I couldn't find this information: how many available pins will be left in the Mega after plugging the shield?

In my project, I will need a few more pins, because I will still be using other devices (such as sensors and motors).

Thank you! [/quote]

Tks you, But i don't know chinese

HazardsMind: You need to use the UTFT and UTouch libraries not the regular TFT library.

I think my LCD or Arduino was damaged, I test with Examples of UTFT and UTOUCH library, SD card 128MB, 9V Power Supply, not work =(

I extracted everything you should need to get it to work.

TFT_Libraries.zip (246 KB)

HazardsMind: I extracted everything you should need to get it to work.

How to use TFT_library?

forgive my clumsy about :blush:

Well, forget the chinese stuff.

Take this as a reference: http://www.ebay.com/itm/SainSmart-3-2-TFT-TFT-LCD-Shield-for-Arduino-Mega2560-Mega1280-R3-Nano-Robot-/271019836468?pt=LH_DefaultDomain_0&hash=item3f1a0a8434

Does anyone here have such shield? How many available pins will there be left after plugging the shield to an arduino mega?

Thanks.

The simple anser is none, they don;t fit the exrras, but if you do fit the connectors you have the following,

Alll the communication pins Pins 8 to 13 All the analogs

Its a shame that thereis no other break outs, the dispkay uses all the Digital pins 22 to 53 but in fact some are redundant The touch uses 2 to 7

cheers Happy coding 8) 8)

Oh, thanks a lot, that's exactly what I needed.

It's such a pity that it consumes so many pins. I will have to think really carefully about my project before purchasing this display.

Thanks, anyway.

BTW Trade Spotting are the ebay arm of SAINSMART and the ebay prices are higher than buying direct !

Have used about 24 screens and shield some times direct but i generally attach screen by ribbon to ensure access to the other pins is simple

Had only 1 failure, UTouch is quite quirky on this display if you email Auther and says Sainsdmart he tells you in no uncertain tone no support your own your own

UTFT works on solution but I have wrappered a class arround it to create in my opinion a nore consistent and defined interface

Cheers 8) 8) 8)

Tks for all My LCD has worked

But i have some problem with Touch See this video, you will know https://www.youtube.com/watch?v=HvS8_MGsvw0&feature=youtu.be

X axis was inverted, and some pixel on the left lost (in this video, i can't press the "clear" button) what's happen?

You can subtract 320 from the getX() value you have now.

The UTouch lIbrary in my view uses a slightly odd method ..

  1. I used a logic analyser to review the Texas Instrument chip used for the screen, this showed the best option seemed to be to attach the IRQ to a pin on arduino as an ege triggered interrupt. rather than use the polll techniues and read while low.

  2. The spec on the chip also highlighted that although its 12 bit resolution to ensure next value availability you should clear the buffer register by clocking 16 bits through, from memory the UTouch library only does 12

  3. You tend to get a ghosting interrupt generated at removal of touch which if your polling will cause extra invalid readings.

4 I run a moving average on data during a touch event.

Calibration is difficult on smaller displays if you google cailibrartion algorithms for TFT touch, the matrix solution always comes out best but

/// a.. On 3,2 its a bit overkill // b. The maths is difficult to program

The UTouch Library solution is fair, but holding the pointer still whilst sampling for a series of locations I find difficult, my customers founmd impossible.

Rewrote the calibration to cycle defined points round screen to acieve am average Y for TOP, BOTTOM and average x for LEFT, RIGHT with that and some simple maths can scale any touch sample read to be position on screen

Currently can specify down to 8 x 8 Icon on screen and with stylas touch detecy position. With finger touch use 16 x 16 Icon

Happy coding

8) 8)