Hi everyone,
I am using 16F18877 with internal oscillator at 32Mhz (8 mhz clock). I am creating a VGA signal to drive an old lcd monitor (800x600 @40mhz).
Hsync is produced using TMR2 in PWM mode and Vsync is produced using TMR1 is compare mode. Everything works great but I have jitter problems.
I notice 1-2 pixels of random phase shift in everyline. See the effect in attached picture.
I am using a logic analyzer to see the data and I notice that the period of the horizontal pulses is slightly different every few pulses. It ranges from 26.2μs to 26.6μs while I target for 26.375. Now I am not sure how to handle this. Is it something that I can't tweak somehow or is it a normal behavior of the internal oscillator and I can only switch to an external crystal to resolve it?
I have used a 0.1μf decoupling capacitor in each of the two pic VDD pins but this is the first time I used an LM2596 - 5v as a switching power source and I am not sure If this is affects the stability of the clock.
Any ideas will be more than welcome.
I am using 16F18877 with internal oscillator at 32Mhz (8 mhz clock). I am creating a VGA signal to drive an old lcd monitor (800x600 @40mhz).
Hsync is produced using TMR2 in PWM mode and Vsync is produced using TMR1 is compare mode. Everything works great but I have jitter problems.
I notice 1-2 pixels of random phase shift in everyline. See the effect in attached picture.
I am using a logic analyzer to see the data and I notice that the period of the horizontal pulses is slightly different every few pulses. It ranges from 26.2μs to 26.6μs while I target for 26.375. Now I am not sure how to handle this. Is it something that I can't tweak somehow or is it a normal behavior of the internal oscillator and I can only switch to an external crystal to resolve it?
I have used a 0.1μf decoupling capacitor in each of the two pic VDD pins but this is the first time I used an LM2596 - 5v as a switching power source and I am not sure If this is affects the stability of the clock.
Any ideas will be more than welcome.
Attachments
-
523.7 KB Views: 19
Last edited: