Arduino TFT (Serial SPI - 2.2" ILI9341) Display
Having bought lots of cheap components from China and Hong Kong, via eBay, with no real problems in either delivery or quality, I couldn't resist trying a '2.2" Serial 240x320 Chip SPI TFT LCD Module Display ILI9340C PCB Adapter SD Card' for only £3.50 (including postage). The unit arrived well packed in about a week and a half (pretty good from Hong Kong).
|2.2" Serial SPI TFT Display Module|
Connecting upSPI (Serial Peripheral Interface) is a synchronous master/slave serial data bus used to connect peripherals to micro-controllers.
The board has a row of pins to connect up to the microcontroller SPI pins; additionally it has some solder points for the included SD card reader (also SPI). I haven't tried the SD card reader, but it looks like one I have used previously so I'll get around to that next.
- Master Input, Slave Output (Input to master)
- Serial Clock (output from master).
- Master Output, Slave Input (output from master)
- Data /Command Selection pin
- Slave Select (active low, output from master)
- Ground connection
- 3.3v power connection
|Back of TFT board|
The first thing to note is that these boards are 3.3v NOT 5v, so if you are using a standard Arduino, I am using an UNO, you will need to drop the voltage for all of the connections.
Level Shifting 5v to 3.3vTo convert the 5v data lines to 3.3v I decided to use a CD4050 Hex Buffer/Converter.
|CD4050 Hex Buffer/Converter|
Software LibrariesTo drive the display I tried two libraries:
- UTFT ( http://henningkarlsen.com/electronics/library.php?id=52 )
- TFTv2 by Seeed Technology (https://github.com/reeedstudio/pvfm/tree/master/libraries/TFT_Touch_Shield_V2)
Connecting to an UNOBoth of the libraries used the same pin out, via the CD4050 (except the LED - D7):
- D4 : RESET
- D5 : CS
- D6 : D/C
- D7 : LED (Via 2222 transistor)
- D11 : MOSI
- D12 : MISO
- D13 : SCK
|Connected up on prototype board (with 2222)|
|Connected up on prototype board (without 2222)|
All doneOnce wired up there are several example programs bundled with both of the Arduino libraries that can be used to test out the display. I have modified one of them to get a "24"style countdown (not real-time), where's Jack Bauer when you need him ?
I can see my next project is going to have a nice colour TFT display :)