Showing posts with label TFT_eSPI. Show all posts
Showing posts with label TFT_eSPI. Show all posts

Tuesday, July 14, 2020

ESP32 + 1.3 inch 240x240 IPS LCD (ST7789 SPI interface), using TFT_eSPI library



It's a 1.3 inch 240x240 IPS LCD, with driver ST7789 using SPI interface.

7 pins are used to connect to MCU:

# Pin Label Description
1 GND LCD Power ground
2 VCC LCD power supply is positive (3.3V)
3 SCL LCD SPI bus clock signal - connect to ESP32 18 TFT_SCLK
4 SDA LCD SPI bus write data signal - connect to ESP32 23 TFT_MOSI
5 RES  LCD reset control signal(Low level reset) - connect to ESP32 4 TFT_RST
6 DC   LCD register/data - connect to EST32 2 TFT_DC
7 BLK LCD backlight control signal - Connect to 3.3V


Product page: lcdwiki : 1.3inch IPS Module

This video show how to setup on Arduino IDE, using TFT_eSPI library on ESP32 (ESP32-DevKitC), to drive the 1.3 inch 240x240 IPS LCD.


Using TFT_eSPI, if you load a new copy of TFT_eSPI then it will over-write your setups if they are kept within the TFT_eSPI folder. It's suggested to create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h (Setup24_ST7789_ESP32.h in my exercise) files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file. (ref: https://github.com/Bodmer/TFT_eSPI)

- Makesure TFT_eSPI library is installed in Arduino IDE.
- Create "TFT_eSPI_Setups" folder under your Arduino library folder.
- Copy the file TFT_eSPI/User_Setups/Setup24_ST7789.h to TFT_eSPI_Setups folder, re-name it Setup24_ST7789_ESP32.h.

- Edit Setup24_ST7789_ESP32.h to match our connection:


- Edit User_Setup_Select.h file to point to the custom setup file, Setup24_ST7789_ESP32.h.


- Then you can try examples of TFT_eSPI.



Saturday, June 27, 2020

ESP32-DevKitC + 2.8inch 240x320 SPI TFT (ILI9341) using TFT_eSPI library

This post show how to use ESP32-DevKitC to drive a 2.8inch 240x320 SPI TFT (wih ILI9314 using serial interface), using TFT_eSPI library.




Connection:


I connect ESP32-DevKitC and Display board follow the default setting of TFT_eSPI library.
TFT_MISO 19
TFT_MOSI 23
TFT_SCLK 18
TFT_CS   15
TFT_DC    2
TFT_RST   4

I found the Fritzing parts here:
ESP32S-HiLetgo Dev Boad with Pinout Template
https://forum.fritzing.org/t/esp32s-hiletgo-dev-boad-with-pinout-template/5357

2.2 320x240 TFT ILI9341.fzpz (it should be logically same as the 2.8" display I use)
https://forum.fritzing.org/t/2-2-ili9342-tft/1813

Setup Library in Arduino IDE:
Menu > Sketch > Include Library > Manager Libraries...
Search and install TFT_eSPI


Then have to edit User_Setup.h to fix your circuit.


- Confirm ILI9341_DRIVER is defined

- comment the original define of:
TFT_CS, TFT_DC and TFT_RST.

- un-comment the pin define under "For ESP32 Dev board (only tested with ILI9341 display)"
TFT_MISO, TFT_MOSI 23, TFT_SCLK, TFT_CS, TFT_DC and TFT_RST.

Then, you can try any example under TFT_eSPI.



Using TFT_eSPI, if you load a new copy of TFT_eSPI then it will over-write your setups if they are kept within the TFT_eSPI folder. It's suggested to create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file.

check it:
ESP32 + 1.3 inch 240x240 IPS LCD (ST7789 SPI interface), using TFT_eSPI library