ESP 32 SPI DMA Questions

rexnanet
Posts: 3
Joined: Thu May 04, 2017 1:36 pm

Re: ESP 32 SPI DMA Questions

Postby rexnanet » Thu Aug 10, 2017 4:59 pm

ILI9341 can work at 80Mhz SPI speeds.
I've made it using ESP8266 running @160Mhz and SPI @80Mhz. But you need to use short wires (10cm will work) or else high frequency signal requirements will come into play.
@80Mhz SPI you'll get around 60fps which is very fast :)

I've tried to replicate this on ESP32 but although I've managed to get SPI to run @80Mhz (or so I think...haven't checked on oscilloscope yet) the fillscreen rate will only go up to 45fps.
At gitter's EPS32 channel I was told that due to the dual core nature of the ESP32 some system tasks need to be done and that takes some of the performance away.
But I think that it pays off by having enough RAM to store an entire frame (or even 2) allowing to change the frame "offline" and then send it as a whole to the display.

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

Re: ESP 32 SPI DMA Questions

Postby neodata » Sun Aug 13, 2017 7:15 pm

Please find some rechearch I've done in video ... what you can be acheived ... real time of course ... step by step :

( Videos from my FB page with public share )

Step 1 : https://goo.gl/fwSoK6
Step 2 : https://goo.gl/XoEfs4
Step 3 : https://goo.gl/GThJvU
Step 4 : https://goo.gl/bPfpvN

Out of CPU performance the main bottleneck from my experience is the fast memory size available ... too limited

hoek67
Posts: 5
Joined: Mon Jan 21, 2019 8:41 am

Re: ESP 32 SPI DMA Questions

Postby hoek67 » Mon Jan 21, 2019 9:00 am

Been looking at the ESP8266 and "adjusted" the SPI library a bit and getting 40+ fps using SPI and a SSD1351 @16BPP.

As stated above, the real limiting factor is the real RAM available as the buffer for the screen itself is 32K!!!!

The other factor is unlike the Arduino Due or Teensy reading from flash must be 4 byte aligned or an exception is popped. Had to change my graphics library a bit to account for this... but without upsetting all the bitmap transfer code. Basically I handle the ESP8266 as if it was AVR and copy the entire bitmap or scanline into ram first then treat that line as "normal".

I altered the SPI library to include an ability to not wait after sending... and a function SPI.waitBusy(); that allows me to get rid of a lot of code overhead when writing dribs and drabs to SPI (like OLED commands). It allows the CPU to send the SPI bytes then allow me to do other stuff while it transfers.

As you can imagine, when updating 32K in 64 byte blocks (FIFO limit) getting rid of all the loop and function call overhead etc is a nice saving.

Getting a ESP32 this week and will "adjust" the SPI library there as well to allow for a no_wait option.

I got SSD1351 with full 25+ fps video on Arduino Due with 8 bit sound @6000Hz so the ESP32 should be able to do the same. The Due however had a lean and mean DMA SPI library I wrote from scratch and 96K of fast SRAM however runs at 84Mhz.

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

Re: ESP 32 SPI DMA Questions

Postby ESP_Sprite » Tue Jan 22, 2019 1:27 am

You may want to try the SPI driver that's native to ESP-IDF instead. It uses DMA and has the 'nowait' (queue and get the result later) option natively already.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 83 guests