# Basic Crystal Operation

#### k1ng 1337

Joined Sep 11, 2020
701
Hi,

I have a 32,768hz crystal but I am having trouble understanding it's inherit characteristics..

a) What is the simplest way to utilize this two lead device?

I've included an image of the datasheet and a Pierce oscillator

b) Is the waveform produced dictated by the crystal physics and/or the feedback network? In other words do I NEED circuits like the piece oscillator to produce waveform X or does the crystal output something when an AC or DC voltage is applied?

c) My component specifies a drive current of 1uW but doesn't list a voltage.. and some resources reveal that too high a voltage distorts the signal.. what's going on here?

If someone could clear up the basics that would be great, many resources I've read become specific to an application quickly and my brain is not that big.. my goal is a Real Time Clock using discreet components.

Thanks

#### Attachments

• 76.1 KB Views: 22
• 36.8 KB Views: 24

#### sparky 1

Joined Nov 3, 2018
735
Hello specifically the principal behind it is called " Inverse piezoelectric effect "
When the circuit is made resonant a tiny vibration gets amplified.
A simulation can break it down a little, but is more robust with the amplifier.
We know this is over simplified but there is movement in the copper wires and the dynamics of that is important.
So I asked that you play with that and imagine the charges.
Even though it is not perfect we can almost replace the inductor with a crystal.

There are some great electronic math teachers that can take this right into the the Pierce
circuit which is a parallel framework which is helpful. I think both (visual) and math are important.
I find that ability to translate a simulation into a quantitative expression more remarkable
than just pointing a link to a simulation. If a student can reproduce what a teacher is showing
that is extraordinary.

Last edited:

#### jpanhalt

Joined Jan 18, 2008
11,087
This is the equivalent circuit of a crystal:

The subscript "s" means series and "p" means parallel. If you simulate a crystal in LTSpice, it will show as a capacitor for which you have to give those values -- at least my version acts like that.

Finally, here are two excellent discussions about how crystals work:
https://www.nxp.com/docs/en/application-note/AN3208.pdf
http://www.ti.com/lit/an/swra372c/swra372c.pdf

If you want a circuit to play with there are countless examples on the internet. What you build depends on what you have available. Having an oscilloscope and signal generator help, but are not required. A very simple way is to get a microcontroller that has a built-in circuit to drive a crystal oscillator. Hook it up, write code to flash an LED, then play with the capacitors, for example, to see how that affects frequency.

#### DickCappels

Joined Aug 21, 2008
10,068
Remember to add a resistor between the ineverter's output and the crystal with its load capacitor (39 pf in the example below)

Rather than trying to measure power dissipated by the crystal (see example by Jim Williams below) It is more practical to go by the crystal manufacturer's advice.

#### jpanhalt

Joined Jan 18, 2008
11,087
A crystal oscillator can be even simpler:*

That is the circuit Microchip uses in its MCU's. The blue dotted resistor (series resistor) may not be needed (i.e., R = 0 Ω). The red dotted resistor is 2 MΩ to 10 MΩ in the Microchip devices. In the Microchip design, the oscillator signal is from the input to the inverter instead of the output.

*Edit: As shown in original post.

Last edited:

#### Tonyr1084

Joined Sep 24, 2015
7,454
That crystal is typically used as a timing crystal. If you take 32768 and divide that by 2 you get 16384. Divide that by 2 and you get 8192.
Dividing by 2:
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
ONE SECOND. The result is an extremely accurate means of keeping time. If any of those frequencies are something you can or want to use - then it's a great crystal. But if you want to achieve some specific frequency - you'll need a different crystal. Or oscillating circuit.

#### k1ng 1337

Joined Sep 11, 2020
701
Remember to add a resistor between the ineverter's output and the crystal with its load capacitor (39 pf in the example below)
View attachment 228552
Rather than trying to measure power dissipated by the crystal (see example by Jim Williams below) It is more practical to go by the crystal manufacturer's advice.
View attachment 228553
My datasheet doesn't specify a resistance for a Pierce configuration.. if the the max power is 1uW and the logic high of the inverter is approximately 5v and assuming the components are ohmic I require a minimum of 25kohm? Every resource I've read had the resistor at around 300k.. is this done to reduce power losses or is it tuned to contribute to the phase shift of the wave?

Also, if the load capacitance is given by this formula: Cload = {[Cin+C1][C2+Cout]/[Cin+C1+C2+Cout]} + pcb strays (2~3pF)

Am I right in assuming the output frequency will NOT be 32768hz unless I provide exactly 12.5pF as specified? It appears I need a variable cap? Or can I compensate elsewhere in the circuit such as an additional resistor to tune to exactly 32768hz?

Furthermore are the capacitors required if the load capacitance is provided elsewhere in the circuit or does the position of the caps in relation to the crystal provide the necessary phase shift?

Thanks everyone

#### DickCappels

Joined Aug 21, 2008
10,068

Every resource I've read had the resistor at around 300k.. is this done to reduce power losses or is it tuned to contribute to the phase shift of the wave?

That may be a hint that for watch crystals around 300k is a good value.

