2.2tft display to arduino uno r3

Hello

I have buyd a 2.2 tft lcd on ebay and i dont know how to connect it.
Can any tell my how to connect and so that it will work with this adafruit libary

My display use this chip: ili9341
(I dont know why the title of this libary not is ILI9341 but it if this libary not will work can any give a another libary?)
Thanks

i have downloaded the ili9341 libary from adafruit and in the example i found this:

define TFT_DC 9

define TFT_CS 10

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

define SD_CS 4

so have i only to connect the tft_dc and the tft_cs? if no: can any give how to connect it correct and can i use this libary?

thanks

Hi

Usually this is a 4-wire SPI interface: You must also connect MOSI and SCK.
I had created a tutorial for u8glib (another Arduino lib): https://code.google.com/p/ucglib/wiki/connectili9341
You will also need level shifters for this display.

Oliver

have any another libary?

edit: in the adafruit ili9341 libary i found this example:

/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/


#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

void setup() {
  Serial.begin(9600);
  Serial.println("ILI9341 Test!"); 

  tft.begin();

  // read diagnostics (optional but can help debug problems)
  uint8_t x = tft.readcommand8(ILI9341_RDMODE);
  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDPIXFMT);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDIMGFMT);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDSELFDIAG);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
  
  Serial.println(F("Benchmark                Time (microseconds)"));

  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  delay(500);

  ...

know any how to connect my screen so it works with this?

The connection must be done as below but keep in mind that you need a level shifter between your display pins and the arduino pins because your display is 3.3 V and you arduino is 5V.

with the below connections and the level shifter you can use hardware SPI.

the screen signals -----> MOSI MISO SCK DC Cs must be connected to the Uno pins -----> 11 12 13 9 10

Thanks, but must only the vcc a power shifter or all the pins a power shifter or need vcc and led a power shifter?

Can you post a link to which display do you have? For sure all the signals must have a voltage shifter.

link to my display: http://www.ebay.nl/itm/2-2-inch-2-2-SPI-TFT-LCD-Display-module-240x320-ILI9341-51-AVR-STM32-ARM-PIC-/200939222521?pt=LH_DefaultDomain_0&hash=item2ec8e935f9

can u make a schematic of how to connect it please?

are you going to buy the level shifter or are you going to build it yourself ?

i will make the level shifter.
bit i dont understand where the level shifter(s) must pe placed.
so can u make a schematic and/or tell how to make a level shifter?
and wich pins need a level shifter?

I have the exact same display, and I got it working with the Mega 2560. Please see this post: http://forum.arduino.cc/index.php?topic=181679.msg1742029#msg1742029

You must just figure out how to connect it to the Uno ;)

Hi, i used resistors divider as level shifter, work perfectly with 3 diff libraries.

For arduino123456789 : i used an home-made copy of freetronics "Eleven", equivalent to UNO :

http://www.freetronics.com/products/eleven#.U4WtJihAc1I

from pin 4, resistor of 1K8 in serie with resistor of 3K3 then GND. common point of the 2 resistors wired to RESET of the TFT Display same wiring for : pin 5 to CS, pin 6 to D/C, pin 11 to SDI(MOSI), pin 13 to SCK.

resistor of 15R from LED (display) to 3V3 VCC (display) also to 3V3 of course GND common SDO(MISO) from display not connected. It is an output not used in the libraries.

Just one line to modify in the sketch, example for UTFT library :

UTFT myGLCD(ILI9341_S5P,11,13,5,4,6); // Remember to change the model parameter to suit your display module!

Regards

Jacques

JMe87: Hi, i used resistors divider as level shifter, work perfectly with 3 diff libraries.

For arduino123456789 : i used an home-made copy of freetronics "Eleven", equivalent to UNO :

http://www.freetronics.com/products/eleven#.U4WtJihAc1I

from pin 4, resistor of 1K8 in serie with resistor of 3K3 then GND. common point of the 2 resistors wired to RESET of the TFT Display same wiring for : pin 5 to CS, pin 6 to D/C, pin 11 to SDI(MOSI), pin 13 to SCK.

resistor of 15R from LED (display) to 3V3 VCC (display) also to 3V3 of course GND common SDO(MISO) from display not connected. It is an output not used in the libraries.

Just one line to modify in the sketch, example for UTFT library :

UTFT myGLCD(ILI9341_S5P,11,13,5,4,6); // Remember to change the model parameter to suit your display module!

Regards

Jacques

can u make a schematic please? and i will use the libary from adafruit.

edit: need the MOSI MISO SCK DC CS and level shifter to? if yes: can i use 4.7K ohm? that makes from 4,5v to 2,3 v.

Any?

Have any a schematic for my? That works with the adafruit libary? And works it with a 4.7k ohm resistor?

HI arduino123456789

first read http://en.wikipedia.org/wiki/Voltage_divider

you may find this shematic

Vin is output of Arduino Vout is input of display Z1 value : 1K8 and Z2 value is 3K3 You must keep this ratio 1.8/3.3 if you choice an other value but resistors have to be different

You must put this resistor divider on the 5 signal lines from Arduino to display

Work perfectly with Adafruit library :

Jacques

So this will work too?:

Hi yes Jacques

Okay but can any tell my wich pin from the display to wich pin on the arduino? So I mean how to connect it.

Thanks

Hi Read my msg from may 28, from start to end. Ok ? Jacques

See reply #4 to find your answer