Wiced Sense hardware timer example (part 2)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

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?

1 Solution

roger_lu

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.

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

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.

0 Likes

roger_lu

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.

0 Likes
Anonymous
Not applicable

Understood. thanks a lot:-)

0 Likes