Skip to main content
Associate II
February 12, 2016
Question

Disable PWM at logic low

  • February 12, 2016
  • 1 reply
  • 545 views
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.

    This topic has been closed for replies.

    1 reply

    re.wolff9
    Senior
    February 13, 2016
    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.