Simple WS2812B/SK6812 example for a few STM32 chips using a timer peripheral. Either I was very lazy about the timing values, or it's a demonstration of how to use logic analyzers to debug timing protocols. You decide!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
boot_code
device_headers
ld
src
vector_tables
LICENSE
Makefile
README.md

README.md

Overview

This is an example of how to run WS2812B and SK6812 'Neopixel' LEDs using an STM32 timer peripheral. Right now it only supports the STM32L432KC, STM32F030K6, STM32F051C8, and STM32F103C8 with inexact timings, but I'm hoping to generalize it.

Why not use hardware interrupts? Because it takes the STM32 20-30 clock cycles to enter an interrupt, and that's usually longer than 300 nanoseconds. Along those lines, the next_pulse method should probably be considered a critical section if you use interrupts.