← index #4662Issue #8345
Off-topic · high · value 0.414
QUERY · ISSUE

[PYBD] Switching Frequency completely locks up the board

openby ThomasChropened 2019-04-01updated 2019-04-30
port-stm32

Examplecode:
machine.freq(216000000)
More details in a Forum Thread: https://forum.micropython.org/viewtopic.php?f=6&t=6190

CANDIDATE · ISSUE

esp32: PWM duty will be changed when changing the frequency if more than one channel is used.

closedby Dreagonmonopened 2022-02-23updated 2022-03-07

After upgrading mpy from 1.17 to 1.18, my buzzer can't play low frequency sounds any more.

With further test, it shows that the pwm has no output when frequencies < 611Hz.

from machine import PWM, Pin
pwm = PWM(Pin(5)) # also tested with Pin(2)
pwm.duty(512)
pwm.freq(611) # it works, digital multimeters shows freq 1222Hz
pwm.freq(610) # no pwm output, digital multimeters says freq is 0

And after switching back to mpy 1.17, pwm.freq(610) works fine. I'v tested with another board and I still got the same result. I'm sure this is an issue introduced by v1.18.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied