A few years ago I discussed WS2812-compatible (ws2812, sk6812, pd9823, …) LEDs
Back in the days, I’ve discussed a few code snippets, but I’ve never came around on releasing the firmware I’ve wrote back in the days. Now I’ve uploaded the old code from back in those days to https://github.com/BlaatSchaapArchive/LEDcontroller.
This is en Eclipse project, using the Eclipse build system (CDT or what is it called). This makes copying the project to a different machine kinda awkward. I guess that, and there still being some issues with the project, are reasons for not publishing it yet… and then I got this burnout, and the project faded away.
But here it is. The project uses the PWM capabilities of the Timer hardware and DMA transfers to control the WS2812-compatible LEDs. Each timer can output 4 signals. This allows for controlling multiple strings at the same time. The host side software takes an OpenPixel connection. The issues in the old project are more on the host side, Basically, to take advantage of outputting multiple signals at the same time, the control software must take this into account. The current issue in this project is using multiple timers. As there is a single buffer, updating one channel on a different timer requires them all getting updated. The current driver updating any number of consecutive channels can be updated in stead of all four of them, however, this is not yet implemented in the host software.
I’ve started to integrate parts of this code into the ucdev projects. Here is the libws2812dma repository:
This contains the STM32F103 PWM-DMA driver for the WS2812 as discussed. Furthermore there is a driver for the NRF5x series. This is code I’ve written last year to control some LEDs with an nRF52832 microcontroller for some freelance project I’ve worked on. Currently this is a single-channel implementation using the nrfx library.
Hi, even if without DMA since I had not proper MCU around, at least I had it working on a 8-bit AVR MCU without bit-banging and low CPU saturation – because I discovered few nice updates from the manufacturer regarding these LEDs.
have a nice day!