Vehicle-mounted clock calibration method and system and automobile

Through the microcontroller, the main crystal oscillator and sub-crystal oscillator of the vehicle clock are divided and frequency measurement, and the on-board clock is periodically calibrated, which solves the problem of time synchronization delay of the vehicle clock after the vehicle sleeps and starts in the prior art, and achieves high-precision calibration and low power consumption.

CN119556548AInactive Publication Date: 2025-03-04BOSCH CAR MULTIMEDIA WUHU
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411663583.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art cannot synchronize the on-board clock when the vehicle is sleeping, and there is a time deviation after the vehicle is started, resulting in delayed update of time synchronization.

Method used

The main crystal oscillator is divided by a microcontroller, and the frequency measurement is performed through the PWM signal, the number of oscillations of the main crystal oscillator and the sub-crystal oscillator is recorded, the frequency value of the sub-crystal oscillator is calculated, and the registers are judged and configured for forward or reverse correction, and the on-board clock is periodically calibrated with high precision.

Benefits of technology

It realizes periodic high-precision calibration of on-board clocks, reduces static power consumption, does not require an external real-time clock chip, saves costs, and improves the speed and accuracy of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556548A_ABST
    Figure CN119556548A_ABST
Patent Text Reader

Abstract

The invention discloses a calibration method and system of a vehicle-mounted clock and an automobile, and belongs to the technical field of automobile electronics, and the method comprises the following steps: carrying out frequency division processing on a main crystal oscillator through a microcontroller (MCU); a pulse width modulation (PWM) signal with a specified frequency is sent out through a microcontroller (MCU); measuring, by a frequency meter, a frequency value F1 of a pulse width modulation (PWM) signal of a specified frequency; recording the oscillation frequency N1 of the main crystal oscillator in a first preset time through a microcontroller (MCU); recording the oscillation times N2 of the sub crystal oscillators in a first preset time through a microcontroller (MCU); calculating a frequency value F2 of the sub crystal oscillator in a first preset time through a microcontroller (MCU); the magnitude relation between the frequency value F2 of the sub crystal oscillator and 32768 is judged through a microcontroller (MCU), and the register is configured according to the judgment result. According to the calibration method and system of the vehicle-mounted clock, high-precision calibration can be periodically carried out on the vehicle-mounted clock.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of automobile electronics, and in particular, relates to a method and system for calibrating an on-board clock and an automobile. Background Art

[0002] As the number of cars continues to increase, people's requirements for car functionality, safety, and comfort are also increasing. In the fast-paced modern society, people's time is becoming more and more precious. In this context, car clocks have been widely promoted and applied. However, during the use of the car, there will be many factors that cause deviations in its time display, affecting the user's use.

[0003] Patent CN101770207A discloses an automatic correction system for a car clock and a correction method thereof. The system includes a clock processing unit and a clock display unit. The clock processing unit includes a clock signal generating circuit and a clock signal processing circuit. The clock display unit receives and displays the clock signal sent by the clock processing unit. The system is characterized in that the clock processing unit is connected to a GPS receiving unit via a CAN bus.

[0004] However, the technology disclosed in the above patent uses GPS to synchronize the vehicle clock. This method cannot synchronize the vehicle clock when the vehicle is asleep, and after the vehicle is started, the time synchronization will be delayed due to time deviation. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method, system and vehicle for calibrating a vehicle clock in view of the deficiencies in the prior art, so as to achieve the purpose of periodically calibrating the vehicle clock with high precision.

[0006] In order to achieve the above object, the technical solution adopted by the present invention is:

[0007] The present invention provides a method for calibrating a vehicle-mounted clock, the method comprising the following steps:

[0008] Step 1: Use a microcontroller (MCU) to divide the frequency of the main crystal oscillator;

[0009] Step 2: Send out a pulse width modulation (PWM) signal of a specified frequency through a microcontroller (MCU);

[0010] Step 3: Measure the frequency value F1 of the pulse width modulation (PWM) signal of the specified frequency by using a frequency meter;

[0011] Step 4: Recording the number of oscillations N1 of the main crystal oscillator within the first predetermined time by a microcontroller (MCU);

[0012] Step 5: Recording the number of oscillations N2 of the sub-crystal oscillator within the first predetermined time by a microcontroller (MCU);

[0013] Step 6: Calculate the frequency value F2 of the sub-crystal oscillator within the first predetermined time by a microcontroller (MCU);

[0014] Step 7: Use the microcontroller (MCU) to determine the relationship between the frequency value F2 of the sub-crystal oscillator and 32768, and configure the register according to the determination result;

[0015] Step 8: Repeat steps 4 to 7 after a second predetermined time interval.

[0016] Further, F2=(N2 / N1)*32768.

