Max SPI speed between Itsybitsy M4 and Adafruit ST7789 display

Good morning,

I'm trying to figure out what is the max SPI speed achievable with an ATSAMD51 ItsyBitsy M4 board and a ST7789 display, and most importantly... how to adjust it.

I'm specifically looking at using the internal storage of the ATSAMD51 to display pictures at full frame (ie 240x240) as close as possible to 20FPS. A quick calculation yield that I would need to achieve 20Mhz at least, is this possible ?

Currently display is slow, ie it looks like it's being written from top to bottom (which it probably is...)

1/ I'm using ATSAMD51 internal storage because this allows me to NOT use the SPI SDCard reader in the display, as I have read it limits SPI speed to 8MHz
2/ I hope that using JPEGDEC library for decode I can actually store a lot of 240x240 frames (I did a test, a JPG compression of a 240x240 is 5k), since decoding seems super fast using this JPEGDEC library

Thanks and regards

240x240 16-bit pixels @ 8MHz = 116ms.
240x240 16-bit pixels @ 24MHz = 39ms.
240x240 16-bit pixels @ 48MHz = 20ms.

20FPS means 50ms per Frame. So 24MHz is possible if you use DMA in a non-blocking manner. JPEG decoding should be possible too. e.g. decode JPEG to buffer2 while DMA is sending buffer1

I don't have a ItstBitsy M4. I am not aware of any TFT library that uses DMA on SAMD51.
Regular Arduino SPI class is generally crap. I don't know whether the Adafruit_SAMD Core is any better.


Edit. It looks as if the Adafruit_SAMD Core does use DMA. And it seems to have variant files for both the regular Arduino_Zero and Arduino_M0 even if there are no entries in boards.txt

It will be interesting to see whether the Adafruit Core actually works on Zero and M0