cancel
Showing results for 
Search instead for 
Did you mean: 

Disable PWM at logic low

marco2
Associate III
Posted on February 12, 2016 at 17:52

At certain time instant I need to disable the PWM.

The problem is that I don't want to disable when the logic is high, but low.

How can I obtain this?

Thanks.

1 REPLY 1
re.wolff9
Senior
Posted on February 13, 2016 at 20:03

You can write the output low, disable the PWM and then write it low again. Worst case you get a short pulse while turning it off. 

Or do you want to finish the current PWM cycle completely? Isn't there a mode that a reload of the PWM register only happens on the next timer overflow? Set the PWM to 0 for the next cycle and maybe disable the whole PWM on the next overflow interrupt.