@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
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.
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...
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?
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 =
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...
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.
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
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 :-(.
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
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!!!
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.
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.
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
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?
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^^
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
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!
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.
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.
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 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).
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
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?
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
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
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
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.
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 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!
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
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.
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?
@@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
I had this display for appx. year, with no luck running it, but your tutorial worked flawlessly, thanks!
You're welcome!
Thank you so much for this video. Clear, succinct and very informative. Much appreciated.
Glad it was helpful!
@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
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.
very useful video; helped me a lot. thanks and keep going the good work 👍
Glad it helped!
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?
Excellent video, I thank you very much that you took the time to do it, very well explained, my screen worked super well.!!!!
Great to hear!
thanks for this well done video (my hardware ESP32 240x240 display st7789controller) everything runs impressively
Glad to hear it helped.
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.
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...
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?
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
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...
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.
Glad to hear it works for you now.
Thank you - very well explained! Great help to me!
You’re welcome.
@@retrotechandelectronics 4 months later and I still refer to this video for troubleshooting with the ST7789 display. Again, thank you so much.
@@hjw5774 glad to hear it. I’ve since posted another video for a larger touchscreen display.
hi you noticed since introduction of LVGL esphome 8.0 I lost lcd display on atom s3 these are the same ST7789 driver thank you for your response!
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
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 :-(.
Failed uploading: uploading error: exit status 2
why i always get this messages? anyone can help?
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
Thanks! I got the pins SCL and SDA mixed up, this saved me!
I did a quick search on the screen driver for some basic info and landed here. The video was very helpful. Thank you.
Glad it helped
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!!!
You're welcome, enjoy!
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.
Thank you my hero
And you are my hero! Thanks for watching.
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.
I have several videos out, the latest includes Wifi.
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
Glad it helped
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?
No. It needs to be initialized in code
my display is built-in but says spi , is it going to be same process
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^^
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
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!
Great video! Thorough and clear. This display was giving me fits!
Glad it was helpful!
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.
Thank you!
You're welcome!
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.
TFT_ESPI 2.4.32 dose not work wiht ESP32, 2.4.2 is fine.
I was not aware of any issue.
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.
sorry i could not help sooner
I would like to ask which one will I use in the setup if I have a st7789v display?
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 !
You're welcome.
how many Hz can it produce?
It doesn’t produce hz. I do t understand
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)...
The concept of QC in China is non existent.
@@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).
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
Great video! Thanks!
Glad you liked it!
How can i use with arduino UNO?
Should work with Arduino too.
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?
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
Careful with gpio pin 2 on certain boards that could be the onboard led. Use another
thank god!
Glad you enjoyed it.
Спасибо тебе прекрасный человек. Ты сохранил мне огромное количество времени.
Рад, что смог помочь, я опубликовал другую информацию о дисплеях, использующих этот драйвер.
Very well explained
Glad it was helpful!
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.
You would need to purchase a device with an I2C interface.
Can i change the pins?
Yes you can, the documentation explains how to specify different pins.
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
Glad to hear its working for you now.
Thanks you sir
You're welcome.
Perfect.
Thank you.
You sir are a God send
I like the musket ! :)
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
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
Thank you! You've saved my day. Great explanation.
Glad I could help!
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?
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.
Thank you for this great tutorial I got everything up and running with just this one video!
Glad to hear it. I’ve referred back to my own video for the wiring on several occasions.
Excellent video, your detailed explanation is great work. Thanks.
You are welcome!
Good video. What video software do you use for the chip/wiring animations?
Final cut pro x
@@retrotechandelectronics thanks for the info.
THANKS !!!
You’re welcome!
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.
You're welcome!
will these stpes work with ST7789V dispaly
Id imagine so.
I want to initialise this display with C8051F120 microcontroller can you help me?
I do not have this microcontroller, sorry.
Thank you for this video, helped a lot !!!
Glad to hear.
Thank you! Got some of these screens, you helped me get them working. Now to make a tiny videogame system! :)
Good luck!
@@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!
Thanks! Very interesting library from Bodmer.
Glad you enjoyed it!
What is the best way to make for e.g. a small battery symbol for it? Coding with lines or loading as .h file?
As a one off in a pinch for a program I could make it with lines pretty quick.
@@retrotechandelectronics great - thanks for the answer, helps :-) So nothing wrong to make it in lines, instead of a picture. Thank you.
Well done, thank you, sir!
You're welcome.
Thanks for sharing!!!!!
No problem 😊
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
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.
thanks a lot
You are most welcome
Gracias muchas gracias
de nada!
Thank you so so much!!
You're welcome!
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!
Glad to help.
I use ESP-IDF and don't need all this crazy Arduino stuff.
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?
@@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