All variables in the above code are unsigned int type.
If I comment the
Code:
DTCON1 = 0x28
line then I get correct PWM MC signals that is both PWM1L and PWM1H start at the same time. With
Code:
DTCON1 = 0x28
I get incorrect signal that is PWM1H starts after approx 2 sec after PWM1L starts.
Initially when device starts there is 200ms delay for LCD and then after PWM MC is started with 0% duty there is a 20ms delay and then a 150ms timer4 interrupt runs and ramps the duty from 0% to 50% in 7.5 seconds.