LCD display with ILI9341 driver on Arduino

I have Arduino Uno. As I understand signal voltages of Uno and Mega are same (5V). Display
requires 3.3V signals (not 5V). When display disconnected and only Arduino board and CD4050 are in scheme (CD4050.VCC connected to Arduino 3.3V) I see 4.2V at CD4050.VCC.

I use CD4050 from http://www.ebay.com/itm/2PCS-CD4050-IC-BUFF-CONVERTER-HEX-DIP16-NEW-GOOD-QUALITY-D14-/301595571771?pt=LH_DefaultDomain_0&hash=item46387f363b

avhohlov:
When I connect CD4050 VCC to Arduino 3.3V and one input to Arduino 5V voltage at CD4050 VCC (and Arduino 3.3V) about 4.2V

You can try to use 74lvs245 to convert the 5 volt signals >> 3.3 SPI, then we put 4050 and nourishes the bunch 3.3 Volt. Good luck.

How about a better part: cd74HC4050
"The ’HC4049 and ’HC4050 are fabricated with high-speed
silicon gate technology. They have a modified input
protection structure that enables these parts to be used as
logic level translators which convert high-level logic to a low level
logic while operating off the low-level logic supply. For
example, 15-V input pulse levels can be down-converted to
0-V to 5-V logic levels."

Many folks use these to convert 5V to 3.3v for SD & uSD cards for example.
http://www.digikey.com/product-detail/en/CD74HC4050E/296-9213-5-ND/376792

vs older, slower cd4050
http://www.digikey.com/product-detail/en/CD4050BE/296-2056-5-ND/67303

Got to stop buying parts from e-bay and get them from reputable distributors.

I bought that same 2.8" display and after many attempts, I finally got my display to work with a few 2k2 and 4k7 resistors. I bought the Hex Buffer chip, CD4050BE, but the voltage was leaking through to a few of the pins and the chip did not work. (Perhaps I just have a bad batch, that's my luck). Anyways the display works but it is incredibly slow and can't really use my DUE, because I want everything to be as compact as possible.

I'm making a multi-purpose controller. It will have the feel of a gaming controller (Actually similar to a PSP) but it will have a touchscreen keyboard, duel PSP joysticks, an accelerometer/gyroscope, D-pad + action buttons and shoulder buttons. It will also have Bluetooth, Wifi, and RF, (no real purpose to have all three, but I will find a use for them)

@CrossRoads
Do you sell any boards similar to this, but with the same processing speed as a DUE?
http://www.ebay.com/itm/161757302117?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

2 CrossRoads

I test Philips 74HC4050N + 3-to-5V level shifter on BC547 and it seems work correct.
Direct connection ILI9340.SDO to Arduino.MISO also seems work.

When connecting a 3V level device to a 5V Arduino, I find the following points very helpful:

To all that come here after this post trying to get these displays working. Weeks ago I was in the same spot. I bought my cheap display and all I wanted to do was hook it up and see pretty colors. That did not go so well. But now after I have spent the last 10 days READING all of these posts and following up with the links, photos and sample code. I have now mastered the ILI93xx series displays.

Everything you need to know is in all of these posts and reading all of them if you are here will teach you something things about displays you probably didnt know when you started all of this and will help you on the next one.

In short. No matter what any website says. A lot of these displays are NOT 5V displays. Not on ANY of the pins. ebay lies. Kenjutsu above me just posted the same thing. He is correct.

You will need a logic converter. I built a small one on a proto type board with a header to plug and unplug my display and it works really nice. You WILL need to build one of these.

Other than that my biggest set back was that some libraries reference pins 4,5 and 6 and some 8,9 and 10. and where LED goes and why why why....

This are USER definable. read the posts. From what I have read most all of them want the following

These are predefined in the Audrino hardware

sclk= 13
miso = 12 (This one really isn't used but mine doesn't seem to work without it)
mosi = 11

These are movable

d/c= 6
cs = 5
reset = 4

This one is preference. The led needs power. You can try hooking it directly to 3.3v or using pin 7 which in the test code uses PWM to drive the voltage. If you use pin 7, you can control on/off if you use directly the backlight will always be on. Some say use a resistor. I did both. didnt seem to matter.

LED= 7

Rinky dink electronics has a working library for these.

http://www.rinkydinkelectronics.com/library.php

The README file says exactly like above. It does work.

The Adafruit library also works well with the following

graphictest.ino, demo code in Adafruit library

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9340.h"

#define _sclk 13
#define _miso 12
#define _mosi 11
#define _cs 5 //10
#define _dc 6 //9
#define _rst 4 //8

Adafruit_ILI9341 tft = Adafruit_ILI9341(_cs, _dc, _rst); // Use hardware SPI

So as you can see you can re-define cs, dc and rst to what you have. This goes the same for the Mega2650. They also work just fine there too.

I will also note the other issue I ran into. These displays can use either software or hardware SPI. You want to use hardware. Software driven re-defines the pin code through the software. It is 10 times slower. The adafruit library even says that.

// Using software SPI is really not suggested, its incredibly slow
//Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _mosi, _sclk, _rst, _miso);

I ran my pin7 LED through the logic converter cause it was already wired on the proto board I made that way. running for 2 days now non-stop no problems.

Thank all of you for your posts, this is by far the longest form I have read and stayed at a while.

I attached a photo of my logic board. This cleared up 80 percent of my problems over using a breadboard. That is a TI 74LVC245AN logic converter. I got a handful off ebay for 7 bucks.

