- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Continued from this closed thread: Wiced Sense hardware timer example
> I tested the above piece of code but that didn't work as expected.
Could you please describe what you see?
If you want glitch free PWM transitions, you might want to use pwm_transitionToSubstituteValues() instead of pwm_start in the timer interrupt handler. Other than that and the fact that the timer is too short, this is the right way to use the timer. Have you tried longer timer intervals?
Solved! Go to Solution.
- Tags:
- pwm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are right, pwm_startWithAlternateValues() is glitch free because it first disables the channel, reinitializes the PWM configuration and then enables it. On the other hand, pwm_transitionToSubstituteValues() reconfigures the PWM HW while it is running, so there might be some glitches/incorrect PWM frequency for one cycle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi arvinds
From the comments in pwm_tones.c in SDK 2.2.0, pwm_transitionToSubstituteValues() is NOT glitch free while pwm_startWithAlternateValues() is glitch free.
Can you make a double check?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are right, pwm_startWithAlternateValues() is glitch free because it first disables the channel, reinitializes the PWM configuration and then enables it. On the other hand, pwm_transitionToSubstituteValues() reconfigures the PWM HW while it is running, so there might be some glitches/incorrect PWM frequency for one cycle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Understood. thanks a lot:-)