Real-time clock device

By adjusting the oscillation circuit frequency using the timestamp information and phase difference in the real-time clock device, the problem of reducing the time information accuracy caused by the aging of the oscillation frequency is solved, and the provision of high-precision time information and maintenance of the time accuracy is achieved.

CN119002220APending Publication Date: 2024-11-22SEIKO EPSON CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410600178.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-17
Filing Date
2024-05-15
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing real-time clock device decreases with time because the frequency accuracy of the oscillating clock signal decreases with time, making it difficult to provide high-precision time information. Especially when time information is frequently updated, the error of timing count increases, affecting clock accuracy.

Method used

The time stamp information is input through the interface circuit, the oscillation circuit generates an oscillation clock signal, and uses the frequency division circuit, timing counter and phase comparator to generate internal time information. The processing circuit adjusts the frequency of the oscillation circuit according to the time difference and phase difference to ensure the time information High precision.

Benefits of technology

It is realized that even in the case of oscillation frequency aging, the timing count error is suppressed by frequency adjustment, and the timing accuracy is maintained in a small, low-power real-time clock device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119002220A_ABST
    Figure CN119002220A_ABST
Patent Text Reader

Abstract

The real-time clock device can provide high-precision time information. The real-time clock device includes: an interface circuit to which timestamp information is input; an oscillation circuit that outputs an oscillation clock signal; a frequency division circuit that divides the oscillation clock signal and generates a divided clock signal; a timer counter that generates information of an internal time on the basis of the divided clock signal; a phase comparator that compares the phases of the reference signal and the divided clock signal and obtains a phase difference; and a processing circuit that performs update processing of information of an internal time of the timer counter in accordance with an input time based on the input timestamp information, and performs frequency adjustment of the oscillation circuit on the basis of a time difference and a phase difference between the input time and the internal time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a real-time clock device and the like. Background Art

[0002] Real-time clock devices are known that generate time information by timing based on an oscillating clock signal. For example, Patent Document 1 discloses the following method: reading the data of a sub-second low-order counter at a timing corresponding to a reference signal to measure the error of the timing data, and using the sub-second high-order counter to perform distributed logic urgency, thereby performing sub-second correction.

[0003] Patent Document 1: Japanese Patent Application Publication No. 2021-189037 Summary of the invention

[0004] According to the prior art of Patent Document 1, the time can be corrected regularly with a higher resolution than the logic urgency. However, as time passes, the frequency accuracy of the clock signal that is the basis of the timing data decreases due to aging. Therefore, there is a problem that it is difficult to provide a high-precision time if the time information is not updated frequently.

[0005] One embodiment of the present disclosure relates to a real-time clock device, which includes: an interface circuit, which is input with timestamp information; an oscillation circuit, which outputs an oscillation clock signal; a frequency division circuit, which divides the oscillation clock signal to generate a divided clock signal; a timing counter, which generates internal time information based on the divided clock signal; a phase comparator, which compares the phases of a reference signal and the divided clock signal to obtain a phase difference between the reference signal and the divided clock signal; and a processing circuit, which updates the internal time information of the timing counter according to an input time based on the input timestamp information, and adjusts the frequency of the oscillation circuit based on the time difference between the input time and the internal time and the phase difference. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Figure 1 This is a configuration example of a real-time clock device according to this embodiment.

[0007] Figure 2 It is an explanatory diagram of the problems of the method of the comparative example.

[0008] Figure 3 It is an explanatory diagram of the method of this embodiment.

[0009] Figure 4 It is an explanatory diagram of input and output signals in this embodiment.

[0010] Figure 5 This is a detailed configuration example of the real-time clock device according to this embodiment.

[0011] Figure 6 It is a signal waveform diagram for explaining the operation of this embodiment.

[0012] Figure 7 This is a flowchart illustrating the operation of this embodiment.

[0013] Figure 8 This is an explanatory diagram of an example of a signal waveform of communication performed by an interface circuit.

[0014] Fig. 9 This is an explanatory diagram of an example of a method for generating a reference signal.

[0015] Fig.10 This is an explanatory diagram of an example of a method for generating a reference signal.

[0016] Fig.11 This is a detailed configuration example of the real-time clock device according to this embodiment.

[0017] Fig.12 It is a signal waveform diagram for explaining the operation of this embodiment.

[0018] Fig.13 This is a flowchart illustrating the operation of this embodiment.

[0019] Description of symbols

[0020] 5: package; 10: oscillator; 20: real-time clock device; 30: interface circuit; 40: processing circuit; 42: time difference calculation unit; 44: frequency offset calculation unit; 46: frequency adjustment circuit; 50: storage unit; 52: correction time interval calculation unit; 54: input time register; 56: internal time register; 60: oscillation circuit; 62: frequency division circuit; 70: timing counter; 80: phase comparator; 90: reference signal generation unit; CK: oscillation clock signal; CKD: frequency division clock signal; CTI: correction time interval; FOF: frequency offset; PHD: phase difference; SFC: frequency control signal; SRF: reference signal; TA: input time; TA1: first input time; TA2: second input time; TB: internal time; TMD: time difference; TMQ: time information; TMS: timestamp information; TSRF: reference signal input terminal. DETAILED DESCRIPTION

[0021] Hereinafter, the present embodiment will be described. In addition, the present embodiment described below does not unduly limit the contents of the claims. In addition, not all of the structures described in the present embodiment are necessarily essential components.

[0022] 1. Real-time clock device

[0023] Figure 1 The following is a configuration example of the real-time clock device 20 according to the present embodiment. The real-time clock device 20 is a device that generates time information by counting time based on an oscillation clock signal CK, for example, a real-time clock module. Figure 1 The real-time clock device 20 includes an interface circuit 30, a processing circuit 40, an oscillation circuit 60, a frequency division circuit 62, a timing counter 70, and a phase comparator 80. In addition, the real-time clock device 20 is not limited to Figure 1 The structure can be modified in various ways, such as omitting some of the structural elements, adding other structural elements, or replacing some of the structural elements with other structural elements.

