I am working with PWM of 2kHz cycle using 16 bit timer set to inverted output. Everything works nicely except at PWM of 100% the output turns off instead of a solid ON. Is there some trick or bug in the silicon?
Works fine up to 99.9% duty cycle.
Frequency is set up as such (during init):
TimerLoadSet(TIMER0_BASE, TIMER_A, SysCtlClockGet(SYSTEM_CLOCK_SPEED)/2000); // step 5 - PWM freq 2kHz
PWM is set by calling:
TimerMatchSet(TIMER0_BASE, TIMER_A, PWM_2K_DUTY_CYCLE(value));
where:
#define PWM_2K_DUTY_CYCLE(x) (uint32_t)((x * M3_PWM_FREQ) / 1000)
#define M3_PWM_FREQ (SysCtlClockGet(SYSTEM_CLOCK_SPEED)/2000)
value is %x10. eg. 999 = 99.9%