Page 1 of 1

Need help - unable to light up ST7789 screen via Arduino IDE

Posted: Wed Jul 16, 2025 1:46 pm
by mgsvamp
Using Arduino IDE version 2.3.6
DevKit: ESP32-S3-USB-OTG
Board: ESP32 S3 MINI 1
Screen: ST7789
Library: TFT_eSPI 2.5.43
user_setup.h:
#define ST7789_DRIVER

#define TFT_RGB_ORDER TFT_BGR

#define TFT_WIDTH 240
#define TFT_HEIGHT 240

#define TFT_MOSI 7
#define TFT_SCLK 6
#define TFT_CS 5
#define TFT_DC 4
#define TFT_RST 8
#define TFT_BL 9


Tried multiple times but couldn't get the screen to light up. Seeking HELP.
Thanks in advance.

Re: Need help - unable to light up ST7789 screen via Arduino IDE

Posted: Thu Jul 17, 2025 3:06 am
by lbernstone
You can try setting TFT_BACKLIGHT_ON, but I find it easier to just manually set the backlight level:

Code: Select all

analogWrite(TFT_BL, 128); // 0-255

Re: Need help - unable to light up ST7789 screen via Arduino IDE

Posted: Fri Jul 18, 2025 9:00 am
by horace99
which file in Arduino\libraries\TFT_eSPIUser_Setups did you edit?
with the ESP32-S3-DevKitC-1 and Waveshare General 2inch LCD Display Module IPS Screen 240×320 ST7789
I used Documents\Arduino\libraries\TFT_eSPIUser_Setups/Setup71_ESP32_S2_ST7789.h
and setup Documents\Arduino\libraries\TFT_eSPI\User_Setup_Select.h to select that file

what output do you get on the Arduino IDE serial monitor?

with ESP32S3 I found that using ESP32 core 2.3.0 and 2.0.17 it goes into a reboot loop
using ESP32 core 2.0.14 works OK

Re: Need help - unable to light up ST7789 screen via Arduino IDE

Posted: Fri Jul 18, 2025 5:10 pm
by lbernstone
With TFT_eSPI, I put a build_opt.h in the sketch folder with the following contents. This makes it more portable (and versionable). You need the USE_HSPI_PORT macro. I then put analogWrite(TFT_BL, TFT_BL_LEVEL); in setup() after init'ing the device. https://wokwi.com/projects/436838160182099969

Code: Select all

-DST7789_DRIVER
-DTFT_SDA_READ
-DTFT_WIDTH=240
-DTFT_HEIGHT=320
-DTFT_CS=12
-DTFT_MOSI=7
-DTFT_SCLK=5
-DTFT_DC=9
-DTFT_RST=11
-DTFT_BL=3
-DTFT_BL_LEVEL=250
-DTFT_INVERSION_OFF
-DTFT_ROT=3
-DLOAD_FONT2
-DLOAD_FONT4
-DLOAD_FONT6
-DUSER_SETUP_LOADED
-DSPI_FREQUENCY=40000000
-DUSE_HSPI_PORT

Re: Need help - unable to light up ST7789 screen via Arduino IDE

Posted: Sat Jul 19, 2025 1:21 am
by mgsvamp
which file in Arduino\libraries\TFT_eSPIUser_Setups did you edit?
with the ESP32-S3-DevKitC-1 and Waveshare General 2inch LCD Display Module IPS Screen 240×320 ST7789
I used Documents\Arduino\libraries\TFT_eSPIUser_Setups/Setup71_ESP32_S2_ST7789.h
and setup Documents\Arduino\libraries\TFT_eSPI\User_Setup_Select.h to select that file

what output do you get on the Arduino IDE serial monitor?

with ESP32S3 I found that using ESP32 core 2.3.0 and 2.0.17 it goes into a reboot loop
using ESP32 core 2.0.14 works OK
Thanks. I met the same issue that stuck in a reboot loop as well. I will try this solution to see if it can lead to a positive result.

Re: Need help - unable to light up ST7789 screen via Arduino IDE

Posted: Sat Jul 19, 2025 1:23 am
by mgsvamp
With TFT_eSPI, I put a build_opt.h in the sketch folder with the following contents. This makes it more portable (and versionable). You need the USE_HSPI_PORT macro. I then put analogWrite(TFT_BL, TFT_BL_LEVEL); in setup() after init'ing the device. https://wokwi.com/projects/436838160182099969

Code: Select all

-DST7789_DRIVER
-DTFT_SDA_READ
-DTFT_WIDTH=240
-DTFT_HEIGHT=320
-DTFT_CS=12
-DTFT_MOSI=7
-DTFT_SCLK=5
-DTFT_DC=9
-DTFT_RST=11
-DTFT_BL=3
-DTFT_BL_LEVEL=250
-DTFT_INVERSION_OFF
-DTFT_ROT=3
-DLOAD_FONT2
-DLOAD_FONT4
-DLOAD_FONT6
-DUSER_SETUP_LOADED
-DSPI_FREQUENCY=40000000
-DUSE_HSPI_PORT
Thank you for providing a new direction. Let me take a look and have a try.