[0024] The interface circuit 30 is a circuit for communicating with an external processing device. For example, the interface circuit 30 communicates with the external processing device based on a given communication standard. For example, the interface circuit 30 performs serial communication such as I2C (Inter-Integrated Circuit) or SPI (Serial Peripheral Interface). In the case of serial communication, the real-time clock device 20 has communication terminals such as a serial clock input terminal or a serial data input / output terminal. Figure 1 In the embodiment of the present invention, time stamp information TMS as time information is input to the interface circuit 30. For example, the time stamp information TMS is input to the interface circuit 30 as serial data.

[0025] The processing circuit 40 is a circuit that performs various calculation processes and control processes in the real-time clock device 20. The processing circuit 40 can be implemented by, for example, a logic circuit, and more specifically, by an ASIC (Application Specific Integrated Circuit) circuit based on an automatic configuration and wiring such as a gate array.

[0026] The oscillation circuit 60 is a circuit that outputs an oscillation clock signal CK. For example, the oscillation circuit 60 generates an oscillation signal through an oscillation action, and outputs an oscillation clock signal CK based on the oscillation signal. For example, the oscillation circuit 60 generates an oscillation signal of a frequency controlled by a frequency control signal SFC from the processing circuit 40, and outputs an oscillation clock signal CK based on the oscillation signal. As an example, the oscillation circuit 60 drives an oscillator such as a quartz oscillator through a driving circuit to oscillate, thereby generating an oscillation signal of a sine wave, and performs waveform shaping on the generated oscillation signal through a waveform shaping circuit, thereby outputting an oscillation clock signal CK of a rectangular wave. The oscillation clock signal CK is, for example, a clock signal of a frequency of 32.768KHz. In addition, the frequency of the oscillation clock signal CK is not limited to this, and may also be a frequency such as 32KHz. In addition, the real-time clock device 20 may also have a clock output terminal that outputs the oscillation clock signal CK. In addition, the oscillation action of the oscillation circuit 60 is not limited to the use of such an oscillator, and various modifications can be implemented.

[0027] The frequency division circuit 62 divides the oscillation clock signal CK from the oscillation circuit 60 to generate a divided clock signal CKD. For example, the frequency division circuit 62 includes a frequency division counter that operates based on the oscillation clock signal CK, and the divided clock signal CKD is generated by the frequency division counter. The divided clock signal CKD is, for example, a clock signal with a frequency of 1 Hz. The frequency division circuit 62 may include: a first frequency division circuit that divides the oscillation clock signal CK with a first frequency division ratio; and a second frequency division circuit that divides the first divided clock signal from the first frequency division circuit with a second frequency division ratio, and outputs the divided clock signal CKD as the second divided clock signal. The first frequency division ratio is, for example, 32, and the frequency of the first divided clock signal is, for example, 1.024 kHz. The second frequency division ratio is, for example, 1024, and thus the divided clock signal CKD of 1 Hz is output from the frequency division circuit 62. In addition, any one of the oscillation clock signal CK, the first divided clock signal, or the divided clock signal CKD as the second divided clock signal may be selected and output from the clock output terminal of the real-time clock device 20.

[0028] The timing counter 70 performs timing counting processing based on the divided clock signal CKD from the frequency dividing circuit 62. Moreover, the timing counter 70 as a timing circuit generates, for example, moment information TMQ indicating the current moment through the timing counting processing. The moment information TMQ as timing data can include data indicating seconds, minutes, hours, days, months, and years. For example, the timing counter 70 has counters for counting seconds, minutes, hours, days, months, and years, respectively, and generates moment information TMQ through the counting processing of these counters. The generated moment information TMQ is output to the outside via the interface circuit 30 as output timestamp information. In addition, the information of the internal moment corresponding to the moment information TMQ is output from the timing counter 70 to the processing circuit 40.

[0029] The phase comparator 80 compares the phases of the divided clock signal CKD from the frequency dividing circuit 62 with the reference signal SRF, and outputs the phase comparison result. The phase comparator 80, for example, compares the edge timing of the divided clock signal CKD with the edge timing of the reference signal SRF, obtains the phase difference between these edge timings, and outputs the information of the phase difference as the phase comparison result. The phase difference is information indicating the phase difference between the divided clock signal CKD and the reference signal SRF, and is, for example, digital data indicating the phase difference. The reference signal SRF is, for example, a signal for synchronizing the time stamp information TMS input to the real-time clock device 20, and is a reference synchronization signal. For example, the moment indicated by the time stamp information TMS becomes the moment of the edge timing of the reference signal SRF. The edge timing is, for example, the rising edge or the falling edge of the signal. For example, an external processing device such as a microcomputer outputs the moment information indicating the moment of the edge timing of the reference signal SRF as the time stamp information TMS, and the time stamp information TMS is input to the interface circuit 30. As the reference signal SRF, as an example, the 1PPS signal in the GPS can be used, but it is not limited to this. For example, when time information is transmitted in order to synchronize a plurality of communication devices that are communicatively connected via a network, a synchronization signal of the time information or the like may be used as the reference signal SRF.

[0030] As described above, the real-time clock device 20 of the present embodiment includes: an interface circuit 30 to which the time stamp information TMS is input; an oscillation circuit 60 to output an oscillation clock signal CK; a frequency division circuit 62 to divide the oscillation clock signal CK to generate a frequency division clock signal CKD; and a timer counter 70 to generate information on the internal time based on the frequency division clock signal CKD. In addition, the real-time clock device 20 includes: a phase comparator 80 to compare the phases of the reference signal SRF for synchronization of the time stamp information TMS with the frequency division clock signal CKD to obtain the phase difference between the reference signal SRF and the frequency division clock signal CKD; and a processing circuit 40. For example, the phase comparator 80 outputs information on the phase difference between the edge timing of the reference signal SRF and the frequency division clock signal CKD to the processing circuit 40. Then, the processing circuit 40 performs an update process of the internal time of the timer counter 70 based on the input time based on the input time of the time stamp information TMS. That is, the processing circuit 40 updates the information on the internal time of the timer counter 70 based on the input time represented by the time stamp information TMS input from the outside via the interface circuit 30. For example, the processing circuit 40 performs an update process of setting the internal time of the timing counter 70 to the input time of the timestamp information TMS. In addition, the processing circuit 40 adjusts the frequency of the oscillation circuit 60 based on the time difference between the input time and the internal time, and the phase difference between the reference signal SRF and the divided clock signal CKD. For example, the processing circuit 40 calculates the time difference between the input time and the internal time based on the timestamp information TMS, and obtains information on the phase difference between the reference signal SRF and the divided clock signal CKD from the phase comparator 80. Then, the processing circuit 40 adjusts the oscillation frequency of the oscillation circuit 60 to a frequency that makes the time difference between the internal time and the input time close to zero and the phase difference close to zero. For example, the processing circuit 40 calculates the frequency offset based on the time difference and the phase difference, and outputs the frequency control signal SFC corresponding to the frequency offset, thereby adjusting the oscillation frequency of the oscillation circuit 60.

[0031] Thus, according to the present embodiment, by performing a timing counting process of the divided clock signal CKD based on the oscillation clock signal CK by the timing counter 70, the information of the internal time can be generated as the time information. Then, the information of the internal time of the timing counter 70 is updated according to the input time based on the input time stamp information TMS, thereby the internal time can be corrected to the input time. Moreover, in the present embodiment, the frequency adjustment of the oscillation circuit 60 is performed based on the time difference between the input time and the internal time, and the phase difference between the reference signal SRF and the divided clock signal CKD. Thus, in addition to the time difference between the input time and the internal time, the frequency of the oscillation circuit 60 can also be adjusted based on the phase difference between the reference signal SRF and the divided clock signal CKD. For example, the following frequency adjustment can be performed: the time difference between the input time and the internal time becomes smaller, and the phase difference between the reference signal SRF and the divided clock signal CKD also becomes smaller. Thus, the following real-time clock device 20 can be realized: even if the frequency of the oscillation is deviated due to, for example, aging, etc., the error of the timing counting caused by the deviation of the frequency of the oscillation can be suppressed, thereby providing high-precision time information.

[0032] For example, Figure 2 1 is an explanatory diagram of the problem of the method of the comparative example of the present embodiment. Figure 2 In the process, due to aging and other reasons, the frequency error corresponding to the frequency accuracy of the oscillation increases over time, and due to this frequency error, a deviation occurs in the internal time. Then, a correction is performed to eliminate the deviation of the internal time caused by such a frequency error. In this case, the frequency error increases over time, so the deviation of the internal time also increases, and the internal time needs to be corrected frequently. For example, in a conventional real-time clock (RTC) module, due to the aging of the oscillator as an internal oscillation element, the frequency deviation increases over time, and the time deviation accelerates. In order to maintain high-precision time information when the time deviation is large, it is necessary to Figure 2As shown in the figure, the correction of updating the time information is frequently performed, so it is difficult to provide a high-precision time. On the other hand, in order to achieve a high-precision time, a method of inputting a reference signal to the real-time clock module to perform a logical priority correction of the timing count is also considered. In this case, it is necessary to input the reference signal separately from the time information. In addition, since the frequency adjustment is not performed in the logical priority, when the clock signal is output from the real-time clock module, the clock accuracy remains poor. In addition, in order to achieve an accurate timing clock, a method of adjusting the frequency of the clock generation circuit by a processing device such as an MCU without using a single packaged real-time clock module is also considered. However, in this method, the size and power consumption of the device are larger than those of a single packaged real-time module. In addition, since the frequency adjustment is performed only by time comparison, there is a problem that the frequency adjustment can only be performed up to the time resolution of the timestamp.

[0033] In this regard, in this embodiment, in addition to the time difference between the input time and the internal time based on the time stamp information TMS, the phase difference between the reference signal SRF and the divided clock signal CKD is also used to adjust the oscillation frequency. Figure 3 As shown in FIG. 1 , the internal time is updated to the input time, and the frequency error is also corrected to be close to zero. Therefore, it is possible to provide a real-time clock device 20 that can provide accurate time information and maintain time accuracy. In addition, in this embodiment, as shown in FIG. Figure 4 As shown, the oscillation frequency based on the time difference and the phase difference is adjusted by inputting the time stamp information TMS, or the time stamp information TMS and the reference signal SRF into the real-time clock device 20. Therefore, the real-time clock device 20 as a real-time clock module in one package can be built with a correction function for adjusting the oscillation frequency based on the time difference and the phase difference, and can provide high-precision time information in a small size and with low power consumption.

[0034] 2. Detailed structure example

[0035] Figure 5 A detailed configuration example of the real-time clock device 20 according to the present embodiment is shown. Figure 5 The real-time clock device 20 is provided with a reference signal generating unit 90 in addition to the interface circuit 30, the processing circuit 40, the oscillation circuit 60, the frequency dividing circuit 62, the timing counter 70, and the phase comparator 80. The reference signal generating unit 90 generates a reference signal SRF based on the time stamp information TMS. In addition, the structure of the real-time clock device 20 and the processing circuit 40 is not limited to Figure 5 The structure can be modified in various ways, such as omitting some of the structural elements, adding other structural elements, or replacing some of the structural elements with other structural elements.

[0036] exist Figure 5 In the embodiment, the oscillation circuit 60 generates an oscillation signal by oscillating the vibrator 10, and outputs an oscillation clock signal CK. The vibrator 10 is an element that generates mechanical vibrations by electrical signals. The vibrator 10 can be implemented, for example, by a vibrating plate such as a quartz vibrating plate. For example, the vibrator 10 can be implemented by a quartz vibrating plate that performs thickness shear vibration with a cut angle of AT cut or SC cut, a tuning fork type quartz vibrating plate, or a double tuning fork type quartz vibrating plate. In addition, the vibrator 10 of the present embodiment can also be implemented by various vibrating plates such as a thickness shear vibration type, a vibrating plate other than a tuning fork type or a double tuning fork type, a piezoelectric vibrating plate formed of a material other than quartz. For example, as the vibrator 10, a SAW (Surface Acoustic Wave) resonator, a MEMS (Micro Electro Mechanical Systems) vibrator as a silicon vibrator formed using a silicon substrate, etc. can also be used.

[0037] For example, Figure 5 The real-time clock device 20 houses an integrated circuit device and an oscillator 10 in a package 5. The integrated circuit device includes an interface circuit 30, a processing circuit 40, an oscillation circuit 60, a frequency division circuit 62, a timing counter 70, a phase comparator 80, and the like. The integrated circuit device is a circuit device called an IC (Integrated Circuit). For example, an integrated circuit device is an IC manufactured by a semiconductor process, and is a semiconductor chip having circuit elements formed on a semiconductor substrate. The oscillator 10 is electrically connected to the integrated circuit device. For example, the oscillator 10 is electrically connected to the integrated circuit device using internal wiring, bonding wires, or metal bumps of the package 5 that houses the oscillator 10 and the integrated circuit device. In addition, the following variation may be implemented: instead of building the oscillator 10 into the real-time clock device 20, a oscillator 10 disposed outside is used.

[0038] The oscillation circuit 60 can be realized, for example, by a drive circuit for oscillation electrically connected to one end and the other end of the oscillator 10, and passive elements such as capacitors and resistors. The drive circuit can be realized, for example, by a bipolar transistor or a CMOS inverter circuit. The drive circuit is the core circuit of the oscillation circuit 60, and the drive circuit drives the oscillator 10 by voltage or current, thereby causing the oscillator 10 to oscillate. As the oscillation circuit 60, various types of oscillation circuits such as inverter type, Pierce type, Colpitts type, or Hartley type can be used.

[0039] In addition, the oscillation circuit 60 can include a variable capacitance circuit not shown. The variable capacitance circuit includes, for example, a capacitor array having a plurality of capacitors and a switch array having a plurality of switches. Furthermore, each capacitor of the plurality of capacitors and each switch of the plurality of switches are connected in series between a node at one end or the other end of the oscillator 10 and, for example, a ground node. Furthermore, the capacitance values ​​of the plurality of capacitors of the capacitor array are weighted in binary. Furthermore, the plurality of switches of the switch array are turned on and off based on the frequency control signal SFC, i.e., the frequency control data, from the processing circuit 40. Thus, the capacitance value of the variable capacitance circuit is controlled, and the oscillation frequency of the oscillation circuit 60 is adjusted. Alternatively, the variable capacitance circuit can also be realized by a variable capacitance element such as a varactor diode. In this case, a frequency control voltage is input to the oscillation circuit 60 as the frequency control signal SFC from the processing circuit 40, and the capacitance of the variable capacitance element is adjusted by the frequency control voltage, thereby adjusting the oscillation frequency of the oscillation circuit 60. Furthermore, in the present embodiment, a temperature compensation circuit for performing temperature compensation processing based on a temperature detection signal from a temperature sensor can also be provided. In this case, the capacitance of the variable capacitance circuit is adjusted based on the temperature compensation result in the temperature compensation circuit, thereby performing temperature compensation for the oscillation frequency. In addition, the connection in this embodiment is an electrical connection. The electrical connection is a connection that can transmit an electrical signal, and is a connection that can transmit information based on the electrical signal. The electrical connection can also be a connection via a passive element, etc.

[0040] exist Figure 5 In the embodiment, the processing circuit 40 includes a time difference calculation unit 42, a frequency offset calculation unit 44, and a frequency adjustment circuit 46. The time difference calculation unit 42 obtains the time difference TMD between the input time TA and the internal time TB set in the timing counter 70. For example, the information of the input time TA based on the time stamp information TMS input via the interface circuit 30 is stored in the input time register 54. In addition, the information of the internal time TB generated by the timing counting process of the timing counter 70 is stored in the internal time register 56. Then, the time difference calculation unit 42 obtains the time difference TMD between the input time TA from the input time register 54 and the internal time TB from the internal time register 56.

[0041] In addition, the reference signal generating unit 90 generates a reference signal SRF based on the time stamp information TMS. For example, when the time stamp information TMS is input from the outside via the interface circuit 30, the reference signal generating unit 90 generates a reference signal SRF based on the time stamp information TMS, and the reference signal SRF is a signal of the reference timing of the time stamp. At the same time, the input time TA based on the time stamp information TMS is stored in the input time register 54. In addition, the phase comparator 80 obtains the phase difference PHD between the reference signal SRF generated by the reference signal generating unit 90 and the divided clock signal CKD from the frequency dividing circuit 62. Then, the frequency offset calculation unit 44 obtains the frequency offset FOF based on the time difference TMD from the time difference calculation unit 42 and the phase difference PHD from the phase comparator 80. For example, the frequency offset calculation unit 44 obtains the average offset frequency deviation based on the addition result of the time difference TMD and the phase difference PHD as the frequency offset FOF. The frequency adjustment circuit 46 adjusts the frequency of the oscillation circuit 60 based on the frequency offset FOF. For example, the frequency adjustment circuit 46 generates a frequency control signal SFC that increases or decreases the frequency of the oscillation clock signal CK by the amount of the obtained frequency offset FOF, and outputs it to the oscillation circuit 60. Then, the oscillation circuit 60 outputs the oscillation clock signal CK of the oscillation frequency corresponding to the frequency offset FOF. For example, by controlling the capacitance of the variable capacitance circuit of the oscillation circuit 60 based on the frequency offset FOF, the oscillation clock signal CK of the oscillation frequency corresponding to the frequency offset FOF is generated.

