Giuseppe Parrello

 

Embedded Display TFT Ilitek ILI9341


Introduction

This embedded TFT display is based on the Ilitek ILI9341 chipset and is compatible with the SPI serial interface. This TFT display has a resolution of 240x320 pixels and 262K colors. A special feature of this screen is that it is also sold with a Touch Screen controller based on the XPTEK XPT2046 chipset. This allows, with proper libraries, to manage the display via touch commands. For ease we are going to connect it to the FTDI FT232H device, of which there is a dedicated page on this site - refer to the above page for installation.

 

Connection via SPI

This display must be connected to the FTDI FT232H development board via SPI protocol. The connection connectors are listed below:

Image Board FT232H Display ILI9341 Touch XPT2046

FT232H - ILI9341

AD0 SCK T_CLK
AD1 SDI (MOSI) T_DIN
AD2 SDO (MISO) T_OUT
AD3 CS ------
AD4 ------ T_CS
AD5 D/C ------
AD6 RESET ------
AD7 ------ T_IRQ
+3.3V LED ------
+5V VCC ------
GND GND ------

The following Python library allows to manage 3 auxiliary pins, "Reset", "Touch IRQ" and "Screen Backlight". Since there are only 2 pins available (AD6 to AD7), the backlight ("LED" pin) is connected to the "+3.3V" of the FTDI FT232H development board. Actually it is possible to control the backlight via software by inverting the connections between the "RESET" pin and the "LED" pin, that is by connecting the "RESET" pin of the screen to the "+3.3V" of the development board and connecting the "LED" pin of the screen to pin "AD6" of the development board. This is because the display works only when its "RESET" pin is in "High" mode (ie with the presence of power), therefore the "RESET" pin of the screen must be connected either to the "+3.3V" pin or to a pin available on the development board.
The use of the "T_IRQ" pin is optional in the following Python library, as it is only used to specify a "handler" method for retrieving "touch" information. Normally the Python library does not require to specify this pin, as the touch reading can always be done in real time (see the examples included with the Python library).

 

Python libraries

To manage this display, we can use the Python library named "ILI9341 FTDI". This library only requires the presence of the "PyFTDI" library and was built from the following Python libraries on Internet:

This library has the following features: