1 Reply Latest reply on Mar 3, 2011 2:36 PM by MR_41

    PWM output incorrect





      I am trying to get a 1KHz output from a PWM.  I am using a 8 bit PWM with the following configurations.




      Clock - VC2 (VC1 divider = 16; VC2 divider = 15)


      Period = 99


      Pulsewidth = 50




      With VC2 clock at 100KHz, with PWM period of 99, the output should be 1KHz.  But I am getting an output near 240KHz from the PWM.  Can someone point me what could be the mistake?







        • 1. Re: PWM output incorrect

          From the data you have provided the only possible problem in your design could be the ClockSync parameter of the PWM.  Have you set this to "Use SysClk Direct"?  When the ClockSync parameter is set to "Use SysClk Direct", it overrides the clock parameter and connects the 24MHz clock to the PWM.  With a 24MHz clock and a period of 99, the output would be 240KHz.  Change the ClockSync to "SyncToSysClk" and that should fix your problem.




          Best Regards,