Don't forget, we're using the SPI interface side of the PCB!
SPI Mode Jumpers
Before you start, we'll need to tell the display to put us in SPI mode so it will know which pins to listen to. To do that, we have to connect tbe IM1
pins to 3.3V. The easiest way to do that is to solder closed the IMx
jumpers on the back of the PCB. Turn over the PCB and find the solder jumpers
With your soldering iron, melt solder to close the three jumpers indicated IM1 IM2 and IM3 (do not solder closed IM0!)
If you really don't want to solder them, you can also wire the breakout pins to the 3vo pin, just make sure you don't tie them to 5V by accident! For that reason, we suggest going with the solder-jumper route.
Wiring up the display in SPI mode is much easier than 8-bit mode since there's way fewer wires. Start by connecting the power pins
3-5V Vin connects to the Arduino 5V pin
GND connects to Arduino ground
CLK connects to SPI clock. On Arduino Uno/Duemilanove/328-based, thats Digital 13. On Mega's, its Digital 52 and on Leonardo/Due its ICSP-3 (See SPI Connections for more details)
MISO connects to SPI MISO. On Arduino Uno/Duemilanove/328-based, thats Digital 12. On Mega's, its Digital 50 and on Leonardo/Due its ICSP-1 (See SPI Connections for more details)
MOSI connects to SPI MOSI. On Arduino Uno/Duemilanove/328-based, thats Digital 11. On Mega's, its Digital 51 and on Leonardo/Due its ICSP-4 (See SPI Connections for more details)
CS connects to our SPI Chip Select pin. We'll be using Digital 10 but you can later change this to any pin
D/C connects to our SPI data/command select pin. We'll be using Digital 9 but you can later change this pin too.
That's it! You do not need to connect the RST
or other pins for now.
Install Adafruit ILI9341 TFT Library
We have example code ready to go for use with these TFTs. It's
written for Arduino, which should be portable to any microcontroller by
adapting the C++ source.
libraries need to be downloaded and installed: first is the Adafruit_ILI9341 library
(this contains the low-level code specific to this device), and second is the Adafruit GFX Library
(which handles graphics operations common to many displays we carry). If you have Adafruit_GFX
already, make sure its the most recent version since we've made updates for better performance
Download both ZIP files, uncompress and rename the folders to Adafruit_ILI9341
) and Adafruit_GFX
) respectively. Then place them inside
your Arduino libraries
folder and restart the Arduino IDE. If this is
all unfamiliar, we have a tutorial introducing Arduino library concepts and installation
Restart the IDE
After restarting the Arduino software, you should see a new example folder called Adafruit_ILI9341 and inside, an example called graphicstest.
Upload that sketch to your Arduino. You may need to press the Reset
button to reset the arduino and TFT. You should see a collection of
graphical tests draw out on the TFT.
If you're having difficulties, check the serial console.The first thing the sketch does is read the driver configuration from the TFT, you should see the same numbers as below
Last updated on 2015-11-20 at 02.51.49 PM
Published on 2014-03-18 at 04.50.41 PM
If you did not connect up the MISO line to the TFT, you wont see the read configuation bytes so please make sure you connect up the MISO line for easy debugging! Once its all working, you can remove the MISO line