Hi Everyone,
I'm looking for the most efficient solution to interface an TFT screen to the ESP32.
SPI Pro > Working fine @ 80MHz > Full screen update 320 x 240 ( 153600 Bytes ) in 16.80ms and only a few GPIO Used
SPI Cons > DMA transfert limited to ~ 4Kb ... CPU busy to transfert block by block in a loop ... defit the purpose of DMA
What about I2S 8 bit parallel output with DMA ? 8 bit x 80 Mhz with DMA allowing a full frame transfert at once should provide some nice improvement. Unfortunatly I do not find enough documentation on this setup ... is this possible ?
I saw an example using a camera with I2S 8 bit parallel input + DMA and there is an I2S "lcd mode" bit to play with ... can I work from this example reverting input / ouput ?
LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
FYI, if you use the esp-idf SPI driver, the transfer should be done entirely in DMA, freeing up the CPU to do other tasks. We're aware of the 4K limitation in that driver, and I expect a MR that amongst others fixes this limitation to come through within a few days.
Wrt 8-bit LCD mode: there used to be a test case for this included in esp-idf, but because it was unmaintained and may be broken, it was thrown out. I've attached it to this post, maybe it helps you or someone else.
Wrt 8-bit LCD mode: there used to be a test case for this included in esp-idf, but because it was unmaintained and may be broken, it was thrown out. I've attached it to this post, maybe it helps you or someone else.
- Attachments
-
- test_lcd.tgz
- (4.44 KiB) Downloaded 1315 times
Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
Hi Sprite,
Thx for your feedback, yes I'm using esp-idf driver.
Looking forward for your update on the spi driver without this 4K limitation and indeed transfert entirely in DMA is the way to go.
Regarding I2S, thank you for the code ... good starting point ... will update this post on both solutions vs my result
Thx for your feedback, yes I'm using esp-idf driver.
Looking forward for your update on the spi driver without this 4K limitation and indeed transfert entirely in DMA is the way to go.
Regarding I2S, thank you for the code ... good starting point ... will update this post on both solutions vs my result
Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
Hi neodata,
You wrote you had seen an example using a camera with I2S 8 bit parallel input + DMA. That's exactly what I'm looking for.
Could you give me the source location link, please?
With best regards,
Aromo1
You wrote you had seen an example using a camera with I2S 8 bit parallel input + DMA. That's exactly what I'm looking for.
Could you give me the source location link, please?
With best regards,
Aromo1
Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
Hi Aromo1,
Sure, here is the link : https://github.com/igrr/esp32-cam-demo
I take the opportunity to add an update on SPI vs DMA vs 4Kb limit. This is solved in esp-idf latest release
( spi_bus_config_t > max_transfer_sz ). Everything works fine now, one call for a full frame transfert using
DMA @ 78Mbit/s !
BR
Sure, here is the link : https://github.com/igrr/esp32-cam-demo
I take the opportunity to add an update on SPI vs DMA vs 4Kb limit. This is solved in esp-idf latest release
( spi_bus_config_t > max_transfer_sz ). Everything works fine now, one call for a full frame transfert using
DMA @ 78Mbit/s !
BR
Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
@Aromo1,
Kinda embarrassed to ask this, but being new to ESP32, I am looking to do this as well. I am impressed with the speeds you achieved.
"full frame transfer using DMA @ 78Mbit/s ! "
Might you be willing to show you code, or at least the hart of that code so that I can see how the DMA is dumping a full frame.
I am not asking because I am lazy, just need a leg up on setting up the SPI DMA properly for this kind of speed.
If not, I understand.
Kinda embarrassed to ask this, but being new to ESP32, I am looking to do this as well. I am impressed with the speeds you achieved.
"full frame transfer using DMA @ 78Mbit/s ! "
Might you be willing to show you code, or at least the hart of that code so that I can see how the DMA is dumping a full frame.
I am not asking because I am lazy, just need a leg up on setting up the SPI DMA properly for this kind of speed.
If not, I understand.
Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources
I'm so sorry for the bump, but I need to know more about this. I'd love to use my Velleman LCD with this, but I'm not sure if this code works with it. The screen driver is probably ILI9341, but I don't know https://www.velleman.eu/products/view/? ... &id=435582 this is the one I have bought, but only locally in my local shop and it didn't say it was ILI9341. I hope it is, but I'm not sure.ESP_Sprite wrote: ↑Wed Apr 26, 2017 1:51 amFYI, if you use the esp-idf SPI driver, the transfer should be done entirely in DMA, freeing up the CPU to do other tasks. We're aware of the 4K limitation in that driver, and I expect a MR that amongst others fixes this limitation to come through within a few days.
Wrt 8-bit LCD mode: there used to be a test case for this included in esp-idf, but because it was unmaintained and may be broken, it was thrown out. I've attached it to this post, maybe it helps you or someone else.
Could I fill a "scanline buffer" with pixels in the way how the NES/SNES consoles would fill their DAC with pixel data? How would I make sure that I don't overflow a DMA buffer in case it (the DMA buffer) ends before the scanline buffer? Does ESP32's CPU contain a CPU instruction code for indirect post-incremented write kinda like AVR (Arduino UNO) has LD X+, R16?
What functions in this code are for:
1. Executing every frame kinda like the NMI interrupt on the NES console which happens on VBlank
2. Executing every time a buffer needs a little refill
?
Who is online
Users browsing this forum: ghmyers, Google [Bot] and 122 guests