Resources for more information on Spark Core DMA

I was wondering where I can find more information/libraries for using the Spark Core withDMA. I am doing a project with a few LED matrices and wanted to see if I could use DMA to increase the number of panels I can run on the core.

Thank you

@lbruder, you will have to dig into the core firmware code or STM32 documentation. One of the biggest limiting factors with led panels is the available RAM. I presently have a library I will be publishing that works with the Adafruit 16x32 and 32x32 panels adapted from Adafruit’s own library. It does not use DMA however. :smile:

1 Like

Okay great! Those are the panels I am actually planning on using. Have you tried to hook up multiple panels to the core? I am curious to see how many panels it will run with and w/o DMA to see if DMA is really worth it or if I can just use a few other Arduinos as “slaves”

1 Like

I’ve also got a project I’d like to use the Adafruit 32x32 LED panel with. +1 on releasing the library. That sounds awesome. Thanks!

1 Like

Ibruder, I will be publishing the library to the IDE as soon as I clean it up and prepare it. At it stands, the library can refresh a single 16x32 panel at 90Hz or so. The original author of the program indicated that it is really not designed for a multi-panel configuration as each 16x32 or 32x32 panel is driven by a single instance of the RGB panel class. The problem is, he did not write the class to have multiple instances running at the same time. So for now, it is really for use with a single panel. :smile:


If I find any free time, I’ll dig deeper into the code and see if I can get an understanding of what’s going on and see if I can make any contributions.

1 Like

If you were going to optimize it how would you do it?

@lbruder, the Arduino code uses direct port writing for the 6bits of RGB data along with inline assembler to speed things up. I had to do some bit-banging to write those bits (one at a time) and no inline assembler. The speed of the ISR dictates the refresh time. So to speed things up:

  1. Do direct port writing of the full 6bit RGB data at once
  2. Write that part of the code using inline GCC Assembler

I believe there is enough (barely) RAM to do 3 16x32 daizy chained displays and a faster ISR would make that fly. :smile:

Just wondering, have you compiled this using the IDE? I’ve tried including the RGBmatrixPanel library (as well as the Adafruit_mfGFX and SparkIntervalTimer dependencies), but the IDE always complains that it can’t find Adafruit_mfGFX/Adafruit_mfGFX.h on line /RGBmatrixPanel/RGBmatrixPanel.h:4:43. Can you point me in the right direction to getting the code to compile? Thanks. I’ve included a screenshot of the configuration that isn’t working for me.

@mootcycle, recent changes in the IDE libraries changed the way the libraries work! I will repost the library with the necessary changes to make it work… hopefully (!) :open_mouth:

A file not found error made me think it might be something like that, but I didn’t have time to investigate last night when I tried it. I really appreciate your help. :slight_smile:

@mootcycle, the problem is the multi-library dependency and referencing the files across libraries.

Got your libraries working by forking the RGB Matrix and just copying over the dependencies. Not the best dependency management system, but it works for now. My fork of your library is here:

And it works!

1 Like