Bidirectional patterns with the HL1606

Most of the videos on YouTube of the HL1606 being driven with an Arduino have patterns that start of the controller end of the strip and propagate to the far end, for example this one. I'm driving patterns in two directions, and even outwards from the centre of the strip. How's that done?

Very simple really, I model the LED strip in software as an array of bytes, one per LED. I load up the array with whatever LED on/off/up/down transformations are needed to create the next step of the pattern, and then shift the entire array to the strip. With the /SS line held low the pattern isn't displayed as it is shifted onto the strip, then when /SS is pulled high, the entire pattern displays all at once. Do that fast enough and you can create whatever patterns you want.

I'm clocking the data to the strip at 2MHz which means it is taking about 80 microseconds to push out a 20-LED pattern, which is far faster than the response time of the LEDs or indeed of the human eye. It is also above the maximum speed specified in the datasheet which is around 1.7MHz, however I'm only driving 20 LEDS at a time rather than the 200 in a full 5 meter length, I don't expect such a high data clock rate would be possible with 200 LEDs. As ever, the datasheet is pretty confused - it isn't clear if the time it takes to propagate the pattern between each chip is 250 nanoseconds or 100 nanoseconds. Whatever, there will be a propagation delay that gets larger as the strip gets longer, so there will definitely be a limit to the number of LEDs you can drive and still have such high clock rates work reliably. Even so, you should still be able to clock a full length in a couple of milliseconds, which should still be imperceptible.

Categories : Tech, AVR