1 Reply Latest reply on Feb 17, 2017 1:29 PM by user_242978793

    pSoc4 tccpwm asymmetric pwm

    james.littlefield

      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