DMA and CPU

I have a string of RGB LEDs. With 48 LEDs per metre, and with 5 metres thats a massive 720bytes of RAM.
Using DMA, not only can you send these 720 bytes quickly, but it also doesn’t need ANY CPU usage!!

You can also save RAM by using the LED Graphics Memory as part of the DMA. Something you can do in C like this:

uint8_t LPD8806_DMABUFFER[LED_COUNT*3+2];
uint8_t* LPD8806_GFXRAM = &LPD8806_DMABUFFER[1];

When updating the LEDs two Zero’s have to be sent too, which is why the DMA buffer is has an extra 2 bytes.

Using a DMA module is very useful, it can speed things up and allow the CPU to do other things!

Double WIN!

Advertisements