Тёмный

Connecting and Configuring the ST7789 LCD SPI Display to the ESP32 

Retro Tech & Electronics
Подписаться 34 тыс.
Просмотров 60 тыс.
50% 1

I'd picked up this LCD display for projects and experiments with the ESP32 platform. Initially, I became confused, as the back of the module clearly states SPI, yes the pins are labeled as i2c. In looking at the technical documentation for the board itself I was able to figure out the correct pinouts to the ESP32 and decided upon the TFT_ESPI library as a platform to build upon. This seemed to have better support and more dynamic than the Adafruit library.
Once connections were completed and libraries installed, a library config file is reviewed and setup, with subsequent tests done, followed by a few demos.
#esp32 #iot #arduino #maker

Наука

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 133   
@steveobrien43
@steveobrien43 Год назад
Thanks for creating this tutorial. Info on the 'net about the ST7789 1.3" 240x240 module was pretty confusing, especially the I2C names on what are actually SPI pins. This video clarified the situation. I followed each step, got a clean compile and a working display. Also, good suggestion below to make a copy of setup.h and keep it in a safe place so future updates don't wipe your working setup.
@dymardo_
@dymardo_ 3 года назад
I did a quick search on the screen driver for some basic info and landed here. The video was very helpful. Thank you.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Glad it helped
@damnfoile
@damnfoile Год назад
Amazing tutorial. I had been struggling with this screens trying to make it work on different projects, after this, it has been a piece of cake. Thanks a lot.
@retrotechandelectronics
@retrotechandelectronics Год назад
You're welcome!
4 года назад
I had this display for appx. year, with no luck running it, but your tutorial worked flawlessly, thanks!
@retrotechandelectronics
@retrotechandelectronics 4 года назад
You're welcome!
@jfairplane8520
@jfairplane8520 4 года назад
Wow, very very great. I had hard time to figure out the how to get to work with this lib. And your video show it perfectly ! Many thanks !
@retrotechandelectronics
@retrotechandelectronics 4 года назад
You're welcome.
@johntoe6127
@johntoe6127 4 года назад
Thanks for the very informative video. I have the SSD1306 version, and had to figure all this out myself. I wish I had discovered your video first.
@retrotechandelectronics
@retrotechandelectronics 4 года назад
sorry i could not help sooner
@livingrainman
@livingrainman 2 года назад
Great video! Thorough and clear. This display was giving me fits!
@retrotechandelectronics
@retrotechandelectronics 2 года назад
Glad it was helpful!
@ksbs2036
@ksbs2036 4 года назад
@Retro Tech & Electronics - ignore the haters who have create ZERO content yet criticize those that do. Thanks for taking the time to put this video together
@retrotechandelectronics
@retrotechandelectronics 4 года назад
You're welcome. Having done this for several years i'm used to people who contribute nothing more than hot air to the comment section.
@andywaring12
@andywaring12 3 года назад
Thank you so much for this video. Clear, succinct and very informative. Much appreciated.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Glad it was helpful!
@SilverC
@SilverC 7 месяцев назад
Thank you for this great tutorial I got everything up and running with just this one video!
@retrotechandelectronics
@retrotechandelectronics 7 месяцев назад
Glad to hear it. I’ve referred back to my own video for the wiring on several occasions.
@donjackson3520
@donjackson3520 2 года назад
Excellent video, your detailed explanation is great work. Thanks.
@retrotechandelectronics
@retrotechandelectronics 2 года назад
You are welcome!
@whirly85
@whirly85 Год назад
very useful video; helped me a lot. thanks and keep going the good work 👍
@retrotechandelectronics
@retrotechandelectronics Год назад
Glad it helped!
@WhoCaresWinsAgain
@WhoCaresWinsAgain 3 года назад
Excellent video tutorial and it enabled me to get my display working correctly with the ESP-32. Many thanks and i look forward tofuture turials with tis combination of devices using the WiFi capability perhaps.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
I have several videos out, the latest includes Wifi.
@SciDIY
@SciDIY 3 года назад
Thank you! You've saved my day. Great explanation.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Glad I could help!
@yura081268
@yura081268 3 года назад
Thanks! Very interesting library from Bodmer.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Glad you enjoyed it!
@PicoGirl
@PicoGirl 3 года назад
Just hooking this up to an ESP32, but can you tell me, does the library for SPI on this LCD stop pins D19 (SPI MISO) and D5 (SPI SS) from being used as GPIO for other purposes? Or for simplicity, can the RES and DC by swapped over from the D2 & D4 connections to use the D19 and D5 instead? I only have this one SPI device, and would like to use all the pins possible.
@ipadize
@ipadize Год назад
yesterday i have connected my first tft display to a teensy 4.1 and didnt know how and where to connect it. i have watched videos on youtube but no one used my display Teensy combination, somehow i got it working the first try after setting the configuration file in the TFT_eSPI library^^
@kennethbeal
@kennethbeal Год назад
Thank you! Got some of these screens, you helped me get them working. Now to make a tiny videogame system! :)
@retrotechandelectronics
@retrotechandelectronics Год назад
Good luck!
@kennethbeal
@kennethbeal Год назад
@@retrotechandelectronics Thank you! Got the "UI" working last night, I put a 20x20 box in the upper right with a 4x4 flashing cursor in it. The accelerometer "moves" this around within the box, indicating how fast the actual cursor will move. Then there's three lines of text, one per "game", with a box to the left of each, which has a section within the box on the right; that section is green if the game is available, red if not (e.g., could use for unlocked levels). By "moving it as if there was a ball on the surface" you can then move the cursor to one of the green or red sections. If you hit a red section, it says "CAN'T ENTER RED!", and if you hit a green one, it says "getting ready..." -- for now. I could have added buttons, but this "user interface" was fun to program, and can be used elsewhere. First actual game I'm planning to make is the "snake game" and I'll use the accelerometer for controls. Thanks again!
@PabloFaby
@PabloFaby 7 месяцев назад
I'm using an ESP32S3 DevKit and is working with this pins: #define TFT_MOSI 11 #define TFT_SCLK 12 #define TFT_CS -1 // Chip select control pin #define TFT_DC 8 // Data Command control pin #define TFT_RST 9 // Reset pin (could connect to RST pin) Work very well, thank you
@georgfuhs5925
@georgfuhs5925 3 года назад
thanks for this well done video (my hardware ESP32 240x240 display st7789controller) everything runs impressively
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Glad to hear it helped.
@imperiosheriff
@imperiosheriff 4 года назад
unfortunately I can't get it to work, I have the tft_espi library installed with the modifications of the User_Setup.h, I tried with another screen but it's the same although both are new, the unic thing seen is a very weak backlight! next i was connect the blk to 3.3v for to see if it is for this reason but nothing
@Fahrenheit20000
@Fahrenheit20000 Год назад
Excellent video, I thank you very much that you took the time to do it, very well explained, my screen worked super well.!!!!
@retrotechandelectronics
@retrotechandelectronics Год назад
Great to hear!
@markj3851
@markj3851 3 года назад
Great video and thanks for the great content. Had high hopes this library would also work with STM32 chips via SPI as stated in the User Setup but it's full of bugs and compiler errors :-(.
@mctainshcom
@mctainshcom 3 года назад
Great video. Got the Read User setup to work but Width was returned as 135 when it was printed as 240x240 on the board. None of the following steps worked. Maybe I got a wire crossed. Never the less, very useful content
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Glad it helped
@FlightHeroRC1
@FlightHeroRC1 11 месяцев назад
You sir are a God send
@yarikkorotkiy5135
@yarikkorotkiy5135 Год назад
Hi mate. thank you for your guide! but i have 240X280 st7789 tft board. how can i set this library to that resolution? I really tried but unlucky(. thank you!
@BlondieSL
@BlondieSL Год назад
Oh this was excellent! Those displays on the ESP32 sure run fast! Much faster than on an Arduino. I love that Meters demo! I can see some excellent use for that. Thanks for going through the setup file and what to look for. I'm curious, would all this be similar to those round displays that are the size of a watch?
@EasyOne
@EasyOne 2 года назад
Very well explained
@retrotechandelectronics
@retrotechandelectronics 2 года назад
Glad it was helpful!
@anoopshankaran8706
@anoopshankaran8706 2 года назад
Thanks for the great tutorial. I recently got an ESP32 C3 Mini 1. Replacing the pins above with the ones in the datasheet did not work. The display is on (backlight) but nothing shows up.
@flashcorp76
@flashcorp76 Год назад
I like the musket ! :)
@mordgarrad
@mordgarrad 3 года назад
OMG Finally I can get that stupid display to work haha! I wish I found your tutorial Months ago! It's hard to beat that display for cheap value .. I bought 2 of them for something like $3.49 each on aliexpress, but ZERO help or hint as to documentation for a "No CS pin" display in regular Arduino IDE drivers or Adafruit or CircuitPython. I was hoping to get this display to work on any RP2040 variant, but this tutorial is for ESP32 ... which then worked awesome with my Adafruit ESP32 Feather. Thanks again for putting this together!!!
@retrotechandelectronics
@retrotechandelectronics 3 года назад
You're welcome, enjoy!
@aezir8753
@aezir8753 11 месяцев назад
I would like to ask which one will I use in the setup if I have a st7789v display?
@sakisv4138
@sakisv4138 8 месяцев назад
Thank you for this video, helped a lot !!!
@retrotechandelectronics
@retrotechandelectronics 8 месяцев назад
Glad to hear.
@user-mj7ry1ir5o
@user-mj7ry1ir5o Год назад
Well done, thank you, sir!
@retrotechandelectronics
@retrotechandelectronics Год назад
You're welcome.
@hjw5774
@hjw5774 Год назад
Thank you - very well explained! Great help to me!
@retrotechandelectronics
@retrotechandelectronics Год назад
You’re welcome.
@hjw5774
@hjw5774 Год назад
@@retrotechandelectronics 4 months later and I still refer to this video for troubleshooting with the ST7789 display. Again, thank you so much.
@retrotechandelectronics
@retrotechandelectronics Год назад
@@hjw5774 glad to hear it. I’ve since posted another video for a larger touchscreen display.
@bebebichoxlive620
@bebebichoxlive620 Год назад
hello good video but I have a problem with my screen for some reason its orientation is wrong and there is an unfilled space at the top, take into account that I did everything your video said to configure it
@eromangasensei7856
@eromangasensei7856 10 месяцев назад
Is there anyone who can help me? The display on my LCD is upside down, and there is an area that's cut off. How can I fix this?
@parkeryoung2471
@parkeryoung2471 6 месяцев назад
my display is built-in but says spi , is it going to be same process
@alexeybeskov2071
@alexeybeskov2071 3 года назад
Спасибо тебе прекрасный человек. Ты сохранил мне огромное количество времени.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Рад, что смог помочь, я опубликовал другую информацию о дисплеях, использующих этот драйвер.
@user-zy8vi2lz8f
@user-zy8vi2lz8f 4 месяца назад
Failed uploading: uploading error: exit status 2 why i always get this messages? anyone can help?
@RedShiftZ0
@RedShiftZ0 3 года назад
Thank you for the video. Quick question. Is there a way to access the SPI Chip Select (CS) line of the interface on this display?
@RedShiftZ0
@RedShiftZ0 3 года назад
I've answered my own question. It's not currently mapped to the header. it's Pin 8 on the ribbon on the back. I presume it can have a jumper soldered to it and test.
@gangger89
@gangger89 3 года назад
fo VS Coder on platformio: there is a better way to initialise the screen , within the platformio setup. So you dont need to change the libraries. just use flags for the desired variables to be defined like this: [env:nodemcu-32s] platform = espressif32 board = nodemcu-32s framework = arduino monitor_speed = 115200 lib_deps = bodmer/TFT_eSPI@^2.3.61 build_flags = -DUSER_SETUP_LOADED=1 -DST7789_DRIVER=1 -DTFT_WIDTH=240 -DTFT_HEIGHT=320 -DTFT_MISO=-1 -DTFT_MOSI=23 -DTFT_SCLK=18 -DTFT_CS=5 -DTFT_DC=2 -DTFT_RST=4 -DLOAD_GLCD=1 -DLOAD_FONT2=1 -DLOAD_FONT4=1 -DLOAD_FONT6=1 -DLOAD_FONT7=1 -DLOAD_FONT8=1 -DLOAD_FONT8N=1 -DLOAD_GFXFF=1 -DSMOOTH_FONT=1 -DSPI_FREQUENCY=27000000
@rallymax2
@rallymax2 3 года назад
Thanks for making the video. Do you know if it’s possible to run in I2C instead of SPI? I’d much rather add it to my i2c bus on my esp32.
@retrotechandelectronics
@retrotechandelectronics 3 года назад
You would need to purchase a device with an I2C interface.
@ko_ale
@ko_ale 4 года назад
Thank you for this tutorial. It was really hard for me to made this display to work with RobotDyn Arduino about a year ago. After this it was lying about a year in a box. And now I decided to make it work with my ESP32. To be honest - it would be hard without your video. Thanks.
@retrotechandelectronics
@retrotechandelectronics 4 года назад
Glad to hear it works for you now.
@ilkeraykut7064
@ilkeraykut7064 4 года назад
Thank you so so much!!
@retrotechandelectronics
@retrotechandelectronics 4 года назад
You're welcome!
@marcotulio-analogchannel306
@marcotulio-analogchannel306 3 года назад
Thanks for sharing!!!!!
@retrotechandelectronics
@retrotechandelectronics 3 года назад
No problem 😊
@neilbarnett3046
@neilbarnett3046 4 года назад
Just a reminder to everyone: Make a backup of the edited user settings AND put it in the .../libraries folder, not the TFT_eSPI folder. If you choose to use multiple setups, then back them all up. Why? Because if you update the driver using the Arduino IDE, it wipes all the files, possibly by downloading an unpacking the entire directory for this library with overwrite. And then you're back here re-doing your edits. I'm sure you can all guess how I know.
@retrotechandelectronics
@retrotechandelectronics 4 года назад
Good to know.... In platform IO there is no centralized config files, each project has its own. I realized this when I updated the arduino ide driver...
@carlanderson5068
@carlanderson5068 Год назад
Thanks. This is one area that I hope gets better with some kind of overlay system or setup for configurations. If you work with several different boards and displays in different projects, how do people keep the configs straight? It looks like the current setup only really works well if you always use the same board and the same display for every project?
@DaniPardo
@DaniPardo 3 месяца назад
Thanks for the video! Quick question: If I just connect GND and VCC to 3.3V, should the display turn on? Because mine seems to do nothing. Maybe I should connect the BLK to 3.3v?
@retrotechandelectronics
@retrotechandelectronics 3 месяца назад
No. It needs to be initialized in code
@Jungmin_Seo
@Jungmin_Seo 3 года назад
Thank you my hero
@retrotechandelectronics
@retrotechandelectronics 3 года назад
And you are my hero! Thanks for watching.
@tamgaming9861
@tamgaming9861 3 года назад
What is the best way to make for e.g. a small battery symbol for it? Coding with lines or loading as .h file?
@retrotechandelectronics
@retrotechandelectronics 3 года назад
As a one off in a pinch for a program I could make it with lines pretty quick.
@tamgaming9861
@tamgaming9861 3 года назад
@@retrotechandelectronics great - thanks for the answer, helps :-) So nothing wrong to make it in lines, instead of a picture. Thank you.
@alfitodesmon3239
@alfitodesmon3239 2 года назад
Thanks you sir
@retrotechandelectronics
@retrotechandelectronics 2 года назад
You're welcome.
@mohsenr4434
@mohsenr4434 2 года назад
Thank you!
@retrotechandelectronics
@retrotechandelectronics 2 года назад
You're welcome!
@hassanshaikh3989
@hassanshaikh3989 4 года назад
I want to initialise this display with C8051F120 microcontroller can you help me?
@retrotechandelectronics
@retrotechandelectronics 4 года назад
I do not have this microcontroller, sorry.
@rogersmith6151
@rogersmith6151 2 года назад
Hello, helpful video. Found it when I couldn't get the display to work. Ran the dianostic but it reports nonsense pin allocation, MOSI = GPIO 2 MISO = GPIO 5 SCK = GPIO 15 TFT_DC = GPIO 5 TFT_RST = GPIO 2. Would seem to be why nothing works, I suspect the esp32 itself, any one help at all. Thank you
@retrotechandelectronics
@retrotechandelectronics 2 года назад
Careful with gpio pin 2 on certain boards that could be the onboard led. Use another
@andreandrade1997
@andreandrade1997 20 дней назад
Hi, thanks for the great video! Regarding the TFT_INVERSION_ON or TFT_INVERSION_OFF not producing any change in the example "Colour_Test", it indeed produces changes for the "All_Free_Fonts_Demo": - With TFT_INVERSION_ON defined ==> black text with white background. - With TFT_INVERSION_OFF defined ==> white text with a black background. None defined seems to get the last constant used defined. So, the bug is in the "Colour_Test" example, not the library. With my display I need to have TFT_INVERSION_ON defined, otherwise the starfield example has black stars with a white background...
@TheDradge
@TheDradge 9 месяцев назад
Good video. What video software do you use for the chip/wiring animations?
@retrotechandelectronics
@retrotechandelectronics 9 месяцев назад
Final cut pro x
@TheDradge
@TheDradge 9 месяцев назад
@@retrotechandelectronics thanks for the info.
@user-pp2hz7ic7h
@user-pp2hz7ic7h 4 года назад
thanks a lot
@retrotechandelectronics
@retrotechandelectronics 4 года назад
You are most welcome
@MrSasha3050
@MrSasha3050 4 года назад
Perfect.
@retrotechandelectronics
@retrotechandelectronics 4 года назад
Thank you.
@shounakbaruri5225
@shounakbaruri5225 3 года назад
will these stpes work with ST7789V dispaly
@retrotechandelectronics
@retrotechandelectronics 3 года назад
Id imagine so.
@fareedsuri
@fareedsuri 4 года назад
THANKS !!!
@retrotechandelectronics
@retrotechandelectronics 4 года назад
You’re welcome!
@martinrcflyer4089
@martinrcflyer4089 3 года назад
Thanks for a great video, Jordan. It’s really useful, invaluable even, because the pinouts on the module are incorrectly labelled for I2C, instead of SPI. Can you say which pin on the ST7789 should be connected as a CS (chip select) pin on the ESP (default TFT_CS is 15). To me, the pin conversion wasn’t fully clear early on in the video - you gave the PIN numbers but not their meaning in the setup header file, which only comes later in your video : 1m41s SCL D18 TFT_SCLK SDA D23 TFT_ MISO RES D4 TFT_ RST DC D2 TFT_ DC BLK n/a (ground to turn off Backlight) 4m47s TFT_MOSI 19 n/c TFT_ MISO 23 SDA TFT_ SCLK 18 SCL TFT_ CS 15 n/c TFT_ DC 2 DC TFT_ RST 4 RES TFT_ BL 32 n/c
@yiannisionas
@yiannisionas 2 года назад
Generic ESP32 setup //#define TFT_MISO 19 #define TFT_MOSI 23 #define TFT_SCLK 18 //#define TFT_CS -1 // Not connected #define TFT_DC 2 #define TFT_RST 4 // Connect reset to ensure display initialises
@leonardoantoniopuertaespin5462
@leonardoantoniopuertaespin5462 3 года назад
Gracias muchas gracias
@retrotechandelectronics
@retrotechandelectronics 3 года назад
de nada!
@xrayer4412
@xrayer4412 3 месяца назад
thank god!
@retrotechandelectronics
@retrotechandelectronics 3 месяца назад
Glad you enjoyed it.
@tobahnsnm
@tobahnsnm Год назад
Cool! I finally could test my display. I had much less success with other libraries and MCU, such RPi and UNO. At least I know my display works fine!
@retrotechandelectronics
@retrotechandelectronics Год назад
Glad to help.
@usmanumer9871
@usmanumer9871 3 года назад
vwey helpful. i m looking a simple device could measure air pressure , temp , air quality and etc. because i live close to Himalaya mountains . i want a make smart device which could help me measure many things
@retrotechandelectronics
@retrotechandelectronics 3 года назад
I would recommend you assemble a device with more than one of each sensor and measure the deviation for each for greater dependability for specific values in harsh terrain.
@raffaelenapoli2012
@raffaelenapoli2012 6 месяцев назад
How can i use with arduino UNO?
@retrotechandelectronics
@retrotechandelectronics 6 месяцев назад
Should work with Arduino too.
@luisagsi4992
@luisagsi4992 2 года назад
Can i change the pins?
@retrotechandelectronics
@retrotechandelectronics 2 года назад
Yes you can, the documentation explains how to specify different pins.
@caiopedreira6643
@caiopedreira6643 2 года назад
This is the pinout that worked on TTGO T7 v1.3: #define TFT_RST 33 //#define TFT_CS -1 // NOT CONNECTED #define TFT_DC 25 #define TFT_BL 32 // LED back-light //#define TFT_MISO -1 // NOT CONNECTED #define TFT_MOSI 23 #define TFT_SCLK 18
@neilbarnett3046
@neilbarnett3046 4 года назад
Wrong markings is probably why they're cheap. Mine just sat there with the built-in LED showing, until I went back and followed every one of your edits, turned out I hadn't #defined TFT_SDA_READ
@retrotechandelectronics
@retrotechandelectronics 4 года назад
Glad to hear its working for you now.
@SeNSBoston
@SeNSBoston 3 года назад
Thanks a lot, man! You video resolved my issue (same sh&t, incorrectly marked pinouts - damn Chinese manufacturers!). I recommended @Bodmer to include your video to his library Wiki page github.com/Bodmer/TFT_eSPI - this is very common issue with cheap TFT SPI displays. P.S. What I really don't understand, why Chinese manufacturers make same mistake all the time? I saw many different cheap TFTs on Amazon, eBay & ali, marked same way (i.e. incorrectly)...
@retrotechandelectronics
@retrotechandelectronics 3 года назад
The concept of QC in China is non existent.
@SeNSBoston
@SeNSBoston 3 года назад
@@retrotechandelectronics Oh, by the way, I forgot to ask you: what software you've used to draw schematics, and could you share your virtual parts (esp32 devkit & 7 pin display)? I'm trying Fritzing but can't find similar kind of display (only "legal" Adafruit ones with a lot of pins).
@user-ct3yb7ix2o
@user-ct3yb7ix2o 2 года назад
TFT_ESPI 2.4.32 dose not work wiht ESP32, 2.4.2 is fine.
@retrotechandelectronics
@retrotechandelectronics 2 года назад
I was not aware of any issue.
@browaruspierogus2182
@browaruspierogus2182 4 года назад
I use ESP-IDF and don't need all this crazy Arduino stuff.
@retrotechandelectronics
@retrotechandelectronics 4 года назад
That the connection, and the library, and the configs, and the testing have little to nothing do with the ide, who cares besides yourself that this was demonstrated with arduino ide? Did that confuse you?
@browaruspierogus2182
@browaruspierogus2182 4 года назад
@@retrotechandelectronics That Arduino library may not exist in few months and your code won't work. Happens all the time. Also I am talking not IDE but Arduino framework. Arduino framework can be used with Visual Studio Code as well, not necessarily Arduino IDE which is horrible imo
Далее
IPS displays on ST7789 and ST7735 controllers
13:20
Просмотров 219 тыс.
Is this Best ESP32 board? New T-Display S3 ESP32S3
10:17
GC9A01 Round LCD with ESP32 & Arduino
45:46
Просмотров 284 тыс.
Hacking a weird TV censoring device
20:59
Просмотров 3 млн
STM32 + LCD TFT = Display Any Data
17:28
Просмотров 11 тыс.
10 МИНУСОВ IPHONE 15
18:03
Просмотров 42 тыс.