adafruit / Adafruit_CircuitPython_NeoPixel

CircuitPython drivers for neopixels.
MIT License
302 stars 98 forks source link

Show() Function Speed Pi Pico vs. Raspberry (takes twice the time in Pi4) #138

Open fabulou1 opened 1 year ago

fabulou1 commented 1 year ago

Hello,

i am having an "Issue" with the speed of the show() function. On a Pi Pico i get an execution time of the show() function of around 46 ms for a 1200 RGBW Led Strip. This is as far as my understanding is correct the expected signal time for this number of leds and colors. Oddly enough on a Raspberry Pi 4 the function takes twice as long. The execution time clocks in at around 90 ms. Is there a reason It takes that much longer? Is the Pi 4 pushing the Data at 400 kHz instead of 800 kHz? Or am I missing a setting?

I appreciate any input! Thanks!

tekktrik commented 1 year ago

Not a totally expert here, but I imagine the PI is slower because the operating system is managing a lot more resources than the Pico. Additionally, I believe the implementation for the function that does the transmission is compiled for the microcontroller, whereas the Pi's version is in Python. You could try speeding up the I2C clock potentially, but I wouldn't be surprised if the difference is just the fact the Pi is juggling a lot more in the background.