The core principle of changing the frequency of a programmable crystal oscillator is to perform precise mathematical operations (frequency division, frequency multiplication, fractional frequency division) on the fixed frequency generated by the basic quartz crystal through an internally integrated phase-locked loop (PLL) and digital frequency division/multiplication circuit, and finally output a target frequency programmed by the user through a digital interface (such as I²C, SPI).
The following are the detailed steps and principles:
1. Basic frequency source:
The core is still a high-quality quartz crystal oscillator (usually operating at a relatively low fixed frequency, such as 10 MHz, 20 MHz, 25 MHz, 50 MHz, etc.). This frequency is very stable and accurate (the accuracy is usually ±10~±50 ppm), but it is fixed.
2. Phase-locked loop:
· A key circuit, the phase-locked loop, is integrated inside the programmable crystal oscillator.
· Basic working principle of PLL:
· Voltage-controlled oscillator: generates a high-frequency output signal.
· Phase/frequency detector: compares the output frequency of the VCO (after frequency division) with the reference frequency (from the basic crystal oscillator).
· Charge pump and loop filter: Convert the error signal output by the detector into a smooth voltage signal.
· Feedback divider: Divide the high output frequency of the VCO by a programmable integer N to obtain the feedback frequency.
When the PLL is locked, the output frequency Fvco of the VCO satisfies: Fvco = N * Fref. Here Fref is the frequency of the basic crystal oscillator.
3. Frequency synthesis (frequency division and frequency multiplication):
The core function of the PLL is to use the basic frequency Fref to synthesize a new, higher frequency Fvco = N * Fref. N is an integer (frequency multiplication factor) that can be set by programming.
Output divider:
Usually, the frequency of Fvco is much higher than the final required output frequency Fout.
Therefore, there are one or more programmable output dividers at the output of the PLL (after the VCO).
These dividers divide Fvco by a programmable integer M to obtain the final output frequency: Fout = Fvco / M = (N * Fref) / M.
Fractional frequency division:
In order to obtain finer frequency steps (much smaller than Fref), modern high-performance programmable crystal oscillators generally use fractional-N PLL technology.
Based on the integer divider N, the division ratio can be quickly switched between N and N+1 in a certain ratio. For example, the average division ratio can be N + F/K (where F and K are integers).
This allows the output frequency to be expressed as: Fout = (N + F/K) * Fref / M.
F and K are also parameters that can be set by programming. K is usually large (such as 2²⁴), so that the fractional part F/K can be very small, thereby achieving extremely fine frequency resolution (such as 0.1 ppm or less).
4. Programming interface:
· The user communicates with the registers inside the programmable crystal oscillator through a standard digital interface (most commonly I²C or SPI).
· The manufacturer provides a programming guide or configuration software, and the user only needs to enter the desired target output frequency Fout.
· The microcontroller or state machine inside the crystal oscillator automatically calculates the optimal frequency division/multiplication coefficient combination (N, M, F, K, etc.) based on Fout, the base frequency Fref, and the limitations of the internal circuit.
· The user writes these coefficient values into the corresponding configuration registers inside the crystal oscillator through the interface.
5. Output drive:
The synthesized and divided signal passes through the output buffer/drive circuit and is converted into a clock signal output with standard level (such as LVCMOS, LVDS, HCSL, etc.) and drive capability.
Summary of key points:
· Basic fixed frequency: The core is a stable but fixed quartz crystal oscillator.
· Mathematical transformation: Use programmable PLL (integer/fractional division) and output divider to perform precise multiplication and division operations on the basic frequency.
· Formula: Fout = (N * Fref) / M (integer mode) or more refined Fout = ((N + F/K) * Fref) / M (fractional mode).
· Digital control: The user sets the target frequency Fout through the I²C/SPI interface, and the crystal oscillator automatically calculates and sets the internal parameters N, M, F, K.
· Flexibility: By changing these digital parameters, almost any desired output frequency (with a resolution of up to ppb level) can be generated within the frequency range supported by the crystal oscillator without changing the physical crystal.
· Additional functions: Many programmable crystal oscillators also integrate other programmable functions, such as output level selection, enable/disable control, spread spectrum modulation (SSM), etc., which are also configured through the same interface.
Therefore, programmable crystal oscillators do not physically change the vibration frequency of the quartz crystal itself (that is the principle of VCXO), but use complex digital frequency synthesis technology to "convert" the fixed crystal frequency into any target frequency required by the user.