Teensy 4.1 + RA8875 DMA??

Mike Chambers

Well-known member
I'm trying to switch my current project to use a larger RA8875 LCD display. I need to use DMA mode, but it hasn't been working. After looking at the library code, I can see why:

Code:
void RA8875::DMA_startAddress(unsigned long adrs)
{
      _writeRegister(RA8875_SSAR0,adrs & 0xFF);
      _writeRegister(RA8875_SSAR0+1,adrs >> 8);
    _writeRegister(RA8875_SSAR0+2,adrs >> 16);
      //_writeRegister(0xB3,adrs >> 24);// not more in datasheet!
}

The framebuffer address that gets sent is only 24 bits wide!

I tried uncommenting that last line, but it didn't change anything.

Is DMA from an arbitrary memory location not possible with this controller?
 
The RA8875 controller supports DMA. Looking at the mfr website, there are DMA software examples listed. Don't know if any of the libraries implement it.


Thanks, but it looks like the same kind of DMA that the library provides. Apparently the controller can connect to some external flash/ROM and DMA from that, but since it's activating DMA built into the controller, it can't just pull data from the Teensy like this.

But since there is SPI DMA capability on the Teensy, there should theoretically be a way to use that to dump a framebuffer to the controller without hogging up CPU time, right?
 
I don't see any reason it can't be supported on the Teensy side. Like you said the work is being done by the Teensy and the display just needs to receive the data and doesn't need to do anything special.

Some work has been going on recently on the ST7796 driver and some of that includes implementing DMA. It is above my pay grade and @h4yn0nnym0u5e has been leading that charge. He might be able to provide some insight.

Here is that ST7796 thread in case you are interested https://forum.pjrc.com/index.php?threads/st7796-teensyduino-support.76510/
 
I don't see any reason it can't be supported on the Teensy side. Like you said the work is being done by the Teensy and the display just needs to receive the data and doesn't need to do anything special.

Some work has been going on recently on the ST7796 driver and some of that includes implementing DMA. It is above my pay grade and @h4yn0nnym0u5e has been leading that charge. He might be able to provide some insight.

Here is that ST7796 thread in case you are interested https://forum.pjrc.com/index.php?threads/st7796-teensyduino-support.76510/

Thanks, same. It's above my pay grade as well. I've never really had to dive deep into SPI. I've never had a case where there wasn't a library that didn't do what I needed with SPI/DMA! I suppose I could dig into to docs and see if I can figure it out.
 
Just been having a brief dig around the web - I don’t have any RA8875 hardware.

The driver code doesn’t seem to have any asynchronous update capabilities, which is possibly because there’s no way to fit an 800x480 frame buffer in the Teensy’s internal RAM. PSRAM would be OK, though that would compromise the speed.
 
You’re at a bottleneck with SPI speed wise in any case, so as slow as PSRAM is for frame rate, so is SPI.

I can tell you that even with the newer RA8889 and a 16 bit parallel bus, the RA itself is just slow.
@wwatson couldn’t go higher than 12Mhz on the parallel bus with DMA support

Consider an SSD1963 based display or an NT35510 integrated controller (only available on smaller displays)
 
Back
Top