Skip to content

[LPC1347] PWMout freq on 16 bit timers wrong #2660

@JojoS62

Description

@JojoS62

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);
}

pwmout-problemwithct16

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions