micropython / micropython-esp32

Old port of MicroPython to the ESP32 -- new port is at https://github.com/micropython/micropython
MIT License
675 stars 217 forks source link

PWM on frequencies lower 611 Hz don't work on firmware 1.18 #264

Closed Kampfzwerg87 closed 2 years ago

Kampfzwerg87 commented 2 years ago

I tried to using PWM on firmware 1.18 to control a servo motor and it doesn't work. With high frequencies the PWM-Signal was ok, on lower frequencies I didn't get any signal.

So I did some test with an oscilloscope and realized that I don't get a PWM-Signal when I use frequencies lower than 611 Hz. Downgrading to firmware 1.17 solved the problem.

I used the ESP32 NodeMCU Development Kit.

Here's the code I used to verify this issue: `import machine import time

pwm = machine.PWM(machine.Pin(4), freq=1)

duty = 512 pwm.duty(duty) PAUSE = 0.03

Endlosschleife

while(True): for freq in range(1,1000): pwm.freq(freq) print(freq) time.sleep(PAUSE)`

With firmware 1.17 it works fine, with firamware 1.18 it doesn't.

Kampfzwerg87 commented 2 years ago

I opend this issue on this old project by mistake. I reopend it on the current project.