NeoPixel - WS2812 limited to 21 pixels.
-
- Posts: 255
- Joined: 26 Jul 2015 17:29
NeoPixel - WS2812 limited to 21 pixels.
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?
Meet me here: https://forum.fibaro.com/index.php?/pro ... rgebruers/ or here: memberlist.php?mode=viewprofile&u=564463
Re: NeoPixel - WS2812 limited to 21 pixels.
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.
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.
-
- Posts: 255
- Joined: 26 Jul 2015 17:29
Re: NeoPixel - WS2812 limited to 21 pixels.
-
Last edited by petergebruers on 16 Sep 2017 12:06, edited 2 times in total.
Meet me here: https://forum.fibaro.com/index.php?/pro ... rgebruers/ or here: memberlist.php?mode=viewprofile&u=564463
Re: NeoPixel - WS2812 limited to 21 pixels.
Excuse, edited my answer
Re: NeoPixel - WS2812 limited to 21 pixels.
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
-
- Posts: 255
- Joined: 26 Jul 2015 17:29
Re: NeoPixel - WS2812 limited to 21 pixels.
Oh, OK. So I'll have to try an alternative approach. Or just use APA102 instead of WS2812 (and bitbang the data and clock).
Meet me here: https://forum.fibaro.com/index.php?/pro ... rgebruers/ or here: memberlist.php?mode=viewprofile&u=564463