Drive WS2812B Addressable LEDs Using an FPGA and Pmod Device

Anfractuosity’s module enables you to program WS2812B LED strips with an FPGA board and save color data using BRAM.

Cabe Atwell
4 years agoLights

The Pmod (peripheral module interface) is an open standard defined by Diligent Inc for peripherals used with FPGAs, which can be simple push-button devices, network interfaces, analog to digital converters, or displays (among many others). Anfractuosity designed his Pmod module to connect WS2812B addressable LEDs strips to an FPGA, which can then be programmed.

"This is my first project using an FPGA, I plan to soon implement an SPI interface with the FPGA, to accept color pixels via SPI from a Raspberry Pi, to then drive the LEDs appropriately," Anfractuosity explains. "I am making use of the original Zybo board, which uses a Zynq FPGA, although I’m not using the ARM portion of this chip as I want to learn VHDL.” He’s currently using block RAM (BRAM) to store the color the color data and utilizes a 74AHCT245 chip to convert Pmod signals from the FPGA from 3.3V logic to 5V logic.

Anfractuosity’s Pmod can handle up to eight addressable LED strips that connect to the board using 2.54mm pin headers, which he attached via Dupont sockets to JST wires using a crimping tool. As with any project, Anfractuosity had a couple of issues using VHDL, with the first being an abnormal termination with Vivado during synthesis, which he fixed by adding some simple code. The other dealt with the time datatype, where 32-bit floats are read instead of 64-bit, which reduces precision. He found a workaround in a Xilinx forum that allowed the board to run at the necessary 64-bit.

A complete walkthrough of his build, complete with links to schematics and code, can be found on Anfractuosity’s blog post.

Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles