Navigation Bar

Article: Crystals

Back to Articles Index

This page is a collection of tips, quantitative thoughts, and qualitative discussion, about quartz crystals (and similar components), and their applications.

 

About IC Oscillators

An internal oscillator's external connections. Atmel ATMEGA324P datasheet, page 31, Figure 6-2.
Internal Oscillator

Usually, OSC_OUT (or in the case of the ATmega pictured, XTAL1) is a CMOS pin, like any other; but unlike any other, it has an unusually weak (and often programmable) output drive strength, and analog feedback to bias it near VDD/2.

This allows it to drive a minimal AC voltage into the crystal, which typically has an impedance on the order of ∼100 ohms, or ∼1.5kohms, or ∼50kohms (depending on series vs. parallel vs. tuning fork crystal types).

The loading capacitors' reactance is always proportional to the crystal's ESR. For example, a 20MHz, 100Ω (ESR) crystal might specify 18pF loading, which means you need two 36pF capacitors, one to ground on either side (as seen by the crystal, they act in series, hence 36/2 = 18pF loading). 18pF is 442 ohms at 20MHz, so the proportion is 4.4 in this case. (The impedance seen by the outside world is about the same proportion higher than this, due to an impedance transformation effect: in this case, 1.94kΩ.) Most crystals will use a similar proportion. This is a good sanity check, but use the datasheet recommendation if available.

Note that actual loading capacitor components are smaller still. The IC pins have capacitance too, which act in parallel with the capacitors. This should be documented somewhere in the IC datasheet. Just subtract that out from each capacitor, then use the result for the physical components, give or take maybe 10 or 20%, nothing terribly picky.

If OSC_OUT (XTAL1) were a full-strength CMOS output, notice the capacitor C1 wouldn't matter, because it would always be pushed around by the much stronger pin. This is almost never done. In fact, though it's rarely documented as such—this is strongly hinted at by the ICs that require an external series resistor (usually around, guess what, 1.5kΩ!) from OSC_OUT to the crystal.

