WS2811/WS2812 driver for the Propeller
David Betz
Posts: 14,516
Has anyone written a driver for the WS2811 and WS2812 RGB LED driver chips? I have a few of these modules and would like to be able to drive them from a Prop board.
https://www.sparkfun.com/products/11820
https://www.sparkfun.com/products/11820
Comments
In high speed mode:
T0H 0.25 us
T0L 1.0 us
T1H 0.6 us
T1L 0.65 us
At least both of these add up to 1.25 us.
http://auschristmaslighting.com/wiki_source/images/b/ba/WS2811.pdf
I've seen some strange colors when the data connection is dodgy (how long is that wire?). It may be an idea to terminate it to a resistor and perhaps small capacitor.
Otherwise, I've tested about 5 different WS2812x products successfully now. I'm using a slightly modified version of Gavin Garner's obex object (to swap the G and R bytes).
Tonight I've been testing the timing limits and looks like they can be pushed to 1.37 Mbits/sec, or an update rate of ~380 per second for a 150 LED string using symmetric timing. Timing was as follows (these values are right on the edge of working successfully, except Low0) :-
As you observed its possible to reduce Low0 to 50, which makes the overall bitrate dependent on the number of 1's vs 0's. However it isn't much of a gain.
Thanks,
David
BTW... if you're dealing with individual pixels, you may want to swap them to see if the problem moves; maybe you have a dodgy part. The WS28xx cleans and amplifies the signal(s) before output; if you're getting good data to the first device the rest should be okay.
I've been using about a 12" ic hook test lead for driving the data, so 2" won't be an issue. Your ground wiring could potentially be - I've been delivering the power to the WS2812B strip, since its high current, then running clip leads back to the prop proto board. You can have 5 amps of current running through the ground wire. Some of the strips provide two ground wires which helps here.
The weird thing is the WS281xx reclocks the data out, so driving the voltage only really affects delivery to the first LED in the chain. While that may help, I would have expected a terminating resistor would also clean up any spurious overshoots.
When testing the timing limits, when you go below minimum on the top three values, everything simply stops (black everywhere!). However when you go below minimum on the Low0, you get some fancy color shifts happening, and it seems to be worse towards the end of the 5m strip.
Btw interesting article by Matt on Adafruit this morning on driving these with Beaglebone Black's PRU. The prop1 actually looks like it has a reasonable combination of ram, i/o pins, speed for driving some pretty big installations. I think it would be possible to drive several independent strips per cog, and its only $8
should work with from 1 to 16 WS2812's using Jon's driver. It is repeating plots of a random byte of color at a random spot in the rgbbuf. Because these are so bright I put a brightness control.
Edit: This code only randomly plots colors for 1 to 16 WS2812's.
Thanks! I just got one of those 8 LED strips today. I'll try your code later.
In the meantime, I tried my SparkFun 8 LED strip and it works wonderfully with JonnyMac's code! No LED anomolies so far.
Whew! Good to know -- I was worried I might have to go in and massage the driver. I prefer the KISS code employed now.
I was teasing about RS. A friend told me about a resistor manufacturer that had these bins near a test fixture: 1%, 5%, 10%, 20%, RadioShack.
It loks up in the very first routine which I believe is the 'rainbow cycle'
Any ideas?
Could you post your code. It seems strange it's locking up. It kind of sounds like a buffer overrun. I'll take a look if you'd like.
I've used 48 NeoPixels with Jon's code.
Did you see this section in the driver?
I left it at 64 myself. You'll want to change it when you try to use all your LEDs at once.
First I made sure to stay under the max led variable of 64, but anything over 32 and it locks. I also tried increasing max led count to 80 and still get same results with anything over 32.
http://obex.parallax.com/object/703