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.