That is, if the IC does not indicate an external resistor, then it has a controlled (weak) pin drive output. If it does require an external resistor, then it is probably a regular CMOS output pin, and could potentially be used and shared as any CMOS clock output pin. (But test it, first. It's probably not documented as such, and could be anything.)

In any case, the other side of the crystal (OSC_IN, sometimes XTAL2) connects to an analog biased Schmitt trigger, which feeds back through the OSC_OUT pin (at whatever drive strength it's designed/configured for). The sensitivity is usually quite good (∼0.1V?), so little power is required to drive the crystal, especially for high impedance types like 32kHz watch crystals.

A small error in the loading capacitors translates to a small frequency error, on the order of 0.01% or so. Which is comparable to the tolerance of most cheap crystals. For both reasons: if you need a precise frequency, you'll need to use a trimmer capacitor for one or both capacitors. If both, adjust them in parallel; if just one, it doesn't really matter which side you pick from.

 

Crystals as Filters

Internal Oscillator

A combined anecdote and little-known-fact about crystals. First the fact, and then the anecdote.

While the dominant mode looks like a series resonant circuit (above), there are numerous other modes present as well. The spurious modes can be represented by other series resonant circuits in parallel with the dominant one. A crystal only looks like its model within ∼10's of kHz of its rated frequency. As misleading oversimplifications go, this can be a dangerous one!

As it happens, the spurious modes are usually clustered above the fundamental frequency. When you look at a plot of response versus frequency, you see a strong peak at the rated (nominal) frequency, followed by lesser peaks at higher frequencies.

The spurious modes have random tempcos, so those peaks tend to drift around, with respect to temperature. If one intersects the nominal mode at some temperature, it will pull the oscillator much more strongly than usual, leading to anomalous frequency error, or it can cause a poor oscillator design to start up on the wrong peak, or follow a lesser peak away from the intended mode.

This all works because the resonator slab is cut at a particular angle (relative to the crystal axis), to minimize the room-temperature tempco of the rated mode. But the others are uncontrolled, and can drift around.

Here are some good starting references:

The main requirement for oscillator applications, is that the spurs be at a lower level (higher ESR, higher insertion loss in a typical filter circuit) than the intended mode. I would guess, for the vast majority of all crystals sold, oscillators are the intended use. I've never seen a datasheet that specified other applications or pertinent data.

The intended mode (the one at the rated frequency) may not be the fundamental or most dominant (least insertion loss) mode. This is important to remember for high frequency oscillators: as far as I know, most crystals above 50MHz are overtone cut. An oscillator using overtone crystals must add an LC resonator around the crystal, to short out the unwanted modes.

It's also important to remember that: a crystal only meets its specifications at its rated frequency. Indeed, there is a very good reason to use the term "overtone" versus "harmonic": the overtones fall at frequencies slightly lower than exact multiples of the fundamental! Evidently, quartz is somewhat dispersive (i.e., velocity varies with frequency). This actually leads to interesting applications, as the fundamental and overtone can be sensed simultaneously (you can run two independent oscillators on the same crystal, using a diplexer filter to isolate them). The two frequencies have different temperature coefficients, so the crystal can be used as its own temperature sensor. The frequency shift might be fed back through a look-up table and varactor diode (variable capacitor), to make a TCXO (temperature compensated crystal oscillator).

So what do spurs look like? I don't have any data or graphs handy, unfortunately, but a qualitative description might at least be good for flavor:

In the course of building my 20m receiver, I got a feeling for the spurs present in the IF filter. Unfortunately I didn't have very many crystals on hand of a given frequency, so it only uses two random everyday 4MHz crystals. This gives a modest "skirt" attenuation (about 40dB after ~10kHz), while the LC resonators give good attenuation at wider offsets (100s of kHz). But what about the spurs at offsets of 20s to 100s of kHz?

Testing with an RF generator (an Eico 322—old fashioned tube tech to complement the radio, eh?) showed that, for a strong and sharp "station" (the generator's output, while a little drifty, is reasonably pure and low jitter), the spurs do indeed come through strongly. Like, within 20dB of the dominant mode. Which is about all you can expect from crystals, from what I've seen—application notes talk about the spurs being typically 6 to 20dB below the dominant mode.

So that kind of sucks, having a passband that's mostly as intended, but with some bumps at higher IF frequencies. But what else is interesting about the spurs is, each one sounds different. That is, some of them are extremely narrow bandwidth: hundreds of Hz! This means the modes have higher ratios of ESR to circuit impedance, but that, in turn, comes from the physics of the modes themselves: stretching and twisting and surface waves, going through and around the crystal and its holders, leading to very different motional impedance and ESR.

In any case, the "sound" of most spurs is simply the sound of a narrower bandwidth. The setup to this is kind of amusing: the Eico 322 uses an air variable capacitor, so it is sensitive to vibrations. Rapping on its box, a DONGGggg sound is heard from the receiver: a mixture of AM and FM in the output, caused by the many mechanical resonances of the enclosure and the air-variable capacitor within. When tuned to the normal passband, it sounds about the same as it does through the air: not terribly loud or anything, and recognizably the same sort of "dong". However, when tuned to the center of a spur, only the lowest thud is heard. When tuned off-center, the pitch varies with offset, as you hear different parts of the clang being bandpassed. It's something like listening to a familiar sound through a huge length of pipe; except, the pipe exhibits periodic frequency notches, while this is a single passband.

It's remarkable to think about such narrow bandwidths. The quartz crystal is physically shaking for whole tens of milliseconds, making hundreds of thousands of cycles before decaying away. There aren't many other things, electrical or physical, which have such a high Q factor. I would hate to have to construct such a sharp filter using RLC components at audio frequencies. It's probably equivalent to a 6th order (maybe more) bandpass, which is tough enough—but thanks to hetrodyne action, the center frequency is also adjustable from 0Hz (i.e., a regular lowpass) to 10s of kHz. A filter, with that kind of bandwidth and adjustable range, is a challenge otherwise!

 

Filter Design

Again, I don't have quantitative information under this heading, but some discussion. A good starting point for the design of crystal filters is WA5BDU, Crystal Characterization and Crystal Filter Design. The general approach is to construct a bandpass filter, replacing the LC resonators with crystals. Now, in the traditional implementation, a bandpass filter uses alternating series and parallel LC resonators. We can make the network all-series by applying a series-parallel transformation. This only works over a narrow bandwidth, but guess what kind of a filter this is? Just like that, a bandpass crystal filter is simply a series chain of crystals, with parallel 'loading' capacitors to ground. The loading capacitor values will be typical of the crystal's load specification (for the same reasons already discussed!). Because the loading capacitors double as impedance transformers, they are the components you adjust to control filter flatness and balance. Just as varying the coupling constant between (traditional) resonators varies the flatness of the filter.

The downside is, the center frequency changes with the loading capacitors. The crystals probably won't be perfectly matched anyway, so you'll usually build one of these with series capacitors, which allows you to slightly tweak the resonant frequencies. You need to vary both capacitors, series and parallel, at the same time, to keep resonant frequency constant while varying coupling to get the desired response.

 

Back to Articles Index

 

Copyright Notice