The CCP1CON contains two last LSBs of the pwm.The |(0xff) part of this line
looks like a mistake. In fact loading anything to CCP1CON that you've read in via an A/D converter seems very odd.Rich (BB code):CCP1CON = ((LSB[x]<<4)|(0xff));
I tried in real hardware, the distortion is unbearable, and the delay seems to be minimal.
Maybe I really need to learn dsPIC..
Thanks again all.