hellow,

thanx for the useful comments and suggestions,i learn a lot from them...

Henrik and Scalerobotics,
i've changed the code and include this Code:

Code:
Temp = SineVal[StepCount]    
CCP1CON.4 = Temp.0   'Bit 0
CCP1CON.5 = Temp.1   'Bit 1 
CCPR1L = Temp  >> 2     'Bit 2-7
and i'm getting a smooth signal for 20Mhz Osc but not for 4MHz,tried to scale the sine table but it didnt work...but for 20Mhz Osc things looks fine...Simulation results..pdf
i'm not sure if it is possible to get a smooth spwm signal with a 4Mhz osc as i've tried to modified my code as suggested above but the waveform is still not smooth.....