A microcontroller for temperature-compensated quartz crystal oscillator and its use method
By integrating components such as voltage regulators and temperature sensors into the microcontroller, the problems of high cost and large size of temperature-compensated quartz crystal oscillators are solved, and miniaturization and high reliability are achieved.
Patent Information
- Application Number
- CN201911132457.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-19
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2039-11-19
AI Technical Summary
The control part of the existing temperature-compensated quartz crystal oscillator is composed of multiple single-function chips, resulting in high cost, large PCB area occupation and poor performance stability.
The voltage stabilizer, temperature sensor, AD converter, processor, memory, PWM pulse width modulation unit and second-order passive filter are integrated into the microcontroller. The microcontroller controls the oscillation frequency of the clock circuit and the quartz crystal, reduces discrete devices and realizes frequency adjustment.
The volume of the crystal oscillator is effectively reduced, the cost is lowered, and the real-time performance and reliability of temperature sensing are improved.
Smart Images

Figure CN110719086B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of microcontrollers, and in particular to a microcontroller for a temperature-compensated quartz crystal oscillator and a method for using the same. Background Art
[0002] A quartz crystal oscillator, also known as a quartz resonator or simply a crystal oscillator, is made from a quartz crystal sheet that exhibits the piezoelectric effect. When subjected to an external alternating electric field, this thin quartz crystal sheet generates mechanical vibrations. When the frequency of the alternating electric field matches the natural frequency of the quartz crystal, the vibrations become intense, reflecting the crystal's resonant properties. Due to their compact size, light weight, high reliability, and high frequency stability, these crystal oscillators are used in household appliances and communications equipment.
[0003] In most applications, quartz crystal resonators have the advantage of providing a temperature stable frequency (with a variation of the order of 0.5 ppm / °C) over a typical temperature range, however, in certain applications this accuracy may not appear to be sufficient.
[0004] Currently, the control section of a temperature-compensated quartz crystal oscillator is implemented using multiple single-function chips. A 5V power supply is stabilized by a voltage regulator to 3V, which powers the temperature sensor and clock circuit. The remaining power is supplied directly by an external 5V power supply. After the 5V power supply is applied, the temperature sensor senses the ambient temperature and feeds the signal back to the microcontroller. The clock circuit and quartz crystal combine to generate a clock signal, which the microcontroller controls to adjust the frequency of the quartz crystal's output clock signal. This approach requires multiple chips and numerous resistors, capacitors, and electronic components to be mounted on the PCB. This is not only costly, but also occupies a large PCB area, is bulky, and has poor performance stability. Summary of the Invention
[0005] The present invention is directed to a microcontroller for a temperature-compensated quartz crystal oscillator and a method for using the same, addressing the aforementioned problems with the prior art. Currently, the control portion of a temperature-compensated quartz crystal oscillator is implemented by multiple single-function chips. A 5V power supply is stabilized to 3V by a voltage regulator to power a temperature sensor and clock circuit, while the remainder is directly powered by an external 5V power supply. After the 5V power supply is powered on, the temperature sensor senses the ambient temperature and feeds the signal back to the microcontroller. The clock circuit and quartz crystal combine to generate a clock signal, which the microcontroller controls to adjust the frequency of the quartz crystal output clock signal. This approach requires multiple chips and numerous resistor-capacitor electronic components to be mounted on a printed circuit board (PCB), resulting in high cost, large PCB area, and poor performance stability.
[0006] To achieve the above-mentioned objectives, the present invention provides the following technical solutions: A microcontroller for a temperature-compensated quartz crystal oscillator, comprising a microcontroller and a clock circuit, wherein the microcontroller internally comprises a voltage regulator, a temperature sensor, an AD converter, a processor, a memory, a PWM pulse width modulation unit, and a second-order passive filter, wherein the electrical output end of the voltage regulator is electrically connected to the temperature sensor and the power input end of the clock circuit, the electrical output end of the temperature sensor is electrically connected to the electrical input end of the AD converter, the electrical output end of the AD converter is electrically connected to the electrical input end of the processor, the electrical output end of the processor is electrically connected to the temperature sensor, the memory, and the electrical input end of the PWM pulse width modulation unit, the electrical output end of the PWM pulse width modulation unit is electrically connected to the second-order passive filter, the electrical output end of the second-order passive filter is electrically connected to the electrical input end of the clock circuit, and the left wall of the clock circuit is electrically connected to a quartz crystal.
[0007] Preferably, the clock circuit contains a varactor diode, and the electrical output end of the second-order passive filter is electrically connected to the control end of the varactor diode.
[0008] Preferably, the memory is a FLASH memory.
[0009] Preferably, the clock circuit includes an inverter, a feedback resistor, a load capacitor, a capacitor, a varactor diode, an isolation resistor, and a control voltage terminal, and the inverter and the feedback resistor constitute an inverting amplifier.
[0010] Preferably, the voltage regulator is a 5V power supply via a voltage regulator.
[0011] Preferably, the electrical input end of the clock circuit is electrically connected to the electrical output end of the control voltage terminal.
[0012] Preferably, the electrical input end of the voltage control terminal is electrically connected to the electrical output end of the microcontroller.
[0013] Preferably, the output end of the microcontroller sends different PWM frequencies and is electrically connected to the varactor diode.
[0014] A method for using a microcontroller for a temperature-compensated quartz crystal oscillator, the method comprising the following steps:
[0015] S1: The microcontroller includes: a voltage regulator, a temperature sensor, an AD converter, a processor, a memory, a PWM pulse width modulation unit, and a second-order passive filter circuit. The voltage regulator stabilizes the external power supply 5V to 3V to power the internal temperature sensor and the external clock circuit.
[0016] S2: The temperature sensor senses the temperature, converts the temperature value into an analog voltage signal and sends it to the AD converter. The AD converter converts the received analog voltage signal into a digital quantity and sends it to the processor. The processor reads the data stored in the memory according to the received digital quantity.
[0017] S3: Control and adjust the duty cycle of the PWM pulse width modulation unit output frequency according to the read data, and send the output of the PWM pulse width modulation unit to the second-order passive filter;
[0018] S4: The second-order passive filter converts the periodic signal into an analog voltage signal and sends it to the control end of the varactor diode of the clock circuit. By adjusting the voltage value of the varactor diode, the junction capacitance value of the varactor diode is changed, thereby adjusting the output frequency of the crystal oscillator.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: in this microcontroller for temperature-compensated quartz crystal oscillators, a clock circuit and a quartz crystal form an oscillator, and the control voltage terminal of the clock circuit is controlled by the microcontroller. Different PWM frequencies can be sent by the microcontroller to change the junction capacitance value of the varactor diode, thereby adjusting the crystal oscillation frequency, changing the idea of using discrete devices for implementation. By integrating the voltage stabilizer, temperature sensor, and PWM second-order filter circuit into the microcontroller, the overall volume of the crystal oscillator can be effectively reduced, the real-time performance of temperature sensing can be improved, the cost can be reduced, and the reliability is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of a fully temperature-compensated quartz crystal oscillator according to the prior art of the present invention;
[0021] Figure 2 This is a schematic diagram of the temperature-compensated quartz crystal oscillator circuit of the present invention;
[0022] Figure 3 Schematic diagram of the clock circuit of the present invention.
[0023] In the figure: 100 microcontroller, 110 voltage regulator, 120 temperature sensor, 130 AD converter, 140 processor, 150 memory, 160 PWM pulse width modulation unit, 170 second-order passive filter, 200 clock circuit, 210 quartz crystal. DETAILED DESCRIPTION
[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0025] The present invention provides a microcontroller for temperature-compensated quartz crystal oscillators. By combining accessories, it is not only small in size and low in cost, but also highly reliable. Figure 1-3 , comprising a microcontroller 100 and a clock circuit 200;
[0026] Please refer again Figure 2 The output end of the microcontroller 100 is fixedly connected to the input end of the clock circuit 200. Specifically, the microcontroller 100 includes a voltage regulator 110, a temperature sensor 120, an AD converter 130, a processor 140, a memory 150, a PWM pulse width modulation unit 160, and a second-order passive filter 170. The electrical output end of the voltage regulator 110 is electrically connected to the temperature sensor 120 and the power input end of the clock circuit 200, and the electrical output end of the temperature sensor 120 is electrically connected to the electrical input end of the AD converter 130. The electrical output end of the AD converter 130 is electrically connected to the electrical input end of the processor 140, the electrical output end of the processor 140 is electrically connected to the electrical input end of the temperature sensor 120, the memory 150 and the PWM pulse width modulation unit 160, the electrical output end of the PWM pulse width modulation unit 160 is electrically connected to the second-order passive filter 170, the electrical output end of the second-order passive filter 170 is electrically connected to the electrical input end of the clock circuit 200, and the left wall of the clock circuit 200 is electrically connected to the quartz crystal 210;
[0027] A method for using a microcontroller for a temperature-compensated quartz crystal oscillator, the method comprising the following steps:
[0028] S1: The microcontroller 100 includes: a voltage regulator 110, a temperature sensor 120, an AD converter 130, a processor 140, a memory 150, a PWM pulse width modulation unit 160, and a second-order passive filter circuit 170. The voltage regulator 110 stabilizes the external power supply 5V to 3V to supply power to the internal temperature sensor 120 and the external clock circuit 200;
[0029] S2: The temperature sensor 120 senses the temperature, converts the temperature value into an analog voltage signal and sends it to the AD converter 130. The AD converter 130 converts the received analog voltage signal into a digital quantity and sends it to the processor 140. The processor 140 reads the data stored in the memory 150 according to the received digital quantity.
[0030] S3: Control and adjust the duty cycle of the PWM pulse width modulation unit output frequency according to the read data, and send the output of the PWM pulse width modulation unit 160 to the second-order passive filter 170;
[0031] S4: The second-order passive filter 170 converts the periodic signal into an analog voltage signal and sends it to the control terminal of the varactor diode of the clock circuit 200. By adjusting the voltage value of the varactor diode, the junction capacitance value of the varactor diode is changed, thereby adjusting the output frequency of the crystal oscillator.
[0032] In specific use, the microcontroller 100 first includes: a voltage regulator 110, a temperature sensor 120, an AD converter 130, a processor 140, a memory 150, a PWM pulse width modulation unit 160, and a second-order passive filter circuit 170. The voltage regulator 110 stabilizes the external power supply 5V to 3V, supplies power to the internal temperature sensor 120 and the external clock circuit 200, and the temperature sensor 120 senses the temperature and converts the temperature value into an analog voltage signal and sends it to the AD converter 130. The AD converter 130 converts the received analog voltage signal into a digital The digital quantity is sent to the processor 140. The processor 140 reads the data stored in the memory 150 according to the received digital quantity, and controls and adjusts the output frequency duty cycle of the PWM pulse width modulation unit according to the read data. The output of the PWM pulse width modulation unit 160 is sent to the second-order passive filter 170. The second-order passive filter 170 converts the periodic signal into an analog voltage signal and sends it to the control end of the varactor diode of the clock circuit 200. By adjusting the voltage value of the varactor diode, the junction capacitance value of the varactor diode is changed, thereby adjusting the output frequency of the crystal oscillator.
[0033] Please refer again Figure 2 In order to store data and facilitate digital quantity reading, specifically, the memory 150 is a FLASH memory.
[0034] Please refer again Figure 2 , wherein the inverter and the feedback resistor constitute an inverting amplifier, and the capacitor utilizes its DC blocking and AC passing function to prevent the control voltage terminal of the varactor diode from affecting the crystal oscillation. Specifically, the clock circuit 200 includes an inverter, a feedback resistor, a load capacitor, a capacitor, a varactor diode, an isolation resistor, and a control voltage terminal, and the inverter and the feedback resistor constitute an inverting amplifier.
[0035] Please refer again Figure 2 In order to facilitate voltage stabilization, specifically, the voltage stabilizer 110 is a 5V power supply.
[0036] Please refer again Figure 2 In order to send different PWM frequencies through the microcontroller 100 and change the junction capacitance value of the varactor diode, specifically, the electrical input end of the clock circuit 200 is electrically connected to the electrical output end of the control voltage terminal, and the electrical input end of the voltage control terminal is electrically connected to the electrical output end of the microcontroller 100.
[0037] Please refer again Figure 2 In order to adjust the crystal oscillation frequency, specifically, the output end of the microcontroller 100 sends different PWM frequencies and is electrically connected to the varactor diode.
[0038] Although the present invention has been described above with reference to exemplary embodiments, various modifications may be made thereto and equivalent components may be substituted without departing from the scope of the present invention. In particular, the various features of the embodiments disclosed herein may be combined with one another in any manner, provided no structural conflicts exist. The omission of an exhaustive description of these combinations in this specification is solely for the sake of space and resource conservation. Therefore, the present invention is not limited to the specific embodiments disclosed herein, but encompasses all technical solutions within the scope of the claims.
Claims
1. A microcontroller for a temperature-compensated quartz crystal oscillator, characterized in that: The invention comprises a microcontroller (100) and a clock circuit (200), wherein the microcontroller (100) is internally integrated with a voltage regulator (110), a temperature sensor (120), an AD converter (130), a processor (140), a memory (150), a PWM pulse width modulation unit (160), and a second-order passive filter (170); The output end of the voltage stabilizer (110) directly supplies power to the temperature sensor (120) and the clock circuit (200); The output end of the temperature sensor (120) is connected to the input end of the AD converter (130), and the output end of the AD converter (130) is connected to the input end of the processor (140); The output end of the processor (140) is respectively connected to the temperature sensor (120), the memory (150) and the PWM pulse width modulation unit (160); The output end of the PWM pulse width modulation unit (160) is connected to the second-order passive filter (170), and the output end of the second-order passive filter (170) is directly connected to the varactor diode control end of the clock circuit (200); The clock circuit (200) comprises a quartz crystal (210), the oscillation frequency of which is adjusted by the junction capacitance value of the varactor diode.
2. The microcontroller according to claim 1, wherein: The second-order passive filter (170) is composed of a second-order RC low-pass filter composed of a resistor and a capacitor, the cut-off frequency of which matches the output frequency of the PWM pulse width modulation unit (160), and the second-order passive filter (170) is integrated inside the microcontroller (100).
3. The microcontroller according to claim 1, wherein: The memory (150) is a FLASH memory storing a temperature-frequency compensation data table, and the processor (140) queries the data table in real time according to the digital quantity output by the AD converter (130) to adjust the PWM duty cycle.
4. The microcontroller according to claim 1, wherein: The clock circuit (200) further comprises an inverter, a feedback resistor and a load capacitor, wherein the inverter and the feedback resistor form an inverting amplifier, and the inverting amplifier, the load capacitor and the varactor are integrated in the same package.
5. The microcontroller according to claim 1, wherein: The input voltage of the voltage regulator (110) is 5V, the output voltage is 3V, and the 3V voltage simultaneously powers the temperature sensor (120) and the clock circuit (200).
6. The microcontroller according to claim 1, wherein: The control voltage of the varactor diode is directly driven by the analog voltage output by the second-order passive filter (170), and the fluctuation range of the analog voltage is less than ±10mV.
7. A method for using a microcontroller according to any one of claims 1 to 6, characterized in that The following steps are involved: S1: converting an external 5V power supply into 3V through the voltage regulator (110) to power the temperature sensor (120) and the clock circuit (200); S2: The temperature sensor (120) senses the ambient temperature in real time and outputs an analog voltage signal, which is converted into a digital value by the AD converter (130) and then transmitted to the processor (140); S3: the processor (140) queries the temperature-frequency compensation data table in the memory (150) according to the digital quantity, and dynamically adjusts the output duty cycle of the PWM pulse width modulation unit (160); S4: The PWM signal output by the PWM pulse width modulation unit (160) is converted into a smooth analog voltage via the second-order passive filter (170), which directly drives the varactor diode of the clock circuit (200), and adjusts the oscillation frequency of the quartz crystal (210) by changing the junction capacitance value.
Citation Information
Patent Citations
Self-fitting digital temperature compensation crystal oscillistor and system and realization method thereof
CN101604970A
Oscillator, electronic apparatus and temperature compensation method for oscillator
JP2013211654A