Skip to content

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

@Dreagonmon

Description

@Dreagonmon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy