2.2 TFT lcd and Arduino Mega 2560

Hi, I have this display http://www.ebay.com/itm/Hot-sale-2-2-inch-Serial-SPI-TFT-Color-240X320-LCD-Module-ILI9341-Driver-IC-/360699426541?pt=LH_DefaultDomain_0&hash=item53fb5c76ed, and there were other posts about it asking how to make it work here. However, I couldn't find any info on how to hook it up to the Mega. I tried both UTFT and seed library GitHub - gmtii/ili9341-arduino: ILI9341 2.2 LCD library. None worked. I'm currently using 270 and 470 ohm transistors as level shifters.

Did you see this post ?
http://forum.arduino.cc/index.php?topic=200126.msg1479535#msg1479535

Hey.Thanks first :slight_smile: . I've just redefined the pins for mega but still nothing. Another post I read said the display just worked with the CD4050, do you think these resistors are ok? What if I wire it directly to the arduino? Would the chip be fried?

There's three methods that prefer but others may recommend another dozen.
I have the 74HC4050, the 74LVC245 and the TXB0108 from Adafruit.

The datasheets are attached for all three.
The main difference is that the 74HC4050 is one directional with no Output enable, while the 74LVC245 is
bidirectional with both a DIRection control pin and an Output Enable but unlike the 74HC4050 , ALL must
go the same direction. (with the 4050 you can have inputs from the higher voltage side mixed with inputs from the
lower voltage side because you have the lower of the two supplies powering the chip . Both the 74HC4050 and the 74LVC245 follow the rule that you connect the lower of the two PS to the Vcc pin of the chip and the any of the inputs can tolerate an input voltage in excess of the connected Vcc. The TXB0108 is in a class all by itself because it requires no DIRection
control pin and has TWO power supply voltage inputs, one for the 3.3V and one for the 5V and whether it is an input or
output is "X-DON'T CARE" as they say because the data flows from the output to the input. (don't ask me how). This
is perfect for the Adafruit Thermocouple breakout bd because you have a Data output, a chip select input and a CLock input.
I connect all three to the 3.3V side and the 5V side goes to the Arduino.

74HC4050_CNV (1).pdf (37.9 KB)

74LVC4245A.pdf (323 KB)

TXB0108.pdf (1.13 MB)

That seems to work, but I couldn't find the 4050 IC in my city.Resistors or direct wiring are not suitable at all?

I've just tried connecting the display directly to arduino and still just the backlight works.Next try will be with diodes.Hope to get it working, or I'll have to find the level shifter somewhere else.

I can't recommend connecting it directly .
Take a look at this post:
http://forum.arduino.cc/index.php?topic=205371.msg1512245#msg1512245
You can try the resistor diode circuit attached.

level_converter_5V_to_3P3V.jpg

Hey @raschemmel , you're a genious! :slight_smile: :slight_smile: It is working now!! Thanks. I just have a question. Does the UTFT library support SD card? I read it does but only for up to 2 GB. I would just need to wire the SD_CS to the arduino,right?

It stopped working! Was perfect, I just soldered the backlight led to pin 47 and it stopped working, even when I put it back to pin 9.

Got working again :stuck_out_tongue:

You're scaring me...
Credit for the resistor-diode circuit goes to MarkT, Reply #8 from this post:
http://forum.arduino.cc/index.php?topic=205371.msg1512245#msg1512245

The SD chip selects tend to be specific, (like pin 10) but look at the example code for the SD card to find
out which pin. If you can redifine it , then even better.
Incidently, did you download the large file on this page ?

Glad it's working... :grin:

I'll take a look at the code. Is UTFT the best library available? If you know others, please indicate them c: .Now the display is working for some time and then just the led works.I guess may be the internal regulators overheating and I'll build some others to try fixing it.

Can you do me a favor ?
Can you please post the wiring detail of how you connected to your Mega ?
It looks like a SPI interface .
I'm just wondering which pins on the Mega you connected to which pins on the display.
Thanks.
Read Reply #10

No,I hadn't downloaded it yet.Just downloaded now. Tomorrow I'll take some pictures of the wiring and them I'll post it here :wink:

How many connections are there ?
You don't have to take photos .
If you know what the connections are you can just post those.

Already took pictures :stuck_out_tongue: . The connections are right, I guess. At least,now the display is working quite fine. Thanks for all the help :smiley:

Which pins of the lcd and mega2560 require the level converter on post 6 ?
Doe anyone have a complete diagram using the LCD on post 1, a mega2560 and the level converter on post 6?