Connect an SPI TFT with Touchscreen to your Arduino - ILI9341 LCD with XPT2046 Touch screen

preview_player
Показать описание
You can get buy some really cheap LCD and touchscreen modules from places like eBay. They're actually great devices that let you add a display to your Arduino and microcontroller projects for under £10. But they don't come with any documentation so they can be a bit tricky to get working if you've never used them before.

In this video I'll walk you through the connections and software needed to get them working. My screen is a generic, red, Chinese sourced device using the very common combination of an ILI9341 based LCD module with a touchscreen driven by the XPT2046 touch controller.

You can easily get hold of one of these touchscreens at Amazon or eBay.

Make sure you visit the project pages on my website for circuit diagrams and breadboard layouts, along with more information and details.

ILI9341 Library

XPT2046 Library

Adafruit GFX Library

Adafruit LCD tutorial

Adafruit GFX Library Tutorial
Рекомендации по теме
Комментарии
Автор

Awesome video series on the ILI9341 TFT touchscreen.I'm using a Arduino Nano, TXS0108E Logic Level Shifter Converter, and ILI9341, 3.2" TFT touchscreen, and your code worked perfectly first try. I really appreciate the time you took to explain what each of the pins does and how to hook them up.

I'm working my way through your videos for a second time, so I can use your information to try nd built a menu system where I can adjust the values of each button. Thanks Pete

Pete-ppkt
Автор

Thanks for a GREAT tutorial! I spent 2 several hour periods trying to figure out why I could never get anything but a white screen. I checked all connections several times. I finally fired up the oscilloscope and found that I only had 1.1V on the clock signal. Checking my voltage divider I discovered that a 10K resistor had snuck into my 2.2K resistors. That one got used for the clock signal. Once replaced everything worked fine. Lesson: once you run out of big options as the problem, try the little ones - maybe try them first. 🙂

DavidTLutz
Автор

Thanks very much for this. After literally thousands of experiments/hours (over a year or so) with Arduino Uno and ILI9341 I finally got it working, thanks to this excellent video. The voltage dividers were my problem. I used 4.7K and 10K resistors in my setup. Thanks again.

mellee
Автор

I learned that you don't need to burn another pin on the Uno to get the TFT Reset function working on these screens. It can piggyback off the Uno's Reset pin, which is otherwise useless unless you plan to get into HVSP tools to recover the chip afterwards. The bit of magic that allows this is to tell the library to use a negative number for TFT_RST. This activates a software TFT Reset function, removing the need for a separate digital pin from the MCU. This only appears to be documented in the library code itself. I've also seen it documented that you can hook TFT Reset to a pullup, but I was not able to make that work. Piggybacking on the Uno RST pin is working great on three different screens I've got here, though.

makermatrix
Автор

Thanks for pointing out the HIGH values for the CS pin. From white to working...

LeraarStijn
Автор

I really like your style. You are not a snob maker - like most. Wow.

activme
Автор

Very informative! Thank you for taking the time to put this together. It is much appreciated.

rondivecchia
Автор

Very helpful for my aircraft engine monitoring system project. Thanks a bunch !

WowRodg
Автор

I was wondering if you have or were consider making a video comparing an Uno shield LCD to a breakout LCD? I have not been able to find a video comparing them, and how to alter my code to switch between a shield LCD and breakout LCD. Thanks Pete

Pete-ppkt
Автор

Hello, this video made me curious why my touchscreen doesn't work, and why I am reading only 4079 preasure, x = 17 and y = 0. And I found a problem - the problem is MISO connection. While I connect MISO from display (SDO) and MISO from touchscreen (TDO) touchscreen is not working. I'm connecting it via breadboard and voltage divider. While I disconnect MISO from display touchscreen starts working.

mrminister
Автор

@ 8:35, If there is no voltage regulator on the TFT you have to use 3, 3Voltage for VCC and LED

viktorhugo
Автор

This and your video on how to modify the Adafruit and Touchscreen sketches are great quite helpful. By the way I think that game is called breakout. Pong usually has two players with paddles.

BartdeBoisblanc
Автор

Great tutorial. I am a novice with mcirocontrollers but I am trying to use the SD card slot but unsure of the physical connections to use. for the sd card slot there is a sd_cs, sd_mosi, sd_miso & sd_sck

williampowell
Автор

I have that exact piece but mine is just giving a white screen, I followed the video....

kevinolofson
Автор

Thank you very much for the video. I managed to get my display working, now I can "play" with it... lol

I just can't use the entire screen... there is a strip on the sides of the SD card pins that is not rendered with each update, giving the impression that the entire screen is not being used.

pablomesquita
Автор

10:00, I'm not following something: Why don't you have to define your clk, miso, and mosi pins in your code (line 29 vs line 27)?

larrybud
Автор

Thank you for your advice. I wish you a nice rest of the bottom. This screen gave me a hard time. I like watching your works, I'm always learning something. Keep up the good work and good luck. Could you post some codes for the clock or the weather station. Or some games. Thank you.

atihrot
Автор

hello sir, i managed to make the lcd work using the calibration code u made, but when i tried it again the next day, it won't display anymore. I didn't touch the wirings.

traflaw
Автор

Great tutorial, thank you! BTW, you can use an Arduino Nano, or probably any other Arduino board, as long as you select the right one in the 'boards' drop-down.

jimdesposito
Автор

Hello! nice video! I was wondering why don't you use the 3.3V output from the arduino board itself to power the screen instead of using the 5V output and doing the voltage conversion bridge? thx!

nucleoy