Skip to content

Limited PWM Frequency Range - Cannot Set Below ~500Hz #1083

@Cycov

Description

@Cycov

Description:

I’ve encountered a limitation when using PWM on the RP2040 with the Mbed-based Arduino core:
It seems impossible to set a PWM frequency below ~500Hz. This effectively restricts the usable PWM range, which feels very limiting for certain applications (e.g., motor control, LED dimming with long periods, etc.).

This existing Mbed forum thread describes the problem in detail:
🔗 PWM period is not good on Mbed with Raspberry Pico

Expected Behavior:

Ability to configure PWM to frequencies significantly below 500Hz, as supported by the RP2040 hardware timers.

Actual Behavior:

Attempts to set periods corresponding to <500Hz frequencies do not work as expected. The resolution appears capped or constrained by the current Mbed layer.

Proposal:

Consider aligning PWM implementation with what the RP2040 hardware can actually achieve. If Mbed OS’s limitations are the root cause, one possible path forward might be migrating this Arduino core to mbed-ce (Community Edition) instead of the current, now less actively maintained, official Mbed OS branch.
mbed-ce appears to be more actively developed and may offer better flexibility and bug fixes for peripheral handling, including PWM.

Or am I missing something here and there is a way to get PWM below 500Hz?

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