LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

neodata
Posts: 4
Joined: Tue Apr 25, 2017 5:48 pm

LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

Postby neodata » Tue Apr 25, 2017 6:15 pm

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 ?

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

Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

Postby ESP_Sprite » Wed Apr 26, 2017 1:51 am

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.
Attachments
test_lcd.tgz
(4.44 KiB) Downloaded 189 times

neodata
Posts: 4
Joined: Tue Apr 25, 2017 5:48 pm

Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

Postby neodata » Wed Apr 26, 2017 3:40 am

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

Aromo1
Posts: 1
Joined: Sun Apr 30, 2017 7:10 am

Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

Postby Aromo1 » Sun Apr 30, 2017 7:15 am

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

neodata
Posts: 4
Joined: Tue Apr 25, 2017 5:48 pm

Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

Postby neodata » Fri May 05, 2017 11:58 pm

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

mikemoy
Posts: 170
Joined: Fri Jan 12, 2018 9:10 pm

Re: LCD SPI & I2S - Serial & Parallel - Speed vs Ressources

Postby mikemoy » Fri Jan 12, 2018 9:16 pm

@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.

Return to “ESP32 IDF”

Who is online

Users browsing this forum: cvargcal, Google [Bot] and 15 guests