Bought a TFT display from Electrodragon. Electrodragon sells 2 versions, a 1.8″ and a 2.2″ version. I got the 2.2 inch version, it costs only 7.2$. It’s a colour (QVGA) display with 240×320 pixels. The display uses an ILI9341 driver chip. I found the datasheet of the ILI9341 here. The chip works at 3.3V, so I used one of my own boards with an ATmega328 running at 3.3V to test the display. On the back of the display there is also an SD card reader.
The display can be used with an Arduino, I’ve found 2 Arduino libraries that support this display.
I first tried out the library provided by Adafruit, you can download it on Github. This library uses hardware SPI to communicate with the driver chip. SPI pins for an Arduino Duemilanove/Nano/Uno are 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). The driver chip needs another 2 pins, D/C and a reset pin (RST).
Back view of the display showing the connection pins:
I connected the display to an Atmega328 and uploaded the “graphicstest” example sketch.
I also found another library that supports this display, the UTFT library. This library supports a number of 8bit, 16bit and serial graphic displays including the ILI9341 driver chip. You can find the library and more information about it here. This library is a little bit more difficult to make it work but it comes with a manual that explains most things. This library does not use the same pins as the Adafruit library. I couldn’t figure out how to connect the display to my ATmega328. So I emailed the programmer of the library and I received a prompt reply how to connect my new display.
These are the connections I made:
DO (MISO) -> Not used by UTFT
SCK -> pin 8
SDI (MOSI) -> pin 9
D/C -> pin 10
RESET -> pin 11
CS -> pin 12
In the sketch you then need to use this constructor to define the type of display and the pins:
I then uploaded the example sketch and it worked, see next video:
I then successfully wrote a simple sketch to display a jpg on the display. The library comes with a tool to convert images files to .c files. That way you can store the image in progmem and show it on the display. But be warned it’s easy to fill the complete memory of an ATmega328 with one image file.