Circuit designs with crystals and layout of digital clock lines

AI Thread Summary
Designers determine shunt capacitor values for crystals based on the total load capacitance specified for the crystal, typically ranging from 18pF to 47pF, which includes the capacitors on the PCB and the input capacitance of the IC pins. External resistors are used to optimize oscillator performance, with series resistors preventing overcurrent and parallel resistors maintaining the inverter gate's linear region. For digital clock signals, maintaining spacing between traces and proximity to ground minimizes crosstalk, and using a serpentine layout helps manage propagation delay while avoiding vias that disrupt impedance. Termination strategies vary, with back termination at the drive gate's output pin being more common due to power constraints. Overall, empirical adjustments are often necessary for reliable oscillator performance, especially with lower frequency watch crystals.
TheAnalogKid83
Messages
174
Reaction score
0
I have two different types of questions regarding crystals and clocks. I can't remember if I've asked these question before. I'd appreciate any input on this topic.

Crystal external circuitry:

Almost any IC with an external crystal has two pins to connect to it. Now my question is how do the designers determine if they should use shunt capacitors from the crystal traces to ground, and also how do they determine what values to use? I see typically 18pF to 47pF. Also how do they determine if they should use a load resistor parallel to the crystal and how do they determine what value to use? I have seen values between 1M Ohm and 5M Ohm. Are they figuring some kind of RC constant with this? I have gotten lucky and seen reference designs or some data sheets specifying what to do (not all do though), but how do they come up with these values?


Digital Clock signals:

My high speed digital design book says to provide extra gap spacing between adjacent traces to my clock signals. They also say to keep as close to ground as possible. This helps kill cross talk. Is it too much to try to carve your clock trace through an internal ground plane, or does that screw with the impedance too much and create loop currents by disrupting the ground plane? Also, is it better to use load resistors at the receiving circuits to terminate clock signals in order to match trace impedance, or is it better to use a series termination resistor at the clock source IC pin, or both? Finally, I've looked at very high speed clock traces on some example boards, and the traces seem to actually be layed out physically in a square-wave geometry (it zigzags on the board). What is the purpose of this and the reasoning behind it? My guess would be it is done just to give it length for propagation delay, but I'm curious if there is a more physics/transmission line type explanation.
 
Engineering news on Phys.org
TheAnalogKid83 said:
I have two different types of questions regarding crystals and clocks. I can't remember if I've asked these question before. I'd appreciate any input on this topic.

Crystal external circuitry:

Almost any IC with an external crystal has two pins to connect to it. Now my question is how do the designers determine if they should use shunt capacitors from the crystal traces to ground, and also how do they determine what values to use? I see typically 18pF to 47pF. Also how do they determine if they should use a load resistor parallel to the crystal and how do they determine what value to use? I have seen values between 1M Ohm and 5M Ohm. Are they figuring some kind of RC constant with this? I have gotten lucky and seen reference designs or some data sheets specifying what to do (not all do though), but how do they come up with these values?

The crystal has been tuned to be on-frequency for some load capacitance (for a parallel resonant oscillator architecture, which is the most common for uCs). So your circuit should use parallel capacitors that match the total parallel load capacitance that the crystal is tuned at the factory for. If you specify an 18pF parallel resonant crystal, then the sum of the two parallel capacitors on your PCB plus the sum of the input capacitances of the two uC pins, should add up to the parallel capacitance value of the crystal spec.

The external resistor values (if any) come from optimizing the performance of the oscillator circuit in the uC. If there is a series resistor specified (typically in the 200-300 Ohm range), that is to help prevent early aging of the crystal due to overcurrent drive by the oscillator. If there is a parallel resistor specified (typically in the 100k to several MegOhm range), that is to help keep the oscillator inverter gate in the linear region. If the uC is meant to work mainly with one frequency crystal, these external resistors and caps are generally pulled inside the chip, to save overall cost. If the uC is meant to allow different values of crystal frequencies, then these parts will generally be external, with different values based on the frequency.


TheAnalogKid83 said:
Digital Clock signals:

My high speed digital design book says to provide extra gap spacing between adjacent traces to my clock signals. They also say to keep as close to ground as possible. This helps kill cross talk. Is it too much to try to carve your clock trace through an internal ground plane, or does that screw with the impedance too much and create loop currents by disrupting the ground plane? Also, is it better to use load resistors at the receiving circuits to terminate clock signals in order to match trace impedance, or is it better to use a series termination resistor at the clock source IC pin, or both? Finally, I've looked at very high speed clock traces on some example boards, and the traces seem to actually be layed out physically in a square-wave geometry (it zigzags on the board). What is the purpose of this and the reasoning behind it? My guess would be it is done just to give it length for propagation delay, but I'm curious if there is a more physics/transmission line type explanation.

To use a forward termination (Zo at the destination), you need a lot of power by the drive gate. Just do the math to figure out how much current it takes to drive Vih and Vil into a full split forward termination of 75 Ohms or so, and compare that to typical digital logic gate Iout capability. Lot of power. So, it is more typical to back terminate (with R = Zo - Rout of the drive gate) right at the drive gate's output pin. The serpentine pattern you observe is generally used to keep the clock trace on one outer layer of the PCB, on the side just above the ground plane (not the power plane). You do not want to use vias on a clock trace, because that disrupts the clean Zo that you want to present for the clock transmission line. That's the reason you wouldn't want to bury the clock line -- that would require a via to bury it, and more vias to tap into it. It would also cut the ground layer as you say, which would be a bad thing (for this application).
 
For run of the mill crystals, I've never had much problem just using the suggested values for capacitors in the databook.

For watch crystals at 32,768Hz, it's a whole different game...

I spent about an hour or so getting a PIC to run with a 32kHz xtal (it required 68pF caps), and even longer getting a 4060 to oscillate reliably with one...

For the 4060 it was a case of adjusting capacitor values and the series & shunt resistor values until the thing started reliably and didn't stop oscillating after a while. All very empirical.
 
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
I have recently moved into a new (rather ancient) house and had a few trips of my Residual Current breaker. I dug out my old Socket tester which tell me the three pins are correct. But then the Red warning light tells me my socket(s) fail the loop test. I never had this before but my last house had an overhead supply with no Earth from the company. The tester said "get this checked" and the man said the (high but not ridiculous) earth resistance was acceptable. I stuck a new copper earth...
Thread 'Beauty of old electrical and measuring things, etc.'
Even as a kid, I saw beauty in old devices. That made me want to understand how they worked. I had lots of old things that I keep and now reviving. Old things need to work to see the beauty. Here's what I've done so far. Two views of the gadgets shelves and my small work space: Here's a close up look at the meters, gauges and other measuring things: This is what I think of as surface-mount electrical components and wiring. The components are very old and shows how...
Back
Top