You will have to read the spec sheet but the connection is pretty straight forward. I went with that model so it would work inline on a proto breadboard with little wiring and look nice. The display mounts backwards over the whole mess so it looks like a somewhat made factory item when connected and I can use others with the same pinouts just by plugging in.

You can also look at the following post for info on driving the backlight via PWM:

PWM ILI9341 backlight control?

I have a problem. Nothing happens with the display except I cant turn on the backlight with connecting LED pin to voltage. :slight_smile:

So parts that I'm using.

Converter:
http://www.ebay.com/itm/281619636885

LCD:
http://www.ebay.com/itm/2-4-320-240-TFT-LCD-Touchscreen-with-PCB-ILI9341-Display-CP11023-/281725377549?hash=item4198241c0d

and Arduino Mega 2560 board.

So the wiring follows.

From arduino

3.3v goes to the Converter's 3.3v on the low side and also to LCD VVC pin.
GND goes to the Converter's GND pin on the low side and also to LCD GND pin.

Then all the wiring is thru converter except the MISO which is direct to arduino. All others go from arduino to Converters High pin and then from Low to LCD pin. For each wire seperate High and low ofcourse.

So:

CS 10
DC 9
RST 8

MOSI 51
SCK(SCLK) 52
MISO 50 (direct to arduino)

I don't know about LED. I put it on 3.3v but as I know it doesn't really matter?!?

So as far as I know wiring is correct?!

Can you tell me which code (library) to run. exemple. I have so many different libraries and none of them works.

Thanks

Anyone is using Dragino Yun shield ?

I want to connect it to 2.2 TFT screen

the screen is working when i use arduino uno to connect

but when uno + dragino yun, the connection is not working, i search document on web, someone suggest me to use ICSP pin, but it is still don't work

anyone can help?

xxtilenxx:
I have a problem. Nothing happens with the display except I cant turn on the backlight with connecting LED pin to voltage. :slight_smile:

So parts that I'm using.

Converter:
http://www.ebay.com/itm/281619636885

LCD:
http://www.ebay.com/itm/2-4-320-240-TFT-LCD-Touchscreen-with-PCB-ILI9341-Display-CP11023-/281725377549?hash=item4198241c0d

and Arduino Mega 2560 board.

So the wiring follows.

From arduino

3.3v goes to the Converter's 3.3v on the low side and also to LCD VVC pin.
GND goes to the Converter's GND pin on the low side and also to LCD GND pin.

Then all the wiring is thru converter except the MISO which is direct to arduino. All others go from arduino to Converters High pin and then from Low to LCD pin. For each wire seperate High and low ofcourse.

So:

CS 10
DC 9
RST 8

MOSI 51
SCK(SCLK) 52
MISO 50 (direct to arduino)

I don't know about LED. I put it on 3.3v but as I know it doesn't really matter?!?

So as far as I know wiring is correct?!

Can you tell me which code (library) to run. exemple. I have so many different libraries and none of them works.

- YouTube

Thanks

MISO (Master In Slave out) is not needed, since the LCD is not transferring nothing back to the arduino.

Double check that the reset pin is high (3.3V) otherwise just attach it to 3.3V.

You may have a faulty display as well. Its seems odd no library works. I would recommend mine, but it's uno only.

As to hardware, I'm not an apologist of using buffers. Buffers and breadboards are quite a big issue and added complexity for 4/8Mhz SPI signals. What i do is to modify the arduino to run at 3.3V and just connect the LCD directly. Everything stays the same, except the 5V pin has 3.3V on it and the output logical levels are 0 and 3.3V, rather than 0 and 5V. Search the internet for this mod if you want to try. Ill probably do a video at some point, just unfortunately i don't have any more boards to mod.

calvinchoi:
Anyone is using Dragino Yun shield ?

I want to connect it to 2.2 TFT screen

the screen is working when i use arduino uno to connect

but when uno + dragino yun, the connection is not working, i search document on web, someone suggest me to use ICSP pin, but it is still don't work

anyone can help?

Perhaps your shield is sharing one of the lines used for CS, DC or RST? I would do a check with a multimeter to make sure the pins you selected are free and not being shared with something else

Perhaps the OP is having the same issue I had to where my converter was leaking. Instead of dropping the output voltage to 3.3v, like it is supposed to do, it was outputting somewhere around 4V. (Which the display does not like).

After much frustration I finally got mine to work using 4k7 and 2k2 resistors. (2k2 to display, 4k7 to ground)

This worked for me.. see
http://forum.arduino.cc/index.php?topic=356435.msg2456881#msg2456881

@nid69ita

Many thanks for this code, my display works after 10 hours!!

#include <stdint.h>
#include "TFTv2.h"
#include "SPI.h"

void setup()
{
TFT_BL_ON; // turn on the background light
Tft.TFTinit(); // init TFT library
}

void loop()
{
for(int r=0;r<115;r=r+2) //set r : 0--115
{
Tft.drawCircle(119,160,r,random(0xFFFF)); //draw circle, center:(119, 160), color: random
}
delay(10);
}

You guys may want to have a look at my webpage on ILI9341 RasMicro.com is for sale | HugeDomains

OldMicroGuy

Great page!

Hello ALL

I have bought 2.2 TFT SPI screen from ebay (cheap version 240*320). I use library

All screen is white when I connect it to pins. Is that problem of Voltage? if yes, what kind of resistors should I use and how? is there any website displaying that? I'm very beginner at it. I don't have any idea what is the problem.

Can it be a problem of pinout?

See Step 1 here for the QVGA display.

rowboteer:
See Step 1 here for the QVGA display.

thank you @rowboteer, I bought resistors and HEF4050BP level logic converter. will see the results