Get in touch

Verification of the Crystal Oscillator (3/3)

Hardware

7 mins read

Introduction

 

In our previous blogs, we’ve covered the aspects of the oscillator design with

 

Now, when we have our prototypes manufactured, it’s time to test and verify all important aspects of our oscillator.

 

What do we need to verify in the oscillator design?

 

Once the design has been done and the prototypes are manufactured, it’s time to validate the oscillator design. The points that need to be validated are listed and analyzed in the following sections.

 

Frequency accuracy

 

The first step is to validate the frequency accuracy. This is done by measuring the actual frequency and modifying the load capacitors to trim the frequency to the exact desired (depending on available instruments, the accuracy of up to ±1 ppm is possible). What is important to note is that both the crystal and the load capacitors have their manufacturing tolerance, so this procedure needs to be conducted on at least 3 modules, preferably 10.

 

Depending on the oscillating frequency, the measurement setup will vary, however, the idea is the same – take your N (N being a number between 3 and 10) freshly manufactured prototypes and measure the oscillation frequency. If the frequency is too high, decrease the load capacitors (for the sake of simplicity, keep their values equal). If the frequency is too low, increase them.

 

The key is to find an optimal value of load capacitors so that all N prototypes have an oscillation frequency as close as possible to the ideal one (while using the same load capacitors). The greater the N number, the better. The reason for doing this on N modules is to eliminate the crystal manufacturing tolerance (i.e. initial frequency accuracy). Of course, the capacitors for this purpose should have a tight tolerance with C0G dielectric. The alternative to the measurement of N modules is to use the reference crystal. This is the crystal that you need to specifically order from the crystal manufacturer.

 

What is special about this crystal – the manufacturer validated that by using the exact rated load capacitance, this crystal will have exactly the nominal oscillation frequency. In other words, this crystal has zero initial frequency tolerance.

 

Multiple measurement setups are possible. What is important to note at the beginning of this discussion is how not to measure it. Do not measure it by probing the crystal or load capacitors directly. No matter how low capacitance your probe is (most likely it has at least 0.5pF of capacitance, possibly up to 10 times more), this will add a load capacitance to the crystal and influence the oscillation frequency.

 

What you can always do (but involves a firmware intervention) – configure a digital output pin to output the oscillator frequency and measure it with a frequency counter. Some MCUs have digital “master clockout” pins that can be configured to directly output the oscillator frequency (for example STM32s). If you don’t have this possibility, you can configure the digital pin as the timer output (and configure the timer to use oscillator as the input). Frequency counters are devices that easily have the accuracy of ±1 ppm or even better.

 

If you prefer HW-only approach, you can use EMI near field probe (use one for E-field) and a spectrum analyzer. Simply locate a near field probe near the crystal while it oscillates (you might still need the FW to initialize the oscillator). Spectrum analyzers also have a frequency accuracy typically in the range of ±1 ppm. Just make sure you use a resolution bandwidth (RBW) filter of approximately 10-100Hz so you can achieve a fine resolution to determine the frequency (start with wider RBW and frequency span, locate the measured frequency on the center of the span and gradually decrease both span and RBW).

 

Near field probe has a negligible influence on the crystal loading. An example of near field probes set can be seen in the figure below.

Figure 1. Near field probes set (https://www.emcfastpass.com/test-equipment/shop/near-field-probes/near-field-probe-set/)

 

If your budget is tight and you don’t have near field probes at hand, you can simply make your own with a piece of wire or a metal surface (any metal surface will detect an electric field). Just connect the metal surface or wire on the center conductor of coaxial cable with SMA, SMB or similar desired connector and plug it in the spectrum analyzer.

 

This approach will measure the MHz-range frequencies. However, it is not suitable for lower frequency oscillators (e.g. 32768 Hz for RTC). For these oscillators it is recommended to measure the frequency via digital output pin (as discussed above).

 

Crystal drive level

 

As we mentioned in the previous blog, drive level is the amount of power dissipated in the crystal. The typical and maximum drive level ratings are listed in the crystal datasheet (in µW or mW). The drive level that is too high can result in a degraded oscillator lifetime and in critical situations even mechanical damage to the crystal.

 

We recommend measurement of the drive level on the crystal in two main ways – by inserting the current probe in series with the crystal or by measuring the voltage on the load capacitor at the amplifier input. Theoretical background of both ways is explained very well in STMicroelectronics AN2867 [6], so you can look it up if you are missing the mathematical evidence for this method.

 

Here at Byte Lab, we prefer the second method – measurement of the voltage at the amplifier input via the low capacitance probe (typically 0.5 pF). Make sure your oscilloscope and probe bandwidths are well above the measured frequency. With this voltage value and the crystal parameters, you can easily calculate the drive level on your crystal. For lower frequency oscillators, this will probably be in the range of a couple of microwatts. For higher frequency oscillators (above MHz), this will be in the range of a couple of milliwatts. If the calculated drive level is below the crystal rated level, you are good to go. If it is too high, increase the external drive level limit resistor. After increasing the value of resistor, repeat the measurement process. Repeat this until the drive level is below the recommended level for crystal. Again, STM32 microcontrollers are convenient here for the low-frequency (LSE) oscillators, because the drive level can be configured in multiple steps via firmware, without any need for an external resistor.

 

It is important to proceed to the next step (safety factor measurement) after the drive level has been validated (by using the suitable external resistor).

 

Safety factor

 

A common test for oscillator stability is a safety factor determining test. Basically, this test tells us how many times the crystal’s ESR can be increased before the oscillator will fail to drive the oscillation frequency to its system.

 

How this can be done – unsolder the crystal and solder it on only one pad (or one row of pads if this is 4-pad package). This will enable you to insert the resistor (or trimmer resistor) in series with the crystal itself.

 

The schematic of the obtained circuit can be seen in the figure below.

Figure 2.Safety factor measurement schematic; source: STM AN2867 [6]

 

Start the procedure with zero ohms resistors and validate that upon power up, the oscillator can start the oscillations. If it succeeds, power the module down and increase the resistance (typically in increment of appr. The crystal ESR). Validate it can start up the oscillations  again. Repeat this procedure until the oscillator can’t start the oscillations.

 

Once you determine the value with which the oscillator can’t start up, bring back the trimmer to the maximum value with which it can start. Measure the value of the trimmer resistance and finally calculate the safety factor using the equation below.

 

If the safety factor of your oscillator is equal to or higher than 5, you are good to go! If it is not, it may be necessary to rethink the crystal choice and go through the complete verification process once again.

 

Good luck!

 

Literature

1. AN2867: Oscillator design guide for STM8AF/AL/S, STM32 MCUs and MPUs, STMicroelectronics