Faster way to bit bang GPIO?

Hello, I am experimenting with an LED matrix that addresses a line at a time.
I have some bit banging code over GPIO, but it is really slow. Can someone give me pointers on how to speed this up? Are there any approaches in .netMF with extensions or other ports, or is RLP the way to go. If RLP, is there much function call overhead–e.g., should i put loops insides of the c++ code, or would a discrete gpio write method still offer a lot of speed up over the .netmf version?


@ jrowe88 - With the caveat that I have not done any RLP myself, my recollection from seeing many similar questions is that RLP is probably the way to go for this. In addition to raw speed, doing bit-banging in managed code, even if highly-optimized, can be tripped up by GC.

So if you need tight timing and high performance, that’s probably a good reason to go with RLP.

@ jrowe88 - It is possible to use hardware serial peripherals like UART or SPI to output fast sequence of bits with minimal software overhead - usually at the price of additional logic to drive the individual LEDs, such as serial shift registers or SPI controlled dedicated LED driver ICs.

@ jrowe88 - I’ve fiddled around with multiple 32x32 led matrices, only to find out that a little arduino out performed cerberus by far.

One could think of a low but barebones device taking care of the bit banging/timing stuff and do some serial or ip-sockets or something else to communicate with a netmf based controller.

If you just playing around and have no time constraints you might have a look at llilum or just go for rpi2 and use the .net core to drive it inclusive a pi based gui control or maybe via app and use mobile devs as a controller …

@ .Peter. - Thanks. I was thinking about going that route. There are plenty of drivers written out there for arduino and rpi2 that looked easy, but I was hoping to keep this all in one device and .NET. (As an aside, someone really ought to make a little driver board for these things that has a more straightforward interface as they are kind of a pain to use).

This is mostly just playing around stemming from a team building project our SW team was doing to get a little HW experience. I can drive it from managed codes, but it is a seizure triggering display due to the slow refresh… :wink:

@ jrowe88 - don’t forget the teensy that’s a feasty little board and you’ll find some ready made tutorials against those led matrices …

Teensy matrix - [url][/url]

Adafruit - [url]Overview | SmartMatrix Animated GIF Player | Adafruit Learning System

1 Like

The mBuinio could be an option. Its super fast. Have the .NETMF device send the message via UART to the mbuinio and have it bit bang the matrix.

1 Like

No. Bite the bullet and use RLP.

@ Gus, I think it may be time for some open source RLP code that is general enough for most bit banging circumstances.

1 Like

Which products are RLP compatible? I couldn’t find this in the documentation–can someone point me in the right direction? E.g., can I run RLP on G30 or G80-based products?

@ jrowe88 -