Library that allows for higher resolution and speed than standard mbed PWM library using same syntax (drop-in replacement).
Issue: Sync Issue (Closed: Fixed)
I am using the FastPWM to produce a 50kHz PWM output on the KL25Z. I routinely change at regular intervals the duty cycle on the PWM output. I am using the pulsewidth() function as I do not want the period to change.
As the library suggests I set the period at the beginning of the code and I use double type variables throughout to maintain accuracy.
Each time the pulsewidth function is called the next PWM pulse is not in sync with the period of the previous (i.e it as if a new pulse train is initialized with the same period as before). Before and after the period is as expected.
Ideally the value of the pulsewidth should be changed and then only activated at the end of the previous pulse period. Apologies is this is my mistake through an incorrect use of this library