As promised in a previous post, this example drives 3 WS2812B’s using DMA to SPI. It also shows that interrupts can happen at the same time without affecting the performance of the LED’s.
Three LED’s are controlled and, as expected, the burst of SPI data lasts 72 microseconds.
The program outputs a simple RGB pattern that moves across the LED’s. The program is deliberately slowed down to allow us see the changing colours. The program also outputs a message over the UART to the host PC using an interrupt driven serial transmit routine which demonstrates that the solution is tolerant of interrupts.
A video of the program in action is over on YouTube.
Code may be downloaded over here on Github