ESP3-C3 Super Mini wiring to ST7789

beegeebee
Posts: 8
Joined: Sun Jan 07, 2024 5:28 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby beegeebee » Sat Feb 10, 2024 8:37 pm

Don't forget to connect the BLK (backlight pin) to GPIO10 or to 3.3V.

Jarizapo
Posts: 4
Joined: Thu Feb 08, 2024 4:04 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby Jarizapo » Sun Feb 11, 2024 12:12 am

Notihng... :/

I've tried coding something different, changing the ports multiple times and nothing.

I've also soldered the pins and noticed that the backlight works purely because of the current going in.

I don't know what's wrong or if my board is faulty or something.

And as the cherry on top, the board stopped being recognized by my computer (I have test it on another computer and with different cables and the board is the problem), but I somehow figured a way to "fix it" since now the computer recognizes it and I can upload the "Blink" code to test it.

I'm attaching a photo but I don't know why it only works when I connect 5V to 3.3V (I think the RST may be broken but I don't know at this point).
Attachments
83b651cb-51c4-4f5a-ab3b-453ef34e76fe.jpeg
83b651cb-51c4-4f5a-ab3b-453ef34e76fe.jpeg (70.83 KiB) Viewed 3560 times

kmdefined25
Posts: 4
Joined: Sat Aug 10, 2024 5:27 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby kmdefined25 » Sat Aug 10, 2024 6:30 pm

Sorry to tag onto this post, but it seems like beegeebee and michielbruijn have figured out how to get an ESP32-C3 Mini and a ST7789 TFT display to work together. I literally just want to be able to have my setup working so that it shows text on the screen so that I can move forward with more advanced things. Can either of you help a noob out with this?

I have the esp32-c3 mini and st7789 (240x240) display attached to a breadboard with the exact wiring explained in this post from beegeebee.
ESP32 ST7789
GPIO06 -> SDA
GPIO04 -> SCL
GPIO08 -> DC
GPIO09 -> RST
GPIO10 -> BLK
3V3 -> VCC
GND -> GND
I feel like the problem is happening with my fresh install of Arduino IDE. There has to be something people have changed that I did not. Trying to remember all the steps I took...
1. Fresh install, accepted all of the prompts that it needed to install
2. File > Preferences > Additional boards manager URLs: https://raw.githubusercontent.com/espre ... index.json
3. Tools > Board > ESP32C3 Dev Module
4. Tools > Port > Says COM3 (connected to my computer via usb-c to usb cable)
5. I wrote some basic code that I found from a tutorial on how to display text, but of course it wasn't showing anything on the screen...

Code: Select all

#include <TFT_eSPI.h>
#include <SPI.h>

TFT_eSPI tft = TFT_eSPI();

void setup() {
  tft.init();
  tft.fillScreen(0x1DF5);
  tft.drawString("Hello World",10,120);
}

void loop() {

}
6. The User_Setup.h / User_Setup_Select.h files are confusing to me, but I'm attempting to understand it. I copied the User_Setup.h file and made a new one specifically for my hardware setup, so for example: User_Setup_ESP32-C3-MINI-ST7789.h. It contains this (which I stole from this thread):

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 7 // Chip select control pin
#define TFT_DC 8 // Data Command control pin
#define TFT_RST 9 // 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
#define TFT_BL 10 // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
7. This is where I might be confused. Next in User_Setup_Select.h, on the line that talks about User_Setup.h (default setup is root library folder) I changed this to be custom named setup file. So the only thing that is uncommented is my custom setup:

Code: Select all

#include <User_Setup_ESP32-C3-MINI-ST7789.h>           // Default setup is root library folder
8. And then I hit upload and it seems to have compiled and uploaded, but nothing shows up.

Any clues on what I should try next? I can provide additional resources if needed.

Basitadam
Posts: 1
Joined: Sun Aug 11, 2024 1:32 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby Basitadam » Sun Aug 11, 2024 1:35 pm

Hi,
Check your serial port output. I am working on almost the same problem. Mine is keep rebooting as soon as tft.begin(); command

Tim

beegeebee
Posts: 8
Joined: Sun Jan 07, 2024 5:28 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby beegeebee » Mon Aug 12, 2024 4:19 pm

kmdefined25:

user_setup.h is a generic setup which you can use to develop your own setup. user_setup_select.h is as it says points to the required user setup include file. The include file path is relative to the location of user_setup_select.h and you will see there is a folder user_setups in the install with a number of example setup files.
You say the "default setup is root library folder". I'm not sure what you mean here. If you create your own setup your should be placing it in the TFT_eSPI install folder or the user_setup folder below that.

Don't try and place it anywhere else because the search order during build goes to the TFT_eSPI install folder first so you would have to make an explicit reference to the location in user_setup_select.h if you placed it anywhere else. Also user_setup_select.h must be in the TFT_eSPI install folder.

The install folder for TFT_eSPI on one of my projects is:
<platformio project folder>\.pio\libdeps\esp32-c3-devkitm-1\TFT_eSPI

I keep user_setup_select.h and user_setup.h (modified for my circuit) in this folder. :x

beegeebee
Posts: 8
Joined: Sun Jan 07, 2024 5:28 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby beegeebee » Mon Aug 12, 2024 4:38 pm

Basitadam:

TFT_eSPI uses the VSPI but also tries to start SPI. If you have any other code using SPI e.g. an SD disk then the order the code is declared can be important. TFT_begin should be one of the first commands after say Serial.Begin (so you can get debug messages). Without sight of the code I can't really be anymore help.

kmdefined25
Posts: 4
Joined: Sat Aug 10, 2024 5:27 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby kmdefined25 » Mon Aug 12, 2024 5:10 pm

Basitadam wrote:
Sun Aug 11, 2024 1:35 pm
Hi,
Check your serial port output. I am working on almost the same problem. Mine is keep rebooting as soon as tft.begin(); command

Tim
I have all the warnings turned on and when I upload, only 1 thing shows up as a warning, everything else looks to be okay.

Code: Select all

In file included from c:\Users\kevin\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:99,
                 from C:\Users\kevin\Documents\Arduino\Sketches\esp32-c3-mini-st7789-video\esp32-c3-mini-st7789-video.ino:1:
c:\Users\kevin\Documents\Arduino\libraries\TFT_eSPI/Processors/TFT_eSPI_ESP32_C3.h:11:3: warning: #warning >>>>------>> DMA is not supported on the ESP32 C3 (possible future update) [-Wcpp]
   11 |  #warning >>>>------>> DMA is not supported on the ESP32 C3 (possible future update)
      |   ^~~~~~~
I do see in the serial monitor tab that it keeps rebooting over and over... I'm gonna have to try and google this error for more info.

Code: Select all

Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x1058
load:0x403cc710,len:0x8a8
load:0x403ce710,len:0x2fa0
entry 0x403cc710
Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

kmdefined25
Posts: 4
Joined: Sat Aug 10, 2024 5:27 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby kmdefined25 » Mon Aug 12, 2024 5:16 pm

beegeebee wrote:
Mon Aug 12, 2024 4:19 pm
Don't try and place it anywhere else because the search order during build goes to the TFT_eSPI install folder first so you would have to make an explicit reference to the location in user_setup_select.h if you placed it anywhere else. Also user_setup_select.h must be in the TFT_eSPI install folder.
I have all the setup files within the library folder. Arduino > libraries > TFT_eSPI.

That reference you are questioning is within the 'User_Setup_Select.h file, its the first line in there that is uncommented. All I did was change it from '#include <User_Setup.h>' to my custom one that I created. Which I'm assuming is okay, because I didn't want to overwrite the default User_Setup.h file.

kmdefined25
Posts: 4
Joined: Sat Aug 10, 2024 5:27 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby kmdefined25 » Fri Aug 23, 2024 10:41 pm

I'm about to give up on this project because it seems like when I try to search for specific help with the esp32 c3 mini + st7789, there are very few resources. And the ones that I found, like this one, just don't work for me because everyone has different hardware. My display will not show anything. The only thing that I can think of is that because my display does not have CS pin, that it's just not going to work. All these tutorials that I'm trying to follow get me nowhere in the end. The other fun thing about the c3 mini that I found out is that sometimes your code doesn't even upload properly and you have to force it into flash mode. I can't even tell if that's doing anything because I can't get the most simple test to show up. Do I need resistors because of the display I picked? I'm just guessing at this point...

All I want to do is get the display to work and then run a video loop on it. Why is this so hard? :(

Max Smirnov
Posts: 1
Joined: Sat Sep 07, 2024 5:15 pm

Re: ESP3-C3 Super Mini wiring to ST7789

Postby Max Smirnov » Sat Sep 07, 2024 5:42 pm

ESP32-C3 Super Mini with the ST7789 135x240 display and the TFT_eSPI library is working successfully.
ESP32C3-ST7789-240-135.png
ESP32C3-ST7789-240-135.png (26.5 KiB) Viewed 932 times

TFT_eSPI settings

Code: Select all

#define ST7789_2_DRIVER
#define USER_SETUP_ID 135
#define TFT_RGB_ORDER TFT_RGB
#define TFT_WIDTH 135
#define TFT_HEIGHT 240
#define CGRAM_OFFSET

#define TFT_BL 1
#define TFT_DC 2
#define TFT_RST 3
#define TFT_SCLK 4
#define TFT_MISO 5
#define TFT_MOSI 6
#define TFT_CS 7

#define SMOOTH_FONT
#define SPI_TOUCH_FREQUENCY 2500000
#define SPI_READ_FREQUENCY 20000000
#define SPI_FREQUENCY 40000000
Example of setting the backlight brightness

Code: Select all

ledcAttach(TFT_BL, 1000, 7);
ledcWrite(TFT_BL, xxx);

Who is online

Users browsing this forum: No registered users and 57 guests