Connecting and Configuring the ST7789 LCD SPI Display to the ESP32

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 พ.ค. 2024
  • 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 132

  • @ksbs2036
    @ksbs2036 4 ปีที่แล้ว +10

    @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 ปีที่แล้ว +3

      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.

  • @steveobrien43
    @steveobrien43 ปีที่แล้ว +1

    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.

  • @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.

  •  4 ปีที่แล้ว +1

    I had this display for appx. year, with no luck running it, but your tutorial worked flawlessly, thanks!

  • @dymardo_
    @dymardo_ 3 ปีที่แล้ว +1

    I did a quick search on the screen driver for some basic info and landed here. The video was very helpful. Thank you.

  • @jfairplane8520
    @jfairplane8520 4 ปีที่แล้ว +1

    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 !

  • @livingrainman
    @livingrainman ปีที่แล้ว +1

    Great video! Thorough and clear. This display was giving me fits!

  • @johntoe6127
    @johntoe6127 4 ปีที่แล้ว +1

    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.

  • @andywaring12
    @andywaring12 3 ปีที่แล้ว +1

    Thank you so much for this video. Clear, succinct and very informative. Much appreciated.

  • @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.

  • @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?

  • @PabloFaby
    @PabloFaby 5 หลายเดือนก่อน

    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

  • @donjackson3520
    @donjackson3520 2 ปีที่แล้ว

    Excellent video, your detailed explanation is great work. Thanks.

  • @SilverC
    @SilverC 5 หลายเดือนก่อน

    Thank you for this great tutorial I got everything up and running with just this one video!

    • @retrotechandelectronics
      @retrotechandelectronics  5 หลายเดือนก่อน

      Glad to hear it. I’ve referred back to my own video for the wiring on several occasions.

  • @whirly85
    @whirly85 ปีที่แล้ว

    very useful video; helped me a lot. thanks and keep going the good work 👍

  • @WhoCaresWinsAgain
    @WhoCaresWinsAgain 3 ปีที่แล้ว +1

    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.

  • @SciDIY
    @SciDIY 3 ปีที่แล้ว

    Thank you! You've saved my day. Great explanation.

  • @yura081268
    @yura081268 3 ปีที่แล้ว

    Thanks! Very interesting library from Bodmer.

  • @georgfuhs5925
    @georgfuhs5925 3 ปีที่แล้ว

    thanks for this well done video (my hardware ESP32 240x240 display st7789controller) everything runs impressively

  • @kennethbeal
    @kennethbeal ปีที่แล้ว

    Thank you! Got some of these screens, you helped me get them working. Now to make a tiny videogame system! :)

    • @retrotechandelectronics
      @retrotechandelectronics  ปีที่แล้ว +1

      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!

  • @aezir8753
    @aezir8753 9 หลายเดือนก่อน

    I would like to ask which one will I use in the setup if I have a st7789v display?

  • @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!

  • @markj3851
    @markj3851 3 ปีที่แล้ว +1

    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 :-(.

  • @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^^

  • @mordgarrad
    @mordgarrad 2 ปีที่แล้ว +1

    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!!!

  • @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.

  • @mctainshcom
    @mctainshcom 3 ปีที่แล้ว +1

    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

  • @gangger89
    @gangger89 3 ปีที่แล้ว +2

    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

  • @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.!!!!

  • @DaniPardo
    @DaniPardo หลายเดือนก่อน

    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?

  • @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.

  • @alexeybeskov2071
    @alexeybeskov2071 3 ปีที่แล้ว +1

    Спасибо тебе прекрасный человек. Ты сохранил мне огромное количество времени.

    • @retrotechandelectronics
      @retrotechandelectronics  3 ปีที่แล้ว

      Рад, что смог помочь, я опубликовал другую информацию о дисплеях, использующих этот драйвер.

  • @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.

  • @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  ปีที่แล้ว +1

      @@hjw5774 glad to hear it. I’ve since posted another video for a larger touchscreen display.

  • @FlightHeroRC1
    @FlightHeroRC1 9 หลายเดือนก่อน

    You sir are a God send

  • @flashcorp76
    @flashcorp76 ปีที่แล้ว

    I like the musket ! :)

  • @EasyOne
    @EasyOne 2 ปีที่แล้ว

    Very well explained

  • @user-mj7ry1ir5o
    @user-mj7ry1ir5o ปีที่แล้ว

    Well done, thank you, sir!

  • @neilbarnett3046
    @neilbarnett3046 3 ปีที่แล้ว +6

    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  3 ปีที่แล้ว +1

      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?

  • @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 ปีที่แล้ว +1

      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.

  • @sakisv4138
    @sakisv4138 6 หลายเดือนก่อน

    Thank you for this video, helped a lot !!!

  • @TheDradge
    @TheDradge 7 หลายเดือนก่อน

    Good video. What video software do you use for the chip/wiring animations?

    • @retrotechandelectronics
      @retrotechandelectronics  7 หลายเดือนก่อน +1

      Final cut pro x

    • @TheDradge
      @TheDradge 7 หลายเดือนก่อน

      @@retrotechandelectronics thanks for the info.

  • @parkeryoung2471
    @parkeryoung2471 4 หลายเดือนก่อน

    my display is built-in but says spi , is it going to be same process

  • @eromangasensei7856
    @eromangasensei7856 8 หลายเดือนก่อน +1

    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?

  • @bebebichoxlive620
    @bebebichoxlive620 ปีที่แล้ว +1

    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

  • @ilkeraykut7064
    @ilkeraykut7064 3 ปีที่แล้ว

    Thank you so so much!!

  • @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.

  • @user-zy8vi2lz8f
    @user-zy8vi2lz8f 2 หลายเดือนก่อน

    Failed uploading: uploading error: exit status 2
    why i always get this messages? anyone can help?

  • @mohsenr4434
    @mohsenr4434 2 ปีที่แล้ว

    Thank you!

  • @marcotulio-analogchannel306
    @marcotulio-analogchannel306 3 ปีที่แล้ว

    Thanks for sharing!!!!!

  • @Jungmin_Seo
    @Jungmin_Seo 3 ปีที่แล้ว

    Thank you my hero

  • @alfitodesmon3239
    @alfitodesmon3239 ปีที่แล้ว

    Thanks you sir

  • @hassanshaikh3989
    @hassanshaikh3989 3 ปีที่แล้ว

    I want to initialise this display with C8051F120 microcontroller can you help me?

  • @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

  • @MrSasha3050
    @MrSasha3050 4 ปีที่แล้ว

    Perfect.

  • @leonardoantoniopuertaespin5462
    @leonardoantoniopuertaespin5462 2 ปีที่แล้ว

    Gracias muchas gracias

  • @user-pp2hz7ic7h
    @user-pp2hz7ic7h 4 ปีที่แล้ว

    thanks a lot

  • @shounakbaruri5225
    @shounakbaruri5225 3 ปีที่แล้ว

    will these stpes work with ST7789V dispaly

  • @fareedsuri
    @fareedsuri 4 ปีที่แล้ว

    THANKS !!!

  • @martinrcflyer4089
    @martinrcflyer4089 3 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      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

  • @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

  • @xrayer4412
    @xrayer4412 หลายเดือนก่อน

    thank god!

  • @raffaelenapoli2012
    @raffaelenapoli2012 4 หลายเดือนก่อน

    How can i use with arduino UNO?

  • @luisagsi4992
    @luisagsi4992 ปีที่แล้ว

    Can i change the pins?

    • @retrotechandelectronics
      @retrotechandelectronics  ปีที่แล้ว

      Yes you can, the documentation explains how to specify different pins.

  • @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!

  • @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.

  • @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

  • @SeNSBoston
    @SeNSBoston 3 ปีที่แล้ว +1

    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.

  • @browaruspierogus2182
    @browaruspierogus2182 4 ปีที่แล้ว

    I use ESP-IDF and don't need all this crazy Arduino stuff.

    • @retrotechandelectronics
      @retrotechandelectronics  4 ปีที่แล้ว +3

      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