- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having trouble getting 100% duty cycle from the PWM. 0-99% works great but I always get a small negative pulse at 100%. I'm using the LHL_CLK to get a 1 kHz signal. I'm trying to get 100% by calling:
pwm_transitionToSubstituteValues(PWM1, 895, 895);
Is there anyway to get 100%?
Solved! Go to Solution.
- Labels:
-
PWM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You cannot have init value == toggle value. The HW uses a counter that controls the output level and it cannot be both high and low at the same time. If you want the output to be always on or always off, just drive the output using gpio_configurePin().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You cannot have init value == toggle value. The HW uses a counter that controls the output level and it cannot be both high and low at the same time. If you want the output to be always on or always off, just drive the output using gpio_configurePin().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So I need to special case 100%? Seems rather clunky I'm not sure on the order of operations here. I've tried disabling the PWM at 100% and calling gpio_configurePin but this is unrealiable; the pin goes low sometimes even though I set it high. Then when transitioning back below 100%, the duty cycle sometimes gets inverted. Do I need to reset the PWM perhaps?