Single chip microcomputer device with crystal oscillator detection function
By designing crystal oscillator detection and switching functions in the microcontroller, the problem of crystal oscillator damage under high humidity is solved, and the backup RC oscillator switching and environmental control are realized when the crystal oscillator is damaged, ensuring the stable operation of the microcontroller.
Patent Information
- Application Number
- CN202011139759.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-22
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-10-22
AI Technical Summary
Existing microcontrollers are prone to inability to work due to damage to crystal oscillator in high humidity environments, and the prior art is difficult to detect and switch to a backup RC oscillator in real time, resulting in a decrease in clock signal accuracy.
A single chip computer device with crystal oscillator detection function is designed, including a clock unit, a control unit, a detection unit and a switching unit to detect the time errors of the crystal oscillator and the RC oscillator in real time, and switch to the RC oscillator to provide a clock signal when the preset value is reached. , and extend the service life of the crystal oscillator through wireless alarm and humidity, temperature detection, heating and dehumidification and heat dissipation measures.
It realizes switching to the RC oscillator to continue working when the crystal oscillator is damaged, extending the equipment life, and ensuring the stability of the clock signal through alarm and environmental control measures.
Smart Images

Figure CN112180811B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a single chip computer device with a crystal oscillator detection function. Background Art
[0002] A single-chip microcomputer is an integrated circuit chip that uses very large-scale integrated circuit technology to integrate a central processing unit CPU with data processing capabilities, random access memory RAM, read-only memory ROM, multiple I / O ports and interrupt systems, timers / counters and other functions (may also include display driver circuits, pulse width modulation circuits, analog multiplexers, A / D converters and other circuits) onto a silicon chip to form a small and complete microcomputer system. It is widely used in the field of industrial control.
[0003] The operation of the single-chip microcomputer requires a clock to provide a clock signal, and the existing single-chip microcomputer generally uses a crystal oscillator to achieve this. However, the crystal oscillator is greatly affected by the environmental humidity and is prone to damage in a high humidity environment for a long time, causing the single-chip microcomputer to fail to work. Summary of the invention
[0004] The present invention provides a single chip microcomputer device with a crystal oscillator detection function, which adopts the following technical solution:
[0005] A single chip microcomputer device with a crystal oscillator detection function, comprising:
[0006] A clock unit, used for providing a clock signal for a single-chip microcomputer device having a crystal oscillator detection function, the clock unit comprising a crystal oscillator;
[0007] A control unit, used for controlling a single-chip microcomputer device having a crystal oscillator detection function, the control unit including an RC oscillator;
[0008] A detection unit, used for detecting a time error between a crystal oscillator of a clock unit and an RC oscillator in a control unit;
[0009] A switching unit, used to cut off the clock unit and provide a clock signal to the single-chip microcomputer device with a crystal oscillator detection function through the RC oscillator when the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value;
[0010] The clock unit, the control unit and the detection unit are connected to the switching unit;
[0011] The clock unit and the control unit are connected to the detection unit.
[0012] Furthermore, the single chip microcomputer device with crystal oscillator detection function also includes:
[0013] A wireless transceiver unit, used for wirelessly transmitting and receiving signals;
[0014] The wireless transceiver unit is connected to the control unit;
[0015] When the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value, the control unit controls the wireless transceiver unit to send an alarm signal to the background server.
[0016] Furthermore, after receiving the alarm signal, the backend server sends a prompt signal to the maintenance personnel.
[0017] Furthermore, the single chip microcomputer device with crystal oscillator detection function also includes:
[0018] A humidity detection unit, used to detect humidity information of the environment surrounding the single-chip microcomputer device with a crystal oscillator detection function;
[0019] The humidity detection unit is connected to the control unit and transmits the detected humidity information to the control unit.
[0020] Furthermore, the single chip microcomputer device with crystal oscillator detection function also includes:
[0021] A heating and dehumidifying unit, used for heating to reduce the humidity of the environment surrounding the single-chip microcomputer device with a crystal oscillator detection function;
[0022] The heating and dehumidification unit is connected to the control unit;
[0023] The control unit controls the heating and dehumidification unit to start working when the humidity detection unit detects that the humidity of the environment surrounding the single-chip microcomputer device with crystal oscillator detection function exceeds a first humidity value, and controls the heating and dehumidification unit to stop working when the humidity detection unit detects that the humidity of the environment surrounding the single-chip microcomputer device with crystal oscillator detection function drops to a second humidity value.
[0024] Furthermore, when the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value, the control unit no longer controls the heating and dehumidification unit based on the humidity of the environment surrounding the single-chip device with crystal oscillator detection function detected by the humidity detection unit.
[0025] Furthermore, the single chip microcomputer device with crystal oscillator detection function also includes:
[0026] A temperature detection unit, used to detect the temperature information of the surrounding environment of the single-chip microcomputer device with a crystal oscillator detection function;
[0027] The temperature detection unit is connected to the control unit and transmits the detected temperature information to the control unit.
[0028] Furthermore, the single chip microcomputer device with crystal oscillator detection function also includes:
[0029] A cooling fan unit for generating air flow to dissipate heat for the single-chip microcomputer device having a crystal oscillator detection function;
[0030] The cooling fan unit is connected to the control unit;
[0031] When the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value, the control unit controls the cooling fan unit to start working when the temperature detection unit detects that the temperature of the surrounding environment of the single-chip microcomputer device with crystal oscillator detection function exceeds a first temperature value, and controls the heating fan unit to stop working when the temperature detection unit detects that the temperature of the surrounding environment of the single-chip microcomputer device with crystal oscillator detection function drops to a second temperature value.
[0032] Furthermore, the single chip microcomputer device with crystal oscillator detection function also includes:
[0033] A prompt unit, used for generating an alarm prompt sound;
[0034] The prompt unit is connected to the control unit;
[0035] When the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value, the control unit controls the prompt unit to emit an alarm prompt sound.
[0036] Furthermore, the frequency of the crystal oscillator of the clock unit is 32.768 KHz.
[0037] The present invention is beneficial in that the single-chip microcomputer device with a crystal oscillator detection function is provided, and the single-chip microcomputer device with a crystal oscillator detection function detects whether the crystal oscillator of the clock unit is damaged in real time, and switches to the internal RC oscillator to work when the crystal oscillator of the clock unit is damaged, so that the single-chip microcomputer device with a crystal oscillator detection function can still continue to work. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of a single chip microcomputer device with a crystal oscillator detection function of the present invention.
[0039] A single chip microcomputer device 100 with a crystal oscillator detection function comprises a clock unit 10, a control unit 11, a detection unit 12, a switching unit 13, a wireless transceiver unit 14, a humidity detection unit 15, a heating and dehumidification unit 16, a temperature detection unit 17, a cooling fan unit 18, and a prompt unit 19. DETAILED DESCRIPTION
[0040] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] like Figure 1The present invention shows a single-chip microcomputer device 100 with a crystal oscillator detection function, which mainly includes: a clock unit 10, a control unit 11, a detection unit 12 and a switching unit 13. The clock unit 10 is used to provide a clock signal for the single-chip microcomputer device 100 with a crystal oscillator detection function. The clock unit 10 includes a crystal oscillator. In the present invention, the frequency of the crystal oscillator of the clock unit 10 is 32.768KHz. The control unit 11 is used to control the single-chip microcomputer device 100 with a crystal oscillator detection function. The control unit 11 includes an RC oscillator. The detection unit 12 is used to detect the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11. The switching unit 13 is used to cut off the clock unit 10 and provide a clock signal for the single-chip microcomputer device 100 with a crystal oscillator detection function through the RC oscillator when the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value. The clock unit 10, the control unit 11 and the detection unit 12 are connected to the switching unit 13. The clock unit 10 and the control unit 11 are connected to the detection unit 12. By means of the single-chip microcomputer device 100 with a crystal oscillator detection function of the present invention, the single-chip microcomputer device 100 with a crystal oscillator detection function detects in real time whether the crystal oscillator of the clock unit 10 is damaged. When the crystal oscillator of the clock unit 10 is damaged, the device switches to the internal RC oscillator for operation.
[0042] As a preferred implementation, the single chip microcomputer device 100 with a crystal oscillator detection function further includes: a wireless transceiver unit 14 .
[0043] Specifically, the wireless transceiver unit 14 is used for wirelessly transmitting and receiving signals. The wireless transceiver unit 14 is connected to the control unit 11. When the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value, the control unit 11 controls the wireless transceiver unit 14 to send an alarm signal to the background server.
[0044] It is understandable that when the crystal oscillator is damaged, although the RC oscillator in the single-chip microcomputer device 100 with a crystal oscillator detection function can temporarily replace the crystal oscillator to provide a clock signal, the accuracy of the clock signal provided by the RC oscillator is low and can only be used as a temporary emergency. When a problem occurs in the crystal oscillator, it is still necessary to feed back the problem to the background server. Preferably, after receiving the alarm signal, the background server sends a prompt signal to the maintenance personnel to replace the crystal oscillator.
[0045] As a preferred implementation, the single chip microcomputer device 100 with a crystal oscillator detection function further includes: a humidity detection unit 15 and a heating and dehumidification unit 16 .
[0046] The humidity detection unit 15 is used to detect humidity information of the environment around the single-chip microcomputer device with crystal oscillator detection function 100. The humidity detection unit 15 is connected to the control unit 11 and sends the detected humidity information to the control unit 11. The heating and dehumidification unit 16 is used to heat to reduce the humidity of the environment around the single-chip microcomputer device with crystal oscillator detection function 100.
[0047] The heating and dehumidifying unit 16 is connected to the control unit 11. The control unit 11 controls the heating and dehumidifying unit 16 to start working when the humidity detection unit 15 detects that the humidity of the environment surrounding the single-chip microcomputer device 100 with a crystal oscillator detection function exceeds a first humidity value, and controls the heating and dehumidifying unit 16 to stop working when the humidity detection unit 15 detects that the humidity of the environment surrounding the single-chip microcomputer device 100 with a crystal oscillator detection function drops to a second humidity value.
[0048] It is understandable that the main reason for the damage of the crystal oscillator is that the humidity of the environment around the single-chip microcomputer device 100 with a crystal oscillator detection function is too high. The crystal oscillator is prone to damage when it is in a high humidity environment for a long time. Therefore, in this embodiment, in order to prevent the crystal oscillator from being in a high humidity environment for a long time, the humidity information of the environment around the single-chip microcomputer device 100 with a crystal oscillator detection function is detected in real time by the humidity detection unit 15, and when the humidity detection unit 15 detects that the humidity of the environment around the single-chip microcomputer device 100 with a crystal oscillator detection function exceeds the first humidity value, the heating and dehumidification unit 16 is controlled to start working, and when the humidity detection unit 15 detects that the humidity of the environment around the single-chip microcomputer device 100 with a crystal oscillator detection function drops to the second humidity value, the heating and dehumidification unit 16 is controlled to stop working. By heating the heating and dehumidification unit 16, the humidity in the environment is reduced. The first humidity value is greater than the second humidity value.
[0049] As a preferred embodiment, when the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value, the control unit 11 no longer controls the heating and dehumidification unit 16 based on the humidity of the environment surrounding the single-chip device 100 with crystal oscillator detection function detected by the humidity detection unit 15.
[0050] It is understandable that when the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value, the single-chip microcomputer device 100 with a crystal oscillator detection function provides a clock signal through an internal RC oscillator. However, the RC oscillator is greatly affected by temperature, and when the temperature is too high, the accuracy will decrease. Therefore, when the single-chip microcomputer device 100 with a crystal oscillator detection function switches to provide a clock signal by an RC oscillator, the control unit 11 no longer controls the heating and dehumidification unit 16 based on the humidity of the environment surrounding the single-chip microcomputer device 100 with a crystal oscillator detection function detected by the humidity detection unit 15, thereby avoiding the situation where the accuracy of the RC oscillator is reduced due to excessive temperature.
[0051] As a preferred implementation, the single chip computer device 100 with a crystal oscillator detection function further includes: a temperature detection unit 17 and a cooling fan unit 18 .
[0052] The temperature detection unit 17 is used to detect the temperature information of the environment around the single-chip computer device 100 with a crystal oscillator detection function. The temperature detection unit 17 is connected to the control unit 11 and sends the detected temperature information to the control unit 11. The cooling fan unit 18 is used to generate air flow to dissipate the heat of the single-chip computer device 100 with a crystal oscillator detection function. The cooling fan unit 18 is connected to the control unit 11. When the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value, the control unit 11 controls the cooling fan unit 18 to start working when the temperature detection unit 17 detects that the temperature of the environment around the single-chip computer device 100 with a crystal oscillator detection function exceeds a first temperature value, and controls the heating fan unit to stop working when the temperature detection unit 17 detects that the temperature of the environment around the single-chip computer device 100 with a crystal oscillator detection function drops to a second temperature value.
[0053] It is understandable that the RC oscillator inside the single-chip microcomputer device 100 with a crystal oscillator detection function is greatly affected by the ambient temperature. Therefore, when the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value and switches to the RC oscillator to provide a clock signal, the temperature detection unit 17 detects the temperature information of the surrounding environment of the single-chip microcomputer device 100 with a crystal oscillator detection function. When the temperature detection unit 17 detects that the temperature of the surrounding environment of the single-chip microcomputer device 100 with a crystal oscillator detection function exceeds a first temperature value, the cooling fan unit 18 is controlled to start working, and when the temperature detection unit 17 detects that the temperature of the surrounding environment of the single-chip microcomputer device 100 with a crystal oscillator detection function drops to a second temperature value, the heating fan unit is controlled to stop working. The first temperature value is greater than the second temperature value.
[0054] As a preferred implementation, the single chip computer device 100 with a crystal oscillator detection function further includes: a prompt unit 19 .
[0055] The prompt unit 19 is used to generate an alarm tone. The prompt unit 19 is connected to the control unit 11. The control unit 11 controls the prompt unit 19 to emit an alarm tone when the detection unit 12 detects that the time error between the crystal oscillator of the clock unit 10 and the RC oscillator in the control unit 11 reaches a preset value.
[0056] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A single chip microcomputer device with a crystal oscillator detection function, characterized in that: include: A clock unit, used for providing a clock signal for the single-chip microcomputer device with a crystal oscillator detection function, wherein the clock unit comprises a crystal oscillator; A control unit, used to control the single-chip microcomputer device with a crystal oscillator detection function, wherein the control unit includes an RC oscillator; A detection unit, used for detecting a time error between a crystal oscillator of the clock unit and the RC oscillator in the control unit; A switching unit, configured to cut off the clock unit and provide a clock signal to the single-chip device with a crystal oscillator detection function through the RC oscillator when the detection unit detects that a time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value; The clock unit, the control unit and the detection unit are connected to the switching unit; The clock unit and the control unit are connected to the detection unit; The single chip microcomputer device with crystal oscillator detection function also includes: A humidity detection unit, used to detect humidity information of the surrounding environment of the single-chip microcomputer device with crystal oscillator detection function; The humidity detection unit is connected to the control unit and sends the detected humidity information to the control unit; The single chip microcomputer device with crystal oscillator detection function also includes: A heating and dehumidifying unit, used for heating to reduce the humidity of the environment surrounding the single-chip microcomputer device with a crystal oscillator detection function; The heating and dehumidification unit is connected to the control unit; The control unit controls the heating and dehumidifying unit to start working when the humidity detection unit detects that the humidity of the environment surrounding the single-chip microcomputer device with a crystal oscillator detection function exceeds a first humidity value, and controls the heating and dehumidifying unit to stop working when the humidity detection unit detects that the humidity of the environment surrounding the single-chip microcomputer device with a crystal oscillator detection function drops to a second humidity value; When the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value, the control unit no longer controls the heating and dehumidifying unit according to the humidity of the environment around the single-chip microcomputer device with crystal oscillator detection function detected by the humidity detection unit; The single chip microcomputer device with crystal oscillator detection function also includes: A temperature detection unit, used to detect the temperature information of the surrounding environment of the single-chip microcomputer device with crystal oscillator detection function; The temperature detection unit is connected to the control unit and sends the detected temperature information to the control unit; The single chip microcomputer device with crystal oscillator detection function also includes: A cooling fan unit, used to generate air flow to dissipate heat for the single-chip microcomputer device with a crystal oscillator detection function; The cooling fan unit is connected to the control unit; When the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value, the control unit controls the cooling fan unit to start working when the temperature detection unit detects that the temperature of the surrounding environment of the single-chip microcomputer device with crystal oscillator detection function exceeds a first temperature value, and controls the heating and dehumidification unit to stop working when the temperature detection unit detects that the temperature of the surrounding environment of the single-chip microcomputer device with crystal oscillator detection function drops to a second temperature value.
2. The single chip microcomputer device with crystal oscillator detection function according to claim 1, characterized in that: The single chip microcomputer device with crystal oscillator detection function also includes: A wireless transceiver unit, used for wirelessly transmitting and receiving signals; The wireless transceiver unit is connected to the control unit; The control unit controls the wireless transceiver unit to send an alarm signal to the background server when the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value.
3. The single chip microcomputer device with crystal oscillator detection function according to claim 2, characterized in that: After receiving the alarm signal, the backend server sends a prompt signal to the maintenance personnel.
4. The single chip microcomputer device with crystal oscillator detection function according to claim 1, characterized in that: The single chip microcomputer device with crystal oscillator detection function also includes: A prompt unit, used for generating an alarm prompt sound; The prompt unit is connected to the control unit; The control unit controls the prompt unit to emit the alarm prompt sound when the detection unit detects that the time error between the crystal oscillator of the clock unit and the RC oscillator in the control unit reaches a preset value.
5. The single chip microcomputer device with crystal oscillator detection function according to claim 1, characterized in that: The frequency of the crystal oscillator of the clock unit is 32.768 KHz.
