adafruit / Adafruit_NeoPixel

Arduino library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.)
GNU Lesser General Public License v3.0
3.02k stars 1.25k forks source link

rp2040 using a PIO state machine for each "strip." #329

Open WestfW opened 1 year ago

WestfW commented 1 year ago

Currently on rp2040, a PIO state machine is allocated for each strip. This limits the number of strips that can be supported to 8, and consumes PIO SMs that may be needed for other purposes. Since the show() implementation is still synchronous (waits until the full bit stream has been written to the strip), there doesn't seem to be much benefit to the separate SMs, and I think the time needed to set up the PIO is small compared to the time required for show()...

(Ideally, I guess it would be nice if the PIO program could have its pin definitions updated on the fly without having to completely reconfigure it. I don' know whether that's possible.)

https://forum.arduino.cc/t/problem-when-using-neopixels-and-pdm-mic-on-rp2040/1030886/1 https://forums.adafruit.com/viewtopic.php?t=194183

hlcm0 commented 2 months ago

I also encountered your problem recently.
changes in #389 fixed setPin for rp2040, allow it to support more than 8 strips.
hope this helps : )