[0017] Furthermore, when the microcontroller (MCU) determines that the frequency value F2 of the sub-crystal oscillator is less than 32768, the register is positively corrected through the real-time clock (RTC) module in the microcontroller (MCU), configuration 1.

[0018] Furthermore, when the microcontroller (MCU) determines that the frequency value F2 of the sub-crystal oscillator is greater than 32768, the register is reversely corrected and configured to 0 through the real-time clock (RTC) module in the microcontroller (MCU).

[0019] Further, the specified frequency is 500 Hz.

[0020] Further, the first predetermined time is 500 milliseconds.

[0021] Further, the second predetermined time is 10 minutes.

[0022] The present invention also provides a vehicle-mounted clock calibration system, comprising a main crystal oscillator, a sub-crystal oscillator, and a microcontroller (MCU), wherein the main crystal oscillator is connected to the sub-crystal oscillator and the microcontroller (MCU) respectively; the sub-crystal oscillator is connected to the microcontroller (MCU).

[0023] The present invention also provides a car, which is equipped with the above-mentioned vehicle-mounted clock calibration system and calibrated by the above-mentioned vehicle-mounted clock calibration method.

[0024] The vehicle-mounted clock calibration method and system of the present invention have the following advantages:

[0025] (1) The vehicle-mounted clock calibration method and system of the present invention can periodically perform high-precision calibration on the vehicle-mounted clock.

[0026] (2) When the vehicle-mounted clock calibration method and system of the present invention are used to periodically calibrate the vehicle-mounted clock with high precision, static power consumption can be effectively reduced.

[0027] (3) The vehicle-mounted clock calibration method and system of the present invention can perform high-precision calibration on the vehicle-mounted clock without using an external real-time clock (RTC) chip, thus saving costs.

[0028] (4) The master crystal oscillator in the present invention can improve the speed and accuracy of data processing.

[0029] (5) The temperature drift error of the main crystal oscillator in the system of the present invention is small, and the clock error can be kept small even when there is temperature drift.

[0030] (6) The main crystal oscillator in the present invention can provide an accurate clock signal, thereby ensuring the stable operation of the functional system of the entire instrument.

[0031] (7) In the present invention, by calibrating the sub-crystal oscillator through the main crystal oscillator, external interference and electromagnetic radiation can be reduced, and the stability and reliability of the functional system of the entire instrument can be further improved.

[0032] (8) In the present invention, by calibrating the sub-crystal oscillator through the main crystal oscillator, the synchronization between the various components within the functional system of the entire instrument can be further ensured, effectively avoiding performance degradation or functional failure caused by clock deviation.

[0033] (9) In the present invention, the sub-crystal oscillator is periodically calibrated by the main crystal oscillator, which has the advantages of both clock accuracy and low power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] This specification includes the following drawings, which show the following contents:

[0035] Figure 1 It is a flowchart of a method for calibrating a vehicle-mounted clock of the present invention;

[0036] Figure 2 The present invention is a logic structure block diagram of a vehicle-mounted clock calibration system.

[0037] Explanation of the reference numerals: 1. Main crystal oscillator; 2. Sub crystal oscillator; 3. Microcontroller (MCU). DETAILED DESCRIPTION

[0038] The specific implementation methods of the present invention are further explained in detail below by describing the embodiments with reference to the accompanying drawings, with the aim of helping those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention and facilitating their implementation.

[0039] Figure 1 The present invention is a flowchart of a method for calibrating a vehicle-mounted clock, the method comprising the following steps:

[0040] Step 1: Use microcontroller (MCU) 3 to divide the frequency of main crystal oscillator 1; Figure 1 Specifically, the signal received from the main crystal oscillator 1 is divided into a 1 MHz signal by the microcontroller (MCU) 3.

[0041] Step 2: Send out a pulse width modulation (PWM) signal of a specified frequency through the microcontroller (MCU) 3; that is, corresponding to Figure 1 Specifically, after the received signal sent by the main crystal oscillator 1 is divided into a 1 MHz signal by the microcontroller (MCU) 3, a pulse width modulation (PWM) signal of a specified frequency is sent out by the microcontroller (MCU), wherein the specified frequency is 500 Hz.

[0042] Step 3: Use a frequency meter to measure the frequency value F1 of the pulse width modulation (PWM) signal of the specified frequency; that is, the corresponding Figure 1 S3 in. Specifically, the frequency value F1 of the pulse width modulation (PWM) signal of the specified frequency is measured by a frequency meter to see whether it is 500 Hz. If so, the process proceeds to step 4; if not, it indicates that there is a problem with the main crystal oscillator 1 or the related hardware circuit. When measuring with a frequency meter, the ppm value corresponding to three decimal places must be read.

