10 years, 3 months ago.

green bean here be aware !! why are you sending 4 neopixel bits in each spi packet ?

Hi,

just got a neopixel ring from Adafruit. Sticking to your library to avoid assembler stuff.

Trying to deeply understand what you do.

Each neopixel bit is encoded in 3 bits from ths SPI bus to account for the 1,25us period. Got it.

Now if I am sending RGB/GRB neopixel bits I should be sending 9 neopixel in each burst isn't it ?¿?¿?¿? You apparently try to pack 4 ?¿? what is the 4th for ??

Thanks for clarifying.

Julian.

Question relating to:

Control an array or chain of NeoPixel-compatible RGB LEDs. "NeoPixel" is Adafruit's name for WS2812- and WS2811-based addressable RGB LEDs. This library should work with any WS2811- or WS2812-based devices. … NeoPixel, NeoPixels, WS2811, WS2812, WS2812B

1 Answer

10 years, 3 months ago.

A quick look at the code, and he is sending 6 packets of 12 bits (12 bit SPI)

which equals 72 bits,

divide by 3, the number of bits per time slice, gives 24,

24 div 3 (RGB) gives 8 bits for R & G & B - Q.E.D.

Hope this solved your dilemma ..

Ceri

BTW hope to try this out a little later, really want to use LPC11U24, but the only other code I found was ONLY foe LPC1768 !!

Accepted Answer

I was misled by the language into thinking that SendFourBits was actually sending 4 neopixel bits....which was contradicting the actions of the code....and a fuse went off in my brain. Thanks for shifting my thinking. It is all clear now.

posted by julian C 14 Aug 2014

Thanks for answering this!

Regarding LPC11U24: The BurstSPI library doesn't currently support LPC11U24 as far as I can see. If you want to use it, you'll have to add support to BurstSPI. This shouldn't be terribly difficult, but it means digging into the mbed API internals (and the LPC11U24 user manual) to find the proper register names. I have an LPC11U24 so if no-one else does it, I might port BurstSPI myself at some point.

As a quick fix, you could hack the PixelArray library to use the standard SPI peripheral instead. As I understand it, the WS2812 chips should tolerate this, but I don't know how well it would work in practice. (The timings will be well out of the specified tolerances.)

posted by Jacob Bramley 20 Aug 2014