LED Matrix
LED Matrix
Tile Design
Tile Design
As my introduction into the world of RTL design, I decided to make a simple driver for the WS2812B LED. My primary goal with this project was to learn the open source ASIC toolchain (iverilog, yosys, and OpenROAD to name a few) and create something that I could easily prototype using an FPGA. 
This project was designed for and taped out on the SKY25a run which uses the open-source SKY130 PDK, a 130nm process node. Thanks to Tiny Tapeout, designing and taping out a custom chip is significantly less costly and more well documented than in the past.
This project drives a WS2812B RGB LED matrix (or strip) using the SPI protocol. Each 3 byte SPI frame gets displayed on each sequential LED in the matrix. This allows for animations to be displayed given the color composition of each pixel on each frame. For an 8x8 matrix, the expected refresh rate is roughly 300hz.
The simple write-only SPI peripheral is designed for a CPHA (clock phase) and CPOL (clock polarity) of 0 and a baudrate of 1Mhz. Each frame should consist of pulling CS low, writing 3 bytes, and pulling CS high.
After a pixel's worth of data has been received into the SPI register, it is latched and the LED driver is signaled to start sending data.

Bringup Video

After receiving the chip back almost a year later, I successfully brought it up and got the example animation running. 
I first connected the SPI interface as described in the project documentation. I used a baud rate of 1MHz and a polarity and phase of 0. I then scoped the data output line to make sure that the generated pulses for the LED matrix were the length I was expecting.  It looked like each pulse was 50-100ns shorter than nominal. Given the simulations for a 12MHz clock (which has a period of ~83ns), I would have actually expected some of the pulses to be longer than nominal. The discrepancy here could be measurement error or perhaps some slight clock frequency offset. Regardless, this is within the 150ns tolerance band that the LED datasheet specifies. 
I then applied power to the LED matrix and connected the data out line. Using the example script in the project documentation, I sent over the bytes for a color cycle animation, which appeared to work correctly. One quirk of the architecture is that if the SPI baud rate isn't high enough, the time between subsequent writes to the LED matrix exceeds 300us and the chip fails to write to more than the first pixel. This is expected, but probably not ideal.
On a personal note, I'm really happy with how this project turned out. This is the first chip that I designed and it's amazing to be able to say that it actually works. Hoping for more silicon successes in the future!

You may also like

↑Back to Top