-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Description
- Type: Bug
- Priority: Major
Bug
PWMout frequency is higher than set in pwm.period(). This happens on pwm pins with 16 bit counters CT16B0 / CT16B1, on CT32B0 it works as expected.
Target
LPC1347
Toolchain:
ARM, online compiler
mbed lib 64...125
Expected behavior
pwm.period(0.01) -> 10 ms
Actual behavior
pwm.period(0.01) -> 0.898 ms
Steps to reproduce
#include <mbed.h>
PwmOut pwm_ok(P0_18);
PwmOut pwm_not_ok(P0_9);
int main()
{
pwm_ok.period(0.01f); // 10 ms / 100 Hz
pwm_ok = 0.25f;
pwm_not_ok.period(0.01f); // 10 ms / 100 Hz
pwm_not_ok = 0.25f;
while(1);
}