I'm guessing that whenever this is executed:
PBP is stopping, setting up and restarting the HPWM.Code:HPWM 1,DutyCycle,10800
If you do this in the loop,
then your problem should go away. I don't know if PBP allows you to do this. If not, you will have to set up the hardware manually.Code:CCPR1L = DutyCycle
Code:PR2 = 462 '10,800Hz frequency CCPR1L = 0 'Initial duty cycle CCP1CON = %1100 'PWM mode T2CON.2 = 1 'Start TIMER2
Bookmarks