[0042] Thus, in the present embodiment, the time difference calculation unit 42 obtains the time difference TMD between the input time TA and the internal time TB, the frequency offset calculation unit 44 obtains the frequency offset FOF based on the time difference TMD and the phase difference PHD, and the frequency adjustment circuit 46 adjusts the frequency of the oscillation circuit 60 based on the frequency offset FOF. In this way, the frequency offset FOF that reflects not only the time difference TMD between the input time TA based on the timestamp information TMS and the internal time TB set in the timing counter 70 but also the phase difference PHD between the reference signal SRF and the divided clock signal CKD is obtained, and the frequency of the oscillation circuit 60 can be adjusted.

[0043] In addition, in the present embodiment, the processing circuit 40 calculates the correction time interval CTI based on the first input time TA1 based on the time stamp information TMS input at the first timing and the second input time TA2 based on the time stamp information TMS input at the second timing after the first timing. For example, the time difference between the first input time TA1 based on the time stamp information TMS input via the interface circuit 30 at the first timing and the second input time TA2 based on the time stamp information TMS input via the interface circuit 30 at the next second timing is calculated, and the correction time interval CTI is set by the time difference. Then, the frequency of the oscillation circuit 60 is adjusted based on the correction time interval CTI, the time difference TMD between the input time and the internal time, and the phase difference PHD between the reference signal SRF and the divided clock signal CKD. For example, the frequency of the oscillation circuit 60 is adjusted based on the value obtained by dividing the addition result of the time difference TMD and the phase difference PHD by the correction time interval CTI. In this way, even when the correction interval based on the timestamp information TMS is not a fixed interval, by calculating the correction time interval CTI based on the difference between the first input moment TA1 of the first timing and the second input moment TA2 of the second timing, appropriate frequency adjustment of the oscillation circuit 60 based on the time difference TMD and the phase difference PHD can be achieved.

[0044] Specifically, if Figure 5As shown, the processing circuit 40 includes a storage unit 50, a correction time interval calculation unit 52, a time difference calculation unit 42, a frequency offset calculation unit 44, and a frequency adjustment circuit 46. The storage unit 50 stores a first input time TA1 based on the time stamp information TMS input at a first timing. The correction time interval calculation unit 52 obtains the correction time interval CTI based on the first input time TA1 stored in the storage unit 50 and the second input time TA2 based on the time stamp information TMS at a second timing. For example, the first input time TA1 based on the time stamp information TMS input via the interface circuit 30 at a first timing is set in the input time register 54 and stored in the storage unit 50. In addition, the second input time TA2 based on the time stamp information TMS input via the interface circuit 30 at the next second timing is set in the input time register 54 and input to the correction time interval calculation unit 52. Then, the correction time interval calculation unit 52 obtains the correction time interval CTI based on the first input time TA1 from the storage unit 50 and the second input time TA2 from the input time register 54. As an example, CTI=TA2-TA1 is obtained as the correction time interval. In addition, the time difference calculation unit 42 obtains the time difference TMD between the second input time TA2 and the internal time TB. For example, the time difference calculation unit 42 obtains the time difference TMD between the second input time TA2 set in the input time register 54 and the internal time TB set in the internal time register 56 from the timing counter 70. That is, the time difference TMD offset between the correction time intervals CTI is obtained. Then, the frequency offset calculation unit 44 performs a calculation to estimate the frequency offset FOF based on the correction time interval CTI, the time difference TMD and the phase difference PHD. For example, the frequency offset calculation unit 44 obtains the average offset frequency deviation, that is, the frequency offset as FOF=(TMD+PHD) / CTI. The frequency adjustment circuit 46 adjusts the frequency of the oscillation circuit 60 based on the frequency offset FOF. For example, frequency correction is performed in the frequency adjustment circuit 46 to offset the estimated frequency offset FOF.

[0045] Thus, in the present embodiment, the correction time interval calculation unit 52 obtains the correction time interval CTI based on the first input time TA1 of the first timing and the second input time TA2 of the next second timing. In addition, the time difference calculation unit 42 obtains the time difference TMD between the second input time TA2 and the internal time TB. Then, the frequency offset calculation unit 44 obtains the frequency offset FOF based on the correction time interval CTI, the phase difference PHD and the time difference TMD, and the frequency adjustment circuit 46 adjusts the frequency of the oscillation circuit 60 based on the frequency offset FOF. Thus, even if the interval of the correction based on the timestamp information TMS is not a fixed interval, the correction time interval calculation unit 52 obtains the correction time interval CTI based on the first input time TA1 and the second input time TA2, thereby enabling the oscillation circuit 60 to achieve appropriate frequency adjustment based on the time difference TMD and the phase difference PHD.

[0046] In addition, Figure 5 In the embodiment, the correction time interval calculation unit 52 calculates the correction time interval CTI, but the present embodiment is not limited thereto. For example, when the correction time interval CTI is known, the correction time interval calculation unit 52 and the storage unit 50 may not be provided. For example, when the time stamp information TMS is input at a fixed time interval, the correction time interval CTI becomes a known interval, so a modification in which the correction time interval calculation unit 52 and the storage unit 50 are not provided can be implemented.

[0047] Figure 6 Yes Description Figure 5 The signal waveform diagram of the operation of the structural example. Figure 6 In the first input shown in A1 of FIG. , the input time TA=TA1=[12:00:00] is input by the time stamp information TMS. And, as shown in A2, the input time TA=TA1=[12:00:00] is set in the input time register 54. TA1 is the first input time. In addition, the reference signal generating unit 90 generates the reference signal SRF based on the time stamp information TMS. Then, using the reference signal SRF as a trigger, the information of the internal time TB of the timing counter 70 is updated, and as shown in A3, the updated internal time TB=[12:00:00] is set in the internal time register 56. In addition, as shown in A4, an adjustment process is performed to make the timing of the timing coincide with the timing of the reference signal SRF. Specifically, a phase adjustment process is performed to make the edge timing of the divided clock signal CKD coincide with the edge timing of the reference signal SRF. This phase adjustment process can be realized, for example, by resetting or setting the frequency division counter of the frequency division circuit 62 based on the reference signal SRF.

[0048] In addition, if Figure 6As shown in A5 of , in the second input, the input time TA=TA2=[12:16:40] is input. For example, when the timing of the first input is the first timing, the second input timing becomes the second timing. Similarly, when the second input timing is the first timing, the third input timing becomes the second timing. The same applies thereafter. Moreover, as shown in A6, the input time TA=TA2=[12:16:40] is set in the input time register 54. TA2 is the second input time. In addition, as shown in A7, the time difference between the input time TA=TA2=[12:16:40] and the input time TA=TA1=[12:00:00] stored in the storage unit 50, that is, 16 minutes and 40 seconds, is obtained as the correction time interval CTI. In addition, as shown in A8, the time difference TMD=1 second between the input time TA=TA2=[12:16:40] and the internal time TB=[12:16:39] is obtained. That is, here, due to the aging of the oscillation frequency of the oscillator 10, the internal time is delayed from the input time as the actual time, and the time difference TMD is calculated as 1 second. In addition, when the internal time is ahead of the input time, the time difference TMD is a negative value. In addition, as shown in A9, the phase difference PHD between the reference signal SRF and the divided clock signal CKD is also calculated. For example, in A4, the edge timing of the reference signal SRF and the divided clock signal CKD is consistent, but in A9, the edge timing of the divided clock signal CKD is delayed relative to the edge timing of the reference signal SRF, which is calculated as the phase difference PHD. Then, based on these time differences TMD and phase difference PHD, the frequency offset FOF is calculated, and the frequency of the oscillation circuit 60 is adjusted based on the frequency offset FOF. For example, when the time difference TMD is 1 second and the phase difference PHD is 0.1 second, TMD+PHD=1.1 seconds. In this case, (TMD+PHD) / CTI=1.1 seconds / 16 minutes and 40 seconds is obtained as the average offset frequency deviation, and the frequency offset correction of the oscillation circuit 60 is performed.

[0049] Figure 7 Yes Description Figure 5 When the power is turned on and the real-time clock device 20 is started (step S1), the timing counter 70 starts to count (steps S2 and S3). Figure 6 , Figure 3 As described in the description, when the time information is input to the real-time clock device 20 through the time stamp information TMS (step S11), the reference signal SRF is generated, the input time is stored in the storage unit 50, and the phase comparison between the reference signal SRF and the divided clock signal CKD is implemented (step S12). Then, the time information of the timing counter 70 and the like is updated (step S13). In addition, Figure 6In the initial input of A1, the phase comparison of step S12 is not performed.

[0050] Then, if it is the first input and there is no previous time input, the processing of adjusting the timing of the timer to the timing of the reference signal SRF is performed (steps S14 and S15). Figure 6 As shown in A4 of FIG. 1 , a phase adjustment process is performed to make the edge timing of the frequency-divided clock signal CKD consistent with the edge timing of the reference signal SRF. On the other hand, when there is a previous time input, the correction time interval CTI is calculated based on the difference between the previous time and the input time, and the time difference TMD between the input time and the internal time of the timing counter 70 is calculated (steps S14 and S16). Then, the frequency offset FOF is calculated based on the time difference TMD and the phase difference PHD obtained in step S12 (step S17), and the frequency offset correction is performed (step S18).

[0051] As described above, in this embodiment, the frequency offset correction of the oscillation circuit 60 is performed based on the time difference TMD between the input time and the internal time and the phase difference PHD between the reference signal SRF and the divided clock signal CKD, so that it is possible to provide accurate time information and maintain time accuracy. In addition, since the frequency offset FOF is calculated using the correction time interval CTI which is the difference between the previous time and the input time, even if the correction interval is not a fixed interval, by using the correction time interval CTI, it is possible to achieve appropriate frequency offset correction based on the time difference TMD and the phase difference PHD.

[0052] In addition, Figure 5 In the embodiment, the real-time clock device 20 includes a reference signal generating unit 90 that generates a reference signal SRF based on the time stamp information TMS. In this way, even if the reference signal SRF for synchronization of the time stamp information TMS is not input from the outside, by generating the reference signal SRF based on the time stamp information TMS, the phase difference PHD between the reference signal SRF and the divided clock signal CKD can be obtained, and the frequency of the oscillation circuit 60 can be adjusted. In addition, based on the reference signal SRF generated by the reference signal generating unit 90, the internal time in the timing counter 70 can also be updated, and the internal time can be updated at an appropriate timing.

[0053] Specifically, in this embodiment, the reference signal generating unit 90 generates the reference signal SRF based on the input timing or input end timing of the time stamp information TMS. In this way, the input timing and input end timing of the time stamp information TMS can be effectively used to set the timing of the reference signal SRF. Moreover, the reference signal SRF with the timing set in this way can be used to perform phase comparison with the divided clock signal CKD.

[0054] For example, Figure 8This is an example of a signal waveform when the interface circuit 30 performs I2C serial communication. I2C is a synchronous serial communication method that uses two signal lines, a serial clock signal SCL and a serial data signal SDA, for communication. Multiple slave devices can be connected to the I2C bus, and the master device specifies the address of each slave device that is individually determined. After selecting a slave device, it communicates with the slave device. Moreover, in I2C, after the master device sets the serial data signal SDA to a low-level start condition, the address is communicated synchronously with the serial clock signal SCL, and then the data is communicated synchronously with the serial clock signal SCL. When the data communication is completed, the ACK bit is returned, and the clock is stretched. Moreover, in the present embodiment, a reference signal SRF is generated based on the input timing of the timestamp information TMS. Specifically, as Fig. 9 As shown, the reference signal generating unit 90 generates the reference signal SRF at the timing of the start condition of I2C. For example, the reference signal generating unit 90 changes the reference signal SRF from the low level to the high level which is the effective level at the timing when the serial data signal SDA changes to the low level. In this way, the reference signal SRF can be generated by utilizing the input timing of I2C when the serial data signal SDA changes from the high level to the low level.

