Pwm lpc1768 period can not be set separately

I rencountered the same problem,I need the pwm output pin has individual period,but find out that all the pins are using the same period as I changed them individually .
the board is lpc1768

PwmOut steer_engine(P1_23);//P1.23
PwmOut power_engine(P1_20);//P1.20
can I set the period separately

Unfortunately not, this is a limitation of the LPC1768 hardware – a common period has to be set for all of the PWMs. If this is an issue for you then you’ll have to use a different Mbed board. I know that the RPi Pico doesn’t have this problem – it can have up to 8 different duty cycles on PWM outputs. Note however that the RPi Pico is only supported in the mbed-ce fork, not baseline Mbed OS.

1 Like