ESP32 and TFT ST7789 set up and wiring using SPI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys thanks for checking out this video i just want to show you how to configure a 38 pin esp32 to work with a tft display running the st7789 chip now i had a few issues trying to do this and i had to scour the internet forums and some of the documentation in order to get this work so hopefully this helps you this is a real hacky video it's really meant just to get you going i don't know a lot about the in-depth technical details or engineering about this but i know that what i did works so first thing you don't need a logic converter or any kind of resistors the output of the esp32 is 3.3 volts and that is what is required for the display next thing i found are the different spi modes so mode 3 is when they're the cs pin is grounded and in this case when it's not on the cs board is a pin to connect that means it is grounded i also found that the sclk and the mosi pins are hardwired on the esp32 and that's important in the programming because they can't be changed the last thing i found was that there is a mode 3 which is also known as vspi mode so now if you come across more documentation or any kind of references there you will be able to tell what is what for this particular sketch i was using the adafruit st7789 library the spi library and the adafruit gfx library you can also define the tft variables to set specific pins and then a thing that i found was very important is you need to initialize the display with the spi underscore mode 3 constant here's a quick table i'll show you what the pins are named on each board and how they all relate and connect to each other so the mosi pin is the tft underscore mosi when you're programming and it connects to the sda pin on the display and that has to be on pin 23 for the esp32 for the sclk pin on the esp32 you refer to that as the tft underscore sclk in your programming and then it is the sck pin on the display and that has to be pin 18 on this particular board for the reset it's tft underscore rst in the programming res is the term on the display and i chose pen 17 but you could use whatever you want and then you have the dc which is the tft underscore dc in your programming and it is dc on the display so again you can pick whatever you want i chose pin 15. so for the last three things you got the ground you got the input voltage which is vcc and then blk which controls the screen the ground and the three three v3 on the esp32 are going to connect to the ground and the vcc on the display and then blk is an optional thing so that you can control the screen if you want i use the arduino programmer so i'm going to show you how to really quickly set that up so that it works with these boards first thing you're going to do is you're going to go to the preferences and then if you go down to additional boards manager you need to enter this url i include that in the comments below what that does is that's going to load the information for the esp32 boards and allow you to use this to program it next thing that we are going to do is we are going to install the libraries that we want so you're going to go to sketch include library manage libraries and then you're going to search for st7789 so you want to install the adafruit st7735 and st7789 library and you want to make sure that when you do that you install all the dependencies as well next search adafruit gfx and then you want to install the adafruit gfx library which is this one right here next we're going to go over tools and we're going to get the board configured so you want to make sure it's the esp dev module so in order to do that you're going to click on board boards manager and then you want to search for esp32 install the one by espressif systems and then you're good to go and one last thing that you want to do is you want to make sure that the drivers are installed just visit this website go to downloads and then find the drivers that are suitable for your particular operating system i'll show you real quick what i did with the code what i did here is i took the examples from the st7789 adafruit library and this is the graphics test example now i cut out some of the comments just to make it a little tighter and easier to read and i'll show you what i did here i'm defining the constants for the pins on the esp32 and then i'm going to connect the pins that i put here to the display so to further clarify pin 17 is going to the reset on the display pin 15 to the dc pin 23 to the sd8 and pin 18 to the sclk again my board did not have a cs pin so i just put a whatever random value there now if you look down here this is the second part that's very important you have to set to spi underscore mode three when you initialize your display once you do all that you can upload it to the board one other little gotcha was the reset button so this is important you do need that pin i did read somewhere that you didn't need it but then what happens is it will run the first time and then until the display is turned off and completely reset it won't run again so that is important to have now the last little trick is what when you go to upload your sketch you're going to see a boot button on to the right of your usb cable when you start seeing it trying to connect you're going to push that boot button and once it latches you'll see it start to load your sketch and you'll be good to go thanks a lot for checking out this video i was having a hell of a time trying to get this thing up and going and uh like i said finding the information that forms was a bit of a pain in the ass so hopefully put in one spot for you guys right here we'll get you where you need to go take care
Info
Channel: Modern Hacker Space
Views: 17,208
Rating: undefined out of 5
Keywords: ESP32, tft, display, st7789, adafruit, aliexpress, alibaba, ESP-wroom 32, wroom, wroom32, ESPWROOM32, gmt130, no cs pin, cs pin, wifi
Id: ZFqVvDtgLLU
Channel Id: undefined
Length: 5min 30sec (330 seconds)
Published: Mon Jun 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.