The invention discloses a digital temperature compensation method of a
crystal oscillator, wherein a closed-loop feedback compensation framework is adopted. According to the method, a binary coding B0i corresponding to a target frequency f0 is determined and stored in a
microprocessor. When the temperature changes, the
microprocessor conducts real-time measurement on the output frequency of a VCXO to generate a binary code B1i. Meanwhile, the
microprocessor compares with the above binary code B1i with a binary code corresponding to the target frequency to obtain a binary code of the needed compensation information. Finally, the binary code of the needed compensation information is converted into a compensation
voltage through a digital-to-analog converter to be input to a
voltage-controlled adjusting end of the VCXO. Therefore, the target frequency is output, and the temperature compensation is achieved. Compared with a digital temperature compensation method of an existing
crystal oscillator, the above digital temperature compensation method does not need any temperature sensor. Meanwhile, the
frequency deviation related to the temperature in real time is directly converted into a binary code which is in one-to-one correspondence with the temperature. Moreover, the binary code is converted into a corresponding compensation
voltage for temperature compensation. Therefore, the temperature
hysteresis problem caused by the fact that the temperature change of a temperature sensor and the temperature change of a
crystal resonator are not synchronous in an existing temperature compensation
crystal oscillator (TCX0) is overcome.