[0043] Step 4: Record the number of oscillations N1 of the main crystal oscillator 3 within the first predetermined time through the microcontroller (MCU) 3; Figure 1 Specifically, after the frequency value F1 of the pulse width modulation (PWM) signal of the specified frequency is measured to be 500 Hz by the frequency meter, the oscillation number N1 of the main crystal oscillator 3 within the first predetermined time is recorded by the microcontroller (MCU) 3, wherein the first predetermined time is 500 milliseconds.

[0044] Step 5: Record the number of oscillations N2 of the sub-crystal oscillator 2 within the first predetermined time by the microcontroller (MCU) 3; Figure 1 Specifically, an interrupt is set by the microcontroller (MCU) 3, and the number of oscillations N2 of the sub-crystal oscillator 2 within a first predetermined time is recorded, wherein the first predetermined time is 500 milliseconds.

[0045] Step 6: Calculate the frequency value F2 of the sub-crystal oscillator 2 within the first predetermined time through the microcontroller (MCU) 3; that is, the corresponding Figure 1 Specifically, after step 4 and step 5, the frequency value F2 of the current sub-crystal oscillator 2 is calculated by the microcontroller (MCU) 3 by using the formula F2=(N2 / N1)*32768 for the first time within 500 milliseconds.

[0046] Step 7: Use the microcontroller (MCU) 3 to determine the relationship between the frequency value F2 of the sub-crystal oscillator 2 and 32768, that is, the corresponding Figure 1 S7 in the above table; and configure the register according to the judgment result; that is, the corresponding Figure 1 S71, S72, S73 in. Specifically, after calculating the frequency value F2 of the sub-crystal oscillator 2, it is necessary to determine the magnitude relationship between the frequency value F2 of the sub-crystal oscillator 2 and 32768 through the microcontroller (MCU) 3, and configure the first register and the second register in the real-time clock (RTC) module in the microcontroller (MCU) 3 according to the determination result. Among them, it is necessary to write a △ value to the first register, △ represents the difference between F2 and 32768 (0 to 128); the second register needs to be configured to indicate the correction direction, configuration 0 indicates reverse correction, and configuration 1 indicates forward correction.

[0047] When the microcontroller (MCU) 3 determines that the frequency value F2 of the sub-crystal oscillator 2 is less than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 performs a positive correction on the register, and configuration 1. Specifically, when the microcontroller (MCU) 3 determines that the frequency value F2 of the sub-crystal oscillator 2 is less than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 writes a △ value to the first register, △=128-(32768-F2), and the real-time clock (RTC) module in the microcontroller (MCU) 3 performs a positive correction on the second register, and configuration 1.

[0048] When the microcontroller (MCU) 3 determines that the frequency value F2 of the sub-crystal oscillator 2 is greater than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 performs reverse correction on the register and configures it to 0. Specifically, when the microcontroller (MCU) 3 determines that the frequency value F2 of the sub-crystal oscillator 2 is greater than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 writes a △ value to the first register, △=F2-32768, and performs reverse correction on the second register and configures it to 0 through the real-time clock (RTC) module in the microcontroller (MCU) 3.

[0049] Step 8: Repeat steps 4 to 7 after a second predetermined time interval; Figure 1 It can be seen that in Figure 1After S71, S72, and S73, and after the second predetermined time, S4 to S7 are re-executed. Specifically, after S4 to S7 are executed, it is equivalent to calibrating the vehicle clock once, and after S4 to S7 are re-executed after the second predetermined time for the first time, it is equivalent to calibrating the vehicle clock for the second time, so that the vehicle clock can be periodically calibrated with high precision. Among them, the second predetermined time is 10 minutes, but the predetermined time is not limited to 10 minutes, but can be set according to specific circumstances.

[0050] For example, after the first interval of the second predetermined time, the number of oscillations N1 of the main crystal oscillator 3 within the first predetermined time is recorded by the microcontroller (MCU) 3; the number of oscillations N3 of the sub-crystal oscillator 2 within the first predetermined time is recorded by the microcontroller (MCU) 3 for the second time; the frequency value F3 of the current sub-crystal oscillator 2 within 500 milliseconds is calculated by the microcontroller (MCU) 3 by the formula F3=(N3 / N1)*F2; wherein the first predetermined time is 500 milliseconds. After the frequency value F3 of the sub-crystal oscillator 2 is calculated, the microcontroller (MCU) 3 needs to determine the magnitude relationship between the frequency value F3 of the sub-crystal oscillator 2 and 32768, and configure the first register and the second register in the real-time clock (RTC) module in the microcontroller (MCU) 3 according to the determination result. Among them, the first register needs to be written with a △ value, △ represents the difference between F3 and 32768 (0 to 128); the second register needs to be configured to indicate the correction direction, configuration 0 indicates reverse correction, and configuration 1 indicates forward correction. When the microcontroller (MCU) 3 determines that the frequency value F3 of the sub-crystal oscillator 2 is less than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 performs a positive correction on the register, and configures 1. Specifically, when the microcontroller (MCU) 3 determines that the frequency value F3 of the sub-crystal oscillator 2 is less than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 writes a △ value to the first register, △=128-(32768-F3), and the real-time clock (RTC) module in the microcontroller (MCU) 3 performs a positive correction on the second register, and configures 1. When the microcontroller (MCU) 3 determines that the frequency value F3 of the sub-crystal oscillator 2 is greater than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 performs a reverse correction on the register, and configures 0. Specifically, when the microcontroller (MCU) 3 determines that the frequency value F3 of the sub-crystal oscillator 2 is greater than 32768, the real-time clock (RTC) module in the microcontroller (MCU) 3 writes a △ value to the first register, △=F3-32768, and the real-time clock (RTC) module in the microcontroller (MCU) 3 reversely corrects the second register and configures it to 0.

