Driving Neopixels/WS2812/b/SK6812 using the SPI port...

Driving Neopixels/WS2812/b/SK6812 using the SPI port…
(I’m thinking out loud and looking to be corrected on anything I say here)

Id like to be able to drive Neopixels on boards where doing so is restrictive because of different frameworks EG… Raspberry Pi, Orange Pi, Beaglebone, Nano Pi etc…

Lets say you have 2 pixels
2 x 3Bytes = 6 Bytes = 48Bits
If we set the SPI Frequency of 3,333,333(or close to) then each Bit takes 0.3us to transmit!

Each BIT is represented by 4SPI Bits eg…
1 = 2x1SPI bits + 2x0SPI bits
0 = 1x1SPI bits + 3x0SPI bits

We can then translate the 48bits of our 2 pixels into a new pattern using the above and transmit via the SPI port. Followed by a 80micro pause…

We only need the DATA(MOSI) pin of the SPI to be connected to the Neopixels DataIN pin…

Theoretically…will this work?

There are libraries out there that do this - someone may have even ported them to the pi.

@Daniel_Garcia ive seen some but they dont work well, or only work with the Pi… im more interested in the logic in my thinking and weather im on track

OK I have implemented this for the ESP8266 https://github.com/leonyuhanov/SK6812viaSPI so my logic is right! Im going to try this on the RPi and the Nano pi as well if anyone is interested