Crystals
Home Up HD44780 I2C Address I2C Connector Crystals Logic Translate DC Supply Compatibility Load Cell

 

Clock oscillator options

Typical options

  • On chip oscillator, external crystal
  • External oscillator module
  • Crystal and logic gate oscillator
  • Crystal and transistor oscillator
  • Crystal and oscillator IC oscillator

On Chip oscillator, external crystal

In my opinion this is an easy option for crystals below 10MHz and devices using the single inverter "Pierce" configuration. 

It is certainly the cheap option if only a single IC needs a clock or if the IC has a facility to output derived clocks. 

I would advise against trying to share a crystal, with some devices you may get away with connecting Xout of one device to Xin of another but the extra loading may affect the oscillation.

Some care should be taken in layout. Most good datasheets give guidelines but generally the connections must be short, kept away from strong signals and the loading capacitors should return to a ground pin on the same IC. Be aware that PCB layout tools may take the grounds to any nearby ground track and the resulting loop may affect performance. In a few rare cases the loading capacitors need to return to the positive rail not ground.

Above 10MHz you should pay more attention to design guidelines and above 20MHz things will get more complicated as you may have to consider "third overtone" crystals. The dividing line is changing as manufacturing technology improves and smaller thinner crystals can achieve higher fundamental frequencies which is helpful as overtone designs are more work..

Using an overtone crystal you need to suppress its fundamental resonant frequency. The simplest way is to use a feedback resistor with a lower than normal value as at some value the oscillation will switch from fundamental to overtone, but an oscillator using this method may change frequency unexpectedly. It may switch back to the fundamental frequency at low temperature. It may even jump to a higher overtone.

A more reliable way to use overtone crystals is to add some form of LC circuit to select the desired oscillation mode.

If you are using an overtone crystal in a mass-production design I would strongly advise you contact the crystal manufacturer and get them to perform compatibility tests on your actual hardware to avoid surprises in production. 

Another observation I'd make about crystals is that I would strongly recommend checking whether the crystal-to-can capacitance has any influence on the circuit. It shouldn't, but some oscillators may show sensitivity to touching the can. It is sometimes worth grounding the can even though strictly speaking the crystal is a two-terminal device.

I've probably been "spoiled" in that while working with Microchip PIC devices I can't recall a case of an oscillator not running. These crystals would have been in the range of 2.45MHz to 8MHz and I always just used the minimum configuration of just the crystal and two loading caps.

I have limited experience of 32.768kHz devices but years ago I used an ADC that required a 32.768kHz crystal clock and I don't remember any issues until I moved to an external oscillator IC at which point I ran into some odd starting issues. Ultra-low-power oscillators can take several seconds to stabilise, and some on-chip oscillators may have insufficient gain to work with some crystals.

External oscillator module

This is definitely the safe option. The oscillator is guaranteed to run at its specified frequency. There is a penalty to pay, the oscillator may be 5-10 times the cost of the crystal.

A benefit of an oscillator is it produces a strongly buffered signal that can be distributed to multiple parts.

Another benefit, particularly with sub-10MHz frequencies, is that the oscillator module may be much smaller than the crystal solution. This is due to the module using a higher frequency internal oscillator divided down to its designated frequency. The higher internal frequency allows use of a smaller internal crystal.

The module also avoids the need for special placement of parts close to the microcontroller since the sensitive crystal connections are inside the oscillator, and only the well buffered output connects to a pin. It is unlikely to be influenced by nearby data lines.

An oscillator may also be helpful in prototyping when a microcontroller is fitted to a footprint adapter or some other non-optimal connection. The presence of an adapter between the IC and crystal may degrade the performance of the IC's on-chip oscillator, but using an external oscillator module avoids this.

For frequencies above 20MHz I would recommend using an oscillator module unless one of the following is true:

  • You are a hobbyist who doesn't mind fiddling a bit and you have the tools to diagnose a non-starter
  • You are mass-producing and are prepared to carry out the level of margin testing needed to verify that the crystal will always work

Failure to carry out margin tests may leave you with either a completely unresponsive project or a pile of production rejects. For small-volume manufacturing the certainty an oscillator module gives is usually worth the extra cost.

32.768kHz oscillator modules do exist, but they are unusual. Where you need absolute minimum current drain driving the IC input from an external oscillator circuit or module may give lower power consumption than using an on-chip oscillator. The external oscillator can use dedicated analogue parts rather than misusing a CMOS inverter. Using the inverter as an oscillator will effectively operate it in class A, whereas driving the inverter from an external source keeps it fully high or low with minimal transition time.

An ultra-low-power 32kHz oscillator can take a substantial time to start, sometimes over a second.

Crystal and logic gate oscillator

Three parts strongly stand out as candidates for building oscillators owing to them containing single un-buffered gates:

The 74HCU04 has the same configuration as the 74HC04 hex inverter but un-buffered. Normally a CMOS inverter would actually be three inverters cascaded inside the IC for higher gain. In the HCU04 each inverter is just the two FETs, making it possible to bias into its linear region. It will require a feedback resistor to bias it correctly otherwise your circuit will be dependent on leakage currents for correct operation. If you fail to bias it you may end up with a design that requires a layer of dirt under the crystal to complete the circuit.

The 74LVC1GX04 is an un-buffered inverter and a buffered inverter in the same transistor-size package, well suited for building logic-gate oscillators. Just like the 74HCU04 It will require a feedback resistor. 

The CD4007UBE is far more interesting and its datasheet only touches on its potential. It isn't so much a logic IC, rather it is six complimentary MOSFETS with some interconnections. It is well suited to making low speed ultra low power oscillators, Unfortunately many of the designs were in various print publications years ago and are not easy to find now.

The general principle of 4007 oscillators is to run one gate in a "starved" configuration either by using source resistors or using a single unbalanced FET with a very high value drain load resistor. The resistors suppress the "shoot-through" current when the gate is in its "linear" region. The weak output of this gate is usually then buffered by the two remaining gates.

Counter oscillator

The 74HC4060 "14 stage binary ripple counter" has a logic gate oscillator suitable for use with a crystal or an RC network. It has a niche use for producing binary fractions of a crystal's frequency and is sometimes seen in RS232 interface circuits.

Crystal and transistor oscillator

I have encountered these circuits as radio frequency sources. Even the low frequency designs can be difficult to set up and may need handcrafted inductors. A 168MHz design had to be fitted in a shielding can. Also expect to need a buffer with high isolation to prevent "load pull".

If you believe that the Colpitts oscillator is somehow inherently superior to Pierce I would advise reading https://www.maximintegrated.com/en/app-notes/index.mvp/id/5265 where it is shown that in AC terms once you ignore how DC is fed in they are almost the same circuit.

More specifically it shows that to convert between them all you do is move the AC ground point. Grounded Emitter: Pierce, Grounded Collector: Colpitts. The Crystal and capacitors stay in the same place, and both designs expect the crystal to supply a positive Z to offset the negative Z of the capacitors.

Crystal and oscillator IC oscillators

  • SN74LVC1GX04
  • MAX2620 is clearly intended as a RF IC for use with a varactor tuned LC resonator, but the datasheet also shows a crystal circuit.