Number of leds cap in NeoPXL8?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
OnlineCaveman
 
Posts: 2
Joined: Fri Dec 10, 2021 4:15 am

Number of leds cap in NeoPXL8?

Post by OnlineCaveman »

Hi,

I am working on a project where multiple strands of RGBW Neopixels will be driven using a Feather M4 and a NeoPXL8 M4 featherwing. Each strand is 16 meters or 960 leds, broken up into 1 meter pieces, all individually powered by a MPM3610 (20V input 5V output) to reduce the current and thus the wire cross section needed for the power cables. The 16 meter strands were all individually tested using the RGBWstrandtest sketch and work fine.

Switching to the NeoPXL8 library to drive the lot generates some strange behaviour. Using the standard neopxl8 strandtest code, everything works only up to 682 pixels. Attempting to define a larger number of leds breaks the code.

The NeoPXL8 M4 page states:
8 strands of concurrent DMA output each one can be 1750 RGB pixels long for a total of 8 x 1750 = 14000 pixels.
I think that might be overstated as far as I checked the code in the NeoPXL8 library and also is mentioned in the end comment in the library file:
this incurs a hefty RAM footprint, about 4X the space required for the "normal" NeoPixel library (1X for the regular NeoPixel buffer which we still use, plus another 3X for the DMA expansion) -- so each RGB pixel needs about 12 bytes RAM, or 16 bytes for RGBW pixels.
In that case 8*1750*16 adds up to be 224KB > 192KB of the Feather M4. Correct me if I'm wrong.

Anyway, that is still about double than what I require. By the same calculation, the memory usage for my setup (eight 960-rgbw-led-strands) should thus add up to 8*960*16 so around 123KB, leaving an ample 69KB for the rest of the program which should be plenty, if I'm not mistaken.

But as soon as I try to increase the number of leds in the code past 682, only part of the strand does light up, in a wrong color or flickering.

I'd post the whole code I use, but that seems a bit redundant as the only changes I made to the neopxl8 example are:

Code: Select all

#define NUM_LED 683  // 682 works. Total number of pixels is 8X this!
int8_t pins[8] = { 13, -1, -1, -1, -1, -1, -1, -1 };
Adafruit_NeoPXL8 leds(NUM_LED, pins, NEO_GRBW);
I'm trying to zero in on the problem but am out of ideas at the moment. Any input from people who wrote, or extensively worked with the NeoPXL8 library would be very much appreciated.

User avatar
OnlineCaveman
 
Posts: 2
Joined: Fri Dec 10, 2021 4:15 am

Re: Number of leds cap in NeoPXL8?

Post by OnlineCaveman »

With not enough time to deep dive into the libraries at the moment, I went for a workaround.
Cutting and rerouting some connections on a Neopxl8 board to have the 3.3V to 5V conversion on pin 12, A2 and A4 (which can be used with the sercom) allowing me to use the Neopixel Zero DMA library. Works like a charm with 2 strings of 960 leds so far. So if ever someone wants to use DMA driven Neopixels on large strings, I guess this is a working way to go for up to 4 strings.

I tried bumping up the numbers to see if I ran into a similar problem. Since the RAM footprint of both the Neopixel Zero DMA library and the NeoPXL8 library is about the same. So I defined 2 strings of 3840 leds with the Neopixel Zero DMA setup to have the same ammount of leds as with 8 strings of 960 leds with the NeoPXL8 library. It still works but, needless to say, gets pretty slow.

I can go ahead and finish my project as is. My problem is solved for now, as I will drive the total amount of 6 strings with 2 Feather M4s and NeoPXL8 Featherwings and synchronize everything over a TCP connection.

The original question/problem about the NeoPXL8 library remains to be answered. If I ever get the time to dig some more into the libraries and the samd5x datasheet, I'll try to come back to this post.

That's it for now folks. Happy bitbanging!

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”