What is the best way to light over 1000 LEDs? Maybe syncing microcontrollers?
Depends on what LEDs you are using. You could easily drive 1000 lpd8806’s off of a teensy 3.0 - at 3 bytes per pixel, that’s 3k of ram - the teensy 3.0 has 16kb of ram. With the ws2811, the data rate is only 800kbps, which is only 33,333 rgb led updates/second (spending 100% of your cpu time pushing led data, which is likely uninteresting), which would get you just about 30fps for 1,111 leds. However, if you want to use the CPU time for things like deciding what your colors should be, you go down to closer to 15-20fps.
If you’re using ws2811’s, and can split your leds up into 8 strips, and you’re using the teensy 3.0 - you can take a look at paul’s excellent OctoWS2811 library - http://www.pjrc.com/teensy/td_libs_OctoWS2811.html
Thanks. I’m using the WS2811. I used Paul’s library for a previous project but instead of a screen I’m trying to do a long strip (1x2000). Then the data wires to each strip would get very long and require something like cat5 cable and extra circuits. Is that the best and easiest way to do it?
So at 2000 leds, it’s going to take you 60ms per frame to write the led data, or 16fps if you’re using 100% of the cpu (8fps if you only want to use 50% of the cpu).
I haven’t done strips that long, are you using the existing strips for the entire chain or extra wiring/doing your own wiring between leds?
I did 800 LEDs on a Arduino Mega. I have pretty efficient code, only C, no float, no delays, and the patterns were noticeably slower. I would recommend a teensy
Your big problem with the 2811s is going to be the time to write our the led data, and short of something like octows2811 or smaller scale multiplexing that I want to do over the summer, there is no getting around that.
Thanks everyone. I have been using existing strips for the chain. I have a few ideas of ways to get the results I want. I’ll post the video this weekend.
You mention syncing microcontrollers - yes, you could potentially use multiple uC’s, each driving a subset of the 1000 pixels. If they are being driven from a single source, you’ll need a fast way to pass data to them.
One question is how you are generating the data to be sent (eg: reading it from an SD card, receiving it via ethernet, creating patterns on the fly…) . The issue is buffering and interrupts - you will likely need to inhibit interrupts while writing to the pixels. That can be a problem, depending on what other activities you need to interleave with writing pixels.
I would advise against forcing interrupts enabled with ws2811 - they get unhappy being interrupted. I’ve thought about doing some fast fail code to stop writing if an interrupt fires but then there’s the risk of never getting a full frame out.
Dan, out of curiosity, how were you thinking to detect than an interrupt had fired and stop the writing? I could imagine requiring than any ISRs set a flat (volatile obviously) which could be checked between pixels for example. Is that what you had in mind, or is there some more automated way?
No, you don’t want the ISRs executing at all while the led data is getting written out, they will screw up the data output and cause the leds to glitch.
On both the AVR and the teensy’s ARM I believe I can check a single register to see if any interrupt flags have gotten set (which would have triggered the ISR if interrupts were enabled) - and if i see that flagged, then finish the current led (so the output doesn’t glitch), then bail out early - i beleive on both platforms if an interrupt is raised while interrupts are disabled, then the appropriate ISRs will fire when the intterupts get re-enabled.