8 Replies Latest reply on Apr 17, 2017 4:54 AM by user_1377889

    Problems to refresh TCPWM Compare Value

    info_1957421

      Hello,

         

      I use a TCPWM to drive the Power Source of an LED. Period is 20Khz.

         

      I only change the Compare (Duty) Value of the PWM to drive the LED power.

         

      Every time I put a new Value in the Compare Register the LED flickers after write  one time.

         

      Illustration Sample:

         

      if  (power>100)  { duty--; TCPWM_WriteCompare(duty); }

         

      else { duty++; TCPWM_WriteCompare(duty); }

         

      Seems to be a restart of the PWM each Time when write Compare Register. I need the change only when Period restarts not inside the Period.

         

      I see there are an WriteCompareBuf but if I write there nothing happent in PWM Signal (swap + SetCompareSwap enabled)

         

      Regards,

         

      Michael