VGA driver from ESP32 S3

vsfred
Posts: 9
Joined: Mon Aug 15, 2022 12:12 pm

VGA driver from ESP32 S3

Postby vsfred » Wed Nov 30, 2022 9:03 am

Hello,

I' m try to develop VGA driver from ESP32-S3.

My schematic is similar to FabGL library (http://www.fabglib.org/conf_v_g_a.html). I have 8 outputs :
1 output V-Sync
1 output H-Sync
2 outputs red
2 outputs green
2 outputs blue

I tested on ESP32 WROOM, it's work fine.


On ESP32-S3, I can't reused fabGL code (FalbGL use I2S module with LCD capabilities). To work on S3, I reused "rgb_panel" example https://github.com/espressif/esp-idf/tr ... /rgb_panel.

This example draw a scatter chart.

I settting the good IO and timings (640*480 : http://tinyvga.com/vga-timing/640x480@60Hz)
I configure driver with two frame buffer in PSRAM.

But on display is dirty. I see the scatter chart, but it's blink and move and the background is not clean.

I try with "Restart transmission in VSYNC" from LCD menuconfig. It's a little better, the scatter chart is centered, but the signal is not clean.

I checked vsync and hsync with oscilloscope. The timings are good (front porch, back porch, ...)

Something else, I tried without LVGL. I writed a pattern, directly in frame buffer. But I don't known how to switch the framebuffer. To display my pattern, I must to write in the two frame buffer.

Code: Select all

// Code OK, but why I must write in the two frame buffer ??
void *buf1 = NULL;
void *buf2 = NULL;

ESP_LOGI(TAG, "Use frame buffers as LVGL draw buffers");
ESP_ERROR_CHECK(esp_lcd_rgb_panel_get_frame_buffer(panel_handle, 2, &buf1, &buf2));

memset(buf1, 0x01, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_V_RES);
memset(buf2, 0x01, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_V_RES);
vTaskDelay(pdMS_TO_TICKS(1000));

memset(buf1, 0x02, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_V_RES);
memset(buf2, 0x02, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_V_RES);
vTaskDelay(pdMS_TO_TICKS(1000));

memset(buf1, 0x04, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_V_RES);
memset(buf2, 0x04, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_V_RES);
vTaskDelay(pdMS_TO_TICKS(1000));
Do you have and idea ?

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: VGA driver from ESP32 S3

Postby ESP_Sprite » Wed Nov 30, 2022 2:50 pm

It's possibly a bandwidth problem. 640x480x16bit takes up about 600K, so you wouldn't be able to store it in internal RAM, so I imagine you're using PSRAM. 640x480x60Hz@16bit is 36MBit/second. That is high enough that quad PSRAM can't handle it, so you probably want octal PSRAM.

vsfred
Posts: 9
Joined: Mon Aug 15, 2022 12:12 pm

Re: VGA driver from ESP32 S3

Postby vsfred » Thu Dec 01, 2022 8:30 am

Thanks for your response ESP_Sprite

I use ESP32-S3-WROOM-1-N8R8 module (from ESP32-S3-DevKitC-1-N8R8).

The two frame buffer are stored in octal PS RAM : 640*480@60Hz@8bits (300 ko / FB)

Do you known, the max bandwidth with octal PS RAM ?

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: VGA driver from ESP32 S3

Postby ESP_Sprite » Thu Dec 01, 2022 1:29 pm

If you configure it correctly, I think octal PSRAM can go to 80MHz DDR, in other words 160MByte/second or 1.2GBit/second.

Who is online

Users browsing this forum: ESP_Mahavir, MicroController and 66 guests