[0051] Figure 2It is a logical structure block diagram of a vehicle clock calibration system of the present invention, including a main crystal oscillator 1, a sub-crystal oscillator 2, and a microcontroller (MCU) 3, wherein the main crystal oscillator 1 is connected to the sub-crystal oscillator 2 and the microcontroller (MCU) 3 respectively; the sub-crystal oscillator 2 is connected to the microcontroller (MCU) 3. The main crystal oscillator 1, the sub-crystal oscillator 2, and the microcontroller (MCU) 3 are integrated on the same printed circuit board (PCB).

[0052] In addition, the present invention also provides a car, which is equipped with the above-mentioned vehicle-mounted clock calibration system and calibrated by the above-mentioned vehicle-mounted clock calibration method.

[0053] The present invention is described above by way of example in conjunction with the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-mentioned methods. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention; or the above concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.

Claims

1. A method for calibrating a vehicle-mounted clock, characterized in that: The method comprises the following steps: Step 1: Use a microcontroller (MCU) to divide the frequency of the main crystal oscillator; Step 2: Send out a pulse width modulation (PWM) signal of a specified frequency through a microcontroller (MCU); Step 3: Measure the frequency value F1 of the pulse width modulation (PWM) signal of the specified frequency by using a frequency meter; Step 4: Recording the number of oscillations N1 of the main crystal oscillator within the first predetermined time by a microcontroller (MCU); Step 5: Recording the number of oscillations N2 of the sub-crystal oscillator within the first predetermined time by a microcontroller (MCU); Step 6: Calculate the frequency value F2 of the sub-crystal oscillator within the first predetermined time by a microcontroller (MCU); Step 7: Use the microcontroller (MCU) to determine the relationship between the frequency value F2 of the sub-crystal oscillator and 32768, and configure the register according to the determination result; Step 8: Repeat steps 4 to 7 after a second predetermined time interval.

2. A vehicle-mounted clock calibration method as claimed in claim 1, characterized in that: The F2=(N2 / N1)*32768.

3. A vehicle-mounted clock calibration method as claimed in claim 1, characterized in that: When the microcontroller (MCU) determines that the frequency value F2 of the sub-crystal oscillator is less than 32768, the register is positively corrected through the real-time clock (RTC) module in the microcontroller (MCU), configuration 1.

4. A vehicle-mounted clock calibration method as claimed in claim 3, characterized in that: When the microcontroller (MCU) determines that the frequency value F2 of the sub-crystal oscillator is greater than 32768, the register is reversely corrected through the real-time clock (RTC) module in the microcontroller (MCU) and configured as 0.

5. The vehicle-mounted clock calibration method according to claim 1, characterized in that: The specified frequency is 500 Hz.

6. A vehicle-mounted clock calibration method as claimed in claim 1, characterized in that: The first predetermined time is 500 milliseconds.

7. A vehicle-mounted clock calibration method as claimed in claim 1, characterized in that: The second predetermined time is 10 minutes.

8. A vehicle-mounted clock calibration system according to any one of claims 1 to 7, characterized in that: The invention comprises a main crystal oscillator, a sub crystal oscillator and a microcontroller (MCU). The main crystal oscillator is connected to the sub crystal oscillator and the microcontroller (MCU) respectively; and the sub crystal oscillator is connected to the microcontroller (MCU).

9. A car, characterized in that: The automobile is equipped with the vehicle clock calibration system as claimed in claim 8 and is calibrated by the vehicle clock calibration method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • RTC module clock source dynamic calibration method and system in meter sleep mode

    CN107765760A

  • RTC clock calibration method and industrial field calibration device

    CN113391539A

  • Chip clock calibration method and device, equipment and storage medium

    CN117111681A

  • Method for calibrating internal RC crystal

    CN117311450A