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.

Role of capacitor in crystal circuit for micro-controller.

Status
Not open for further replies.

sysysy

New Member
Hi,

May i know what is the actual functional of capacitor that we use in the crystal circuit? for example 2 22pf are using in connect between 2 terminal of crystal to Gnd.

I remembered last time my friends take wrong value of the capacitor and connected to the crystal.As a result, the microcontroller is never getting work until he found out the problem.

From the datasheet, it juz say that for higher capacitance that we use, the re is more stability of oscillator but also increase the the start-up time. Unfortunately, it did not say why must use or real purpose of this capacitor.

Hope anyone know can share the discussion here.

Thanks


regards,

sysysy.
 
hi,
Look at this pdf.

EDIT:
To make it clearer what are the requirements for the external capacitors I have edited the datasheet in order to highlight the importance
of the external components.

Hopefully this will dispel the 'Forum folk lore' explanations for the components.

CrystalCaps.png
 

Attachments

  • 2001SEP06_AMD_AN.PDF
    51.9 KB · Views: 2,585
Last edited:
The additional capacitors on either side of the crystal are basically to damp unwanted oscillation modes, The crystal will transfer any harmonic of it's resonant frequency to a greater or lesser degree, sometimes this is desired, but not in micro controllers, I've never seen a micro controller that uses an overtone crystal (non resonant but harmonically higher), in theory if you changed the cap values you could get a 10mhz crystal to start a micro controller up at 5mhz or 20mhz, assuming the oscillator circuitry allowed it, might require tweaking, but not needed, micro controllers almost always have clock divider options that would allow you to divide the incoming clock for the main frequency. Generally micros are run at their maximum allowable frequency all the time, situations where their running frequency needs to be tweaked don't occur regularly.

When it's started up a crystal oscilator is basically fed a noise pulse, and the rest of the passive components in the circuit have to act to quickly to attenuate all the unwanted frequencies down to the one the oscilator can run at BUT that the MCU will run at, if there is no check on that noise you can get random false positive clock ticks at harmonics if they're not filtered out So you could get a 10mhz main clock but sometimes there are over or undertones causing extra ticks here or there, all that's desired is one and only one frequency where there is output. It may never stabilize which will really wreak havoc on code, or again in theory if the oscillator allowed it could stabilize at so high a frequencies the micro controller can't function properly (generally from flash timing)
 
Last edited:
The additional capacitors on either side of the crystal are basically to damp unwanted oscillation modes, ...

Nope, that is exactly the OWT that this thread is trying to dispell!

The capacitors are there to resonate with the crystal inductance and cause the crystal to oscillate on its fundamental parallel-resonant mode.
The reason that there are two capacitors in series is to create a network that creates a 180 degree phase inversion at resonance, because the amplifier (inverter) has a 180 degree phase inversion between its input and output. This makes the loop gain have a net phase shift of 360 degrees, which is what causes it to oscillate (look up Barkhausen Criterion).

This is a Pierce oscillator; (look that up, too).
 
Last edited:
the capacitors are there as starting capacitors.most crystal cant start oscillation on their own.if you want to stop bothering about capacitors, u can use a resonator instead.they are self oscillating or better still quickly finish mastering your pic commands and move to a higher one like 16f628 that have internal oscillator.
 
Hi ablemicky,

the capacitors are there as starting capacitors.most crystal cant start oscillation on their own.if you want to stop bothering about capacitors, u can use a resonator instead.they are self oscillating or better still quickly finish mastering your pic commands and move to a higher one like 16f628 that have internal oscillator.

may i know how is the capacitance value take effect on it?
why must the within range provided by the datasheet just able to start the crystal oscillation?

how about if using too large value of capacitance?
 
the capacitors are there as starting capacitors.most crystal cant start oscillation on their own. if you want to stop bothering about capacitors, u can use a resonator instead.they are self oscillating ..

The difference between a crystal with two capacitors compared to a ceramic resonator is that the capacitors happen to be integrated into the ceramic resonator. From an analysis standpoint, a ceramic resonator is equivalent to a crystal and two capacitors, except that the crystal has a higher Q and better frequency stability.
 
...
why must the within range provided by the datasheet just able to start the crystal oscillation?

how about if using too large value of capacitance?

Read up on "Pierce Oscillator"; that explains it all.
 
Last edited:
Well Mike, I can say this, the very start of my post makes perfect sense, the rest of it does however show I don't know how they actually function in the circuit =)
The additional capacitors on either side of the crystal are basically to damp unwanted oscillation modes
Makes sense that's what they do, I've never done an AC analysis before though so my actual native understanding of their function in the circuit is zero and goes to show that I should just say what I know without trying to extemporizing on things I don't know well =>
 
Here is a pretty good explanation of what the capacitors do, and how the inverter inside the PIC makes an oscillator.
 

Attachments

  • CMOSosc.pdf
    51.9 KB · Views: 1,304
That PDF recommends using a feedback resistor between 10-20meg on low crystal values basically anything lower than about 6mhz. I've never seen that before, but the explanation in the PDF is quiet good. I wonder how much this effects accuracy on something like real time clock crystals because I can't recall ever seeing a feedback resistor in a real time clock circuit.
 
Last edited:
The 10meg resistor is needed to "bias" one-sixth of a hex logic inverter into the linear gain region when the inverter is used as the gain block of a crystal oscillator. The resistor effectively turns the CMOS inverter into an inverting amplifier (phase shift of 180 degrees), with high input impedance, fairly low output impedance, with a gain bandwidth product of several hundred MHz.

The two capacitors in series resonate with the effective inductance of the crystal at its parallel-resonant fundamental mode. The common point between the two capacitors is ground, so the crystal+2capacitors network has a net 180 degree phase shift between its two ports, which when combined with the 180degree phase shift in the amplifier adds up to 360, which means oscillation (loop gain >1, phase shift = 0 dgrees, or multiples of 360 degrees). That is by definition a Pierce Oscillator.

The inverter integrated into a PIC chip or other similar IC doesn't need the external 10meg resistor because it is integrated inside the chip. The reason that sometimes the capacitors can be left out (and the oscillator will still oscillate) is because the pad/pin capacitance of the two pins at the input and output of the inverter have an intrinsic capacitance pushing ~10pf, but it is not good to expect that the crystal will start reliably if you leave out the external capacitors.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top