PWM is disturbed when neopixel update a led strip / esp8266 #9524
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Does a machine.Pin object default to Pin.OUT when used with NeoPixel? |
Beta Was this translation helpful? Give feedback.
-
This is a bug but not sure if it's one we can fix easily and whether it's in the IDF or in MicroPython. It's complicated, but worth investigating. The simple answer is that MicroPython just forwards both of these functions to the ESP IDF:
You would expect that both of these should be able to run concurrently (at the end of the day, that's the point of having hardware support). In particular the PWM should be just set-and-forget (even if the RMT driver has to run interrupts to keep the output buffer full). Would need to investigate further and find out why the PWM peripheral isn't just running independently... surely it doesn't require an IRQ to keep running. It would be interesting to find out of the glitches are happening during RMT initialisation, or during the transmit of the data. |
Beta Was this translation helpful? Give feedback.
-
If this is an esp8266 (as opposed to esp32) then it's a know limitation: the PWM is software based and so is the neopixel driver. They both require full control of the MCU without anything interrupting them (eg the PWM will miss transitions if the neopixel is outputting for too long). So they don't work well together, unfortunately. |
Beta Was this translation helpful? Give feedback.
If this is an esp8266 (as opposed to esp32) then it's a know limitation: the PWM is software based and so is the neopixel driver. They both require full control of the MCU without anything interrupting them (eg the PWM will miss transitions if the neopixel is outputting for too long).
So they don't work well together, unfortunately.