Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Crystal Oscillator configuration

Status
Not open for further replies.

chrisdagger

New Member
Hello all!

I seem to be having a little trouble with an oscillator on a PIC chip. What is happening, is when there is high current draw, the oscillator slows down, significantly. I have the crystal configured with 2x 15pF capacitors, and have also tried with a 10M resistor in the circuit, but don't seem to be able to keep it steady. The PCB I've made is connected to an external device, and so I have little control over it's current draw!

Is this pretty normal for crystal oscillators? The stability of the oscillator is given as +/- 50ppm. I also have a very similar result using a ceramic resonator.

I have uploaded a video to the interweb in MP4 format - www.arcadeangel.co.uk/MOV00008.MP4 . In the video, you can see where the external device is drawing current, first of all when it is running stepper motors, and secondly (when the waveform is really sketchy) when there is a lot of illumination.

And I will always maintain that an oscilloscope is the second most important piece of equipment in any workshop after the coffee maker. ;-)

Any advice would be greatly appreciated!
 
The stability of the oscillator is given as +/- 50ppm.
That specification usually indicates the initial frequency tollerance. The stability depends on other things such as voltage, temperature, capacitance, interference ageing etc.

Check the stability of the voltage supply to the pic. Try adding more supply decoupling/smoothing capacitors as others have suggested.

Maybe you will even need a separate regulator ic just for the pic if you cannot guarantee the stability of the existing supply.

Check the board layout to ensure the crystal and it's caps are as close as possible to the pic. May also need ground plane guard tracks around the crystal if nearby signals are creating interference (such as the stepper motor drivers)

Maybe try increasing the crystal caps slightly to 22pF as this may improve stability.

Read microchip app note AN949 for more info.
https://www.electro-tech-online.com/custompdfs/2009/02/00949a.pdf
 
Schematic for reference!

Thanks for your advice folks! I'm off to to workshop to try out those suggestions, and I'll let you know how I get on!

For reference, I have uploaded the schematic :)

Cheers,
Chris
 

Attachments

  • PT1.png
    PT1.png
    5.3 KB · Views: 145
Hi Bill,

I currently have a 1uF across Vdd and Vss. Will replace for 0.1uF and try it then. I'm using an 8Mhz crystal - nothing too fancy!

I've just replaced the 15pf caps across the crystal for 22pF, and the signal seems to be worse, but, it might just be allowing me to see the noise more clearly? According to the literature, it recommends 30pF load cap? Which I will also try but will have to buy them in.

Many thanks,
Chris
 
I currently have a 1uF across Vdd and Vss. Will replace for 0.1uF and try it then
As Bill suggested, you need a 0.1uF capacitor and it should be fitted as close as possible to the pic's supply pins. (pins 1 & 20)
Also, try replacing those two 1uF capacitors with 10uF or higher and then add another 0.1uF as close as possible to the 5V regulator output leads.

You could also remove the 10uF capacitor (C5) that is connected to mclr and tie mclr to VDD, then enable the config "power-up timer" (PWRT) which would have a similar effect to capacitor C5 that you were using to delay the start-up.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top