This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: PWM doesn't directly transition from 100% to 0% duty cycle.

Part Number: TMS570LC4357

Hi, this is almost the same as HET Issue: Cannot stop pwm output, if duty cycle was set to 100% but doesn't involve start or stop actions.

Using HAL function pwmSetDuty() I've discovered that if the duty cycle is at 100% and then you go directly to 0% it stays at 100%. AFAICT no other transition gets stuck like this.

I'm working around this by detecting this transition and going "via" 1%, that is converting the command request of 0% to 1%, sleeping a bit and then commanding the PWM unit to 0%. My PWM cycle is 1ms so I need to sleep 2ms to allow for the transition to 1% to go through before moving on to 0%.

Sleeps are far from an ideal solution so I'd appreciate a bit of an explanation on why this problem might be happening to help me find a better way to handle this anomaly.