0

I have recently purchased a ESP32-C3 1.28 Inch Round Display. No documentation nor reference were provided with the hardware :(

I made a nice UI on SquareLine studio to be run on my ESP32-2424S012. I have used the "create project template" option, then "export UI files".

I have received indeed the project with apparently everything I need. Then, I opened Arduino IDE with the main "ui.ino" file. I set on the IDE the right Sketchbook location. I managed to compile and upload with no error on my device.

The thing is... when I received the ESP32-2424S012, it had its own demo software and it was running fine. Since I uploaded my project, nothing is displayed anymore.

I also updated the User_Setup_Select.h file on libraries/TFT_eSPI to enable #include <User_Setups/Setup46_GC9A01_ESP32.h>. on User_Setup.h, I enabled #define GC9A01_DRIVER.

I am out of ideas about how to solve this issue.

Thanks for your support!

EDIT: Please find User_Setup.h: https://pastebin.com/Rc2zcayF User_Setup_Select.h: https://pastebin.com/uPyVZWsa

EDIT 2: Below is the trace i received using pyserial-miniterm: https://pastebin.com/LGMpLYPH

EDIT 3: This is the board's wiring diagram: Wiring diagram

6
  • Without output from the ESP32 it's quite impossible to say what's going on.
    – Tarmo
    Commented Dec 3 at 15:00
  • I tried to add some Serial.printf into setup() and loop() to check if these methods were called, so far, nothing on the Serial Monitor...
    – colletjb
    Commented Dec 3 at 15:26
  • That means your serial monitor is not set up correctly - ESP will print bootloader messages when its booting which you should be seeing. I suggest you start by fixing that. Debugging an embedded system without seeing its output is not for the faint of heart :) In general, it's just a serial port and you can open it with any reasonable tool on your platform. I'm personally fond of pyserial's super useful pyserial-miniterm utility. E.g. pyserial-miniterm /dev/ttyUSB0 115200 opens the default USB-UART adapter on Linux at the default baud rate.
    – Tarmo
    Commented Dec 3 at 18:51
  • Please update your post by adding your User_Setup.h, we have no idea whether you configure the setup properly or not.
    – hcheung
    Commented Dec 4 at 1:37
  • Setup46_GC9A01_ESP32.h is for GC9A01 driver for sure but the pin assignments are not for ESP32-C3 or the particular ESP32-C3 board.
    – hcheung
    Commented Dec 4 at 7:38

1 Answer 1

0

Setup46_GC9A01_ESP32.h

The Setup46 that comes with TFT_eSPI library is for GC9A01 driver for sure but the pin assignments are not for ESP32-C3 and certainly not for ESP32-2020S012 board.

Add the following User_Setup.h in the project folder where your_sketch.ino located (Assuming you are using Arduino IDE).

#define GC9A01_DRIVER

#define TFT_WIDTH  240 // ST7789 240 x 240 and 240 x 320
#define TFT_HEIGHT 240 // GC9A01 240 x 240

#define TFT_MOSI 7
#define TFT_SCLK 6
#define TFT_CS   10
#define TFT_DC   2
#define TFT_RST  -1
#define TFT_BL   3
#define TFT_MISO -1

#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

#define SMOOTH_FONT

#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY  20000000

Add the following code to the setup() for using analogWrite() to control backlight brightness.

void setup(void) {
    // all the necessary setup code go here

    // backlight brightness control
    pinMode(TFT_BL, OUTPUT);
    analogWrite(TFT_BL, 120); // change value from 20 - 255 to adjust brightness
}
7
  • Thanks for your contribution. It still does not work, but i feel we are getting close. Please find here the trace from the serial: pastebin.com/AHc9nZ5E. Thanks for your help !
    – colletjb
    Commented Dec 5 at 19:48
  • The backlight is the only thing that seem to work... I have no Serial anymore :(
    – colletjb
    Commented Dec 5 at 22:52
  • This configuration was derived from ESP Home Assistant configuration and the schematic of esp32-2424s012 also shows the pins used for the interface.
    – hcheung
    Commented Dec 6 at 2:06
  • I noticed that you select ESP32-C3 generic board on Arduino IDE, which seems that the MOSI and SCK pins are different from this setting. However, I can't find a board variances on Arduino IDE that supports the configuration shown on schematic. Maybe the vendor has their own configuration and framework/flash tool for the display.
    – hcheung
    Commented Dec 6 at 2:10
  • One suggestion: Change the pin configuration to #define TFT_MOSI MOSI, #define TFT_SCLK SCK, #define TFT_CS SS. this would used whatever selected Arduino Board is used for the SPI interface.
    – hcheung
    Commented Dec 6 at 2:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.