I'm trying to use the PWM to drive a buzzer at a specified frequency. I am able to turn on the buzzer and control its frequency as expected, so that's fine.
Of course, I also want to be able to turn the buzzer off, and also ensure the output is low so the drive transistor isn't left on. So, according to the LPC17xx User Manual, to ensure it outputs low (when in Single Edge mode), I should set the match value to 0. Manual section 24.4.1 says "All single edge controlled PWM outputs go high at the beginning of a PWM cycle
unless their match value is equal to 0." However, if I do that, then the output is left high, not low.
I've found that if I set the PWM channel's match value to equal to the MR0 value, then it does seem to stay low.
Is this correct use of the PWM? If so, the User Manual should be changed to clarify this point.
Hi Craig McQueen,
The output will keep constant low if the match value is 0, I'd highly recommend that you can create a simple testing demo and upload it, then I can replicate the issue on my site.
I'm looking forward to your reply.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------