[0055] In addition, in the present embodiment, the reference signal generating unit 90 may generate the reference signal SRF based on the input end timing. Fig.10 In the example, after ACK, the master device makes the serial data signal SDA high level, thereby outputting a stop condition. In this case, the reference signal generating unit 90 can also set the timing of the reference signal SRF by using the timing of the stop condition of I2C, for example. For example, after the data reception based on the stop condition is completed, the time required for data reception is determined according to the input data amount, and the phase comparison with the frequency-divided clock signal CKD is performed at the timing shifted from the time.

[0056] In addition, the generation of the reference signal SRF is not limited to Figure 8 to Figure 10 For example, various modifications can be implemented, such as generating the reference signal SRF based on the first change timing of the serial clock signal after the slave device is selected in the SPI.

[0057] 3. Detailed other structural examples

[0058] Fig.11 Another detailed configuration example of the real-time clock device 20 according to the present embodiment is shown. Fig.11 and Figure 5 The difference in structure is that in Fig.11 Not set in Figure 5 Instead of the reference signal generating unit 90, the real-time clock device 20 includes a reference signal input terminal TSRF to which the reference signal SRF is input. Figure 5 The same, therefore, the detailed description is omitted. Fig.11 In the structural example, a reference signal SRF for synchronization of the time stamp information TMS can be input from the outside via the reference signal input terminal TSRF. Then, the phase difference PHD between the reference signal SRF input from the outside and the divided clock signal CKD can be obtained to adjust the frequency of the oscillation circuit 60. In addition, based on the reference signal SRF input from the outside, the internal time in the timing counter 70 can also be updated, and the internal time can be updated at an appropriate timing.

[0059] Fig.12 Yes Description Fig.11 The signal waveform diagram of the operation of the structural example. Fig.12 In the first input shown in B1, the input time TA=TA1=[12:00:00] is input, and as shown in B2, the input time TA=TA1=[12:00:00] is set in the input time register 54. In addition, the reference signal SRF is used as a trigger to update the information of the internal time TB of the timing counter 70, and as shown in B3, the internal time TB=[12:00:00] is set in the internal time register 56. In addition, as shown in B4, the adjustment process is performed to make the timing of the timing coincide with the timing of the reference signal SRF. In addition, as shown in B5, in the second input, the input time TA=TA2=[12:16:40] is input. And, as shown in B6, the input time TA=TA2=[12:16:40] is set in the input time register 54. In addition, as shown in B7, the time difference between the input time TA=TA2=[12:16:40] and the input time TA=TA1=[12:00:00] stored in the storage unit 50 is obtained as the correction time interval CTI. In addition, as shown in B8, the time difference between the input time TA=TA2=[12:16:40] and the internal time TB=[12:16:39] is obtained, and as shown in B9, the phase difference PHD between the reference signal SRF and the divided clock signal CKD is also obtained. Then, based on these time difference TMD and phase difference PHD, the frequency offset FOF is obtained, and the frequency of the oscillation circuit 60 is adjusted based on the frequency offset FOF.

[0060] Fig.13 Yes Description Fig.11 Signal waveform diagram of the operation of the structural example. Fig.13 and Figure 7 The difference is that in Figure 7 In step S12, the reference signal generating unit 90 generates the reference signal SRF. Fig.13 In the present invention, such a reference signal SRF is not generated, and the reference signal SRF is input from the outside via the reference signal input terminal TSRF. Fig.13In step S19, the internal time register 56 is updated by the reference signal SRF input from the outside.

[0061] In this way, Fig.11 In the structural example, a reference signal input terminal TSRF is provided, and a reference signal SRF is input from the outside. Thus, an external processing device can indicate the timing of the input time of the time stamp information TMS through the reference signal SRF and input it to the real-time clock device 20. Then, the real-time clock device 20 compares the phase of the reference signal SRF with the divided clock signal CKD to obtain the phase difference PHD, and can perform frequency adjustment of the oscillation circuit 60 based on the phase difference PHD and the time difference TMD between the input time and the internal time.

[0062] As described above, the real-time clock device of this embodiment includes: an interface circuit, which is input with time stamp information; an oscillation circuit, which outputs an oscillation clock signal; a frequency division circuit, which divides the oscillation clock signal to generate a frequency division clock signal; and a timing counter, which generates internal time information based on the frequency division clock signal. In addition, the real-time clock device includes a phase comparator, which compares the phase of the reference signal for synchronization of the time stamp information with the frequency division clock signal, and obtains the phase difference between the reference signal and the frequency division clock signal. In addition, the real-time clock device includes a processing circuit, which updates the internal time information of the timing counter according to the input time based on the input time stamp information, and adjusts the frequency of the oscillation circuit based on the time difference and phase difference between the input time and the internal time.

[0063] According to the present embodiment, the internal time information of the timing counter is updated according to the input time based on the input timestamp information, thereby the internal time can be corrected to the input time. Moreover, in the present embodiment, the frequency of the oscillation circuit is adjusted based on the time difference between the input time and the internal time, and the phase difference between the reference signal and the divided clock signal. Thus, in addition to the time difference between the input time and the internal time, the frequency of the oscillation circuit can also be adjusted based on the phase difference between the reference signal and the divided clock signal. Thus, the following real-time clock device can be realized: even if the frequency of the oscillation is deviated due to, for example, aging, the error of the timing count caused by the deviation of the frequency of the oscillation can be suppressed, thereby providing high-precision time information.

[0064] In addition, in this embodiment, the processing circuit may include: a time difference calculation unit, which calculates the time difference between the input time and the internal time; a frequency offset calculation unit, which calculates the frequency offset based on the time difference and the phase difference; and a frequency adjustment circuit, which adjusts the frequency of the oscillation circuit based on the frequency offset.

