Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 4 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:
1 Answer
10 years, 4 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 !!
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 14 Aug 2014Thanks 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 20 Aug 2014