SPI to WS2812B Converter: More LEDs, More Power!
With a few components, you can convert a standard 1-MHz SPI data stream into a bit stream suitable for WS2812(B)-type addressable RGB LEDs (a.k.a. NeoPixels). This allows controlling 25% more LEDs in the same period while freeing up MCU resources.
With a few components you can convert a standard 1 MHz SPI data stream into a bit stream compatible with WS2812B-type addressable RGB LEDs (aka NeoPixels). A 1 MHz data rate allows controlling 25% more LEDs in the same period than a standard 800 kHz software-based (typically bit-banging) driver can do while freeing up memory and processing power on the MCU at the same time. The result: more LEDs to play with and more processing power available for nicer animations. This is what we call a win-win situation.
This means that a data rate of 1 MHz should work too as it is only 25% faster than 800 kHz and therefore within the 50% headroom. 1 MHz is a frequency that most SPI peripherals can produce easily, even if they only have a basic clock prescaler.
In this video we show you how to profit from this by adding a few components to the microcontroller.
Use the WS2812(B)’s Headroom
Usually, it is assumed that WS2812(B) LEDs (and its clones) must run at 800 kHz, which is an inconvenient frequency for microcontrollers clocked at 4, 8, 12 or 16 MHz or any other frequency that is not a power-of-two multiple of 800 kHz. However, when you read the LED’s datasheet carefully, you will notice that the timing tolerances are almost 50%, which is rather generous.This means that a data rate of 1 MHz should work too as it is only 25% faster than 800 kHz and therefore within the 50% headroom. 1 MHz is a frequency that most SPI peripherals can produce easily, even if they only have a basic clock prescaler.
In this video we show you how to profit from this by adding a few components to the microcontroller.