pSoc4 tccpwm asymmetric pwm

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

cross mob
lock attach
Attachments are accessible only for community members.
JaLi_1091341
Level 1
Level 1
5 sign-ins First question asked First reply posted

Attempting to generate a sequence of variable width pulses using the  PWM component configured for asymmetric align.

   

Here is the configuration of the module

   

Prescaler - 1x

   

PWM Align - Asymmetric Align

   

PWM mode : PWM

   

Interrupt on Terminal count

   

Period Register = 50,  Period Register Buf = 206,  swap is checked

   

Compare Register = 10, Compare Register Buf = 103 swap is checked

   

(See Capture.png attached)

   

According to pSocCreator I should get a waveform that looks like capture2.png attached.

   

Instead I see continuously a waveform that appears to be based only on the initially configured period and compare values so it looks like the swap is not working.    The module datasheet indicates that the swap event can be generated in software and the swap will occur on the next TC event.    I tried using the void TCPWM_SetPeriodSwap(uint32 swapEnable)  and void TCPWM_SetCompareSwap(uint32 swapEnable)  api's to (re)enable the swapping at each TC interrupt but this does not impact the generated waveform.

   

Please advise on how to utilize the swapping function of the PWM component....

   

Thanks

   

Jim

0 Likes
1 Reply
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Please post your code so we can check it.

0 Likes