So I've been pretty much obsessed with these ws2811 led chips since I got some in a group buy a while back. They are great for testing out the capabilities of a new mcu chip and its peripherals. However, one thing I've been bothered by is all the different timing numbers that are published on the net. Some people use 250ns / 600ns, or 250ns./ 1000ns and finally 350ns / 800ns. Most people are using a total cycle length of 1250 ns ( or as close as they can ).
I was perplexed by some attiny asm code I found on github. It was using different timing settings I hadn't seen and also had an inconsistent total pulse length. I've wondered how the ws2811 works internally and mentioned it to oPossom in IRC. He speculated that the ws2811 chip probably doesn't care about anything other than the pulse duration. It probably didn't care about the entire cycle length of the signal as long as it was close. We talked about various things they might be doing and in passing he mentioned the ws2811 probably re-clocks the pulse and sets them to the proper duration. I'd never thought much about that but I slapped a scope on the input side and output side (DIN, DO) pins of the ws2811. Much to my surprise the pulse duration numbers coming out the DO side were different than the published timing numbers.
My latest chip experiment was using one of those LPC810 8 pin 32 bit cortex-m0+ chips running at 24MHz to bit bang the ws2811 protocol. Using the 250ns / 600ns timing I was able to get them going. In my code, when I pushed in a 250 ns pulse on DIN, the chip was sending out a 340 ns pulse on DO. When I pushed in a 600 ns pulse it put out a 675 ns one. I measured each chip down the strip and those numbers stayed consistent. 340 ns and 675 ns.
I've since changed my routines to use 333 ns and 666 ns. Those values are pretty easy to achieve with a 24MHz clock. Now my timings going in are closer to the timings coming out. Not sure if it really matters but at least I feel like I'm using the right timing now.
Of course if you have code that works you can ignore all this. It was just something I thought I would pass on and see if anyone else had seen the same thing.
-rick