The power is limited so the crystal will not be damaged. Remember that these are high Q devices and the amplitude of the oscillation builds up over time, so a tiny bit of power can result in huge mechanical vibrations.

Also, if the load capacitance is given by this formula: Cload = {[Cin+C1][C2+Cout]/[Cin+C1+C2+Cout]} + pcb strays (2~3pF)

Am I right in assuming the output frequency will NOT be 32768hz unless I provide exactly 12.5pF as specified? It appears I need a variable cap? Or can I compensate elsewhere in the circuit such as an additional resistor to tune to exactly 32768hz?

"Exactly" is a loaded term. If you hit the specified load capacitance the oscillation frequency should be within published tolerance.

Watches used a trimmer capacitor adjust their accuracy the last time I looked. For my own microcontroller use I don't use them to get to meetings on time so untrimmed accuracy us usually fine.

Furthermore are the capacitors required if the load capacitance is provided elsewhere in the circuit or does the position of the caps in relation to the crystal provide the necessary phase shift?

Discreet capacitors are not required if the required load capacitance is already part of the circuitry. I use some 32768 Hz crystals that require very little load capacitance and it is within 1 pf of the load capacitance provided by some microcontrollers I use. Have not had a problem yet.

If by "position" you are referring to the physical position of the capacitors with respect to the crystal, no, it is not important, but remember you will be keeping that oscillator circuitry small and tight to help keep the oscillations clean.

#### k1ng 1337

Joined Sep 11, 2020
701

Every resource I've read had the resistor at around 300k.. is this done to reduce power losses or is it tuned to contribute to the phase shift of the wave?

That may be a hint that for watch crystals around 300k is a good value.

The power is limited so the crystal will not be damaged. Remember that these are high Q devices and the amplitude of the oscillation builds up over time, so a tiny bit of power can result in huge mechanical vibrations.

Also, if the load capacitance is given by this formula: Cload = {[Cin+C1][C2+Cout]/[Cin+C1+C2+Cout]} + pcb strays (2~3pF)

Am I right in assuming the output frequency will NOT be 32768hz unless I provide exactly 12.5pF as specified? It appears I need a variable cap? Or can I compensate elsewhere in the circuit such as an additional resistor to tune to exactly 32768hz?

"Exactly" is a loaded term. If you hit the specified load capacitance the oscillation frequency should be within published tolerance.

Watches used a trimmer capacitor adjust their accuracy the last time I looked. For my own microcontroller use I don't use them to get to meetings on time so untrimmed accuracy us usually fine.

Furthermore are the capacitors required if the load capacitance is provided elsewhere in the circuit or does the position of the caps in relation to the crystal provide the necessary phase shift?

Discreet capacitors are not required if the required load capacitance is already part of the circuitry. I use some 32768 Hz crystals that require very little load capacitance and it is within 1 pf of the load capacitance provided by some microcontrollers I use. Have not had a problem yet.

If by "position" you are referring to the physical position of the capacitors with respect to the crystal, no, it is not important, but remember you will be keeping that oscillator circuitry small and tight to help keep the oscillations clean.
For a Pierce oscillator:

a) If caps are not required, is there a particular reason why there is a cap on each side of the crystal usually of equal value? My guess is that since the inverter contributes 180° of the phase shift, their capacitances cancel out as far as the inverter is concerned..

b) Can you explain how the ESR of the crystal affects the circuit? If my crystal has 30kohm ESR does that mean the inverter sees 30k across it? If so is this while the crystal is / is not oscillating or both?

c) What are the dominating factors that dictate the frequency? From what I can tell it's the load capacitance; would adding random resistance and inductance change the frequency or would they just become another variable contributing to the total phase shift?

#### Bordodynov

Joined May 20, 2015
3,090
See. Icc=1.8 uA, Pxtal=1.5 uW. VCC=5V.

#### DickCappels

Joined Aug 21, 2008
10,068
If caps are not required, is there a particular reason why there is a cap on each side of the crystal usually of equal value? My guess is that since the inverter contributes 180° of the phase shift, their capacitances cancel out as far as the inverter is concerned..

The capacitance is required though they do not need to be discreet components.

b) Can you explain how the ESR of the crystal affects the circuit? If my crystal has 30kohm ESR does that mean the inverter sees 30k across it? If so is this while the crystal is / is not oscillating or both?

No, but maybe somebody else can.

c) What are the dominating factors that dictate the frequency? From what I can tell it's the load capacitance; would adding random resistance and inductance change the frequency or would they just become another variable contributing to the total phase shift?

The way in which the crystal was cut and its thickness are the dominant factors. My experience is that you can't pull them very much perhaps ±75 ppm by changing the load capacitance. Conjecture => Changing the resistor in series will probably not affect frequency very much but it could speed up or slow down the amount of time it takes to come up to frequency when switched on.

#### jpanhalt

Joined Jan 18, 2008
11,087
For a Pierce oscillator:

a) If caps are not required, is there a particular reason why there is a cap on each side of the crystal usually of equal value? My guess is that since the inverter contributes 180° of the phase shift, their capacitances cancel out as far as the inverter is concerned..