[0065] In this way, the frequency of the oscillation circuit can be adjusted by obtaining a frequency offset that reflects not only the time difference between the input time based on the time stamp information and the internal time set in the timer counter but also the phase difference between the reference signal and the divided clock.

[0066] In addition, in this embodiment, the processing circuit may calculate a correction time interval based on a first input time based on timestamp information input at a first timing and a second input time based on timestamp information input at a second timing after the first timing, and adjust the frequency of the oscillation circuit based on the correction time interval, the time difference and the phase difference.

[0067] In this way, even when the correction interval based on timestamp information is not a fixed interval, by calculating the correction time interval based on the difference between the first input time at the first timing and the second input time at the second timing, appropriate frequency adjustment of the oscillation circuit based on the time difference and phase difference can be achieved.

[0068] In addition, in this embodiment, the processing circuit may also include: a storage unit that stores the first input time; and a correction time interval calculation unit that calculates the correction time interval based on the first input time stored in the storage unit and the second input time based on the timestamp information of the second timing. In addition, the processing circuit may also include: a time difference calculation unit that calculates the time difference between the second input time and the internal time; a frequency offset calculation unit that calculates the frequency offset based on the correction time interval, the time difference and the phase difference; and a frequency adjustment circuit that adjusts the frequency of the oscillation circuit based on the frequency offset.

[0069] Thus, even when the correction interval based on the time stamp information is not a fixed interval, the correction time interval calculation unit obtains the correction time interval based on the first input time and the second input time, thereby enabling appropriate frequency adjustment of the oscillation circuit based on the time difference and the phase difference.

[0070] Furthermore, in this embodiment, a reference signal generating unit that generates a reference signal based on time stamp information may be included.

[0071] In this way, even if a reference signal is not input from the outside, by generating a reference signal based on time stamp information, it is possible to obtain a phase difference between the reference signal and the divided clock signal and adjust the frequency of the oscillation circuit.

[0072] In addition, in the present embodiment, the reference signal generating unit may generate the reference signal based on the input timing or input end timing of the time stamp information.

[0073] In this way, the timing of the reference signal can be set by effectively utilizing the input timing or input end timing of the time stamp information.

[0074] In addition, in this embodiment, a reference signal input terminal to which a reference signal is input may be included.

[0075] In this way, a reference signal for synchronization of time stamp information can be input from the outside via the reference signal input terminal, and a phase difference between the externally input reference signal and the divided clock signal can be obtained to adjust the frequency of the oscillation circuit.

[0076] In addition, the present embodiment is described in detail as described above, but those skilled in the art can easily understand that various modifications can be made without substantially departing from the new matters and effects of the present disclosure. Therefore, all such modifications are included in the scope of the present disclosure. For example, in the specification or the drawings, a term recorded at least once together with a different term in a broader sense or with the same meaning can be replaced with the different term in any part of the specification or the drawings. In addition, all combinations of the present embodiment and the modifications are also included in the scope of the present disclosure. In addition, the structure and operation of the real-time clock device are not limited to the contents described in the present embodiment, and various modifications can be implemented.

Claims

1. A real-time clock device, characterized in that: The real-time clock device comprises: an interface circuit which is input with time stamp information; an oscillation circuit which outputs an oscillation clock signal; A frequency dividing circuit, which divides the frequency of the oscillating clock signal to generate a frequency-divided clock signal; A timing counter, which generates internal time information based on the divided clock signal; a phase comparator for performing phase comparison between a reference signal and the frequency-divided clock signal to obtain a phase difference between the reference signal and the frequency-divided clock signal; as well as A processing circuit updates the internal time information of the timing counter according to an input time based on the input timestamp information, and adjusts the frequency of the oscillation circuit based on a time difference between the input time and the internal time and the phase difference.

2. The real-time clock device according to claim 1, characterized in that: The processing circuit comprises: a time difference calculation unit for obtaining the time difference between the input time and the internal time; a frequency offset calculation unit for calculating a frequency offset based on the time difference and the phase difference; as well as A frequency adjustment circuit performs frequency adjustment of the oscillation circuit based on the frequency deviation.

3. The real-time clock device according to claim 1, characterized in that: The processing circuit calculates a correction time interval based on a first input time instant of the timestamp information input at a first timing and a second input time instant of the timestamp information input at a second timing after the first timing, and adjusts the frequency of the oscillation circuit based on the correction time interval, the time difference and the phase difference.

4. The real-time clock device according to claim 3, characterized in that: The processing circuit comprises: a storage unit for storing the first input time; a correction time interval calculation unit for calculating the correction time interval based on the first input time stored in the storage unit and the second input time based on the time stamp information of the second timing; a time difference calculation unit for obtaining the time difference between the second input time and the internal time; a frequency offset calculation unit for calculating a frequency offset based on the correction time interval, the time difference and the phase difference; as well as A frequency adjustment circuit performs frequency adjustment of the oscillation circuit based on the frequency deviation.

5. The real-time clock device according to any one of claims 1 to 4, characterized in that: The real time clock device includes a reference signal generating unit that generates the reference signal based on the time stamp information.

6. The real-time clock device according to claim 5, characterized in that: The reference signal generation unit generates the reference signal based on input timing or input end timing of the time stamp information.

7. The real-time clock device according to any one of claims 1 to 4, characterized in that: The real-time clock device includes a reference signal input terminal to which the reference signal is input.

Citation Information

Patent Citations

  • Real-Time Clock Device And Electronic Apparatus

    CN113031428A

  • Reference frequency generating device

    JP1999271476A

  • Temperature compensated oscillation circuit, real-time clock device and electronic apparatus

    JP2013150344A

  • Synchronization of a generated clock

    US20110280109A1

  • Time synchronization device, time synchronization system, and time synchronizationmethod

    US20230077120A1