Different PWM Frequency

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
hassankamran012
Posts: 1
Joined: Sun May 26, 2019 1:47 pm

Different PWM Frequency

Post by hassankamran012 » Sun May 26, 2019 1:49 pm

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

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Different PWM Frequency

Post by jimmo » Mon May 27, 2019 1:03 am

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

Post Reply