Closed neilt6 closed 10 years ago
Picture of the waveform produced by setting the period to 2µs, and the duty cycle to 0.9:
I forgot to clear the prescaler register when the prescaler is not needed. Originally, P_8 (PWM of 16bit timer) can't correctly generate 20m PWM, so the prescaler is added.
Should be an easy fix then?
Creating a PwmOut object using P0_8, and setting the period to 2µs (500kHz) produces an incorrect waveform running at ~33kHz. This code worked on a previous version of the mbed library, leading me to believe it was broken 4 months ago as part of https://github.com/mbedmicro/mbed/commit/a3465b5eacb4d383e742abfecedeadbd637b2b24.