- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using a PWM to drive an LED but am wondering how to get around the reset pulse when the compare matches the period at 100% duty cycle. Is there a way to eliminate this pulse when running the PWM at 100% duty cycle?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Disable the PWM and set the PIN for the LED high instead (one option)
Alternatively, you could use the inverted output from the PWM and invert all of your duty cycle values; That way, the default "reset" state is ON rather than OFF, but then you will run into the same issue for a 0% duty cycle.
If you increase the period, the pulse will become relatively smaller in comparison, and thus less overall effect.
(Just some thoughts, but I don't know of any really good fix for this)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're incrementing the pwm compare in an ISR you can stop the interrupt and you wouldn't have the reset issue.
Stopping the PWM and then restarting it will cause a visible brightness glitch.