-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TFT_eSPI_ESP32_C6.c and TFT_eSPI_ESP32_C6.h #3399
base: master
Are you sure you want to change the base?
Conversation
I am trying the new files you made. at the compilation level there are no errors but when I go to load the esp32c6 program it crashes and restarts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have marked the changes that I made for myself which seem to have made it work. I've compiled probably 50 times successfully already with these files and the small changes made.
Also, here is a setup that finally worked with the pins and no errors or faulty connections to a ILI9488 TFT LCD shield via parallel.
When running the test on the pins, I had to put the GPIO printed number into the user setup file (where I also connected the cables to) and the actual pin number into the test code I ran to check the connections (you will see what I mean in the comments behind the pins).
Not sure if that is "normal", I always thought that the written GPIO names are used but apparently not.. well whatever, I am not that long into ESP32 coding stuff, but at least I can compile my stuff with the ILI9488 now :)
#include <driver/gpio.h>
#define USER_SETUP_ID 70
#define ILI9488_DRIVER
#define TFT_PARALLEL_8_BIT
#define TFT_CS 23 // testPin(21, "TFT_CS"); // GPIO23
#define TFT_DC 19 // testPin(17, "TFT_DC"); // GPIO19
#define TFT_RST 1 // testPin(9, "TFT_RST"); // GPIO1
#define TFT_WR 11 // testPin(12, "TFT_WR"); // GPIO11
#define TFT_RD 0 // testPin(8, "TFT_RD"); // GPIO0
#define TFT_D0 4 // testPin(4, "TFT_D0"); // GPIO4
#define TFT_D1 5 // testPin(5, "TFT_D1"); // GPIO5
#define TFT_D2 12 // testPin(13, "TFT_D2"); // GPIO12
#define TFT_D3 13 // testPin(14, "TFT_D3"); // GPIO23
#define TFT_D4 18 // testPin(16, "TFT_D4"); // GPIO18
#define TFT_D5 6 // testPin(6, "TFT_D5"); // GPIO6
#define TFT_D6 7 // testPin(7, "TFT_D6"); // GPIO7
#define TFT_D7 22 // testPin(20, "TFT_D7"); // GPIO22
#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF
#define SMOOTH_FONT
// #define SPI_FREQUENCY 1000000
// #define SPI_FREQUENCY 5000000
// #define SPI_FREQUENCY 10000000
//#define SPI_FREQUENCY 20000000
#define SPI_FREQUENCY 27000000
#define SPI_READ_FREQUENCY 20000000
Processors/TFT_eSPI_ESP32_C6.c
Outdated
// Select the SPI port to use, ESP32 has 2 options | ||
#if !defined (TFT_PARALLEL_8_BIT) | ||
#ifdef CONFIG_IDF_TARGET_ESP32 | ||
#ifdef USE_HSPI_PORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifdef USE_HSPI_PORT | |
#ifdef USE_FSPI_PORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESP32-C6 apparently only uses FSPI so I just replaced every HSPI and VSPI with FSPI. Not sure if necessary, but I haven't noticed any negative effects by doing that and I've been able to compile multiple different (small) test firmwares.
Processors/TFT_eSPI_ESP32_C6.c
Outdated
#if !defined (TFT_PARALLEL_8_BIT) | ||
#ifdef CONFIG_IDF_TARGET_ESP32 | ||
#ifdef USE_HSPI_PORT | ||
SPIClass spi = SPIClass(HSPI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPIClass spi = SPIClass(HSPI); | |
SPIClass spi = SPIClass(FSPI); |
Processors/TFT_eSPI_ESP32_C6.c
Outdated
#elif defined(USE_FSPI_PORT) | ||
SPIClass spi = SPIClass(FSPI); | ||
#else // use default VSPI port | ||
SPIClass spi = SPIClass(VSPI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPIClass spi = SPIClass(VSPI); | |
SPIClass spi = SPIClass(FSPI); |
Processors/TFT_eSPI_ESP32_C6.c
Outdated
SPIClass spi = SPIClass(VSPI); | ||
#endif | ||
#else | ||
#ifdef USE_HSPI_PORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifdef USE_HSPI_PORT | |
#ifdef USE_FSPI_PORT |
Processors/TFT_eSPI_ESP32_C6.c
Outdated
#endif | ||
#else | ||
#ifdef USE_HSPI_PORT | ||
SPIClass spi = SPIClass(HSPI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPIClass spi = SPIClass(HSPI); | |
SPIClass spi = SPIClass(FSPI); |
Processors/TFT_eSPI_ESP32_C6.c
Outdated
RD_L; | ||
uint32_t reg; // Read all GPIO pins 0-31 | ||
reg = gpio_input_get(); // Read three times to allow for bus access time | ||
reg = gpio_input_get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reg = gpio_input_get(); | |
for (int i = TFT_D0; i <= TFT_D7; i++) { |
Co-authored-by: .raw <[email protected]>
Co-authored-by: .raw <[email protected]>
Co-authored-by: .raw <[email protected]>
Co-authored-by: .raw <[email protected]>
With the official Espressif ESP32-C6-DevKitC-1-N8 Development Board (Amazon) connected to a 2.8 TFT Display 240x320 (touch display) which works perfectly on MEGA Arduinos with ILI9341 DRIVER. I tried your update on my code by:Copying: TFT_eSPI_ESP32_C6.c
|
|
…ESP32S3, and ESP32C6 cannot use the TFT library in ESP3.0 version.
Hi, I am trying to use TFT_eSPI with the XIAO ESP32-C6. I pulled PR #3399, which resolves the compilation issues for this MCU in Arduino IDE. However, I still cannot get my ST7789 240x240 display working via SPI. The wiring and pinout are correct, as it functions with other libraries. Is there anything else needed to make this work on the ESP32-C6? Any advice or insights would be greatly appreciated! |
@emblink I got it working yesterday with a pretty similar setup (same display controller), I think you need to enable |
Hi @DanielBrkr, Thanks again for your help! |
This is the final version modified based on the reference.:https://github.com/Cincinnatu/TFT_eSPI |
I added TFT_eSPI_ESP32_C6.c and TFT_eSPI_ESP32_C6.h to fix the ESP32C6 compilation error.
When using the TFT_eSPI library on Arduino, I found that using TFT_eSPI_ESP32 did not compile correctly. After several attempts and modifications, I finally chose to add the files TFT_eSPI_ESP32_C6.c and TFT_eSPI_ESP32_C6.h to resolve the compilation issues