CRYSTAL OSCILLATOR

Photo of author

By Jackson Taylor

Home » Hardware » CRYSTAL OSCILLATOR

As an Amazon Associate we earn from qualifying purchases.

A crystal oscillator gives a microcontroller or other digital circuit a steady clock signal. The clock sets how fast the chip runs instructions and how accurately it keeps time for things like serial communication. This page explains what the common crystal frequencies are used for and how to choose and connect one. It also lists the crystals we have: 3.579 MHz, 4 MHz, 11.0592 MHz and 16 MHz.

What a crystal oscillator does

A quartz crystal is a thin slice of quartz that vibrates at a very precise frequency when voltage is applied. That frequency depends mainly on how the crystal is cut and its size. Because the vibration is so stable, a crystal is much more accurate than a simple resistor-capacitor (RC) timing circuit.

In everyday use, the word “crystal” and the phrase “crystal oscillator” are often mixed up:

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video
  • A bare crystal has two leads. It needs an inverting amplifier to start vibrating, and most microcontrollers have one built in on their clock pins.
  • A complete crystal oscillator module has the crystal and the driving circuit in one package. It usually has four pins (power, ground, output and sometimes enable) and puts out a ready-made clock signal.

The items listed below are crystals for microcontroller boards, so you connect them to the chip’s oscillator pins.

Crystals in stock

The listing below shows the frequency, the listed price and the quantity remaining for each crystal. The price is shown as it appeared in the original listing, without a currency. Stock levels change, so confirm availability before you plan an order.

3.579 MHz

3.579 Mhz crystal

PRICE—6

QUANTITY REMAINING—40

4 MHz

4 MHz crystal

PRICE—6

QUANTITY REMAINING—20

11.0592 MHz

11.0592 MHz crystal

PRICE—6

QUANTITY REMAINING—80

16 MHz

16 MHz crystal

PRICE—6

QUANTITY REMAINING—400

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works

What each frequency is used for

3.579 MHz

This frequency is closely tied to analog television. The NTSC color subcarrier is 3.579545 MHz, so crystals at this value were made in very large numbers and are cheap and easy to find. Hobbyists use them in tone-generation and timing projects. They are also used in some DTMF (touch-tone) circuits, where this clock frequency is a common choice. Always check the datasheet of the chip you are using before relying on it.

See also
Sepic converter with MPPT for battery charging from solar panel

4 MHz

A 4 MHz crystal is a general-purpose choice for small microcontrollers and simple logic projects. It gives a round, easy-to-calculate clock. Some chips can also multiply a 4 MHz input internally with a PLL to reach a higher system speed.

11.0592 MHz

This is the classic crystal for the 8051 family. It looks like an odd number, but it divides cleanly into standard serial baud rates. With the 8051’s UART, an 11.0592 MHz clock produces exact baud rates such as 1200, 2400, 4800 and 9600 with zero error. A clock like 12 MHz gives rates that are slightly off, which can cause garbled characters at higher speeds.

On a classic 8051 with Timer 1 in 8-bit auto-reload mode and the baud-rate doubling bit off, a reload value of 0xFD gives 9600 baud at 11.0592 MHz. The same crystal is also popular in other designs that need accurate UART timing.

16 MHz

A 16 MHz crystal is common on AVR-based boards and many Arduino-compatible designs. It lets the chip run at a higher speed than 8 MHz or lower options while still working at standard 5 V logic levels. It is also widely used in bare-chip builds, where you put a microcontroller on a breadboard with its own clock.

How to choose the right crystal

  1. Check the chip’s datasheet. It lists the supported clock range and any recommended crystal values.
  2. Decide if you need accurate serial timing. If you use a UART with an older chip, pick a frequency that divides evenly into your baud rate, such as 11.0592 MHz.
  3. Match the load capacitance. Crystals are specified for a certain load capacitance, often given in picofarads (pF). The capacitors in your circuit should be chosen to match it.
  4. Think about accuracy. Crystal accuracy is usually given in parts per million (ppm). For most hobby projects the typical tolerance is fine.
  5. Check the package. Make sure the size and lead style fit your board or breadboard.
See also
THREE-PORT FULL-BRIDGE CONVERTERS WITH WIDE VOLTAGE RANGE INPUT FOR SOLAR POWER SYSTEMS

How to connect a crystal to a microcontroller

A bare crystal connects between the two oscillator pins of the chip, often labeled XTAL1 and XTAL2 or OSC1 and OSC2. Each pin also gets a small capacitor to ground. Values in the range of roughly 12 pF to 33 pF are typical, but the correct value depends on the crystal’s load capacitance and the board’s stray capacitance, so follow the datasheet.

  • Place the crystal and capacitors as close to the chip as you can.
  • Keep the traces short and away from noisy signals.
  • Connect the capacitor grounds directly to the chip’s ground.
  • On microcontrollers with configurable clock sources, make sure the fuse or configuration bits select an external crystal. If they do not, the chip will not use it.

Troubleshooting a crystal that will not start

If the circuit does not run, the cause is usually simple. Check that the clock source setting matches an external crystal. Check the capacitor values and the wiring. Also check for long wires or a poor breadboard contact, which can stop a crystal from oscillating. An oscilloscope on the oscillator pin will show whether it is running, though the probe’s own capacitance can disturb the signal.

FAQ

Why is 11.0592 MHz used instead of 12 MHz?

Because 11.0592 MHz divides evenly into standard baud rates, serial communication on chips like the 8051 runs without timing error. A 12 MHz clock does not divide evenly, so the resulting baud rates are slightly off.

Can I use a 16 MHz crystal in place of a 4 MHz one?

Only if the microcontroller supports that clock speed. Check the datasheet for the maximum frequency and for any change needed in the clock settings. Your program’s timing, such as delays and baud-rate calculations, will also change.

Do I always need capacitors with a crystal?

Most bare crystals used with microcontrollers need two load capacitors. Some chips have them built in, and complete oscillator modules do not need them at all. The datasheet will tell you which applies.

See also
BI POLAR STEPPER MOTOR CONTROL USING ARDUINO AND L293D

What is the difference between a crystal and a crystal oscillator?

A crystal is just the quartz component and needs a driving circuit. A crystal oscillator is a complete unit that includes that circuit and outputs a clock signal on its own.

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works