Controlling WS2812 LED Strips with the LPC810

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by cpldcpu on Mon Jul 29 11:25:41 MST 2013
I ported my light weight WS2812 to the LPC810. The WS2812 is an RGB LED with an integrated controller that uses a 800kHz serial NRZ protocol to transmit 24 bit RGB data. Due to the nature of the protocol, it is quite incompatible to what most SPI units support.

I implemented a bitbanging approach with active CPU waiting. This requires predictable code execution timing. Luckily the LPC810 supports zero waitstate code memory access up to 30 Mhz. One advantage of the LPC810 is the relatively large SRAM compared to the code memory. 1024 bytes of sram allow controlling a full strip. A full 4m strip contains 240 LEDS and requires 3*240=720 bytes of memory. Most of the small 8 bit controllers only have 512 bytes or less.

You can see my code in action here: http://www.youtube.com/watch?v=Uwxt7SuSV7Y
Current state of the library: https://github.com/cpldcpu/light_ws2812/tree/master/light_ws2812_ARM

I have been considering to use the SCT to get rid of the reliance on code exection timing. Unfortunately it seems that this will still not free up CPU timing, as the interrupt overhead would not allow 800kHz clocking. Maybe it is possible to use internal pin forwarding to combine SPI and SCT to implement this protocol?