VGA output: Can SPI make and send infinite circular buffer?
Posted: Thu Dec 21, 2017 4:18 pm
VGA output: Can SPI make and send infinite circular buffer?
Hi, I'm new to ESP32 and esp-idf. But I have a question about SPI interface in ESP32.
My question is: Is ESP32's master mode SPI able to use (infinite) circular buffer which is defined DMA linked list descriptor?
My project is output VGA signal via SPI (800x600 video pixels, Pixel frequency is 40MHz, single frame contains 1056x628 pixel cycles as a signal). I choose SPI because ESP32 has QSPI which may enable RGB or RGBI output without clock skew. Also since ESP32's SPI can't generate 25.175MHz pixel frequency (640x480 "standard" VGA) signal, I choose 40MHz as pixel frequency which can be generated by ESP32's SPI.
As a first step, I tried to generate V-Sync and H-Sync pulse by LED_PWM. So far, it seems okay. My display properly recognize these siganls as 800x600@60Hz VGA input.
As a next step, I want to generate color signals by SPI.
Firstly, I've tried H-Sync interrupt by connecting GPIO output pin from LEDC to dedicated input pin for GPIO interrupt. But unfortunately, there's higher priority interrupts. So my H-Sync interrupt routine is randomly jammed by these interrupts. Especially FreeRTOS's tick counter frequently disrupts H-Sync routine. Personally, I want to use ESP32 and esp-idf's superb functionality such as WiFi, Bluetooth, etc as is. So for now, I'd like to avoid to disable FreeRTOS's tick. Thus I gave up H-Sync interrupt.
Secondly, I've tried to make circular buffer for SPI's DMA. I supposed that I can use DMA linked list descriptor (lldesc_t) for it. I set first descriptor's address to last descriptor's next descriptor address. And it works fine for some seconds. But since there's SPI_USR_MOSI_DBITLEN descrease for each cycle, it eventually stop to send MOSI signal.
So back to my question. Is there any way to make infinite circular buffer by master mode SPI with DMA linked list descriptor?
Perhaps, my question is irrelevant for VGA output. If so, any advice is welcome.
Hi, I'm new to ESP32 and esp-idf. But I have a question about SPI interface in ESP32.
My question is: Is ESP32's master mode SPI able to use (infinite) circular buffer which is defined DMA linked list descriptor?
My project is output VGA signal via SPI (800x600 video pixels, Pixel frequency is 40MHz, single frame contains 1056x628 pixel cycles as a signal). I choose SPI because ESP32 has QSPI which may enable RGB or RGBI output without clock skew. Also since ESP32's SPI can't generate 25.175MHz pixel frequency (640x480 "standard" VGA) signal, I choose 40MHz as pixel frequency which can be generated by ESP32's SPI.
As a first step, I tried to generate V-Sync and H-Sync pulse by LED_PWM. So far, it seems okay. My display properly recognize these siganls as 800x600@60Hz VGA input.
As a next step, I want to generate color signals by SPI.
Firstly, I've tried H-Sync interrupt by connecting GPIO output pin from LEDC to dedicated input pin for GPIO interrupt. But unfortunately, there's higher priority interrupts. So my H-Sync interrupt routine is randomly jammed by these interrupts. Especially FreeRTOS's tick counter frequently disrupts H-Sync routine. Personally, I want to use ESP32 and esp-idf's superb functionality such as WiFi, Bluetooth, etc as is. So for now, I'd like to avoid to disable FreeRTOS's tick. Thus I gave up H-Sync interrupt.
Secondly, I've tried to make circular buffer for SPI's DMA. I supposed that I can use DMA linked list descriptor (lldesc_t) for it. I set first descriptor's address to last descriptor's next descriptor address. And it works fine for some seconds. But since there's SPI_USR_MOSI_DBITLEN descrease for each cycle, it eventually stop to send MOSI signal.
So back to my question. Is there any way to make infinite circular buffer by master mode SPI with DMA linked list descriptor?
Perhaps, my question is irrelevant for VGA output. If so, any advice is welcome.