The LPD8806 protocol for Adafruit RGB LED Strips

I bought a meter of addressable RGB LED strip from Adafruit. It uses the LPD8806 driver chip to drive LEDs. I didn’t find a writeup of the protocol, so here’s a quick overview.

Each LPD8806 has 6 PWM outputs and can therefore drive two RGB LEDs. It has two lines for SPI input (data & clock), and two lines for SPI output (data & clock).

It is implemented in a very simple way:

  • When it receives a zero byte, it resets its byteCount to 0, and writes a zero byte on the output.
  • When it receives a byte with the high bit set (ie ORed with 0x80) and its byteCount < 6, it uses the lower 7 bits of the byte to set the output of one of the PWM outputs. It then increments byteCount to move to the next PWM output.
  • If byteCount == 6, it just sends the byte to the output.

When these chips are chained together, with the inputs of the second chip connected to the output of the first chip, they are quite easy to use. You just send a total of 3 bytes per LED, and bytes 1-3 go to the first one, 4-6 to the second, and so on.  The byte order is not GRB instead of RGB, which is presumably done so that the PCB layout is simpler.

The color value is 7 bits per color, for 128 * 128 * 128 = 2,097,152 colors.

That’s about it.

And just to repeat the note in the tutorial…

  • Adafruit buys the strip in 5 meter lengths, with connectors at both ends. When you buy a shorter length they cut it off the longer length, so if it has a connector on it, the connector may be the one on the end rather than the one on the start. If you try to hook up to a connector on the end, it won’t work.


  • One Comment

    • Reply Robert Bliek |

      I almost get it. On the LPD8806: If I send it 6 ‘zero bytes’ will it output zero on all 6 outputs?
      What if I send it ‘10101010’ then ‘00000000’ then 10011111′ then ‘00000000’
      Will output 1 turn on, output 2 turn off and output 3 on and output 4 off?
      I thought that when the clock is ‘0’ for more than 500usec, the byte count goes to ‘0’?
      Thanks for your reply.
      Robert

    So, what do you think ?