More power!

With the Carambola board proving inadequate, I had to upgrade the embedded hardware of the board. With the current amount of Linux-based cheap embedded boards on the market, this wasn't hard. The Raspberry Pi actually is a shoo-in for this: two to three times as fast as the Carambola, has USB and network and is just a bit more expensive than the Carambola. It also runs Linux and the stock Raspbian distribution has the same libraries available as the OpenWrt distribution, so in theory I could just recompile my software and be done with it.

However, the Pi also has some GPIO available (just as the Carambola does), and I've read about some people doing fairly impressive things with these pins plus the peripherials embedded on the Broadcom SOC. Especially the DMA module interested me: it is fairly flexible and you can, for example, chain DMA-transfer descriptors into a loop so the DMA-engine will keep copying the same data over and over again. There's a project called ServoBlaster that actually uses this: it uses the PCM hardware to pace DMA-transfers to GPIO in such a way the hardware generates servo-PWM-signals for up to 8 servos, without any CPU usage.

I could perfectly use these DMA channels to do what I want. With the right configuration, I could just define a struct with the same fields as the GPIO registers and create an array out of those. With the DMA engine configured correctly, it'd then blast these structs to the GPIO pins one after another, without interference of the processor. If I configured the array to contain all the IO-operations I needed to write a single frame to the display and then chain the DMA-descriptors so the DMA-engine would automatically restart the operation when it's done, I had basically made a weird-looking framebuffer: a bit of memory containing what gets automatically sent to the display.

So, now all I needed to do to check if this could work was port my existing software to the Raspberry Pi (not too hard considering both the Carambola and the Pi run Linux), implement the DMA-routines and fix up the hardware. I planned the Raspberry Pi connections as such:

Fixing up the hardware wasn't that hard to do considering all the circuit consists of are direct connections between the Pi and the LED-board:

The software was fairly easy too: the Servoblaster source code already had a working DMA-to-GPIO implementation, so using that as a base combined with the LED control code I already did for the FT2232H I was done fairly quickly.

« Prev 4 Next »

© 2006-2016 Sprite_tm - Contact