When multiple setduty(...);pwm_start() are called to fast, pwm is not correctly set.
When using :
Code: Select all
setduty(..);pwm_start()
wait some time
setduty(..);pwm_start()
It works OK,
But when using :
Code: Select all
setduty(..);pwm_start()
setduty(..);pwm_start()
pwm behavior is not correct.
As the setduty(..);pwm_start() can come from different threads, interrupts. There cannot be a guarantee that there is a long enough period between the two calls.