-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ESP32-S3 + ST7789 (240x240) - Severe "Rainbow Static" noise when drawing Camera frames #3889
Description
Hi Bodmer,
First of all, thank you for this amazing library.
I am trying to build a digital camera using an ESP32-S3 (N16R8), an OV2640 camera, and a standard ST7789 240x240 IPS display.
The Problem:
The screen works perfectly when drawing static text or graphics (User_Setup test works fine). However, as soon as I start the Camera and try to push frames to the screen (using tft.pushImage), the image is overwhelmed by "rainbow static" or noise. It looks like electrical interference or a timing mismatch.
What I have tried:
Lowered SPI Frequency to 20MHz and 10MHz.
Lowered Camera XCLK to 10MHz to reduce interference.
Used a custom "Magic Init" sequence (adjusting Porch control and Gamma) found in another driver file, which helped slightly but didn't fix it.
Forced TFT_RGB_ORDER TFT_BGR and TFT_INVERSION_ON.
My Setup:
Board: ESP32-S3 Dev Module (N16R8) + Built In Camera OV2640 + SD Card Slot
Library Version: Latest
Wiring (HSPI):
SDA (MOSI): GPIO 47
SCL (SCLK): GPIO 21
DC: GPIO 41
RST: GPIO 42
(MISO/CS are not available)
My User_Setup.h:
#define ST7789_DRIVER
#define TFT_WIDTH 240
#define TFT_HEIGHT 240
#define TFT_RGB_ORDER TFT_BGR
#define TFT_INVERSION_ON
#define TFT_MOSI 47
#define TFT_SCLK 21
#define TFT_DC 41
#define TFT_RST 42
#define TFT_CS -1
#define LOAD_GLCD
#define SPI_FREQUENCY 20000000 // I have tried lower
The Code Snippet (Loop):
// Using native rom/tjpgd.h decoder
static UINT tjd_output(JDEC *jd, void *bitmap, JRECT rect) {
tft.pushImage(rect->left, rect->top, rect->right - rect->left + 1, rect->bottom - rect->top + 1, (uint16_t)bitmap);
return 1;
}
void loop() {
camera_fb_t *fb = esp_camera_fb_get();
if (fb) {
drawFrame(fb); // Calls tjd_output
esp_camera_fb_return(fb);
}
}
The Visuals :
https://github.com/user-attachments/assets/6bacd2c0-7e2d-4005-900d-929ffe8ce28e

Is there a specific initialization command or SPI setting I am missing for the ESP32-S3 to handle the high-speed camera data alongside the screen update?