I2S-parallel example: Drive a 64x32 display
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
I2S-parallel example: Drive a 64x32 display
So while we're still working on some kind of official driver for the parallel mode of the I2S peripheral, we do already have some logic for it working. Essentially, we can use DMA to set up a round-robin buffer to output a selected set of buffers over and over again. THis is ideal for generating a fixed signal of some sorts, and can be used to control a 'dumb' LED-display. This is what we did:
The logic involved actually is somewhat more involved than it may look: because the LEDs on the screen can only lit on 2 out of the 16 rows at the time, the display needs to be continuously supplied with data. To complicate things even more, each subpixel can only be turned off or on, so there's no chance of doing grayscale... unless you send a bazillion subframes to get something like PWM working. The end result is that the DMA engine in the ESP32 is put to good use here, continuously pumping about 100MBit of data into the LED-display without using up a single percent of CPU power. The result is pretty good:
Sources: led_panel_example_prelim.tgz Be aware that this is preliminary work and it comes with no guarantees or support from Espressif.
The logic involved actually is somewhat more involved than it may look: because the LEDs on the screen can only lit on 2 out of the 16 rows at the time, the display needs to be continuously supplied with data. To complicate things even more, each subpixel can only be turned off or on, so there's no chance of doing grayscale... unless you send a bazillion subframes to get something like PWM working. The end result is that the DMA engine in the ESP32 is put to good use here, continuously pumping about 100MBit of data into the LED-display without using up a single percent of CPU power. The result is pretty good:
Sources: led_panel_example_prelim.tgz Be aware that this is preliminary work and it comes with no guarantees or support from Espressif.
-
- Posts: 19
- Joined: Mon Sep 18, 2017 4:48 pm
Re: I2S-parallel example: Drive a 64x32 display
Spectacular Sprite_tm!
BTW
required in app_main.c and i2s_parallel.c to compile.
On my display, despite leaving
the display is fine... and looking at the above output, the ABCD lines are in fact being clocked correctly (abcd=0 at the start and by the end of the cycle, abcd=1).
My Lena is more washed out than your picture, but the cat thing looks just fine.
And by the look of it clocking at 4MHz.
My output enable and latch signals appear to be unreliable into by salae logic - probably going to fast for it's 24Mhz capture rate.
However, looking at the ABCD lines it appears each entire frame (64 pixels by 16 (x2) rows) is done in 0.25 ms. Amazing result for zero CPU.
kind regards
Ian.
BTW
Code: Select all
#include "driver/gpio.h"
On my display, despite leaving
Code: Select all
#define DISPLAY_ROWS_SWAPPED 1
My Lena is more washed out than your picture, but the cat thing looks just fine.
And by the look of it clocking at 4MHz.
My output enable and latch signals appear to be unreliable into by salae logic - probably going to fast for it's 24Mhz capture rate.
However, looking at the ABCD lines it appears each entire frame (64 pixels by 16 (x2) rows) is done in 0.25 ms. Amazing result for zero CPU.
kind regards
Ian.
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2S-parallel example: Drive a 64x32 display
Hehe - Lena is weird on LED-screens. Try taking a picture of it or looking at it through your eyelashes - color resolution immediately improves. My guess is that the colors are so similar that the brain focuses on the individual LEDs more than the image.
ABCD control the lines, not the rows Not sure why your display displays the same.... *cue lightbulb turning on* Aaaaaah wait, I remember that that actually may have been a peculiarity of the I2S hardware: I seem to recall something about it reading 32-bit words and sending the bottom 16-bits first, then the top 16-bits. Gotta look that up next week, but if that's the case, take the comments about the inverted lines with a grain of salt... Ah well, I said it was preliminary, right?
ABCD control the lines, not the rows Not sure why your display displays the same.... *cue lightbulb turning on* Aaaaaah wait, I remember that that actually may have been a peculiarity of the I2S hardware: I seem to recall something about it reading 32-bit words and sending the bottom 16-bits first, then the top 16-bits. Gotta look that up next week, but if that's the case, take the comments about the inverted lines with a grain of salt... Ah well, I said it was preliminary, right?
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: I2S-parallel example: Drive a 64x32 display
I didn't get what hardware you were using. I suppose those aren't ws2812b LEDs because the display is "dumb"?
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2S-parallel example: Drive a 64x32 display
It's a standard display similar to this one. (But waaaay less expensive if you get them directly from/in China.)
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: I2S-parallel example: Drive a 64x32 display
Thanks! What would you say is the max. pixel clock? Not that it isn't impressive already, mind you.
Re: I2S-parallel example: Drive a 64x32 display
Less than 30 US$ with shipping from AliExpress (4mm pixel pitch) or ebay (2.5mm pixel pitch).ESP_Sprite wrote:It's a standard display similar to this one. (But waaaay less expensive if you get them directly from/in China.)
And Adafruit is probably buying the display they sell from China!
Last edited by loboris on Wed Oct 04, 2017 12:03 pm, edited 1 time in total.
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: I2S-parallel example: Drive a 64x32 display
Yeah ordering that from Adafruit would be insane. However I like fine-pitched displays, but I only found this one which is too large and expensive:
https://www.aliexpress.com/item/New-pro ... 0.0.rKRVoy
Anyone knows of something cheaper, yet still fine-pitched?
https://www.aliexpress.com/item/New-pro ... 0.0.rKRVoy
Anyone knows of something cheaper, yet still fine-pitched?
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2S-parallel example: Drive a 64x32 display
FWIW, P2 was the smallest pitch I could find that was still available for a reasonable price (RMB176 for a 64x64 display, should be incoming next week). Also, it seems most displays have a max pixel clock of 25'ish MHz because of the internal structure.
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: I2S-parallel example: Drive a 64x32 display
Good to know, thanks. Do you know if there is a way to daisy-chain 2 panels, so the aspect ratio is closer to widescreen?
Who is online
Users browsing this forum: No registered users and 9 guests