LPD8806 RGB LED String Driver in VHDL

LPD8806 RGB LED String Driver in VHDL


Category: Uncategorized

Created: April 24, 2013

Updated: January 27, 2020

Language: VHDL

Other project properties

Development Status: Stable

Additional info: Design done, FPGA proven

WishBone compliant: No

WishBone version: n/a

License: LGPL


Have you ever wanted to add some color to your project? Then this might be your answer. The LPD8806 RGB LED strings are available for low cost from various sites on the internet, and they come in strips which can be cut or joined to the desired length. Since the Red/Green/Blue (RGB) LEDs on the strip are driven by a serial controller IC that is also on the strip, your project can set each LED color independently of the others.

The connections to the LED strip include 4 wires: +5V, GND, clock and data. It turns out that these LED strips will also work using +3.3V as the supply voltage!

The format of the serial data stream used to drive the LEDs is given in the comments inside the VHDL code, and it can also be found by browsing the internet. The color settings are 7-bits for each color, for a total of 2^21 combinations, over 2 million different colors.

The VHDL module in this project was recently used in a Lattice Semiconductor FPGA. However, it does not include architecture specific macros, so it should be easy to use on any given FPGA or CPLD. It is parameterized so that the user can determine how many LEDs to drive, and the desired update rate to the LED string.

The color data is provided to the module by an input data bus, using an address to select which LED and which color is being loaded.

My VHDL coding style uses the "unsigned" type instead of the "std_logic_vector" type. It is easy to translate between the two using functions in "convert_pack.vhd", or you can go through and modify the code to use std_logic_vector instead.


The module is ready to simulate and synthesize.

It was used as part of a larger project... Since I'm not including the full code for the entire project, I am currently only providing the LPD8806 module code plus an example of how it is instantiated and used, but without a nice testbench.

Don't worry, the code works. Just give it a try. If you create a testbench, please send it to me and I'll post it for others to use.

There is an "extra" module provided in the code, which can be used to send single bytes of data to the LPD8806 string. If you want to use this module, then you'll need to provide the signals "sel_led", "bus_we" and "bus_dat_wr(7 downto 0)". Then you can send individual bytes, and see the separate green, red and blue LEDs light up individually in order as each new byte is received down the chain. However, if you don't want to do that, then just delete that part of the code.