Every microcontroller system incorporates a crystal oscillator, which plays a crucial role. In conjunction with the internal circuitry of the microcontroller, it generates the necessary clock frequency for the microcontroller. The execution of all instructions by the microcontroller is based on this clock frequency. The higher the clock frequency provided by the crystal oscillator, the faster the microcontroller operates.
A crystal oscillator operates in a resonant state using a crystal capable of converting electrical energy and mechanical energy into each other, providing stable and precise single-frequency oscillation. Under normal operating conditions, the absolute frequency accuracy of an ordinary crystal oscillator can reach up to 50 parts per million. Advanced models have even higher accuracy. Some crystal oscillators can also adjust their frequency within a certain range by applying an external voltage, known as a voltage-controlled oscillator (VCO).
The function of a crystal oscillator is to provide the basic clock signal for the system. Typically, a system shares a single crystal oscillator to facilitate synchronization among its various components. In some communication systems, the baseband and radio frequency use different crystal oscillators, but they maintain synchronization through electronic frequency adjustment methods.
Crystal oscillators are typically used in conjunction with phase-locked loop circuits to provide the clock frequency required by the system. If different subsystems require clock signals of different frequencies, different phase-locked loops connected to the same crystal oscillator can be used to provide them.

AC equivalent oscillating circuit; the actual crystal oscillator AC equivalent circuit is shown in Figure 1b, where Cv is used to adjust the oscillation frequency, typically achieved by using a varactor diode with different reverse bias voltages, which is also the mechanism of voltage control; substituting the crystal with its equivalent circuit is shown in the figure. Where Co, C1, L1, and RR are the equivalent circuit components of the crystal.
By analyzing the entire oscillating tank circuit, it can be seen that using Cv to change frequency is limited: the entire tank circuit capacitance C that determines the oscillation frequency is the series combination of Cbe, Cce, and Cv, which is then connected in parallel with Co and in series with C1. It can be observed that the smaller C1 is, the larger Co becomes, and the smaller the effect of Cv changes on the entire tank circuit capacitance. Therefore, the frequency range that can be "voltage-controlled" is also smaller. In practice, since C1 is very small (on the order of 1E-15), Co cannot be ignored (on the order of 1E-12, several picofarads). Therefore, when Cv becomes larger, the effect of reducing the tank circuit frequency becomes increasingly smaller, while when Cv becomes smaller, the effect of increasing the tank circuit frequency becomes increasingly larger. This aspect causes nonlinearity in the voltage-controlled characteristics; the larger the voltage-controlled range, the more severe the nonlinearity. On the other hand, the feedback voltage (voltage on Cbe) allocated to the oscillation becomes smaller and smaller, eventually leading to oscillation stoppage. You should have a general understanding of the role and working process of a crystal oscillator through the schematic diagram of the crystal oscillator. The higher the overtone order of the crystal oscillator used, the smaller its equivalent capacitance C1; therefore, the range of frequency variation is also smaller.
The clock sources for microcontrollers can be categorized into two types: those based on mechanical resonant devices, such as crystal oscillators and ceramic resonant tank circuits, and RC (resistor-capacitor) oscillators. One type is the Pierce oscillator configuration, which is suitable for crystal oscillators and ceramic resonant tank circuits. The other type is a simple discrete RC oscillator.
The method to measure whether a crystal oscillator is working with a multimeter is as follows: measure whether the voltage between two pins is half of the chip's operating voltage. For example, if the operating voltage is +5V for a 51 microcontroller, check whether the voltage is around 2.5V. Additionally, if touching another pin of the crystal with tweezers causes a significant change in this voltage, it indicates that the crystal has started oscillating.
The types of crystal oscillators include SMD and DIP, namely surface-mount devices (SMD) and dual in-line package (DIP) types.
First, let's talk about DIP: Commonly used sizes include HC-49U/T, HC-49S, UM-1, UM-5, all of which are measured in MHZ units.
Regarding SMD, there are types such as 0705, 0603, 0503, and 0302, which are further categorized into those with four solder points and those with two solder points. For our company, the default is the ones with four solder points. Materials for those with two solder points require importation, which has a longer cycle time. Generally speaking, we cannot produce those with two solder points. (Transferred from Electronics World, Captain Demons)