WS2812B (Neopixel) library for Libmaple using SPI DMA

Please do not post requests
User avatar
RogerClark
Posts: 7455
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: WS2812B (Neopixel) library for Libmaple using SPI DMA

Post by RogerClark » Wed Jun 21, 2017 11:19 am

@nutsy

Thanks.

I don't think there is a easy or perfect solution to use these devices

I'm not convinced my method is that good, as it depends how many pixels you change before calling show(), whether the performance is better or worse than doing it the bit-banged way

racemaniac
Posts: 620
Joined: Sat Nov 07, 2015 9:09 am

Re: WS2812B (Neopixel) library for Libmaple using SPI DMA

Post by racemaniac » Wed Jun 21, 2017 11:31 am

The main problem for these kind of things is that everyone has got his own requirements/priorities. For my implementation i gave up a bit of transmission speed & memory, in order to make the building the buffer part as fast as possible. As seen in the tests i did on DMA, even if the sending is now 33% slower, it won't matter for all the other things i'm doing while the DMA is running, and is still plenty fast for the amount of leds i'll be controlling :). So for me that was the optimal trade off. But of course for each user those trade offs will be different.

Luckily, for most users who don't want to get every bit of power from the microcontroller, whichever implementation you choose won't matter, all they care about is having the neopixels up & running in 10 minutes XD.

User avatar
RogerClark
Posts: 7455
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: WS2812B (Neopixel) library for Libmaple using SPI DMA

Post by RogerClark » Wed Jun 21, 2017 10:51 pm

racemaniac wrote:
Wed Jun 21, 2017 11:31 am

Luckily, for most users who don't want to get every bit of power from the microcontroller, whichever implementation you choose won't matter, all they care about is having the neopixels up & running in 10 minutes XD.
Thats true..

The only reason I started to look at using SPI DMA was because the bit-banged library that someone else had tried to port to STM32 did not work for me.
So I had to fix that first, and then it got me thinking because it loops in assembler for timing ( which didnt seem to give consistent timings)
Hence why I thought SPI which has a fixed clock freq could be better.

If i get chance, I will try to do some timings on my SPI version,because at the moment, I dont know how long the memcpy takes, so I dont know the efficiency of my system

racemaniac
Posts: 620
Joined: Sat Nov 07, 2015 9:09 am

Re: WS2812B (Neopixel) library for Libmaple using SPI DMA

Post by racemaniac » Thu Jun 22, 2017 5:41 am

indeed, i also think the spi dma version is going to be the easiest to use, it doesn't depend on critical timings/disabling interrupts/... that's going to make the library a lot easier to use.

Post Reply