Real-time clock device
The real-time clock device integrates frequency adjustment using phase and time differences to correct for aging-induced frequency drift, ensuring accurate timekeeping with reduced power consumption and device size.
Patent Information
- Application Number
- JP2023081261
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2024-11-28
AI Technical Summary
Existing real-time clock devices face challenges in maintaining high accuracy over time due to frequency drift caused by aging, necessitating frequent updates and increasing size and power consumption when external devices are used for frequency adjustment.
A real-time clock device with an integrated frequency adjustment mechanism that uses phase and time differences between a reference signal and a divided clock signal to correct the oscillation frequency, allowing for accurate timekeeping with reduced power consumption and device size.
The device maintains high time accuracy by adjusting the oscillation frequency based on phase and time differences, reducing errors from frequency drift and enabling precise timekeeping without frequent updates.
Smart Images

Figure 2024165240000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a real time clock device and the like. [Background technology]
[0002] There is known a real-time clock device that generates time information by measuring time based on an oscillating clock signal. For example, Patent Document 1 discloses a method for correcting subseconds by reading data from a lower subsecond counter at a timing corresponding to a reference signal, measuring the error in the measured time data, and performing distributed logical speed-up and speed-down in a higher subsecond counter. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent Publication No. 2021-189037 Summary of the Invention [Problem to be solved by the invention]
[0004] According to the conventional technology of Patent Document 1, it is possible to periodically correct the time with high resolution by logical slowing and fastening. However, as time passes, aging reduces the frequency accuracy of the clock signal that is the basis of the timekeeping data, so there is a problem that it becomes difficult to provide a highly accurate time unless the time information is updated frequently. [Means for solving the problem]
[0005] One aspect of the present disclosure relates to a real-time clock device that includes an interface circuit to which time stamp information is input, an oscillation circuit that outputs an oscillation clock signal, a divider circuit that divides the oscillation clock signal to generate a divided clock signal, a time counter that generates internal time information based on the divided clock signal, a phase comparator that compares the phase of a reference signal with the divided clock signal and determines the phase difference between the reference signal and the divided clock signal, and a processing circuit that updates the internal time information of the time counter based on an input time according to the input time stamp 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] 2 shows an example of the configuration of a real-time clock device according to the present embodiment. [Diagram 2] FIG. 13 is an explanatory diagram of problems in the method of the comparative example. [Diagram 3] FIG. [Figure 4] FIG. 4 is an explanatory diagram of input / output signals according to the embodiment. [Diagram 5] 3 shows a detailed configuration example of the real-time clock device of the present embodiment. [Figure 6] FIG. 4 is a signal waveform diagram illustrating the operation of the present embodiment. [Figure 7] 4 is a flowchart illustrating the operation of the present embodiment. [Figure 8] 4A to 4C are diagrams illustrating examples of signal waveforms of communication performed by an interface circuit. [Figure 9] FIG. 4 is a diagram illustrating an example of a method for generating a reference signal. [Figure 10] FIG. 4 is a diagram illustrating an example of a method for generating a reference signal. [Figure 11] 3 shows a detailed configuration example of the real-time clock device of the present embodiment. [Figure 12] FIG. 4 is a signal waveform diagram illustrating the operation of the present embodiment. [Figure 13] 4 is a flowchart illustrating the operation of the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0007] The present embodiment will be described below. Note that the present embodiment described below does not unduly limit the contents of the claims. Furthermore, not all of the configurations described in the present embodiment are necessarily essential configurations.
[0008] 1. Real-time clock device Fig. 1 shows an example of the configuration of a real-time clock device 20 according to this embodiment. The real-time clock device 20 is, for example, a device that generates time information by measuring time based on an oscillation clock signal CK, and is, for example, a real-time clock module. The real-time clock device 20 in Fig. 1 includes an interface circuit 30, a processing circuit 40, an oscillation circuit 60, a frequency divider circuit 62, a time counter 70, and a phase comparator 80. Note that the real-time clock device 20 is not limited to the configuration in Fig. 1, and various modifications are possible, such as omitting some of these components, adding other components, or replacing some components with other components.
[0009] 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 an input terminal for a serial clock and an input / output terminal for serial data. In FIG. 1, time stamp information TMS, which is 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.
[0010] The processing circuit 40 is a circuit that performs various arithmetic processing and control processing in the real-time clock device 20. The processing circuit 40 can be realized, for example, by a logic circuit, and more specifically, by an ASIC (Application Specific Integrated Circuit) circuit that is automatically placed and wired by a gate array or the like.
[0011] The oscillation circuit 60 is a circuit that outputs an oscillation clock signal CK. For example, the oscillation circuit 60 generates an oscillation signal by an oscillation operation, and outputs an oscillation clock signal CK based on the oscillation signal. For example, the oscillation circuit 60 generates an oscillation signal with a frequency controlled by a frequency control signal SFC from the processing circuit 40, and outputs an oscillation clock signal CK based on this oscillation signal. As an example, the oscillation circuit 60 generates a sine wave oscillation signal by driving an oscillator such as a quartz oscillator to oscillate with a drive circuit, and outputs a square wave oscillation clock signal CK by shaping the generated oscillation signal with a waveform shaping circuit. The oscillation clock signal CK is a clock signal with a frequency of, for example, 32.768 KHz. Note that the frequency of the oscillation clock signal CK is not limited to this, and may be a frequency such as 32 KHz. The real-time clock device 20 may also have a clock output terminal that outputs this oscillation clock signal CK. Note that the oscillation operation of the oscillation circuit 60 is not limited to using such an oscillator, and various modifications are possible.
[0012] The frequency divider circuit 62 divides the oscillation clock signal CK from the oscillation circuit 60 to generate a divided clock signal CKD. For example, the frequency divider circuit 62 includes a frequency divider counter that operates based on the oscillation clock signal CK, and generates the divided clock signal CKD by the frequency divider counter. The divided clock signal CKD is a clock signal with a frequency of, for example, 1 Hz. The frequency divider circuit 62 can include a first frequency divider circuit that divides the oscillation clock signal CK by a first frequency division ratio, and a second frequency divider circuit that divides the first frequency divided clock signal from the first frequency divider circuit by a second frequency division ratio to output a divided clock signal CKD, which is a second frequency divided clock signal. The first frequency division ratio is, for example, 32, and the frequency of the first frequency divided clock signal is, for example, 1.024 KHz. The second frequency division ratio is, for example, 1024, and as a result, a divided clock signal CKD with a frequency of 1 Hz is output from the frequency divider circuit 62. Note that the real-time clock device 20 may select and output from its clock output terminal any one of the oscillation clock signal CK, the first frequency-divided clock signal, and the frequency-divided clock signal CKD, which is the second frequency-divided clock signal.
[0013] The time counter 70 performs a time count process based on the divided clock signal CKD from the frequency divider circuit 62. The time counter 70, which is a time counter circuit, generates time information TMQ indicating the current time, for example, through this time count process. The time information TMQ, which is time data, can include data indicating seconds, minutes, hours, days, months, and years. For example, the time counter 70 has counters for counting the seconds, minutes, hours, days, months, and years, respectively, and generates the time information TMQ through the count process of these counters. The generated time information TMQ is output to the outside via the interface circuit 30 as output time stamp information. Furthermore, the time counter 70 outputs information on the internal time corresponding to the time information TMQ to the processing circuit 40.
[0014] The phase comparator 80 performs a phase comparison between the divided clock signal CKD from the frequency divider circuit 62 and 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 time indicated by the time stamp information TMS is the time at the edge timing of the reference signal SRF. The edge timing is, for example, the rising edge or falling edge of the signal. For example, a processing device such as an external microcomputer outputs time information indicating the time at the edge timing of the reference signal SRF as time stamp information TMS, and this time stamp information TMS is input to the interface circuit 30. As an example of the reference signal SRF, a 1PPS signal in GPS can be used, but is not limited to this. For example, when time information is transmitted to synchronize a plurality of communication devices connected to each other via a network, a synchronization signal of the time information may be used as the reference signal SRF.
[0015] As described above, the real-time clock device 20 of this embodiment includes the interface circuit 30 to which the time stamp information TMS is input, the oscillation circuit 60 to which the oscillation clock signal CK is output, the frequency division circuit 62 to which the oscillation clock signal CK is divided to generate the frequency-divided clock signal CKD, and the clock counter 70 to which the information on the internal time is generated based on the frequency-divided clock signal CKD. The real-time clock device 20 also includes a phase comparator 80 to compare the phase of the reference signal SRF for synchronizing the time stamp information TMS with the frequency-divided clock signal CKD to obtain the phase difference between the reference signal SRF and the frequency-divided clock signal CKD, and a processing circuit 40. For example, the phase comparator 80 outputs information on the phase difference between the edge timings of the reference signal SRF and the frequency-divided clock signal CKD to the processing circuit 40. The processing circuit 40 then performs an update process of the internal time of the clock counter 70 based on the input time indicated by the input time stamp information TMS. That is, the processing circuit 40 updates the information on the internal time of the clock counter 70 based on the input time indicated 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 to set the internal time of the clock counter 70 to the input time of the time stamp information TMS. The processing circuit 40 also 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 frequency-divided clock signal CKD. For example, the processing circuit 40 calculates the time difference between the input time of the time stamp information TMS and the internal time, and obtains information on the phase difference between the reference signal SRF and the frequency-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 brings the time difference between the internal time and the input time closer to zero and also brings the phase difference closer to zero. For example, the processing circuit 40 calculates a frequency offset based on the time difference and the phase difference, and adjusts the oscillation frequency of the oscillation circuit 60 by outputting a frequency control signal SFC corresponding to the frequency offset.
[0016] Thus, according to this embodiment, the time counter 70 performs a time count process based on the divided clock signal CKD of the oscillation clock signal CK, so that information on the internal time can be generated as time information. Then, the information on the internal time of the time counter 70 is updated based on the input time of the input time stamp information TMS, so that the internal time can be corrected to the input time. Furthermore, in this embodiment, the frequency of the oscillation circuit 60 is adjusted 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. This makes it possible to adjust the frequency of the oscillation circuit 60 based on the time difference between the input time and the internal time as well as the phase difference between the reference signal SRF and the divided clock signal CKD. For example, it is possible to adjust the frequency so that 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. As a result, even if a deviation occurs in the oscillation frequency due to aging or the like, it is possible to realize a real-time clock device 20 that can suppress errors in the time count caused by the deviation in the oscillation frequency and provide highly accurate time information.
[0017] For example, FIG. 2 is an explanatory diagram of the problem of the method of the comparative example of this embodiment. In FIG. 2, the frequency error corresponding to the frequency accuracy of oscillation increases over time due to aging, etc., and this frequency error causes a deviation in the internal time. Then, correction is performed to eliminate the deviation in the internal time caused by such a frequency error. In this case, since the frequency error increases over time, the deviation in the internal time also increases, and frequent correction of the internal time becomes necessary. For example, in a conventional one-package real-time clock (RTC) module, the frequency offset increases over time due to aging of the oscillator, which is the internal oscillation element, and the time deviation accelerates accordingly. In order to maintain highly accurate time information when the time deviation is large, it is necessary to frequently perform correction to update the time information as shown in FIG. 2, making it difficult to provide a highly accurate time. On the other hand, in order to realize a highly accurate time, a method of inputting a reference signal to a real-time clock module and performing logical slowing and fasting correction of the time counting is also conceivable. In that case, it is necessary to input a reference signal separately from the time information. Also, since frequency adjustment is not performed in logical slowing and fasting, when a clock signal is output from the real-time clock module, the clock accuracy remains poor. In order to realize an accurate timekeeping clock, it is also possible to use a processing device such as an MCU to adjust the frequency of the clock generation circuit, without using a single-package real-time clock module. However, this method results in a larger device and consumes more power than a single-package 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.
[0018] 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 oscillation frequency is adjusted using the phase difference between the reference signal SRF and the divided clock signal CKD. Therefore, as shown in FIG. 3, the internal time is corrected to be 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, as shown in FIG. 4, in this embodiment, the oscillation frequency is adjusted based on the time difference and phase difference by inputting the time stamp information TMS, or the time stamp information TMS and the reference signal SRF, to the real-time clock device 20. Therefore, it is possible to provide highly accurate time information with a small size and low power consumption by incorporating a correction function for adjusting the oscillation frequency based on the time difference and phase difference into the real-time clock device 20, which is a one-package real-time clock module.
[0019] 2. Detailed configuration example Fig. 5 shows a detailed configuration example of the real-time clock device 20 of this embodiment. The real-time clock device 20 of Fig. 5 is provided with a reference signal generating unit 90 in addition to the interface circuit 30, the processing circuit 40, the oscillator circuit 60, the frequency divider circuit 62, the clock 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. Note that the configurations of the real-time clock device 20 and the processing circuit 40 are not limited to those shown in Fig. 5, and various modifications are possible, such as omitting some of these components, adding other components, or replacing some components with other components.
[0020] In FIG. 5, the oscillator 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 vibration by an electrical signal. The vibrator 10 can be realized by a vibrating piece such as a quartz crystal vibrating piece. For example, the vibrator 10 can be realized by a quartz crystal vibrating piece that vibrates in a thickness-shear manner such as an AT-cut or SC-cut cut angle, a tuning-fork type quartz crystal vibrating piece, or a double-tuning-fork type quartz crystal vibrating piece. Note that the vibrator 10 of this embodiment can also be realized by various vibrating pieces such as a vibrating piece other than a thickness-shear type, a tuning-fork type, or a double-tuning-fork type, or a piezoelectric vibrating piece formed of a material other than quartz. For example, the vibrator 10 can be a SAW (Surface Acoustic Wave) resonator or a MEMS (Micro Electro Mechanical Systems) vibrator as a silicon vibrator formed using a silicon substrate.
[0021] For example, in the real-time clock device 20 of FIG. 5, an integrated circuit device including an interface circuit 30, a processing circuit 40, an oscillation circuit 60, a frequency divider circuit 62, a time counter 70, a phase comparator 80, etc., and an oscillator 10 are housed in a package 5. The integrated circuit device is a circuit device called an IC (Integrated Circuit). For example, the integrated circuit device is an IC manufactured by a semiconductor process, and is a semiconductor chip in which circuit elements are formed on a semiconductor substrate. The oscillator 10 is electrically connected to the integrated circuit device. For example, the oscillator 10 and the integrated circuit device are electrically connected to each other using internal wiring, bonding wires, metal bumps, or the like of the package 5 that houses the oscillator 10 and the integrated circuit device. Note that a modification in which the oscillator 10 is not built into the real-time clock device 20 but is provided externally can be used.
[0022] The oscillation circuit 60 can be realized by, for example, a drive circuit for oscillation electrically connected to one end and the other end of the vibrator 10, and passive elements such as a capacitor and a resistor. The drive circuit can be realized by, for example, a bipolar transistor or a CMOS inverter circuit. The drive circuit is a core circuit of the oscillation circuit 60, and the drive circuit drives the vibrator 10 with voltage or current to oscillate the vibrator 10. As the oscillation circuit 60, various types of oscillation circuits can be used, such as an inverter type, a Pierce type, a Colpitts type, or a Hartley type.
[0023] The oscillation circuit 60 may include a variable capacitance circuit (not shown). The variable capacitance circuit may include, for example, a capacitor array having a plurality of capacitors and a switch array having a plurality of switches. Each of the plurality of capacitors and each of the plurality of switches are connected in series between a node at one end or the other end of the vibrator 10 and, for example, a ground node. The capacitance values of the plurality of capacitors in the capacitor array are weighted in binary. The plurality of switches in the switch array are turned on and off based on frequency control data, which is a frequency control signal SFC from the processing circuit 40. This controls the capacitance value of the variable capacitance circuit, and the oscillation frequency of the oscillation circuit 60 is adjusted. Alternatively, the variable capacitance circuit may be realized by a variable capacitance element such as a varactor. 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 this frequency control voltage, and the oscillation frequency of the oscillation circuit 60 is adjusted. In this embodiment, a temperature compensation circuit may be provided that performs temperature compensation processing based on a temperature detection signal from a temperature sensor. 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 of the oscillation frequency. Note that the connection in this embodiment is an electrical connection. An electrical connection is a connection that allows an electrical signal to be transmitted, and is a connection that allows information to be transmitted by an electrical signal. The electrical connection may be a connection via a passive element or the like.
[0024] 5, 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 calculates the time difference TMD between the input time TA and the internal time TB set in the clock counter 70. For example, information on 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. Information on the internal time TB generated by the clock count process of the clock counter 70 is stored in the internal time register 56. The time difference calculation unit 42 then calculates 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.
[0025] Also, 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, which is a signal of the reference timing of the time stamp, from the time stamp information TMS. At the same time, the input time TA according to the time stamp information TMS is stored in the input time register 54. Also, the phase comparator 80 calculates 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 divider circuit 62. Then, the frequency offset calculation unit 44 calculates 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 calculates the average offset frequency deviation based on the result of adding the time difference TMD and the phase difference PHD as the frequency offset FOF. Then, 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 determined frequency offset FOF, and outputs it to the oscillation circuit 60. The oscillation circuit 60 then outputs the oscillation clock signal CK having an oscillation frequency according to the frequency offset FOF. For example, the capacitance of the variable capacitance circuit of the oscillation circuit 60 is controlled by the frequency control signal SFC based on the frequency offset FOF, thereby generating the oscillation clock signal CK having an oscillation frequency according to the frequency offset FOF.
[0026] As described above, in this embodiment, the time difference calculation unit 42 calculates the time difference TMD between the input time TA and the internal time TB, the frequency offset calculation unit 44 calculates 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 manner, it becomes possible to calculate the frequency offset FOF that reflects not only the time difference TMD between the input time TA based on the time stamp information TMS and the internal time TB set in the clock counter 70, but also the phase difference PHD between the reference signal SRF and the divided clock signal CKD, and adjust the frequency of the oscillation circuit 60.
[0027] In this embodiment, the processing circuit 40 obtains a correction time interval CTI based on a first input time TA1 based on the time stamp information TMS input at the first timing and a second input time TA2 based on the time stamp information TMS input at the second timing after the first timing. For example, a time difference between the first input time TA1 based on the time stamp information TMS input through the interface circuit 30 at the first timing and the second input time TA2 based on the time stamp information TMS input through the interface circuit 30 at the next second timing is obtained, and the correction time interval CTI is set based on this 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 a value obtained by dividing the sum of the time difference TMD and the phase difference PHD by the correction time interval CTI. In this way, even if the interval of correction using the time stamp information TMS is not constant, by calculating the correction time interval CTI based on the difference between the first input time TA1 at the first timing and the second input time TA2 at the second timing, it is possible to achieve appropriate frequency adjustment of the oscillator circuit 60 based on the time difference TMD and phase difference PHD.
[0028] Specifically, as shown in FIG. 5, 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 the first timing. The correction time interval calculation unit 52 calculates a 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 the second timing. For example, the first input time TA1 based on the time stamp information TMS input via the interface circuit 30 at the first timing is set in the input time register 54 and stored in the storage unit 50. 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. The correction time interval calculation unit 52 calculates 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, the correction time interval is calculated as CTI=TA2-TA1. The time difference calculation unit 42 also calculates the time difference TMD between the second input time TA2 and the internal time TB. For example, the time difference calculation unit 42 calculates 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 clock counter 70. That is, the time difference TMD shifted during the correction time interval CTI is calculated. The frequency offset calculation unit 44 then performs calculations 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 calculates the frequency offset, which is the average offset frequency deviation, as FOF=(TMD+PHD) / CTI. Then, 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 performs frequency correction so as to cancel the estimated frequency offset FOF.
[0029] In this embodiment, the correction time interval calculation unit 52 calculates the correction time interval CTI based on the first input time TA1 at the first timing and the second input time TA2 at the next second timing. The time difference calculation unit 42 calculates the time difference TMD between the second input time TA2 and the internal time TB. The frequency offset calculation unit 44 calculates 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 this frequency offset FOF. In this way, even if the interval of correction based on the time stamp information TMS is not constant, the correction time interval calculation unit 52 calculates the correction time interval CTI from the first input time TA1 and the second input time TA2, so that the oscillation circuit 60 can be properly adjusted in frequency based on the time difference TMD and the phase difference PHD.
[0030] 5, the correction time interval calculation unit 52 calculates the correction time interval CTI, but this embodiment is not limited to this. For example, if 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, if the time stamp information TMS is input at a constant time interval, the correction time interval CTI is a known interval, so that a modified embodiment without providing the correction time interval calculation unit 52 and the storage unit 50 is possible.
[0031] FIG. 6 is a signal waveform diagram for explaining the operation of the configuration example of FIG. 5. In the first input shown at A1 in FIG. 6, the input time TA=TA1=[12:00:00] is input by the time stamp information TMS. Then, as shown at A2, the input time TA=TA1=[12:00:00] is set in the input time register 54. TA1 is the first input time. The reference signal generating unit 90 generates a reference signal SRF based on the time stamp information TMS. Then, the reference signal SRF is used as a trigger to update the information of the internal time TB of the clock counter 70, and as shown at A3, the updated internal time TB=[12:00:00] is set in the internal time register 56. Also, as shown at A4, an adjustment process is performed to align the clock timing with the timing of the reference signal SRF. Specifically, a phase adjustment process is performed to align the edge timing of the divided clock signal CKD 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.
[0032] As shown in A5 of FIG. 6, in the second input, the input time TA=TA2=[12:16:40] is input. For example, if the timing of the first input is the first timing, the second input timing is the second timing. Similarly, if the timing of the second input is the first timing, the timing of the third input is the second timing. The same applies to the following. Then, 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. As shown in A7, 16 minutes and 40 seconds, which is 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. 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 aging of the oscillation frequency of the oscillator 10, the internal time is delayed from the input time, which is the actual time, and the time difference TMD=1 second is obtained. If the internal time is ahead of the input time, the time difference TMD becomes a negative value. Also, as shown in A9, the phase difference PHD between the reference signal SRF and the divided clock signal CKD is obtained. For example, in A4, the edge timing of the reference signal SRF and the divided clock signal CKD are aligned, but in A9, the edge timing of the divided clock signal CKD is delayed from the edge timing of the reference signal SRF, and this is obtained as the phase difference PHD. 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 this frequency offset FOF. For example, if the time difference TMD is 1 second and the phase difference PHD is 0.1 seconds, TMD+PHD=1.1 seconds. In this case, the average offset frequency deviation is calculated as (TMD+PHD) / CTI=1.1 seconds / 16 minutes 40 seconds, and the frequency offset correction of the oscillator circuit 60 is performed.
[0033] Fig. 7 is a flow chart for explaining the operation of the configuration example of Fig. 5. When the power is turned on and the real-time clock device 20 is started (step S1), the time count by the clock counter 70 is started and executed (steps S2, S3). Then, as explained in Figs. 6 and 3, when the time information is input to the real-time clock device 20 by the time stamp information TMS (step S11), the reference signal SRF is generated, the input time is stored in the memory unit 50, and a phase comparison is performed between the reference signal SRF and the divided clock signal CKD (step S12). Then, the time information of the clock counter 70, etc. is updated (step S13). Note that the phase comparison in step S12 is not performed in the first input of A1 in Fig. 6.
[0034] If this is the first input and there has been no previous time input, a process is performed to adjust the timing to match the timing of the reference signal SRF (steps S14, S15). That is, as shown at A4 in FIG. 6, a phase adjustment process is performed to align the edge timing of the divided clock signal CKD with the edge timing of the reference signal SRF. On the other hand, if there has been a previous time input, a correction time interval CTI is calculated from the difference between the previous time and the input time, and a time difference TMD between the input time and the internal time of the clock counter 70 is calculated (steps S14, S16). Then, a frequency offset FOF is calculated from the time difference TMD and the phase difference PHD calculated in step S12 (step S17), and frequency offset correction is performed (step S18).
[0035] As described above, in this embodiment, the frequency offset of the oscillator circuit 60 is corrected 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 precision. Also, 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 constant, it is possible to achieve appropriate frequency offset correction based on the time difference TMD and phase difference PHD by using the correction time interval CTI.
[0036] 5, 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 with the time stamp information TMS is not input from the outside, the reference signal SRF can be generated based on the time stamp information TMS, thereby determining the phase difference PHD between the reference signal SRF and the divided clock signal CKD and adjusting the frequency of the oscillator circuit 60. In addition, it becomes possible to update the internal time in the clock counter 70 based on the reference signal SRF generated by the reference signal generating unit 90, and it becomes possible to update the internal time at the appropriate timing.
[0037] 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 or input end timing of the time stamp information TMS can be effectively used to set the timing of the reference signal SRF. Then, the reference signal SRF whose timing is set in this way can be used to perform phase comparison with the divided clock signal CKD, etc.
[0038] For example, FIG. 8 shows an example of signal waveforms when the interface circuit 30 performs serial communication of I2C. I2C is a synchronous serial communication method that communicates using two signal lines, a serial clock signal SCL and a serial data signal SDA. A plurality of slaves can be connected to the I2C bus, and the master selects a slave by specifying an address of the slave that is individually determined, and then communicates with the slave. In I2C, after a start condition in which the master sets the serial data signal SDA to a low level, an address is communicated in synchronization with the serial clock signal SCL, and then data is communicated in synchronization with the serial clock signal SCL. When data communication is completed, an ACK bit is returned, and the clock is stretched. In this embodiment, a reference signal SRF is generated based on the input timing of the time stamp information TMS. Specifically, as shown in FIG. 9, 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 a low level to a high level, which is an active level, at the timing when the serial data signal SDA changes to a low level. In this way, the reference signal SRF can be generated by utilizing the I2C input timing at which the serial data signal SDA changes from high level to low level.
[0039] In this embodiment, the reference signal generating unit 90 may generate the reference signal SRF based on the input end timing. For example, in FIG. 10, the master outputs a stop condition by setting the serial data signal SDA to high level after ACK. In this case, the reference signal generating unit 90 may set the timing of the reference signal SRF using, for example, the timing of the I2C stop condition. For example, after data reception is completed by the stop condition, the time required for data reception is determined from the input data amount, and a phase comparison with the divided clock signal CKD is performed at a timing shifted by the amount of the determined time.
[0040] The generation of the reference signal SRF is not limited to the method described in Fig. 8 to Fig. 10. For example, various modifications are possible, such as generating the reference signal SRF based on the first change timing of the serial clock signal after a slave select in the SPI.
[0041] 3. Detailed other configuration examples FIG. 11 shows another detailed configuration example of the real-time clock device 20 of this embodiment. The difference between the configuration of FIG. 11 and that of FIG. 5 is that the reference signal generating unit 90 of FIG. 5 is not provided in FIG. 11, and instead the real-time clock device 20 includes a reference signal input terminal TSRF to which the reference signal SRF is input. Other configuration operations are the same as those of FIG. 5, so detailed explanations are omitted. According to the configuration example of FIG. 11, the reference signal SRF for synchronizing the time stamp information TMS can be input from the outside via the reference signal input terminal TSRF. Then, it is possible to obtain the phase difference PHD between the reference signal SRF input from the outside and the divided clock signal CKD, and adjust the frequency of the oscillation circuit 60. In addition, it is possible to update the internal time in the clock counter 70 based on the reference signal SRF input from the outside, and it is possible to update the internal time at the appropriate timing.
[0042] FIG. 12 is a signal waveform diagram for explaining the operation of the configuration example of FIG. 11. In the first input shown in B1 of FIG. 12, the input time TA=TA1=[12:00:00] is input, and the input time TA=TA1=[12:00:00] is set in the input time register 54 as shown in B2. The reference signal SRF is used as a trigger to update the information of the internal time TB of the clock counter 70, and the internal time TB=[12:00:00] is set in the internal time register 56 as shown in B3. As shown in B4, an adjustment process is performed to align the clock timing with the timing of the reference signal SRF. As shown in B5, in the second input, the input time TA=TA2=[12:16:40] is input. Then, as shown in B6, the input time TA=TA2=[12:16:40] is set in the input time register 54. 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. 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 the time difference TMD and the phase difference PHD, the frequency offset FOF is obtained, and the frequency of the oscillation circuit 60 is adjusted based on this frequency offset FOF.
[0043] Figure 13 is a signal waveform diagram explaining the operation of the configuration example of Figure 11. Figure 13 differs from Figure 7 in that, whereas in step S12 in Figure 7, reference signal generation unit 90 generates reference signal SRF, in Figure 13 such generation of reference signal SRF is not performed, and reference signal SRF is input from the outside via reference signal input terminal TSRF. Then, in step S19 of Figure 13, internal time register 56 is updated by reference signal SRF input from the outside.
[0044] 11, a reference signal input terminal TSRF is provided to input a reference signal SRF from the outside. This allows an external processing device to specify the timing of the input time of the time stamp information TMS using the reference signal SRF and input it to the real-time clock device 20. The real-time clock device 20 then compares the phases of this reference signal SRF and the divided clock signal CKD to determine the phase difference PHD, and can adjust the frequency of the oscillator circuit 60 based on this phase difference PHD and the time difference TMD between the input time and the internal time.
[0045] As described above, the real-time clock device of this embodiment includes an interface circuit to which time stamp information is input, an oscillation circuit that outputs an oscillation clock signal, a frequency divider circuit that divides the oscillation clock signal to generate a frequency-divided clock signal, and a time counter that generates internal time information based on the frequency-divided clock signal. The real-time clock device also includes a phase comparator that performs phase comparison between a reference signal for synchronizing the time stamp information and the frequency-divided clock signal to determine the phase difference between the reference signal and the frequency-divided clock signal. The real-time clock device further includes a processing circuit that updates the internal time information of the time counter based on the input time of 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.
[0046] According to this embodiment, the internal time information of the clock counter is updated based on the input time of the input time stamp information, so that the internal time can be corrected to the input time. Furthermore, in this embodiment, the frequency of the oscillator 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. This makes it possible to adjust the frequency of the oscillator circuit based on the time difference between the input time and the internal time as well as the phase difference between the reference signal and the divided clock signal. This makes it possible to realize a real-time clock device that can provide highly accurate time information by suppressing errors in the clock count caused by the deviation in the oscillation frequency, even if a deviation occurs in the oscillation frequency due to aging, for example.
[0047] In addition, in this embodiment, the processing circuit may include a time difference calculation unit that calculates the time difference between the input time and the internal time, a frequency offset calculation unit that calculates a frequency offset based on the time difference and the phase difference, and a frequency adjustment circuit that adjusts the frequency of the oscillator circuit based on the frequency offset.
[0048] In this way, it is possible to obtain 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 clock counter, but also the phase difference between the reference signal and the divided clock, and adjust the frequency of the oscillator circuit.
[0049] 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 oscillator circuit based on the correction time interval, the time difference, and the phase difference.
[0050] In this way, even if the interval for correction based on the timestamp information is not constant, 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, it is possible to achieve appropriate frequency adjustment of the oscillator circuit based on the time difference and phase difference.
[0051] In this embodiment, the processing circuit may include a storage unit that stores the first input time, a correction time interval calculation unit that calculates a 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 that calculates a time difference between the second input time and the internal time, a frequency offset calculation unit that calculates a 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.
[0052] In this way, even if the interval for correction based on the timestamp information is not constant, the correction time interval calculation unit can calculate the correction time interval from the first input time and the second input time, thereby achieving appropriate frequency adjustment of the oscillator circuit based on the time difference and phase difference.
[0053] This embodiment may also include a reference signal generating unit that generates a reference signal based on the time stamp information.
[0054] In this way, it is possible to generate a reference signal based on timestamp information without inputting the reference signal from outside, thereby determining the phase difference between the reference signal and the divided clock signal and adjusting the frequency of the oscillator circuit.
[0055] In this embodiment, the reference signal generating unit may generate a reference signal based on the input timing or the input end timing of the time stamp information.
[0056] In this way, the timing of inputting the time stamp information and the timing of the end of inputting the time stamp information can be effectively used to set the timing of the reference signal.
[0057] In this embodiment, a reference signal input terminal to which a reference signal is input may also be included.
[0058] In this way, a reference signal for synchronizing timestamp information can be input from outside via the reference signal input terminal, and the phase difference between the externally input reference signal and the divided clock signal can be determined, making it possible to adjust the frequency of the oscillator circuit.
[0059] Although the present embodiment has been described in detail as above, it will be easily understood by those skilled in the art that many modifications are possible without substantially departing from the novel matters and effects of the present disclosure. Therefore, all such modifications are intended to be included in the scope of the present disclosure. For example, a term described at least once in the specification or drawings together with a different term having a broader meaning or the same meaning may be replaced with that different term anywhere in the specification or drawings. In addition, all combinations of the present embodiment and modifications are also included in the scope of the present disclosure. In addition, the configuration and operation of the real-time clock device are not limited to those described in the present embodiment, and various modifications are possible. [Explanation of symbols]
[0060] 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...oscillating circuit, 62...frequency division circuit, 70...time counter, 80...phase comparator, 90...reference signal generating unit, CK...oscillating clock signal, CKD...frequency-divided 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...time stamp information, TSRF...reference signal input terminal
Claims
1. an interface circuit to which time stamp information is input; an oscillation circuit that outputs an oscillation clock signal; a frequency divider circuit that divides the oscillation clock signal to generate a frequency-divided clock signal; a time counter that generates internal time information based on the divided clock signal; a phase comparator that performs a phase comparison between a reference signal and the frequency-divided clock signal to determine a phase difference between the reference signal and the frequency-divided clock signal; a processing circuit that updates the internal time information of the clock counter based on an input time according to the input time stamp 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; A real-time clock device comprising:
2. 2. The real-time clock device according to claim 1, The processing circuitry includes: a time difference calculation unit that calculates the time difference between the input time and the internal time; a frequency offset calculation unit that calculates a frequency offset based on the time difference and the phase difference; a frequency adjustment circuit that adjusts the frequency of the oscillation circuit based on the frequency offset; A real-time clock device comprising:
3. 2. The real-time clock device according to claim 1, The processing circuitry includes: A real-time clock device characterized in that a correction time interval is calculated based on a first input time based on the timestamp information input at a first timing and a second input time based on the timestamp information input at a second timing after the first timing, and the frequency of the oscillator circuit is adjusted based on the correction time interval, the time difference, and the phase difference.
4. 4. The real-time clock device according to claim 3, The processing circuitry includes: a storage unit that stores the first input time; 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 time stamp information of the second timing; 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 a frequency offset based on the correction time interval, the time difference, and the phase difference; a frequency adjustment circuit that adjusts the frequency of the oscillation circuit based on the frequency offset; A real-time clock device comprising:
5. 5. The real-time clock device according to claim 1, a reference signal generating unit that generates the reference signal based on the time stamp information.
6. 6. The real-time clock device according to claim 5, The reference signal generating unit is A real-time clock device which generates the reference signal based on an input timing or an input end timing of the time stamp information.
7. 5. The real-time clock device according to claim 1, A real-time clock device comprising a reference signal input terminal to which the reference signal is input.
Citation Information
Patent Citations
Real time clock circuit, real time clock module, electronic apparatus and correction method for real time clock circuit
JP2021189037A
