st7789 240x240
BLK --> not connected
DC --> Pin 8
RES --> Pin 10
SDA --> Pin 6
SCL --> Pin 4
VCC --> 3V3
GND --> GND
change fileTFT_eSPI/Processors/TFT_eSPI_ESP32_C3.h
#define SPI_PORT SPI2_HOST
to
#if ESP_ARDUINO_VERSION_MAJOR < 3
#define SPI_PORT SPI2_HOST
#else
#define SPI_PORT 2
#endif
ESP3-C3 Super Mini wiring to ST7789
-
ScottLininger
- Posts: 1
- Joined: Fri May 02, 2025 6:03 am
Re: ESP3-C3 Super Mini wiring to ST7789
SUPER HUGE THANKS to Moriyama. That change to the fileTFT_eSPI/Processors/TFT_eSPI_ESP32_C3.h was critical. After days of struggling with it, that finally did the trick.
In the hopes that some poor soul runs across this thread like I did, here are the complete steps I used to get the ST7789 240x240 working with my ESP3-C3 Supermini.
1. Install the library in Arduino IDE. Go to Tools > Manage Libraries and search for "TFT_eSPI". Install the TFT_eSPI library by Bodmer. I installed 2.5.43 as of May 2, 2025.
2. Search your hard drive for fileTFT_eSPI/User_Setup.h. Open that file, replace its entire contents with the following, and save it. (You could make a copy of the original file and rename it User_Setup_original.h if copy pasting over all the comments makes you nervous.)
3. In that same folder, open the file fileTFT_eSPI/Processors/TFT_eSPI_ESP32_C3.h, and replace this line (line 71)
...with this code...
4. Wire up the thing carefully to match this diagram:
5. Make a sketch with this code:
Hopefully that works for you! The key seemed to be changing the .h code in step 4.
In the hopes that some poor soul runs across this thread like I did, here are the complete steps I used to get the ST7789 240x240 working with my ESP3-C3 Supermini.
1. Install the library in Arduino IDE. Go to Tools > Manage Libraries and search for "TFT_eSPI". Install the TFT_eSPI library by Bodmer. I installed 2.5.43 as of May 2, 2025.
2. Search your hard drive for fileTFT_eSPI/User_Setup.h. Open that file, replace its entire contents with the following, and save it. (You could make a copy of the original file and rename it User_Setup_original.h if copy pasting over all the comments makes you nervous.)
Code: Select all
#define USER_SETUP_INFO "User_Setup"
#define ST7789_DRIVER
#define TFT_RGB_ORDER TFT_BGR
#define TFT_WIDTH 240
#define TFT_HEIGHT 240
#define TFT_MISO 5
#define TFT_MOSI 6
#define TFT_SCLK 4
#define TFT_CS -1 // Chip select control pin
#define TFT_DC 8 // Data Command control pin
#define TFT_RST 10 // Reset pin (could connect to RST pin)
#define TOUCH_CS -1 // Chip select pin (T_CS) of touch screen
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SPI_FREQUENCY 27000000
3. In that same folder, open the file fileTFT_eSPI/Processors/TFT_eSPI_ESP32_C3.h, and replace this line (line 71)
Code: Select all
#define SPI_PORT SPI2_HOSTCode: Select all
#if ESP_ARDUINO_VERSION_MAJOR < 3
#define SPI_PORT SPI2_HOST
#else
#define SPI_PORT 2
#endif4. Wire up the thing carefully to match this diagram:
Code: Select all
GND -> GND
VCC -> 3V3
SCL -> 4
SDA -> 6
RST -> 9
DC -> 8
BLK -> 3v3 to always have the backlight on5. Make a sketch with this code:
Code: Select all
#include <TFT_eSPI.h> // Include the graphics library
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI(); // Invoke custom setup from User_Setup.h
void setup() {
tft.init();
tft.setRotation(0);
tft.fillScreen(TFT_RED);
tft.setTextColor(TFT_WHITE, TFT_RED);
tft.drawString("Hello ESP32-C3 Super Mini!", 10, 10, 2);
}
void loop() {
}
Hopefully that works for you! The key seemed to be changing the .h code in step 4.
Who is online
Users browsing this forum: Qwantbot and 3 guests