Hello Everyone. I was playing around with the PWM and I noticed that changing the PWM frequency on 1 pin changed the PWM frequency on an other PIn. Is it possible to have different PWM frequencies on different Pins?
Thanks in Advance
Different PWM Frequency
Re: Different PWM Frequency
Hi,
Unfortunately it doesn't look like it -- the way it's implemented [1], the frequency is shared by all pins (channels).
I'm fairly sure this is a limitation of the ESP8266 hardware. From the reference doc [2] "PWM (Pulse Width Modulation) can be implemented on Frame Rate Control 1 (FRC1) via software programming, achieving multi-channelled PWM with the same frequency but different duty ratio. It can be used to control devices such as color lights, buzzer, and electric machines, etc."
I think other ESP8266-based platforms (e.g. Arduino) potentially work around this using soft-PWM?
[1] https://github.com/micropython/micropyt ... pwm.c#L124
[2] https://www.espressif.com/sites/default ... e_en_0.pdf
Unfortunately it doesn't look like it -- the way it's implemented [1], the frequency is shared by all pins (channels).
I'm fairly sure this is a limitation of the ESP8266 hardware. From the reference doc [2] "PWM (Pulse Width Modulation) can be implemented on Frame Rate Control 1 (FRC1) via software programming, achieving multi-channelled PWM with the same frequency but different duty ratio. It can be used to control devices such as color lights, buzzer, and electric machines, etc."
I think other ESP8266-based platforms (e.g. Arduino) potentially work around this using soft-PWM?
[1] https://github.com/micropython/micropyt ... pwm.c#L124
[2] https://www.espressif.com/sites/default ... e_en_0.pdf