Close

WS2812B driver

A project log for DIPSY

DIY System on Chip based on FPGA, priced below 5 USD

christophChristoph 09/18/2015 at 21:142 Comments

dipsy has lots more resources than necessary for creating a WS2812B driver. On our way to a really useful implementation I created the actual driver core that converts 24 bits to the correctly timed pulse train and tested it with a single "pixel":

After hours of troubleshooting I decided to connect my logic analyzer - only to find out that I had connected the WS to the wrong pin. Well, that's life.

I also created a "cycling" example that cycles through red, green, blue and white over and over again. Both can be found in my git fork (/THP2015/examples/verilog/ws2812b_standalone), soo to be pulled into antti's repository.

The goal is to create a WS driver chip with a frame buffer and SPI interface. The dipsy FPGA has 14 RAM tiles with 512 bytes each, so we can easily drive a total of 2048 pixels (using 12 tiles: 4x512, 3 bytes for each pixel) with this thing.

This blog post was very helpful in understanding the timing: https://cpldcpu.wordpress.com/2014/01/14/light_ws2812-library-v2-0-part-i-understanding-the-ws2812/

Discussions

Yann Guidon / YGDES wrote 09/19/2015 at 02:47 point

2048 pixels is *possible* but not actually practical or reliable.

The WS2812 data rate is about 30K LED/second so you are limited to 16 frames/second. It's still decent for some animation but there is worse : the probability that one LED is broken increases exponentially and sooner or later, you spend you time fixing the LED display. In average, one broken LED breaks half the display so most failures are critical.

DIPSY *can* but shouldn't, at least this way. For driving "many LEDs", more channels is better. Use many DIPSY in parallel then, with LED chains that are as short  as possible.

This explains why WizYasep https://hackaday.io/project/6903-wizyasep has up to 24 outputs. The next generation should have up to 40 (or more if pins are available).

  Are you sure? yes | no

Christoph wrote 09/19/2015 at 08:16 point

To be honest I have no experience (apart from
this) with the WS2812, but those 2048 LEDs were just a ballpark figure
and I also meant to spread them across 4 outputs (512 pixels per
output), while using one RAM tile for reach color (hence 4x512x3).
The
RAM can also be used differently: 14 Tiles, two for each output is 1024
bytes per output or 341 LEDs, making 2387 LEDs spread over7 stripes.
The point is that dipsy has only 7 outputs available when SPI is used,
and not all the RAM has to be used. If one wants only 30, that's fine.

  Are you sure? yes | no