Wiring up the 8-bit mode is kind of a pain, so we really only recommend doing it for UNO (which we show) and Mega (which we describe, and is pretty easy since its 8 pins in a row). Anything else, like a Leonardo or Micro, we strongly recommend going with SPI mode since we don't have an example for that. Any other kind of 'Arduino compatible' that isn't an Uno, try SPI first. The 8-bit mode is hand-tweaked in the Adafruit_TFTLCD pin_magic.h file. Its really only for advanced users who are totally cool with figuring out bitmasks for various ports & pins.
Really, we'll show how to do the UNO but anything else? go with SPI!
Begin by wiring up the 3-5VDC and GND pins.
Connect the 3-5V pin to 5V and GND to GND on your Arduino. I'm using the breadboard rails but you can also just wire directly.
Now that the backlight is working, we can get the TFT LCD working. There are many pins required, and to keep the code running fairly fast, we have 'hardcoded' Arduino digital pins #2-#9 for the 8 data lines.
However, they are not in that order! D0 and D1 go to digital #8 and #9, then D2-D7 connect to #2 thru #7. This is because Arduino pins #0 and #1 are used for serial data so we can't use them
- Connect the third pin CS (Chip Select) to Analog 3
- Connect the fourth pin C/D (Command/Data) to Analog 2
- Connect the fifth pin WR (Write) to Analog 1
- Connect the sixth pin RD (Read) to Analog 0
The RD pin is used to read the chip ID off the TFT. Later, once you get it all working, you can remove this pin and the ID test, although we suggest keeping it since its useful for debugging your wiring.
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.
Two libraries need to be downloaded and installed: first is the Adafruit_TFTLCD library (this contains the low-level code specific to this device).
Download the ZIP file, uncompress and rename the folder to Adafruit_TFTLCD (contains Adafruit_TFTLCD.cpp and .h). Then place it 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.
In the Adafruit_TFTLCD Library folder, you may need to edit Adafruit_TFTLCD.h. On about line 12, you will see
Make sure this line is commented out with a // in front (it should but if you're having issues, its worth checking.)
The GFX library can be installed via the Arduino library manager.
Open up the Arduino library manager:
Search for the Adafruit GFX library and install it
We also have a great tutorial on Arduino library installation at:
(The images below shows SPI wiring but the graphical output should be similar!)