NeoPixel - WS2812 limited to 21 pixels.

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
petergebruers
Posts: 245
Joined: 26 Jul 2015 17:29

NeoPixel - WS2812 limited to 21 pixels.

Post by petergebruers »

Up to 21 pixels the color wheel works. But at 22 pixel stuff gets weird. I guess you need 3 bytes per pixel (one for each color) and 4 bytes per colour, if I understand the implementation of NeoPixel::show() correctly. So 21 * 3 * 4 = 252 bytes. And for 22 pixels you need 264 bytes and that is > 256. Coincidence? Does that number exceed the capabilities of the chip or the implementation?

User avatar
PoltoS
Posts: 5507
Joined: 26 Jan 2011 19:36

Re: NeoPixel - WS2812 limited to 21 pixels.

Post by PoltoS »

Exactly. Z-Uno is doing radio, hence it can not do full-time control of a too big neopixel strip. To still be able to do that we use SPI MOSI pin in DMA mode.

The DMA buffer is indeed 256 bytes. Each color bit requires four in the buffer. Hence we need 4*3*N bytes for N LEDs. This gives 21 LEDs.

petergebruers
Posts: 245
Joined: 26 Jul 2015 17:29

Re: NeoPixel - WS2812 limited to 21 pixels.

Post by petergebruers »

-
Last edited by petergebruers on 16 Sep 2017 12:06, edited 2 times in total.

User avatar
PoltoS
Posts: 5507
Joined: 26 Jan 2011 19:36

Re: NeoPixel - WS2812 limited to 21 pixels.

Post by PoltoS »

Excuse, edited my answer

User avatar
PoltoS
Posts: 5507
Joined: 26 Jan 2011 19:36

Re: NeoPixel - WS2812 limited to 21 pixels.

Post by PoltoS »

The buffer is 300 bytes (we use same for IR features too), but SPI can address only 256 of them. The address is 1 byte

petergebruers
Posts: 245
Joined: 26 Jul 2015 17:29

Re: NeoPixel - WS2812 limited to 21 pixels.

Post by petergebruers »

Oh, OK. So I'll have to try an alternative approach. Or just use APA102 instead of WS2812 (and bitbang the data and clock).

Post Reply