Glitchless PWM

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

cross mob
Anonymous
Not applicable

Hello,

   

I would like to know if there are any examples or documentation on how to update the compare register in a TCPWM module and have the update be glitchless. I would like to avoid having to pause the counter if possible.

   

 

   

Thank you.

0 Likes
5 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can use the "swap" functionality in the TCPWM. This allows you to change between two different periods / compare values.

0 Likes
Anonymous
Not applicable

Thank you for the suggestion. I have tried using the swap functionality but I am not sure how to generate the switch signal so that it doesn't continue swapping. Is there a way to generate it with software or does it have to be a hardware event.

   

 

   

Daniel

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

There is the TCPWM_SetPeriodSwap() API call which you can use. Otherwise a control register can be used.

0 Likes
Anonymous
Not applicable

Thank you for the suggestion but I could not implement it. Yes I am aware of the TCPWM_SetPeriodSwap() API but I could not get it do anything unless there is a level change on the swap input. Hence my previous post. Also, I would like to use a control register however I am confident that the PROC does not have them. I managed to get it working by setting an unused pin as an input and output. I then routed that pin to the swap input of the TCPWM. With software I toggled the pin and it worked. I would like a cleaner solution as I will need to be using that pin down the line,

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

As far as I remember you may set in a TCPWM the compare register which is taken into account the next cycle. So there will be no glitch.

   

 

   

Bob

0 Likes