Real-time clock generation device and real-time clock generation method
The real-time clock generating device addresses the challenges of power consumption, size, and cost in IoT microcomputers by using a ring oscillator with a control value table to adjust the division ratio and calibrate the frequency, ensuring accurate timekeeping.
Patent Information
- Application Number
- JP2024016537
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-19
AI Technical Summary
Microcomputers in IoT systems face challenges in achieving low power consumption, small size, and low cost while maintaining accurate real-time clock functionality due to the high cost and large size of quartz crystal oscillators.
A real-time clock generating device utilizing a ring oscillator with a control value table to adjust the division ratio of a reference clock signal, combined with a measurement clock for calibration, to maintain accuracy and reduce power consumption.
Generates a real-time clock signal with low power consumption, small size, and low cost while maintaining accuracy by dynamically adjusting the division ratio and calibrating the frequency.
Smart Images

Figure 2025121222000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a technique for generating a real-time clock. [Background technology]
[0002] Microcomputers installed in IoT (Internet of Things) systems and the like are equipped with real-time clocks. Real-time clocks calculate the current time by continuously measuring the oscillations of a reference clock. Here, quartz crystal oscillators are known to oscillate with relatively high accuracy. For this reason, quartz crystal oscillators are usually used as the reference clock (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2003-270369 Summary of the Invention [Problem to be solved by the invention]
[0004] It is desirable for microcomputers installed in IoT systems and the like to be able to run for long periods using coin batteries. Therefore, microcomputers are required to have low power consumption, as well as to be small and inexpensive.
[0005] However, quartz crystal units are expensive. Furthermore, the size of the oscillator circuit for a quartz crystal unit is large, consuming a lot of power. Therefore, using a quartz crystal unit in a real-time clock makes it difficult to meet the requirements of a microcomputer. On the other hand, without using a quartz crystal unit, it is difficult to maintain the accuracy of the real-time clock.
[0006] An object of the present invention is to generate a real-time clock signal with low power consumption, a small size and low cost configuration while maintaining accuracy. [Means for solving the problem]
[0007] According to one aspect of the present invention, a real-time clock generating device includes a first ring oscillator that outputs a reference clock signal; a table acquisition unit that acquires a control value table that indicates the correspondence between a time period in which the first ring oscillator operates and a division ratio of the reference clock signal; a frequency division unit that generates a real-time clock signal by changing the division ratio of the reference clock signal for each time period in which the first ring oscillator operates in accordance with the control value table; a second ring oscillator that outputs a measurement clock signal that oscillates with higher accuracy than the reference clock signal when performing calibration of the control value table; a frequency measurement unit that measures the frequency of the real-time clock signal based on the measurement clock signal; and an update determination unit that determines whether the frequency of the real-time clock signal measured by the frequency measurement unit is within a predetermined allowable error, and if the frequency of the real-time clock signal exceeds the allowable error, updates at least some of the division ratios in the control value table, and terminates the calibration if the frequency of the real-time clock signal is within the allowable error.
[0008] A real-time clock generating method according to another aspect of the present invention includes: obtaining a control value table indicating a correspondence between a time period during which a first ring oscillator that outputs a reference clock signal operates and a division ratio of the reference clock signal; generating a real-time clock signal by changing the division ratio of the reference clock signal for each time period during which the first ring oscillator operates according to the control value table; measuring the frequency of the real-time clock signal based on a measurement clock signal that is output by a second ring oscillator and oscillates with higher accuracy than the reference clock signal when calibrating the control value table; updating at least some of the division ratios in the control value table when the frequency of the real-time clock signal exceeds an allowable error; and terminating the calibration when the frequency of the real-time clock signal becomes equal to or less than the allowable error. [Effects of the Invention]
[0009] According to the present invention, a real-time clock signal can be generated with low power consumption, a small size, and a low cost configuration while maintaining accuracy. [Brief explanation of the drawings]
[0010] [Figure 1] 1 is a diagram illustrating a configuration of an RTC generating device according to an embodiment of the present invention. [Figure 2] FIG. 2 is a functional block diagram for explaining the operation of the RTC generating device. [Figure 3] 10 is a flowchart illustrating an example of an initial calibration executed by a CPU. [Figure 4] 10 is a flowchart showing an example of a first-day in-use calibration executed by a CPU. [Figure 5] 10 is a flowchart showing an example of a second day in-use calibration executed by a CPU. [Figure 6] 10 is a flowchart showing an example of calibration during use on the third day and thereafter executed by the CPU. [Figure 7] 10 is a flowchart showing an example of calibration during use on the third day and thereafter executed by the CPU. [Figure 8] 10 is a flowchart illustrating an example of an update determination process executed by a CPU. [Figure 9] 10 is a flowchart illustrating an example of a temperature determination process executed by a CPU. [Figure 10] 10 is a flowchart showing an example of an abnormality determination process executed by a CPU. DETAILED DESCRIPTION OF THE INVENTION
[0011] Hereinafter, a real-time clock generating device and a real-time clock generating method according to an embodiment of the present invention will be described in detail with reference to the drawings. In the following description, the real-time clock will be abbreviated as RTC.
[0012] 1. RTC generator configuration 1 is a diagram showing the configuration of an RTC generating device according to an embodiment of the present invention. In this example, the RTC generating device 200 is configured as an IC (integrated circuit) chip and is installed in a microcomputer. The RTC generating device 200 operates selectively between an active mode and a sleep mode. In the sleep mode, the power consumption of the RTC generating device 200 is reduced compared to the active mode.
[0013] 1, the RTC generating device 200 includes a storage device 10, a CPU (Central Processing Unit) 20, a ROM (Read Only Memory) 30, a RAM (Random Access Memory) 40, a communication I / F (Interface) 50, a temperature output unit 60, a reference voltage source 70, ring oscillators 80 and 90, a circuit unit 100, and a bus 110. The storage device 10, the CPU 20, the ROM 30, the RAM 40, the communication I / F 50, the temperature output unit 60, and the circuit unit 100 are connected to the bus 110.
[0014] The RTC generating device 200 is also partitioned into a power domain 120 and a power domain 130, which are different from each other. The power domain 120 includes a RAM 40, a reference voltage source 70, a ring oscillator 80, and a circuit unit 100. The power domain 130 includes a storage device 10, a CPU 20, a ROM 30, a communication I / F 50, a temperature output unit 60, a ring oscillator 90, and a bus 110.
[0015] In the active mode, power is supplied to the power domains 120 and 130. In the sleep mode, power is supplied to the power domain 120. Therefore, elements arranged in the power domain 120 can operate even in the sleep mode. On the other hand, in the sleep mode, power is not generally supplied to the power domain 130, but power is supplied to part of the power domain 130 during the initial calibration and the in-use calibration described below. Therefore, some elements arranged in the power domain 130 can operate even in the sleep mode.
[0016] The storage device 10 includes a storage medium such as a semiconductor memory, and stores an RTC generation program in advance. The CPU 20 executes the RTC generation program stored in the storage device 10 to perform an RTC generation process. Details of the RTC generation process will be described later. The RTC generation program may be stored in the ROM 30 instead of the storage device 10. Alternatively, the RTC generation program may be provided in a form stored in an external storage medium such as a computer-readable SD memory card, and may be installed in the storage device 10 or the ROM 30 by being read out via the communication I / F 50 or the like.
[0017] The ROM 30 is made of, for example, a nonvolatile memory. The ROM 30 stores the frequency of the ring oscillator 80 when it vibrates (the frequency of a reference clock signal, which will be described later). The frequency of the ring oscillator 80 varies for each individual RTC generating device 200 due to differences in the manufacturing process. Therefore, in this example, the frequency of the ring oscillator 80 is measured at a specific temperature before shipping the RTC generating device 200 and stored in the ROM 30.
[0018] The RAM 40 is made up of, for example, a volatile memory and is used as a work area for the CPU 20. A control value table is also temporarily stored in the RAM 40. The control value table is generated based on the frequency of the ring oscillator 80 stored in the ROM 30 and the temperature output by the temperature output unit 60, and is used for control by the circuit unit 100. The control value table describes control parameters indicating a division ratio for generating a signal that oscillates at approximately 1 Hz by dividing the frequency of the ring oscillator 80 at the operating temperature of the ring oscillator 80 (the internal temperature of the RTC generating device 200). In this example, the control parameters include a prescaler setting value or a duty ratio in PWM (pulse width modulation) control.
[0019] A communication chip 300 can be connected to the communication I / F 50. The communication chip 300 includes, for example, a Wi-Fi (Wireless Fidelity) chip. When the communication chip 300 is connected to the communication I / F 50, the communication I / F 50 acquires information distributed from a server or the like and outputs the information to the bus 110. The information distributed from the server or the like may include the current time. Furthermore, when the communication chip 300 is connected to the communication I / F 50, an RTC generation program distributed from the server or the like may be installed in the storage device 10 or the ROM 30.
[0020] The temperature output unit 60 includes a temperature sensor 61, an ADC (analog-to-digital converter) 62, and an ADC control unit 63. The temperature sensor 61 detects the ambient temperature of the RTC generation device 200. The ADC 62 performs AD (analog-to-digital) conversion of the temperature value detected by the temperature sensor 61. The ADC control unit 63 accumulates the temperature AD converted by the ADC 62 for a certain period of time and outputs the accumulated temperature to the bus 110. The temperature output to the bus 110 is used to evaluate the internal temperature of the RTC generation device 200.
[0021] An external power supply 400 is connected to the reference voltage source 70. In this example, the external power supply 400 is a coin battery with a voltage of 3.3 V. The reference voltage source 70 includes, for example, a BGR (bandgap reference) circuit, and generates a constant voltage (1.2 V in this example) that is more stable than the external power supply 400, from the voltage supplied by the external power supply 400. The voltage generated by the reference voltage source 70 is supplied to various elements such as ring oscillators 80 and 90.
[0022] The ring oscillator 80 is an oscillator in which a plurality of delay elements are connected in a ring shape, and when a voltage is supplied to it, it outputs an oscillating signal (hereinafter referred to as a reference clock signal) to the circuit section 100. The frequency of the reference clock signal is, for example, about 32 kHz. As described above, a highly stable voltage is supplied to the ring oscillator 80 by the reference voltage source 70, so that fluctuations in the frequency of the reference clock signal caused by fluctuations in voltage are reduced.
[0023] The ring oscillator 90 is configured with a ring oscillator having a bias circuit, and outputs a signal (hereinafter referred to as a measurement clock signal) that oscillates when a voltage is supplied to the circuit unit 100. The frequency of the measurement clock signal is, for example, about 32 MHz. The power consumption of the ring oscillator 90 is greater than that of the ring oscillator 80, but the oscillation accuracy of the measurement clock signal is higher than that of the reference clock signal.
[0024] The circuit unit 100 is configured, for example, by an LSI (large-scale integrated circuit), and includes a selection unit 101, a frequency measurement unit 102, a frequency division unit 103, and a time calculation unit 104. A ring oscillator 90 is connected to the selection unit 101. An external measurement device 500 is also temporarily connected to the selection unit 101 when measuring the frequency of the reference clock signal. In this example, the external measurement device 500 is a tester that outputs an oscillating signal (hereinafter referred to as an external clock signal). The frequency of the external clock signal is, for example, approximately 32 MHz. The accuracy of the external clock signal is higher than the accuracy of the oscillation of the measurement clock signal. The selection unit 101 selects one of the measurement clock signal and the external clock signal, and outputs it to the frequency measurement unit 102.
[0025] The frequency measurement unit 102 is connected to the ring oscillator 80. The frequency measurement unit 102 measures the frequency of the reference clock signal by comparing the reference clock signal output by the ring oscillator 80 with the external clock signal output by the selection unit 101 at a specific temperature. Specifically, the frequency measurement unit 102 measures the frequency of the reference clock signal by counting the number of oscillations of the external clock signal per period of the reference clock signal. The frequency measurement unit 102 may measure the frequency of the reference clock signal by counting the number of oscillations of the external clock signal per multiple periods of the reference clock signal and calculating the average value of the number of oscillations of the external clock signal per period of the reference clock signal. The frequency measurement unit 102 outputs the measured frequency of the reference clock signal to the bus 110. The frequency of the reference clock signal output to the bus 110 is stored in the ROM 30.
[0026] Furthermore, the output signal of the frequency divider 103 (an RTC signal, described later) is fed back to the frequency measurement unit 102. The frequency measurement unit 102 measures the frequency of the RTC signal by comparing the RTC signal fed back from the frequency divider 103 with the measurement clock signal output by the selector 101. The frequency measurement unit 102 outputs the measured frequency of the RTC signal to the bus 110. If the frequency of the RTC signal output to the bus 110 exceeds a predetermined allowable error, at least some of the control parameters in the control value table stored in the RAM 40 are updated.
[0027] The frequency divider 103 divides the reference clock signal measured by the frequency measurement unit 102 by controlling a built-in prescaler or switching element based on the control value table stored in the RAM 40, to generate a signal (hereinafter referred to as the RTC signal) that oscillates at a frequency close to 1 Hz. The control value table describes control parameters based on the internal temperature of the RTC generation device 200, so fluctuations in the frequency of the RTC signal caused by temperature fluctuations are reduced. Since the frequency divider 103 is connected to the RAM 40, it can directly access the RAM 40 in sleep mode without going through the bus 110.
[0028] As described above, the RTC signal generated by the frequency dividing unit 103 is fed back to the frequency measuring unit 102. The feedback of the RTC signal continues until all control parameters in the control value table stored in the RAM 40 are determined. Even after all control parameters in the control value table have been determined, if the temperature output by the temperature output unit 60 fluctuates significantly, the feedback of the RTC signal may be resumed in order to regenerate the control value table. In this example, the feedback of the RTC signal is resumed if the temperature output for a certain time of day deviates significantly from the temperature recorded in the control value table as the temperature for the corresponding time.
[0029] The time calculation unit 104 continuously acquires the RTC signal generated by the frequency division unit 103. The time calculation unit 104 also calculates the time by integrating unit times determined by the acquired RTC signal, and outputs the calculated time to the bus 110. The operation mode of the RTC generation device 200 is switched between active mode and sleep mode according to an operation schedule specified by the user. Therefore, the time output to the bus 110 is used to switch the operation mode of the RTC generation device 200.
[0030] An initial time may be set in the time calculation unit 104 by a user or the like after the RTC generation device 200 is powered on. In this case, the time calculation unit 104 continues to update the set time based on the vibration frequency of the ring oscillator 80. After the in-use calibration is completed, the time calculated by the time calculation unit 104 is periodically compared with the distributed time and is used to detect abnormalities in the RTC generation device 200.
[0031] 2. Operation of the RTC generator 2 is a functional block diagram for explaining the operation of the RTC generating device 200. As shown in Fig. 2, the RTC generating device 200 includes, as functional units, a frequency acquiring unit 201, a temperature acquiring unit 202, a frequency division ratio determining unit 203, a table acquiring unit 204, an update determining unit 205, a temperature determining unit 206, and an abnormality determining unit 207. In this example, the functional units of the RTC generating device 200 are realized by, for example, the CPU 20 executing an RTC generation program.
[0032] The RTC generating device 200 sequentially undergoes initial calibration and in-use calibration. During the initial calibration and in-use calibration, the functional units of the RTC generating device 200 can operate even in sleep mode. In the initial calibration, for example, after the RTC generating device 200 is manufactured and before it is shipped, the frequency of the reference clock signal is measured. Specifically, the RTC generating device 200 is placed in an environment at a specific temperature (for example, 25°C). An external measuring device 500 is connected to the selection unit 101.
[0033] In this state, a voltage is supplied from the reference voltage source 70 to the ring oscillator 80, causing the ring oscillator 80 to output a reference clock signal. The frequency measurement unit 102 measures the frequency of the reference clock signal using the external clock signal output by the selection unit 101. The frequency acquisition unit 201 acquires the frequency of the reference clock signal measured by the frequency measurement unit 102 and stores it in the ROM 30. This completes the initial calibration. After that, the RTC generation device 200 is shipped.
[0034] At the shipping destination of the RTC generating device 200, it will operate according to an operation schedule specified by the user. In-use calibration is performed when the RTC generating device 200 is first started up at the shipping destination of the RTC generating device 200. In the in-use calibration, the temperature acquisition unit 202 acquires the internal temperature of the RTC generating device 200 for each time period of one day based on the ambient temperature of the RTC generating device 200 output by the temperature output unit 60 and the operation schedule of the RTC generating device 200 specified by the user. In this example, the internal temperature of the RTC generating device 200 is acquired at one-hour intervals.
[0035] The internal temperature of the RTC generator 200 is evaluated by adding the temperature due to the power consumption of the RTC generator 200 and the temperature around the RTC generator 200. The temperature due to the power consumption of the RTC generator 200 is calculated by multiplying the power consumption of the RTC generator 200 by the known thermal resistance of the RTC generator 200. The power consumption of the RTC generator 200 differs depending on the operation mode of the RTC generator 200. In sleep mode, the power consumption of the RTC generator 200 is extremely small. Therefore, in sleep mode, the temperature due to the power consumption of the RTC generator 200 can be ignored. In this case, the operating temperature of the RTC generator 200 is equal to the temperature around the RTC generator 200.
[0036] The division ratio determination unit 203 acquires the frequency of the reference clock signal stored in the ROM 30. Based on the frequency of the reference clock signal acquired from the ROM 30, the division ratio determination unit 203 determines the division ratio of the reference clock signal for each time period to generate a signal that oscillates at approximately 1 Hz. In this example, the division ratio of the reference clock signal for each hour is determined. The division ratio includes integer division ratios and decimal division ratios.
[0037] For example, suppose the frequency of the reference clock signal obtained from ROM 30 is 32.456 kHz. Meanwhile, the frequency of the measurement clock signal is 32.050 MHz. In this case, the frequency ratio between the reference clock signal and the measurement clock signal is 987. Therefore, the frequency of the reference clock signal measured using the measurement clock signal is 32472.1378 Hz. Therefore, the integer division ratio for that time period is determined to be 32472.
[0038] The determined integer division ratio is set in the prescaler, thereby generating a signal obtained by dividing the reference clock signal by the determined integer division ratio (hereinafter referred to as the integer division signal). The division ratio determination unit 203 determines the fractional division ratio so that the frequency of the integer division signal in each time period approaches 1 Hz with a resolution smaller than the integer division ratio. In this example, the fractional division ratio is determined as the duty ratio D in PWM control. Here, the duty ratio D for increasing the frequency of the integer division signal in the negative direction is determined by the following equation (1). On the other hand, the duty ratio D for increasing the frequency of the integer division signal in the positive direction is determined by the following equation (2).
[0039]
number
[0040]
number
[0041] In equations (1) and (2), f cal is the frequency of the signal (i.e., the RTC signal) generated by dividing by the fractional division ratio, and is ideally 1 Hz. pre is the frequency of the integer divided signal. In the above example, f pre Therefore, the frequency f in the given time period is 32.456kHz / 32472=0.99950726Hz. preTo approach 1 Hz, the frequency must be increased in the positive direction. Therefore, the duty ratio D is determined using equation (2). Specifically, the duty ratio D for that time period is determined to be approximately 1 / 2029. According to this duty ratio D, the frequency of the RTC signal after frequency division is 1.000000120 Hz.
[0042] The frequency of the reference clock signal fluctuates due to fluctuations in the internal temperature of the RTC generation device 200. Therefore, in this example, the division ratio determination unit 203 compensates the determined integer division ratio and decimal division ratio based further on the known temperature characteristics of the ring oscillator 80 and the internal temperature of the RTC generation device 200 in each time period acquired by the temperature acquisition unit 202. In this way, fluctuations in the reference clock signal caused by fluctuations in the internal temperature of the RTC generation device 200 are compensated for.
[0043] The table acquisition unit 204 generates a control value table describing the integer division ratios and decimal division ratios determined by the division ratio determination unit 203 for each time period in one day, and stores the control value table in the RAM 40. In this example, the temperatures acquired by the temperature acquisition unit 202 for each time period are also described in the control value table.
[0044] In this case, the frequency divider 103 reads the control value table stored in the RAM 40 and divides the reference clock signal output from the ring oscillator 80 by the integer frequency division ratio and decimal frequency division ratio corresponding to the current time, thereby generating an RTC signal. The RTC signal continues to be generated and output at all times, even when the RTC generator 200 transitions to sleep mode.
[0045] After the control value table is stored in RAM 40, frequency measurement unit 102 measures the frequency of the RTC signal for one day output by frequency division unit 103 using the measurement clock signal output by selection unit 101. Update determination unit 205 determines whether the frequency of the RTC signal for each time period measured by frequency measurement unit 102 (in this example, the error between the RTC signal frequency and 1 Hz) is below a predetermined allowable error. If the frequency of the RTC signal for any time period exceeds the allowable error, update determination unit 205 updates the integer division ratio and decimal division ratio in the control value table for that time period. On the other hand, the integer division ratios and decimal division ratios in the control value table for other time periods are not updated and remain fixed.
[0046] In this example, if the frequency of the RTC signal exceeds the allowable error, the update determination unit 205 causes the temperature acquisition unit 202 to acquire the internal temperature of the RTC generation device 200 again for the same time period on the following day. In this case, the division ratio determination unit 203 re-determines the integer division ratio and decimal division ratio for that time period. As a result, the integer division ratio and decimal division ratio in the control value table for that time period are updated.
[0047] When the frequency of the RTC signal is equal to or less than the allowable error for all time periods, the update determination unit 205 ends the in-use calibration. Also, the feedback of the RTC signal from the frequency divider unit 103 to the frequency measurement unit 102 is stopped. Even after the in-use calibration is completed, the feedback of the RTC signal from the frequency divider unit 103 to the frequency measurement unit 102 may be periodically executed, thereby allowing the update determination unit 205 to determine whether the frequency of the RTC signal in any time period is equal to or less than the allowable error. If the frequency of the RTC signal exceeds the allowable error, the above-described in-use calibration may be executed again.
[0048] Furthermore, if the installation environment of the RTC generating device 200 (e.g., installation location or season) changes, the pattern of fluctuations in the internal temperature of the RTC generating device 200 over a day may change, which may invalidate the validity of the generated control value table. Therefore, even after the in-use calibration is completed, the temperature acquisition unit 202 acquires the ambient temperature of the RTC generating device 200 at a specific time every day from the temperature output unit 60. The temperature determination unit 206 determines whether the difference between the temperature acquired by the temperature acquisition unit 202 and the ambient temperature at the same time during the in-use calibration is equal to or less than a predetermined threshold. If the temperature difference exceeds the threshold, the in-use calibration is performed again.
[0049] If all control parameters in the control value table acquired by the table acquisition unit 204 are not fixed within a predetermined period after the start of in-use calibration, the abnormality determination unit 207 determines that the RTC generator 200 is abnormal. After the end of in-use calibration, the abnormality determination unit 207 compares, at predetermined time intervals, the time calculated by the time calculation unit 104 with the time acquired by communication from the communications chip 300 via the communications I / F 50. If the comparison result exceeds the allowable error, the abnormality determination unit 207 determines that the RTC generator 200 is abnormal.
[0050] Due to aging degradation of the RTC generating device 200, the probability of an abnormality occurring in the RTC generating device 200 increases as time passes since the manufacturing date of the RTC generating device 200. Therefore, the intervals at which the above comparison is performed may be shortened as time passes since the manufacturing date of the RTC generating device 200. For example, the abnormality determination unit 207 may perform the comparison every six months for the five years from the manufacturing date of the RTC generating device 200, every month from the fifth year onwards, and every week from the eighth year onwards.
[0051] When the abnormality determination unit 207 determines that the RTC generating device 200 is abnormal, it notifies the user of this. As an example of the notification by the abnormality determination unit 207, if the RTC generating device 200 is connected to a display device, a character string indicating that the RTC generating device 200 is abnormal may be displayed on the display device. If the RTC generating device 200 is connected to an audio output device, a sound indicating the same content may be output, or an alarm sound such as a buzzer may be output. If the RTC generating device 200 is connected to an indicator light such as a lamp, the indicator light may be turned on, off, or flashing.
[0052] 3.RTC generation process The RTC generation process is performed by the CPU 20 executing an RTC generation program, and includes initial calibration, in-use calibration, update determination process, temperature determination process, and abnormality determination process. Below, the initial calibration, in-use calibration, update determination process, temperature determination process, and abnormality determination process will be described with reference to FIG. 2.
[0053] 3 is a flowchart showing an example of a process executed by CPU 20. In the initial calibration, frequency measurement unit 102 measures the frequency of a reference clock signal using an external clock signal output by external measurement device 500. Frequency acquisition unit 201 acquires the frequency of the reference clock signal measured by frequency measurement unit 102 (step S1).
[0054] Next, the frequency acquisition unit 201 estimates process variation information of the ring oscillator 80 based on the frequency of the reference clock signal acquired in step S1 (step S2). In this example, the process variation information is a parameter related to the threshold voltages of PMOS and NMOS field effect transistors, and includes "FF," "FS," "SF," "TT," and "SS." Note that "FF" indicates that the PMOS threshold voltage is low and the NMOS threshold voltage is low. "FS" indicates that the PMOS threshold voltage is low and the NMOS threshold voltage is high. "SF" indicates that the PMOS threshold voltage is high and the NMOS threshold voltage is low. "TT" indicates that the PMOS threshold voltage is approximately intermediate and the NMOS threshold voltage is approximately intermediate. "SS" indicates that the PMOS threshold voltage is high and the NMOS threshold voltage is high.
[0055] Thereafter, the frequency acquisition unit 201 stores the frequency of the reference clock signal including the process variation information estimated in step S2 in the ROM 30 (step S3), thereby completing the initial calibration.
[0056] The in-use calibration starts when the RTC generating device 200 is powered on for the first time after shipping. FIG. 4 is a flowchart showing an example of the in-use calibration on the first day executed by the CPU 20. In the in-use calibration on the first day, the temperature acquisition unit 202 acquires the ambient temperature of the RTC generating device 200 for one day from the temperature output unit 60 (step S11). The temperature acquisition unit 202 also acquires the operation schedule of the RTC generating device 200 (step S12). Steps S11 and S12 may be executed either first or simultaneously. The temperature acquisition unit 202 acquires the fluctuation in the internal temperature of the RTC generating device for one day based on the ambient temperature acquired in step S11 and the operation schedule acquired in step S12 (step S13).
[0057] Next, the division ratio determination unit 203 acquires the frequency of the reference clock signal from the ROM 30 (step S14). Furthermore, the division ratio determination unit 203 determines the integer division ratio for each time period based on the frequency of the reference clock signal acquired in step S14 (step S15). Subsequently, the division ratio determination unit 203 determines the decimal division ratio for the integer-divided signal for each time period determined in step S15 based on equation (1) or equation (2) (step S16). After that, the division ratio determination unit 203 compensates the integer division ratio determined in step S15 and the decimal division ratio determined in step S16 based on the fluctuation in the internal temperature of the RTC generating device over one day acquired in step S13 (step S17).
[0058] Next, table acquisition unit 204 generates a control value table describing the integer division ratio determined in step S15 and the decimal division ratio determined in step S16 (step S18). In this example, the temperature obtained for each time period in steps S11 and S13, and the integer division ratio and decimal division ratio compensated in step S17 are also described in the control value table. Table acquisition unit 204 also stores the control value table obtained in step S18 in RAM 40 (step S19).
[0059] The frequency dividing unit 103 reads the control value table stored in RAM 40 and divides the reference clock signal by the compensated integer division ratio and decimal division ratio to generate an RTC signal. The frequency measuring unit 102 measures the frequency of the RTC signal using the measurement clock signal. This completes the first day of in-use calibration. Since step S11 takes approximately 24 hours to execute, steps S11 to S19 take approximately one day to execute.
[0060] In addition, when the RTC generating device 200 is powered on for the first time after being shipped, the following pre-calibration may be performed by the CPU 20 before the above-mentioned first-day use calibration is started.
[0061] In pre-calibration, an initial time is set in the time calculation unit 104 by a user of the RTC generation device 200 or the like. Therefore, the time calculation unit 104 calculates the time based on a reference clock and continues to update the set initial time. Here, the abnormality determination unit 207 determines whether a predetermined time (24 hours in this example) has elapsed based on the time calculated by the time calculation unit 104.
[0062] If the predetermined time has not elapsed, the abnormality determination unit 207 waits until the predetermined time has elapsed. If the predetermined time has elapsed, the abnormality determination unit 207 acquires the time calculated by the time calculation unit 104. Furthermore, the abnormality determination unit 207 acquires the time distributed by communication from the communication chip 300 via the communication I / F 50. Next, the abnormality determination unit 207 determines whether the difference between the calculated time and the distributed time is within the allowable error.
[0063] If the time difference exceeds the allowable error, the frequency measurement unit 102 measures the frequency of the reference clock signal using the measurement clock signal output by the ring oscillator 90. Therefore, the frequency acquisition unit 201 acquires the frequency of the reference clock signal measured by the frequency measurement unit 102. Thereafter, the frequency acquisition unit 201 updates the frequency of the reference clock signal stored in the ROM 30 to the frequency of the newly acquired reference clock signal. Thereafter, the processing returns to the step of determining whether or not a predetermined time has elapsed.
[0064] If the time difference becomes equal to or smaller than the allowable error, the abnormality determination unit 207 ends the pre-calibration. If the pre-calibration does not end within a predetermined period, the abnormality determination unit 207 may determine that an abnormality has occurred in the RTC generating device 200, notify the user of this, and end the pre-calibration.
[0065] After the in-use calibration on the first day is completed, the in-use calibration on the second day is executed. Fig. 5 is a flowchart showing an example of the in-use calibration on the second day executed by the CPU 20. In the in-use calibration on the second day, the update determination unit 205 acquires the frequency of the RTC signal for each time period of one day measured by the frequency measurement unit 102 (step S21). The update determination unit 205 also determines whether the frequency of the RTC signal for each time period acquired in step S21 has become equal to or less than a predetermined allowable error (step S22).
[0066] If the frequency of the RTC signal for each time period acquired in step S21 falls below the allowable error, the update determination unit 205 sets an OK flag for all time periods in the control value table (step S23). The OK flag indicates that the information in the control value table belonging to the set time period does not need to be updated. Therefore, the in-use calibration on the second day is completed.
[0067] On the other hand, if the frequency of the RTC signal for any time period exceeds the allowable error, the update determination unit 205 sets an NG flag for that time period in the control value table and an OK flag for the other time periods (step S24). The NG flag indicates that the information in the control value table belonging to the set time period needs to be updated. In this case, the temperature acquisition unit 202 acquires the ambient temperature of the RTC generator 200 for that time period from the temperature output unit 60 (step S25). Furthermore, the temperature acquisition unit 202 acquires the internal temperature of the RTC generator for that time period based on the ambient temperature acquired in step S25 and the operation schedule acquired in step S12 (step S26).
[0068] Next, the division ratio determination unit 203 compensates the integer division ratio and decimal division ratio of the reference clock signal for that time period based on the internal temperature of the RTC generating device for that time period acquired in step S26 (step S27). Subsequently, the table acquisition unit 204 updates the control value table stored in RAM 40 using the integer division ratio and decimal division ratio compensated in step S27 (step S28). Specifically, in the control value table, the compensated integer division ratio and decimal division ratio for the time period in which the RTC signal frequency exceeds the allowable error are rewritten to the integer division ratio and decimal division ratio compensated in step S27. In addition, the temperatures acquired in steps S11 and S13 for that time period are also updated to the temperatures acquired in steps S25 and S26, respectively.
[0069] In this case, the frequency dividing unit 103 reads the updated control value table and divides the reference clock signal by the compensated integer division ratio and decimal division ratio to generate an RTC signal. The frequency measuring unit 102 measures the frequency of the RTC signal using the measurement clock signal. This completes the in-use calibration on the second day. Since step S21 takes approximately 24 hours to execute, steps S21 to S30 take approximately one day to execute.
[0070] After the in-use calibration on the second day is completed, the in-use calibration on the third day and thereafter is executed. Figures 6 and 7 are flowcharts showing an example of the in-use calibration on the third day and thereafter executed by CPU 20. In the in-use calibration on the third day and thereafter, update determination unit 205 determines whether or not OK flags are set for all time periods in the control value table (step S31). If OK flags are set for all time periods, the in-use calibration on the third day and thereafter is completed.
[0071] If an NG flag is set for any of the time periods, the abnormality determination unit 207 determines whether a predetermined number of days has passed since the start of in-use calibration (step S32). If the predetermined number of days has passed, the abnormality determination unit 207 determines that an abnormality has occurred in the RTC generating device 200 and notifies the user of this (step S33). In this case, the in-use calibration also ends.
[0072] If the predetermined number of days has not passed, the update determination unit 205 acquires the frequency of the RTC signal for the time period for which the NG flag was set, measured by the frequency measurement unit 102 (step S34). The update determination unit 205 also determines whether the frequency of the RTC signal for that time period acquired in step S34 has become equal to or less than the allowable error (step S35). If the frequency of the RTC signal for that time period has become equal to or less than the allowable error, the update determination unit 205 changes the NG flag for that time period in the control value table to an OK flag (step S36). This completes the in-use calibration from the third day onwards.
[0073] If, in step S35, the frequency of the RTC signal for that time period exceeds the allowable error, steps S37 to S40, which are similar to steps S25 to S28, are executed. This ends the in-use calibration for the third day. In this case, the in-use calibrations shown in FIGS. 6 and 7 are executed on the fourth and subsequent days. The in-use calibrations shown in FIGS. 6 and 7 are repeated until an OK flag is set for all time periods in the control value table, or until a predetermined number of days have passed since the start of the in-use calibration and an abnormality in the RTC generating device 200 is notified to the user.
[0074] In this example, when the OK flag is set for all time periods in the control value table, the in-use calibration ends, and the in-use calibrations in FIGS. 6 and 7 are not performed on the fourth day and thereafter, but the embodiment is not limited to this. Even when the OK flag is set for all time periods in the control value table, the in-use calibrations in FIGS. 6 and 7 may be performed on the fourth day and thereafter. In this case, the in-use calibration ends immediately after step S31 is performed.
[0075] 4 to 7, after the control value table is created, the RTC generator 200 is ready for normal operation. During normal operation, the frequency divider 103 reads the control value table stored in the RAM 40 and divides the reference clock signal output from the ring oscillator 80 by the integer frequency division ratio and decimal frequency division ratio corresponding to the current time, thereby enabling the generation of an RTC signal. The RTC signal continues to be generated and output at all times, even when the RTC generator 200 transitions to sleep mode.
[0076] The update determination process, temperature determination process, and abnormality determination process are periodically executed during normal operation after the end of in-use calibration. Fig. 8 is a flowchart showing an example of the update determination process executed by CPU 20. In the update determination process, update determination unit 205 determines whether a predetermined period (e.g., one month) has passed since the end of in-use calibration (step S51). If the predetermined period has not passed, update determination unit 205 waits until the predetermined period has passed.
[0077] When the predetermined period has elapsed, the update determination unit 205 acquires the frequency of the RTC signal for one day measured by the frequency measurement unit 102 (step S52). The update determination unit 205 also determines whether the frequency of the RTC signal for each time period acquired in step S52 is equal to or less than the allowable error (step S53).
[0078] If the frequency of the RTC signal in each time period is equal to or less than the allowable error, the process returns to step S51. If the frequency of the RTC signal in any time period exceeds the allowable error, the update determination unit 205 instructs the temperature acquisition unit 202 and the like to re-execute in-use calibration in order to update the control parameters (step S54), and ends the update determination process. As a result, the in-use calibration of FIGS. 4 to 7 is executed again.
[0079] 9 is a flowchart showing an example of temperature determination processing executed by the CPU 20. In the temperature determination processing, the temperature determination unit 206 acquires the ambient temperature of the RTC generator 200 at a specific time during execution of in-use calibration (step S61). The temperature can be acquired from a control value table stored in the RAM 40. Next, the temperature acquisition unit 202 acquires the ambient temperature of the RTC generator 200 at the same time from the temperature output unit 60 (step S62).
[0080] Next, the temperature determination unit 206 determines whether the difference between the temperature acquired in step S61 and the temperature acquired in step S62 is equal to or less than a threshold value (step S63). If the temperature difference is equal to or less than the threshold value, the process returns to step S62. In this case, step S62 will be executed again at the same time the next day. On the other hand, if the temperature difference exceeds the threshold value, the temperature determination unit 206 instructs the temperature acquisition unit 202 and the like to re-execute the in-use calibration (step S64), and ends the temperature determination process. As a result, the in-use calibration of FIGS. 4 to 7 is executed again.
[0081] 10 is a flowchart showing an example of the abnormality determination process executed by the CPU 20. In the abnormality determination process, the abnormality determination unit 207 determines whether a predetermined period has elapsed since the manufacturing date of the RTC generating device 200 (step S71). If the predetermined period has not elapsed, the abnormality determination unit 207 waits until the predetermined period has elapsed. The period may be shortened as the time elapses since the manufacturing date of the RTC generating device 200.
[0082] When the predetermined period has elapsed, the abnormality determination unit 207 acquires the time calculated by the time calculation unit 104 (step S72). Furthermore, the abnormality determination unit 207 acquires the time distributed by communication from the communication chip 300 through the communication I / F 50 (step S73). Steps S72 and S73 are executed substantially simultaneously. Next, the abnormality determination unit 207 determines whether the difference between the time acquired in step S72 and the time acquired in step S73 is equal to or less than the allowable error (step S74).
[0083] If the time difference is equal to or less than the allowable error, the process returns to step S71. At this time, the time calculation unit 104 may update the calculated time to the time acquired in step S73. If the time difference exceeds the allowable error, the abnormality determination unit 207 determines that an abnormality has occurred in the RTC generation device 200 and notifies the user of this (step S75). This ends the abnormality determination process.
[0084] 4.Effects In the RTC generating device 200 according to this embodiment, a control value table indicating the correspondence between the time period during which the ring oscillator 80 that outputs the reference clock signal operates and the division ratio of the reference clock signal is acquired by the table acquiring unit 204. The RTC signal is generated by the dividing unit 103 by changing the division ratio of the reference clock signal for each time period during which the ring oscillator 80 operates according to the control value table.
[0085] When in-use calibration is performed, the frequency measurement unit 102 measures the frequency of the RTC signal based on the measurement clock signal, which is output by the ring oscillator 90 and oscillates with higher accuracy than the reference clock signal. The update determination unit 205 determines whether the frequency of the RTC signal has fallen below a predetermined allowable error. If the frequency of the RTC signal exceeds the allowable error, at least some of the division ratios in the control value table are updated. If the frequency of the RTC signal has fallen below the allowable error, in-use calibration ends.
[0086] This RTC generating device 200 does not require a crystal oscillator. This allows the RTC generating device 200 to be small and inexpensive, while also reducing power consumption. Furthermore, the division ratio of the control value table is updated based on a measurement clock signal that oscillates with higher accuracy than the reference clock signal. This maintains the accuracy of the RTC signal. Furthermore, after the end of in-use calibration, there is no need to drive the ring oscillator 90, further reducing power consumption. As a result, an RTC signal can be generated with a low-power, small-sized, and inexpensive configuration while maintaining accuracy.
[0087] Furthermore, the temperature acquisition unit 202 acquires the operating temperature of the ring oscillator 80 for each time period during which the ring oscillator 80 operates. Based on the operating temperature of the ring oscillator 80 acquired by the temperature acquisition unit 202, the division ratio of the reference clock signal for each time period during which the ring oscillator 80 operates is determined by the division ratio determination unit 203. The control value table acquired by the table acquisition unit 204 shows the correspondence between the time period during which the ring oscillator 80 operates and the division ratio of the reference clock signal determined by the division ratio determination unit 203. In this case, fluctuations in the frequency of the RTC signal caused by fluctuations in the operating temperature of the ring oscillator 80 are reduced. This makes it easier to maintain the accuracy of the RTC signal.
[0088] If the frequency of the RTC signal in a certain time period exceeds the allowable error, the operating temperature of ring oscillator 80 in that time period is acquired again by temperature acquisition unit 202. Based on the operating temperature of ring oscillator 80 in that time period acquired again by temperature acquisition unit 202, the division ratio of the reference clock signal in that time period is determined again (compensated) by division ratio determination unit 203. Based on the division ratio of the reference clock signal determined again by division ratio determination unit 203, the division ratio for that time period in the control value table is updated. In this case, the division ratio for the time period in which the frequency of the RTC signal exceeds the allowable error is updated, and the division ratios for other time periods are fixed without being updated. This allows for efficient in-use calibration.
[0089] Furthermore, the frequency of the reference clock signal measured at a specific temperature is acquired by the frequency measurement unit 102. The control value table acquired by the table acquisition unit 204 indicates the correspondence between the time period during which the ring oscillator 80 operates and the division ratio for the frequency of the reference clock signal acquired by the frequency measurement unit 102. In this case, variations in the frequency of the reference clock signal for each individual RTC generation device 200 due to differences in the manufacturing process are reduced. This makes it easier to maintain the accuracy of the RTC signal.
[0090] During initial calibration, which is before in-use calibration is performed, frequency measurement unit 102 is temporarily connected to external measurement device 500, which outputs an external clock signal that oscillates with higher accuracy than the reference clock signal. Based on the external clock signal, frequency measurement unit 102 measures the frequency of the reference clock signal. The frequency of the reference clock signal measured by frequency measurement unit 102 is acquired by frequency measurement unit 102. In this case, a more accurate frequency of the reference clock signal can be acquired using external measurement device 500, such as a quartz oscillator, while maintaining RTC generation device 200 small and inexpensive.
[0091] The division ratio includes integer division ratios and decimal division ratios. The integer division ratio is determined by the division ratio determination unit 203 based on the frequency of the reference clock signal and the frequency of the measurement clock signal. In this case, the division ratio for generating the RTC signal can be easily determined. The decimal division ratio is determined by the division ratio determination unit 203 as a division ratio for adjusting the frequency of the reference clock signal (integer-divided signal) when divided by an integer division ratio to approach a specific frequency with a resolution smaller than that of the integer division ratio. This allows for more accurate determination of the division ratio for generating the RTC signal. Here, the RTC signal is generated by changing the decimal division ratio of the reference clock signal through PWM control by the divider unit 103. The decimal division ratio includes the duty ratio in pulse width modulation control. In this case, the RTC signal can be generated through simple control.
[0092] Furthermore, by supplying a voltage from the external power supply 400 to the reference voltage source 70, the reference voltage source 70 generates a voltage with higher stability than the supplied voltage, and the generated voltage is supplied to the ring oscillator 80. In this case, fluctuations in the frequency of the reference clock signal caused by fluctuations in the voltage of the external power supply 400 are reduced. This makes it easier to maintain the accuracy of the RTC signal.
[0093] Furthermore, the RTC generating device 200 is partitioned into two different power domains: a power domain 120 and a power domain 130. The ring oscillator 80 and the frequency divider 103 are arranged in the power domain 120, and the ring oscillator 90 and the update determination unit 205 are arranged in the power domain 130. In this case, after the end of the in-use calibration, it is possible to easily stop the operation of the ring oscillator 90, the update determination unit 205, etc. while continuing to generate the RTC signal. This makes it possible to easily reduce power consumption.
[0094] After the in-use calibration is completed, the update determination unit 205 periodically determines whether the frequency of the RTC signal measured by the frequency measurement unit 102 exceeds the allowable error. If the frequency of the RTC signal exceeds the allowable error, the in-use calibration is resumed. In this case, it is possible to prevent the accuracy of the RTC signal from decreasing after the in-use calibration is completed.
[0095] After the in-use calibration is completed, the temperature determination unit 206 determines whether the ambient temperature of the RTC generator 200 at a predetermined time is equal to or less than a predetermined threshold value. In this example, it determines whether the difference between the ambient temperature of the RTC generator 200 and the temperature recorded in the control value table as the temperature corresponding to the predetermined time is equal to or less than the threshold value. If the temperature exceeds the threshold value, the in-use calibration is resumed. In this case, even if the installation environment of the RTC generator 200 changes after the in-use calibration is completed, it is possible to prevent the accuracy of the RTC signal from deteriorating.
[0096] Furthermore, if the in-use calibration does not end within a predetermined period after the start of the in-use calibration, the abnormality determination unit 207 determines that the RTC generating device 200 is abnormal. In this case, an initial abnormality in the RTC generating device 200 can be easily determined. Furthermore, the time calculation unit 104 calculates the time based on the RTC signal generated by the frequency division unit 103. If the difference between the time calculated by the time calculation unit 104 and the time distributed from an external source exceeds a predetermined allowable error, the abnormality determination unit 207 determines that the RTC generating device 200 is abnormal. In this case, a time-dependent abnormality in the RTC generating device 200 can be easily determined.
[0097] 5. Other Embodiments (1) In the above embodiment, the RTC generating device 200 is connected to the external measuring device 500 during initial calibration, and the frequency of the reference clock signal is measured using the external clock signal output from the external measuring device 500. However, the embodiment is not limited to this. The RTC generating device 200 does not have to be connected to the external measuring device 500 during initial calibration. In this case, the frequency of the reference clock signal is measured using the measurement clock signal output from the ring oscillator 90 during initial calibration. Furthermore, the initial calibration may be performed using the ring oscillator 90 at the shipping destination of the RTC generating device 200 after the RTC generating device 200 has been shipped.
[0098] (2) In the above embodiment, the control value table in the initial state is obtained by being generated by the table obtaining unit 204, but the embodiment is not limited to this. The control value table in the initial state may be stored in advance in the ROM 30. In this case, the table obtaining unit 204 obtains the control value table in the initial state from the ROM 30.
[0099] (3) In the above embodiment, the ambient temperature of the RTC generating device 200 is acquired every hour, but the embodiment is not limited to this. The temperature may be acquired every hour, for example, or it may be acquired every hour. Alternatively, the temperature may be acquired every hour as the difference between the maximum and minimum temperatures over a day decreases. If the temperature is acquired every 30 minutes, for example, the control parameters are determined every 30 minutes and written in the control value table. Similarly, if the temperature is acquired every two hours, for example, the control parameters are determined every two hours and written in the control value table.
[0100] (4) The functions of the above-disclosed elements may be implemented using circuitry or processing circuitry, including general-purpose processors, special-purpose processors, integrated circuits, ASICs (application-specific integrated circuits), conventional circuitry, and / or combinations thereof, configured to perform the disclosed elements or programmed to perform the disclosed functions. A processor is considered processing circuitry or circuitry when it includes transistors and other circuitry therein. In this disclosure, a circuitry, unit, or means is hardware that performs the recited function or hardware programmed to perform the function. The hardware may be any hardware disclosed herein or other known hardware that is programmed to perform or configured to perform the recited function. When the hardware is a processor, which may be considered a type of circuitry, the circuitry, means, or unit is a combination of hardware and software, software used to configure the hardware, and / or processor.
[0101] 6. Correspondence between each element of the claims and each part of the embodiment Below, examples of correspondence between each element of the claims and each element of the embodiments will be described, but the present invention is not limited to the following examples. Various other elements having the configuration or function described in the claims can also be used as each element of the claims.
[0102] In the above embodiments, ring oscillators 80 and 90 are examples of a first ring oscillator and a second ring oscillator, table acquisition unit 204 is an example of a table acquisition unit, frequency division unit 103 is an example of a frequency division unit, frequency measurement unit 102 is an example of a frequency measurement unit, and update determination unit 205 is an example of an update determination unit. RTC generation device 200 is an example of a real-time clock generation device, temperature acquisition unit 202 is an example of a temperature acquisition unit, frequency division ratio determination unit 203 is an example of a frequency division ratio determination unit, and frequency acquisition unit 201 is an example of a frequency acquisition unit.
[0103] External measuring device 500 is an example of an external measuring device, and reference voltage source 70 is an example of a reference voltage source. Power supply domains 120 and 130 are examples of a first power supply domain and a second power supply domain, respectively. Temperature determination unit 206 is an example of a temperature determination unit, abnormality determination unit 207 is an example of an abnormality determination unit, and time calculation unit 104 is an example of a time calculation unit.
[0104] 7. Summary of the embodiment (1) The real-time clock generating device according to the first paragraph is a first ring oscillator that outputs a reference clock signal; a table acquisition unit that acquires a control value table that indicates a correspondence relationship between a time period during which the first ring oscillator operates and a frequency division ratio of the reference clock signal; a frequency divider that generates a real-time clock signal by changing the frequency division ratio of the reference clock signal for each time period in which the first ring oscillator operates in accordance with the control value table; a second ring oscillator that outputs a measurement clock signal that oscillates with higher accuracy than the reference clock signal when the calibration of the control value table is performed; a frequency measurement unit that measures the frequency of the real-time clock signal based on the measurement clock signal; and an update determination unit that determines whether the frequency of the real-time clock signal measured by the frequency measurement unit has become equal to or less than a predetermined allowable error, updates at least some of the frequency division ratios in the control value table when the frequency of the real-time clock signal has exceeded the allowable error, and terminates the calibration when the frequency of the real-time clock signal has become equal to or less than the allowable error.
[0105] This real-time clock generating device does not require a crystal oscillator. Therefore, the real-time clock generating device can be made small and inexpensive, and power consumption can be reduced. Furthermore, the division ratio of the control value table is updated based on a measurement clock signal that oscillates with higher accuracy than the reference clock signal. This maintains the accuracy of the real-time clock signal. Furthermore, after calibration is complete, there is no need to drive the second ring oscillator, further reducing power consumption. As a result, a real-time clock signal can be generated with a low-power, small-sized, and inexpensive configuration while maintaining accuracy.
[0106] (2) The real-time clock generating device according to the first paragraph is a temperature acquisition unit that acquires an operating temperature of the first ring oscillator for each time period during which the first ring oscillator operates; a division ratio determination unit that determines the division ratio of the reference clock signal for each time period in which the first ring oscillator operates, based on the operating temperature of the first ring oscillator acquired by the temperature acquisition unit, The table acquisition unit may acquire the control value table indicating a correspondence relationship between a time period during which the first ring oscillator operates and the division ratio of the reference clock signal determined by the division ratio determination unit.
[0107] In this case, fluctuations in the frequency of the real-time clock signal caused by fluctuations in the operating temperature of the first ring oscillator are reduced, making it easier to maintain the accuracy of the real-time clock signal.
[0108] (Item 3) In the real-time clock generating device described in item 2, when the update determination unit determines that the frequency of the real-time clock signal in a certain time period has exceeded an allowable error, the temperature acquisition unit again acquires the operating temperature of the first ring oscillator in that time period; The frequency division ratio determination unit may update the frequency division ratio for the time period in the control value table based on the operating temperature of the first ring oscillator for the time period that is acquired again by the temperature acquisition unit.
[0109] In this case, the division ratio is updated during the time period when the frequency of the real-time clock signal exceeds the tolerance, while the division ratio during other time periods is fixed without being updated, thereby enabling efficient calibration.
[0110] (4) The real-time clock generating device according to any one of the first to third paragraphs, further comprising a frequency acquisition unit that acquires the frequency of the reference clock signal; The table acquisition unit may acquire the control value table indicating a correspondence relationship between a time period during which the first ring oscillator operates and the division ratio for the frequency of the reference clock signal acquired by the frequency acquisition unit.
[0111] In this case, variations in the frequency of the reference clock signal between individual devices due to differences in the manufacturing process of the real-time clock generating device are reduced, making it easier to maintain the accuracy of the real-time clock signal.
[0112] (Item 5) In the real-time clock generating device described in item 4, the frequency measurement unit is temporarily connected to an external measuring device that outputs an external clock signal that oscillates with higher accuracy than the reference clock signal before the calibration of the control value table is performed, and further measures the frequency of the reference clock signal based on the external clock signal; The frequency acquisition unit may acquire the frequency of the reference clock signal measured by the frequency measurement unit.
[0113] In this case, the real-time clock generating device can be kept small and inexpensive, while the frequency of the reference clock signal can be obtained more accurately using an external measuring device.
[0114] (Item 6) In the real-time clock generating device according to any one of items 1 to 5, The division ratio may include an integer division ratio determined based on the frequency of the reference clock signal.
[0115] In this case, the division ratio for generating the real-time clock signal can be easily determined.
[0116] (Item 7) In the real-time clock generating device described in item 6, The division ratio may further include a fractional division ratio for making the frequency of the reference clock signal when divided by the integer division ratio approach a specific frequency with a resolution smaller than the integer division ratio.
[0117] In this case, the division ratio for generating the real-time clock signal can be determined more accurately.
[0118] (Item 8) In the real-time clock generating device according to item 7, the frequency divider generates the real-time clock signal by changing the fractional frequency division ratio of the reference clock signal through pulse width modulation control; The fractional frequency division ratio may include a duty ratio in the pulse width modulation control.
[0119] In this case, the real-time clock signal can be generated by simple control.
[0120] (Item 9) The real-time clock generating device according to any one of items 1 to 8, The oscillator may further include a reference voltage source that receives a voltage from an external power supply, generates a voltage having higher stability than the supplied voltage, and supplies the generated voltage to the first ring oscillator.
[0121] In this case, fluctuations in the frequency of the reference clock signal due to fluctuations in the voltage of the external power supply are reduced, making it easier to maintain the accuracy of the real-time clock signal.
[0122] (Item 10) In the real-time clock generating device according to any one of items 1 to 9, the real-time clock generating device is partitioned into a first power domain and a second power domain that are different from each other; the first ring oscillator and the frequency divider unit are arranged in the first power supply domain; The second ring oscillator and the update determination unit may be arranged in the second power domain.
[0123] In this case, after the calibration is completed, it is possible to easily stop the operation of the second ring oscillator and the update determination unit while continuing to generate the real-time clock signal, which makes it easy to reduce power consumption.
[0124] (Item 11) In the real-time clock generating device according to any one of items 1 to 10, After the calibration is completed, the update determination unit may periodically determine whether the frequency of the real-time clock signal measured by the frequency measurement unit exceeds an allowable error, and if the frequency of the real-time clock signal exceeds an allowable error, resume the calibration.
[0125] In this case, it is possible to prevent the accuracy of the real-time clock signal from decreasing after the calibration is completed.
[0126] (Item 12) The real-time clock generating device according to any one of items 1 to 11, The device may further include a temperature determination unit that determines whether the ambient temperature of the real-time clock generating device at a predetermined time after the calibration is completed is below a predetermined threshold value, and resumes the calibration if the temperature exceeds the threshold value.
[0127] In this case, even if the installation environment of the real-time clock generating device changes after the calibration is completed, it is possible to prevent the accuracy of the real-time clock signal from decreasing.
[0128] (Item 13) The real-time clock generating device according to any one of items 1 to 12, The device may further include an abnormality determination unit that determines that the real-time clock generation device is abnormal if the calibration is not completed within a predetermined period after the calibration is started.
[0129] In this case, an early abnormality in the real-time clock generating device can be easily detected.
[0130] (14) The real-time clock generating device according to any one of the first to thirteenth paragraphs, a time calculation unit that calculates time based on the real-time clock signal generated by the frequency division unit; The device may further include an abnormality determination unit that determines that the real-time clock generation device is abnormal if the difference between the time calculated by the time calculation unit and the time distributed from outside exceeds a predetermined allowable error.
[0131] In this case, it is possible to easily determine whether the real-time clock generating device has an abnormality over time.
[0132] (15) The real-time clock generating method according to the 15th paragraph is Obtaining a control value table indicating a correspondence relationship between a time period during which a first ring oscillator that outputs a reference clock signal operates and a frequency division ratio of the reference clock signal; generating a real-time clock signal by changing the frequency division ratio of the reference clock signal for each time period in which the first ring oscillator operates according to the control value table; When performing calibration of the control value table, measuring the frequency of the real-time clock signal based on a measurement clock signal that is output by a second ring oscillator and oscillates with higher accuracy than the reference clock signal; updating at least some of the frequency division ratios in the control value table when the frequency of the real-time clock signal exceeds an allowable error; and terminating the calibration when the frequency of the real-time clock signal falls below an allowable error.
[0133] This real-time clock generation method eliminates the need for a crystal oscillator. Furthermore, the division ratio of the control value table is updated based on a measurement clock signal that oscillates with higher accuracy than the reference clock signal. This allows for the generation of a real-time clock signal with low power consumption, a compact design, and a low cost, while maintaining accuracy. [Explanation of symbols]
[0134] 10...storage device, 20...CPU, 30...ROM, 40...RAM, 50...communication I / F, 60...temperature output unit, 61...temperature sensor, 62...ADC, 63...ADC control unit, 70...reference voltage source, 80, 90...ring oscillator, 100...circuit unit, 101...selection unit, 102...frequency measurement unit, 103...frequency division unit, 104...time calculation unit, 110...bus, 120, 130...power supply domain, 200...RTC generation device, 201...frequency acquisition unit, 202...temperature acquisition unit, 203...frequency division ratio determination unit, 204...table acquisition unit, 205...update determination unit, 206...temperature determination unit, 207...abnormality determination unit, 300...communication chip, 400...external power supply, 500...external measuring device
Claims
1. a first ring oscillator that outputs a reference clock signal; a table acquisition unit that acquires a control value table that indicates a correspondence relationship between a time period during which the first ring oscillator operates and a frequency division ratio of the reference clock signal; a frequency divider that generates a real-time clock signal by changing the frequency division ratio of the reference clock signal for each time period in which the first ring oscillator operates in accordance with the control value table; a second ring oscillator that outputs a measurement clock signal that oscillates with higher accuracy than the reference clock signal when the calibration of the control value table is performed; a frequency measurement unit that measures the frequency of the real-time clock signal based on the measurement clock signal; an update determination unit that determines whether the frequency of the real-time clock signal measured by the frequency measurement unit is below a predetermined allowable error, updates at least some of the frequency division ratios in the control value table when the frequency of the real-time clock signal exceeds the allowable error, and terminates the calibration when the frequency of the real-time clock signal is below the allowable error.
2. a temperature acquisition unit that acquires an operating temperature of the first ring oscillator for each time period during which the first ring oscillator operates; a division ratio determination unit that determines the division ratio of the reference clock signal for each time period in which the first ring oscillator operates, based on the operating temperature of the first ring oscillator acquired by the temperature acquisition unit, 2. The real-time clock generating device according to claim 1, wherein the table acquisition unit acquires the control value table indicating a correspondence between a time period during which the first ring oscillator operates and the division ratio of the reference clock signal determined by the division ratio determination unit.
3. when the update determination unit determines that the frequency of the real-time clock signal in a certain time period has exceeded an allowable error, the temperature acquisition unit again acquires the operating temperature of the first ring oscillator in that time period; 3. The real-time clock generating device of claim 2, wherein the frequency division ratio determination unit updates the frequency division ratio for the time period in the control value table based on the operating temperature of the first ring oscillator for the time period reacquired by the temperature acquisition unit.
4. further comprising a frequency acquisition unit that acquires the frequency of the reference clock signal; 4. The real-time clock generating device according to claim 1, wherein the table acquisition unit acquires the control value table indicating a correspondence between a time period during which the first ring oscillator operates and the division ratio for the frequency of the reference clock signal acquired by the frequency acquisition unit.
5. the frequency measurement unit is temporarily connected to an external measuring device that outputs an external clock signal that oscillates with higher accuracy than the reference clock signal before the calibration of the control value table is performed, and further measures the frequency of the reference clock signal based on the external clock signal; The real-time clock generating device according to claim 4 , wherein the frequency acquisition unit acquires the frequency of the reference clock signal measured by the frequency measurement unit.
6. 4. The real-time clock generating device according to claim 1, wherein the frequency division ratio includes an integer frequency division ratio determined based on the frequency of the reference clock signal.
7. 7. The real-time clock generating device according to claim 6, wherein the division ratio further includes a fractional division ratio for making the frequency of the reference clock signal when divided by the integer division ratio approach a specific frequency with a resolution smaller than that of the integer division ratio.
8. the frequency divider generates the real-time clock signal by changing the fractional frequency division ratio of the reference clock signal through pulse width modulation control; 8. The real-time clock generating device according to claim 7, wherein the fractional frequency division ratio includes a duty ratio in the pulse width modulation control.
9. A real-time clock generating device as described in any one of claims 1 to 3, further comprising a reference voltage source that, when supplied with voltage from an external power source, generates a voltage having higher stability than the supplied voltage and supplies the generated voltage to the first ring oscillator.
10. the real-time clock generating device is partitioned into a first power domain and a second power domain that are different from each other; the first ring oscillator and the frequency divider unit are arranged in the first power supply domain, 4. The real-time clock generation device according to claim 1, wherein the second ring oscillator and the update determination unit are arranged in the second power domain.
11. The real-time clock generating device according to any one of claims 1 to 3, wherein the update determination unit periodically determines whether the frequency of the real-time clock signal measured by the frequency measurement unit exceeds an allowable error after the calibration is completed, and if the frequency of the real-time clock signal exceeds an allowable error, resumes the calibration.
12. A real-time clock generating device as described in any one of claims 1 to 3, further comprising a temperature determination unit that determines whether the ambient temperature of the real-time clock generating device at a predetermined time after the calibration is completed is below a predetermined threshold value, and resumes the calibration if the temperature exceeds the threshold value.
13. A real-time clock generating device as described in any one of claims 1 to 3, further comprising an abnormality determination unit that determines that the real-time clock generating device is abnormal if the calibration is not completed within a predetermined period after the start of the calibration.
14. a time calculation unit that calculates time based on the real-time clock signal generated by the frequency division unit; A real-time clock generating device as described in any one of claims 1 to 3, further comprising an abnormality determination unit that determines that the real-time clock generating device is abnormal if the difference between the time calculated by the time calculation unit and the time distributed from outside exceeds a predetermined allowable error.
15. acquiring a control value table indicating a correspondence relationship between a time period during which a first ring oscillator that outputs a reference clock signal operates and a frequency division ratio of the reference clock signal; generating a real-time clock signal by changing the frequency division ratio of the reference clock signal for each time period in which the first ring oscillator operates in accordance with the control value table; When performing calibration of the control value table, measuring the frequency of the real-time clock signal based on a measurement clock signal that is output by a second ring oscillator and oscillates with higher accuracy than the reference clock signal; updating at least some of the frequency division ratios in the control value table when the frequency of the real-time clock signal exceeds an allowable error; and terminating the calibration when the frequency of the real-time clock signal falls below an allowable error.
Citation Information
Patent Citations
Time correction method and time correction device for real time clock
JP2003270369A