ESP32 C3 Super Mini with GC9A01

blake4711
Posts: 1
Joined: Sat Aug 03, 2024 7:15 am

ESP32 C3 Super Mini with GC9A01

Postby blake4711 » Sat Aug 03, 2024 7:39 am

Hey,

I've been at it for almost a week, trying to connect my ESP C3 super mini to a round GC9A01 240x240. I've tried with both Micropython and ESP-IDF and am currently trying with Arduino IDE and the TFT_eSPI lib. In Arduino I've selected the MakerGO ESP32 C3 SuperMini. I found suggestions to use the ESP32 C3 DevModule, but that wasn't working ether.

I have already looked around a lot here in the forum and so on, and I have also adopted the most common pin assignment. This is the User_Setup.h

Code: Select all

#define USER_SETUP_INFO "User_Setup"

#define GC9A01_DRIVER
#define TFT_SDA_READ

#define TFT_WIDTH  240
#define TFT_HEIGHT 240
#define TFT_CS 7
#define TFT_DC 8
#define TFT_RST 9

#define TFT_MISO 5
#define TFT_MOSI 6
#define TFT_SCLK 4

#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 SMOOTH_FONT

#define SPI_FREQUENCY  27000000

#define SPI_READ_FREQUENCY  20000000
The Display has no MISO so it isn't connected to anything. The display also has a BLK pin. High = Backlight on so I haven't connected it ether.

For test Code im Using an example from the lib: Colour_Test:

Code: Select all

#include <SPI.h>

#include <TFT_eSPI.h>       // Hardware-specific library

#define TFT_MISO 5

TFT_eSPI tft = TFT_eSPI();  // Invoke custom library

void setup(void) {
  tft.init();

  tft.fillScreen(TFT_BLACK);
  tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);

  // Set "cursor" at top left corner of display (0,0) and select font 4
  tft.setCursor(0, 4, 4);

  // Set the font colour to be white with a black background
  tft.setTextColor(TFT_WHITE);

  // We can now plot text on screen using the "print" class
  tft.println(" Initialised default\n");
  tft.println(" White text");
  
  tft.setTextColor(TFT_RED);
  tft.println(" Red text");
  
  tft.setTextColor(TFT_GREEN);
  tft.println(" Green text");
  
  tft.setTextColor(TFT_BLUE);
  tft.println(" Blue text");

  delay(5000);
}

void loop() {
  tft.invertDisplay( false ); // Where i is true or false
 
  tft.fillScreen(TFT_BLACK);
  tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);

  tft.setCursor(0, 4, 4);

  tft.setTextColor(TFT_WHITE);
  tft.println(" Invert OFF\n");

  tft.println(" White text");
  
  tft.setTextColor(TFT_RED);
  tft.println(" Red text");
  
  tft.setTextColor(TFT_GREEN);
  tft.println(" Green text");
  
  tft.setTextColor(TFT_BLUE);
  tft.println(" Blue text");

  delay(5000);


  // Binary inversion of colours
  tft.invertDisplay( true ); // Where i is true or false
 
  tft.fillScreen(TFT_BLACK);
  tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);

  tft.setCursor(0, 4, 4);

  tft.setTextColor(TFT_WHITE);
  tft.println(" Invert ON\n");

  tft.println(" White text");
  
  tft.setTextColor(TFT_RED);
  tft.println(" Red text");
  
  tft.setTextColor(TFT_GREEN);
  tft.println(" Green text");
  
  tft.setTextColor(TFT_BLUE);
  tft.println(" Blue text");

  delay(5000);
}
But it looks like my ESP is already crashing in the setup without a backtrace. With some prints and removing code, I was able to figure out, that the problem is with tft.init(). And in there with: writecommand(0x00); (Which is called in case TFT_RST >= 0, but it doesn't matter since all writecommands lead to a crash).

Because of this, I assumed a problem with this line: spi.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, -1); Printing the values reveals that this is executed: spi.begin(4, -1, 6, -1);. TFT_MISO is changed to -1, besides the declaration in User_Setup. I tried hard-wiring the variable, but it didn't change anything. I also tried a lot of different pins, but none of them work and all have the same problem.

Does anyone have any ideas about what I could try or even any idea what the specific problem is here?

Who is online

Users browsing this forum: Baidu [Spider] and 51 guests