JP7392576B2 - Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method - Google Patents

Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method Download PDF

Info

Publication number
JP7392576B2
JP7392576B2 JP2020094443A JP2020094443A JP7392576B2 JP 7392576 B2 JP7392576 B2 JP 7392576B2 JP 2020094443 A JP2020094443 A JP 2020094443A JP 2020094443 A JP2020094443 A JP 2020094443A JP 7392576 B2 JP7392576 B2 JP 7392576B2
Authority
JP
Japan
Prior art keywords
circuit
time
real
clock
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020094443A
Other languages
Japanese (ja)
Other versions
JP2021189037A (en
Inventor
正之 神山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2020094443A priority Critical patent/JP7392576B2/en
Publication of JP2021189037A publication Critical patent/JP2021189037A/en
Application granted granted Critical
Publication of JP7392576B2 publication Critical patent/JP7392576B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、リアルタイムクロック回路、リアルタイムクロックモジュール、電子機器及びリアルタイムクロック回路の補正方法に関する。 The present invention relates to a real-time clock circuit, a real-time clock module, an electronic device, and a correction method for a real-time clock circuit.

特許文献1には、1緩急周期内に緩急量の短い複数回の緩急操作を分散的に実行する分散緩急方式を採用することにより、1緩急周期内で時間基準信号に必要な総緩急量を確保しながら、緩急タイミングにおける時間基準信号の伸縮量を最小に抑え、緩急タイミングと所要の出力タイミングとの干渉を無視できる程まで抑制できる論理緩急回路が開示されている。 Patent Document 1 discloses that the total amount of adjustment required for the time reference signal can be reduced within one adjustment period by employing a distributed adjustment method in which a plurality of adjustment operations with short adjustment amounts are performed in a distributed manner within one adjustment period. A logical adjustment circuit has been disclosed that can minimize the amount of expansion and contraction of the time reference signal in the adjustment timing while ensuring that the interference between the adjustment timing and the required output timing can be ignored.

特開平06-027265号公報Japanese Patent Application Publication No. 06-027265

しかしながら、特許文献1には、緩急量を設定する補正データをどのように生成するかについては開示されていない。例えば32kHzの源振信号あるいはその分周信号を外部装置に出力し、当該信号の周波数を外部装置で測定し、測定結果に基づいて補正データを生成する方法や、1日~1か月といった長期の単位で計時データの累積遅れを正確な基準時間と比較して補正データを生成する方法などが考えられる。しかしながら、前者の場合、外部装置に周波数を測定する構成が必要となる。また、後者の場合、補正精度を向上させるためには長期の計測が必要となる。 However, Patent Document 1 does not disclose how to generate correction data for setting the adjustment amount. For example, there are methods that output a 32kHz source oscillation signal or its frequency-divided signal to an external device, measure the frequency of the signal with the external device, and generate correction data based on the measurement results, and A possible method is to generate correction data by comparing the cumulative delay of time measurement data with an accurate reference time in units of . However, in the former case, a configuration for measuring the frequency is required in the external device. Moreover, in the latter case, long-term measurement is required to improve the correction accuracy.

本発明に係るリアルタイムクロック回路の一態様は、
振動子を発振させて第1クロック信号を生成する発振回路と、
前記第1クロック信号を分周して第2クロック信号を生成する第1分周回路と、
前記第2クロック信号を分周して第3クロック信号を生成するとともに、前記第2クロック信号に基づいて1秒よりも短い時間の第1計時データを生成する第2分周回路と、
前記第3クロック信号に基づいて1秒以上の時間の第2計時データを生成する計時回路と、
基準信号に同期した間隔での前記第1計時データの変化量に基づいて生成された補正データを用いて、前記間隔に相当する長さの期間において、前記第1分周回路に対して緩急処理を行う論理回路と、を備える。
One aspect of the real-time clock circuit according to the present invention is
an oscillation circuit that generates a first clock signal by oscillating a vibrator;
a first frequency dividing circuit that divides the first clock signal to generate a second clock signal;
a second frequency dividing circuit that frequency divides the second clock signal to generate a third clock signal, and generates first time measurement data for a time shorter than one second based on the second clock signal;
a timekeeping circuit that generates second timekeeping data for a time of one second or more based on the third clock signal;
Using correction data generated based on the amount of change in the first time measurement data at intervals synchronized with the reference signal, the first frequency dividing circuit is subjected to slow and fast processing during a period of length corresponding to the intervals. and a logic circuit that performs.

本発明に係るリアルタイムクロックモジュールの一態様は、
前記リアルタイムクロック回路の一態様と、
前記振動子と、を備える。
One aspect of the real-time clock module according to the present invention is
One aspect of the real-time clock circuit,
and the vibrator.

本発明に係る電子機器の一態様は、
前記リアルタイムクロック回路の一態様と、
前記リアルタイムクロック回路と通信するホストデバイスと、を備える。
One aspect of the electronic device according to the present invention is
One aspect of the real-time clock circuit,
a host device communicating with the real-time clock circuit.

本発明に係るリアルタイムクロック回路の補正方法の一態様は、
振動子を発振させて第1クロック信号を生成する発振回路と、前記第1クロック信号を分周して第2クロック信号を生成する第1分周回路と、前記第2クロック信号を分周して第3クロック信号を生成するとともに、前記第2クロック信号に基づいて1秒よりも短い時間の第1計時データを生成する第2分周回路と、前記第3クロック信号に基づいて1秒以上の時間の第2計時データを生成する計時回路と、を備えたリアルタイムクロック回路の補正方法であって、
前記リアルタイムクロック回路が、基準信号に同期した間隔での前記第1計時データの変化量に基づいて生成された補正データを用いて、前記間隔に相当する長さの期間において、前記第1分周回路に対して緩急処理を行う工程を備える。
One aspect of the real-time clock circuit correction method according to the present invention is as follows:
an oscillation circuit that oscillates a vibrator to generate a first clock signal; a first frequency divider circuit that divides the frequency of the first clock signal to generate a second clock signal; and a first frequency divider circuit that divides the frequency of the second clock signal. a second frequency dividing circuit that generates a third clock signal based on the second clock signal, and generates first time measurement data for a time shorter than one second based on the third clock signal; A method for correcting a real-time clock circuit, comprising: a clock circuit that generates second clock data for a time of
The real-time clock circuit performs the first frequency division in a period corresponding to the interval using correction data generated based on the amount of change in the first clock data at intervals synchronized with the reference signal. It includes a step of performing slow and fast processing on the circuit.

第1実施形態のリアルタイムクロックモジュールの機能ブロック図。FIG. 2 is a functional block diagram of a real-time clock module according to the first embodiment. 計時回路の構成例を示す図。The figure which shows the example of a structure of a timekeeping circuit. 第1分周回路の構成例を示す図。The figure which shows the example of a structure of a 1st frequency division circuit. 選択データSELが0である場合の第2分周回路の構成例を示す図。The figure which shows the example of a structure of the 2nd frequency division circuit when selection data SEL is 0. 選択データSELが1である場合の第2分周回路の構成例を示す図。FIG. 7 is a diagram illustrating a configuration example of a second frequency dividing circuit when selection data SEL is 1; 選択データSELが0の場合の補正期間と緩急処理のタイミングとの関係の一例を示す図。The figure which shows an example of the relationship between the correction period and the timing of gradual and rapid processing when selection data SEL is 0. 選択データSELが1の場合の補正期間と緩急処理のタイミングとの関係の一例を示す図。The figure which shows an example of the relationship between the correction period and the timing of gradual and rapid processing when selection data SEL is 1. 緩急処理のタイミングで制御信号PE,PDがともにローレベルのときのタイミングチャート図。FIG. 7 is a timing chart diagram when control signals PE and PD are both at low level at the timing of slow/fast processing. 緩急処理のタイミングで制御信号PEがハイレベル、制御信号PDがローレベルのときのタイミングチャート図。FIG. 7 is a timing chart diagram when the control signal PE is at a high level and the control signal PD is at a low level at the timing of slow/fast processing. 緩急処理のタイミングで制御信号PEがローレベル、制御信号PDがハイレベルのときのタイミングチャート図。FIG. 7 is a timing chart diagram when the control signal PE is at a low level and the control signal PD is at a high level at the timing of slow/fast processing. 第1実施形態のリアルタイムクロック回路の補正方法の手順の一例を示す図。FIG. 3 is a diagram illustrating an example of a procedure of a method for correcting a real-time clock circuit according to the first embodiment. 第2実施形態のリアルタイムクロックモジュールの機能ブロック図。FIG. 3 is a functional block diagram of a real-time clock module according to a second embodiment. 第2実施形態のリアルタイムクロック回路の補正方法の手順の一例を示す図。FIG. 7 is a diagram illustrating an example of a procedure of a correction method for a real-time clock circuit according to a second embodiment. 第3実施形態のリアルタイムクロック回路の補正方法の手順の一例を示す図。FIG. 7 is a diagram illustrating an example of a procedure of a correction method for a real-time clock circuit according to a third embodiment. 電子機器の実施形態の機能ブロック図。FIG. 2 is a functional block diagram of an embodiment of an electronic device. 電子機器の実施形態の外観の一例を示す図。FIG. 1 is a diagram illustrating an example of the appearance of an embodiment of an electronic device.

以下、本発明の好適な実施形態について図面を用いて詳細に説明する。なお、以下に説明する実施の形態は、特許請求の範囲に記載された本発明の内容を不当に限定するものではない。また以下で説明される構成の全てが本発明の必須構成要件であるとは限らない。 Hereinafter, preferred embodiments of the present invention will be described in detail using the drawings. Note that the embodiments described below do not unduly limit the content of the present invention described in the claims. Furthermore, not all of the configurations described below are essential components of the present invention.

1.リアルタイムクロック回路、リアルタイムクロックモジュール
1-1.第1実施形態
1-1-1.リアルタイムクロックモジュールの構成
図1は、第1実施形態のリアルタイムクロックモジュール1の機能ブロック図である。図1に示すように、リアルタイムクロックモジュール1は、振動子2と、リアルタイムクロック回路3とを備える。
1. Real-time clock circuit, real-time clock module 1-1. First embodiment 1-1-1. Configuration of Real-Time Clock Module FIG. 1 is a functional block diagram of a real-time clock module 1 according to the first embodiment. As shown in FIG. 1, the real-time clock module 1 includes a vibrator 2 and a real-time clock circuit 3.

リアルタイムクロックモジュール1は、メイン電源4からリアルタイムクロック回路3の端子P1を介して第1の電源電圧である電源電圧VDDが供給され、バックアップ電源
5からリアルタイムクロック回路3の端子P2を介して第2の電源電圧である電源電圧VBATが供給される。
The real-time clock module 1 is supplied with a power supply voltage VDD, which is a first power supply voltage, from a main power supply 4 through a terminal P1 of the real-time clock circuit 3, and a second power supply voltage VDD, which is a first power supply voltage, is supplied from a backup power supply 5 through a terminal P2 of the real-time clock circuit 3. A power supply voltage VBAT, which is a power supply voltage of , is supplied.

振動子2は、音叉型水晶振動子、ATカット水晶振動子、SCカット水晶振動子等であってもよいし、SAW(Surface Acoustic Wave)共振子や水晶振動子以外の圧電振動子であってもよい。また、振動子2は、シリコン半導体を材料とするMEMS(Micro Electro Mechanical Systems)振動子であってもよい。振動子2は、圧電効果によって励振されてもよいし、クーロン力(静電気力)によって駆動されてもよい。 The vibrator 2 may be a tuning fork type crystal vibrator, an AT-cut crystal vibrator, an SC-cut crystal vibrator, or a SAW (Surface Acoustic Wave) resonator or a piezoelectric vibrator other than a crystal vibrator. Good too. Further, the vibrator 2 may be a MEMS (Micro Electro Mechanical Systems) vibrator made of silicon semiconductor. The vibrator 2 may be excited by piezoelectric effect or may be driven by Coulomb force (electrostatic force).

リアルタイムクロック回路3は、発振回路10、第1分周回路20、第2分周回路30、計時回路40、論理回路50、ライトバッファー60、リードバッファー70、イベント時刻レジスター80、インターフェース回路90、記憶部100、割込発生回路110、電源電圧選択回路120、電源電圧判定回路130及びレギュレーター140を備える。ただし、リアルタイムクロック回路3は、これらの要素の一部を省略又は変更し、あるいは他の要素を追加した構成としてもよい。本実施形態では、リアルタイムクロック回路3は、1チップの集積回路(IC:Integrated Circuit)であるが、複数チップの集積回路で構成されてもよいし、少なくとも一部がディスクリート部品で構成されてもよい。 The real-time clock circuit 3 includes an oscillation circuit 10, a first frequency dividing circuit 20, a second frequency dividing circuit 30, a clock circuit 40, a logic circuit 50, a write buffer 60, a read buffer 70, an event time register 80, an interface circuit 90, and a memory. 100, an interrupt generation circuit 110, a power supply voltage selection circuit 120, a power supply voltage determination circuit 130, and a regulator 140. However, the real-time clock circuit 3 may have a configuration in which some of these elements are omitted or changed, or other elements are added. In the present embodiment, the real-time clock circuit 3 is a one-chip integrated circuit (IC), but it may be configured with a plurality of integrated circuit chips, or at least a portion may be configured with discrete components. good.

電源電圧判定回路130は、電源電圧VDDを監視し、電源電圧VDDが所定の電圧値VT以上であるか否かを判定し、判定信号VDETを出力する。本実施形態では、電源電圧判定回路130は、電源電圧VDDが電圧値VT以上であると判定した場合はハイレベルの判定信号VDETを出力し、電源電圧VDDが電圧値VT未満であると判定した場合はローレベルの判定信号VDETを出力する。 The power supply voltage determination circuit 130 monitors the power supply voltage VDD, determines whether the power supply voltage VDD is equal to or higher than a predetermined voltage value VT, and outputs a determination signal VDET. In this embodiment, the power supply voltage determination circuit 130 outputs a high-level determination signal VDET when determining that the power supply voltage VDD is equal to or higher than the voltage value VT, and determines that the power supply voltage VDD is less than the voltage value VT. If so, a low level determination signal VDET is output.

電源電圧選択回路120は、判定信号VDETに基づいて電源電圧VDD又は電源電圧VBATを選択して電源電圧VOUTとして出力する。具体的には、電源電圧選択回路120は、判定信号VDETがハイレベルである場合、すなわち、電源電圧判定回路130により電源電圧VDDが電圧値VT以上であると判定された場合は、電源電圧VDDを選択する。また、電源電圧選択回路120は、判定信号VDETがローレベルである場合、すなわち、電源電圧判定回路130により電源電圧VDDが電圧値VT未満であると判定された場合は、電源電圧VBATを選択する。 Power supply voltage selection circuit 120 selects power supply voltage VDD or power supply voltage VBAT based on determination signal VDET and outputs it as power supply voltage VOUT. Specifically, when the determination signal VDET is at a high level, that is, when the power supply voltage determination circuit 130 determines that the power supply voltage VDD is equal to or higher than the voltage value VT, the power supply voltage selection circuit 120 selects the power supply voltage VDD. Select. Further, the power supply voltage selection circuit 120 selects the power supply voltage VBAT when the determination signal VDET is at a low level, that is, when the power supply voltage determination circuit 130 determines that the power supply voltage VDD is less than the voltage value VT. .

したがって、メイン電源4からリアルタイムクロックモジュール1に電源電圧VDDが供給されているときは、電源電圧VOUTは、電源電圧VDDであり、VT以上の所定の電圧値である。メイン電源4からリアルタイムクロックモジュール1への電源電圧VDDの供給が遮断されると、電源電圧VOUTは、直ちに電源電圧VBATに切り替わり、VT以下の所定の電圧値となる。そのため、リアルタイムクロックモジュール1は、メイン電源4からの電源電圧VDDの供給が遮断されている間も計時動作を継続することができる。これに対して、リアルタイムクロックモジュール1の動作を制御するホストデバイス6は、メイン電源4から電源電圧VDDが供給されて動作し、メイン電源4からの電源電圧VDDの供給が遮断されると動作を停止する。 Therefore, when the power supply voltage VDD is supplied from the main power supply 4 to the real-time clock module 1, the power supply voltage VOUT is the power supply voltage VDD and has a predetermined voltage value higher than VT. When the supply of power supply voltage VDD from main power supply 4 to real-time clock module 1 is cut off, power supply voltage VOUT immediately switches to power supply voltage VBAT and becomes a predetermined voltage value below VT. Therefore, the real-time clock module 1 can continue the timekeeping operation even while the supply of the power supply voltage VDD from the main power supply 4 is cut off. On the other hand, the host device 6 that controls the operation of the real-time clock module 1 operates when the power supply voltage VDD is supplied from the main power supply 4, and does not operate when the supply of the power supply voltage VDD from the main power supply 4 is cut off. Stop.

レギュレーター140は、電源電圧VOUTに基づいて、一定の電圧値の安定化された電源電圧VOSC及び電源電圧VLOGICを生成する。 The regulator 140 generates a stabilized power supply voltage VOSC and a power supply voltage VLOGIC having a constant voltage value based on the power supply voltage VOUT.

電源電圧VOSCは、発振回路10に供給される。また、電源電圧VLOGICは、第1分周回路20、第2分周回路30、計時回路40、論理回路50、ライトバッファー60、リードバッファー70、イベント時刻レジスター80、インターフェース回路90、記憶部100及び割込発生回路110に供給される。 Power supply voltage VOSC is supplied to the oscillation circuit 10. Further, the power supply voltage VLOGIC includes a first frequency dividing circuit 20, a second frequency dividing circuit 30, a clock circuit 40, a logic circuit 50, a write buffer 60, a read buffer 70, an event time register 80, an interface circuit 90, a storage section 100, The signal is supplied to the interrupt generation circuit 110.

発振回路10は、振動子2を発振させて第1クロック信号CK1を生成する。具体的には、発振回路10は、リアルタイムクロック回路3の端子P3,P4を介して振動子2の両端と電気的に接続されており、振動子2の出力信号を増幅してフィードバックすることにより振動子2を発振させて第1クロック信号CK1を出力する。本実施形態では、共振周波数の異なる2種類の振動子2を選択可能であり、第1クロック信号CK1の周波数は異なる2つの周波数、例えば、32.768kHz及び32kHzのいずれかとなる。第1クロック信号CK1を正確な周波数とするために、発振回路10は、温度補償機能や周波数制御機能を備えた発振回路であることが好ましい。 The oscillation circuit 10 causes the vibrator 2 to oscillate and generates the first clock signal CK1. Specifically, the oscillation circuit 10 is electrically connected to both ends of the vibrator 2 via terminals P3 and P4 of the real-time clock circuit 3, and amplifies the output signal of the vibrator 2 and feeds it back. The vibrator 2 is caused to oscillate and a first clock signal CK1 is output. In this embodiment, two types of vibrators 2 having different resonance frequencies can be selected, and the frequency of the first clock signal CK1 is one of two different frequencies, for example, 32.768 kHz and 32 kHz. In order to make the first clock signal CK1 an accurate frequency, the oscillation circuit 10 is preferably an oscillation circuit equipped with a temperature compensation function and a frequency control function.

第1分周回路20は、第1クロック信号CK1を分周して、所望の周波数を有する第2クロック信号CK2を生成する。本実施形態では、第1分周回路20の分周比は固定されている。例えば、第1クロック信号CK1の周波数が32.768kHz又は32kHzであり、第1分周回路20の分周比が32である場合、第2クロック信号CK2の周波数は1.024kHz又は1kHzである。なお、第1分周回路20の詳細については後述する。 The first frequency dividing circuit 20 divides the first clock signal CK1 to generate a second clock signal CK2 having a desired frequency. In this embodiment, the frequency division ratio of the first frequency dividing circuit 20 is fixed. For example, when the frequency of the first clock signal CK1 is 32.768 kHz or 32 kHz and the frequency division ratio of the first frequency dividing circuit 20 is 32, the frequency of the second clock signal CK2 is 1.024 kHz or 1 kHz. Note that details of the first frequency dividing circuit 20 will be described later.

第2分周回路30は、第2クロック信号CK2を分周して、所望の周波数を有する第3クロック信号CK3を生成する。本実施形態では、第2分周回路30は、選択データSELの値に応じて、バイナリーカウンター又はBCD(Binary Coded Decimal)カウンターとして動作し、いずれの場合も生成される第3クロック信号CK3の周波数は1Hzとなる。具体的には、第2分周回路30は、選択データSELが0であればバイナリーカウンターとして動作し、第2クロック信号CK2を第1の分周比で分周して1Hzの第3クロック信号CK3を生成する。例えば、第2クロック信号CK2の周波数が1.024kHzである場合、第1の分周比は1024である。また、第2分周回路30は、選択データSELが1であればBCDカウンターとして動作し、第2クロック信号CK2を第2の分周比で分周して1Hzの第3クロック信号CK3を生成する。例えば、第2クロック信号CK2の周波数が1kHzである場合、第2の分周比は1000である。 The second frequency dividing circuit 30 divides the second clock signal CK2 to generate a third clock signal CK3 having a desired frequency. In this embodiment, the second frequency dividing circuit 30 operates as a binary counter or a BCD (Binary Coded Decimal) counter depending on the value of the selection data SEL, and in either case, the frequency of the third clock signal CK3 generated is is 1Hz. Specifically, if the selection data SEL is 0, the second frequency dividing circuit 30 operates as a binary counter, and divides the second clock signal CK2 by the first frequency division ratio to generate the third clock signal of 1Hz. Generate CK3. For example, if the frequency of the second clock signal CK2 is 1.024 kHz, the first frequency division ratio is 1024. Further, if the selection data SEL is 1, the second frequency dividing circuit 30 operates as a BCD counter, and divides the second clock signal CK2 by a second frequency division ratio to generate a third clock signal CK3 of 1 Hz. do. For example, if the frequency of the second clock signal CK2 is 1 kHz, the second frequency division ratio is 1000.

また、第2分周回路30は、第2クロック信号CK2に基づいて、1秒よりも短い時間の計時データSUB_Tを生成する。例えば、計時データSUB_Tは、第2クロック信号CK2の周波数が1.024kHであれば1/1024秒単位の計時データであり、第2クロック信号CK2の周波数が1kHであれば1/1000秒単位の計時データである。 Further, the second frequency dividing circuit 30 generates time measurement data SUB_T for a time shorter than one second based on the second clock signal CK2. For example, if the frequency of the second clock signal CK2 is 1.024kHz, the clock data SUB_T is clock data in units of 1/1024 seconds, and if the frequency of the second clock signal CK2 is 1kHz, it is clock data in units of 1/1000 seconds. This is timing data.

また、第2分周回路30は、論理回路50に第4クロック信号CK4を出力する。本実施形態では、第2分周回路30は、選択データSELが0であってバイナリーカウンターとして動作する場合は8Hzの第4クロック信号CK4を出力し、選択データSELが1であってBCDカウンターとして動作する場合は10Hzの第4クロック信号CK4を出力する。なお、第2分周回路30の詳細については後述する。 Further, the second frequency dividing circuit 30 outputs the fourth clock signal CK4 to the logic circuit 50. In this embodiment, the second frequency dividing circuit 30 outputs the fourth clock signal CK4 of 8 Hz when the selection data SEL is 0 and operates as a binary counter, and outputs the fourth clock signal CK4 of 8 Hz when the selection data SEL is 1 and operates as a BCD counter. When operating, the fourth clock signal CK4 of 10 Hz is output. Note that details of the second frequency dividing circuit 30 will be described later.

計時回路40は、第3クロック信号CK3に基づいて1秒以上の時間の計時データBCD_T,BIN_Tを生成する。計時データBCD_Tは、年、月、日、時、分及び秒の各BCD値を含み、計時データBIN_Tは2進数の値である。なお、計時回路40の詳細については後述する。 The clock circuit 40 generates clock data BCD_T and BIN_T for a time of one second or more based on the third clock signal CK3. The clock data BCD_T includes BCD values of year, month, day, hour, minute, and second, and the clock data BIN_T is a binary value. Note that details of the clock circuit 40 will be described later.

論理回路50は、補正データTDを用いて、基準信号REFに同期した間隔に相当する長さの期間である補正期間において、第1分周回路20に対して緩急処理を行う。本実施形態では、基準信号REFは、ホストデバイス6が生成し、リアルタイムクロック回路3の端子P5から入力される信号である。基準信号REFは、正確に所定の周波数を有する信号である。例えば、ホストデバイス6が不図示のGPS受信機を有し、基準信号REF
は、当該GPS受信機から出力される信号であってもよいし、当該GPS受信機から出力される信号に基づいて生成される信号であってもよい。補正データTDは、基準信号REFに同期した間隔での計時データSUB_Tの変化量に基づいて生成されたデータである。本実施形態では、補正データTDは、記憶部100に記憶されている。また、基準信号REFに同期した間隔は、基準信号REFの1周期の整数倍の長さである。したがって、論理回路50は、補正データTDを用いて、基準信号REFの1周期の整数倍の長さの補正期間において、第1分周回路20に対して緩急処理を行う。具体的には、論理回路50は、補正期間における第2クロック信号CK2の周波数を増加させるための制御信号PE又は補正期間における第2クロック信号CK2の周波数を減少させるための制御信号PDを生成する。例えば、論理回路50は、補正データTDに対してデルタシグマ変調を行って、制御信号PE,PDを生成してもよい。第1分周回路20は、制御信号PE,PDに応じて、補正期間における平均周波数が所定の周波数となる第2クロック信号CK2を生成する。
The logic circuit 50 uses the correction data TD to perform speed-up and speed processing on the first frequency dividing circuit 20 during a correction period that is a period corresponding to an interval synchronized with the reference signal REF. In this embodiment, the reference signal REF is a signal generated by the host device 6 and input from the terminal P5 of the real-time clock circuit 3. The reference signal REF is a signal having exactly a predetermined frequency. For example, the host device 6 has a GPS receiver (not shown), and the reference signal REF
may be a signal output from the GPS receiver, or may be a signal generated based on the signal output from the GPS receiver. The correction data TD is data generated based on the amount of change in the clock data SUB_T at intervals synchronized with the reference signal REF. In this embodiment, the correction data TD is stored in the storage unit 100. Further, the interval synchronized with the reference signal REF has a length that is an integral multiple of one period of the reference signal REF. Therefore, using the correction data TD, the logic circuit 50 performs a speed-up process on the first frequency dividing circuit 20 during a correction period having a length that is an integral multiple of one period of the reference signal REF. Specifically, the logic circuit 50 generates a control signal PE for increasing the frequency of the second clock signal CK2 during the correction period or a control signal PD for decreasing the frequency of the second clock signal CK2 during the correction period. . For example, the logic circuit 50 may perform delta-sigma modulation on the correction data TD to generate the control signals PE and PD. The first frequency dividing circuit 20 generates a second clock signal CK2 whose average frequency during the correction period is a predetermined frequency according to the control signals PE and PD.

本実施形態では、論理回路50には補正期間設定データPNが入力され、論理回路50は、補正期間設定データPNと第2分周回路30が出力する第4クロック信号CK4とに基づいて、前述の基準信号REFに同期した間隔を決定する。具体的には、補正期間設定データPNの値をnとし、第4クロック信号CK4の周波数をfとし、あらかじめ決められた所定値をmとしたとき、当該間隔はn×m/f秒である。例えば、nが32であり、第4クロック信号CK4の周波数が8Hzであり、mが8である場合、当該間隔は32×8/8=32秒である。このとき、例えば、基準信号REFの周波数は1Hzであり、当該間隔は基準信号REFの1周期の32倍の長さである。また、nが256であり、第4クロック信号CK4の周波数が10Hzであり、mが8である場合、当該間隔は32×8/10=25.6秒である。このとき、例えば、基準信号REFの周波数は1.25Hzであり、当該間隔は基準信号REFの1周期の32倍の長さである。このように、補正期間設定データPNは、前述の基準信号REFに同期した間隔を指定する情報である。 In this embodiment, the correction period setting data PN is input to the logic circuit 50, and the logic circuit 50 uses the correction period setting data PN and the fourth clock signal CK4 output from the second frequency dividing circuit 30 as described above. The interval synchronized with the reference signal REF is determined. Specifically, when the value of the correction period setting data PN is n, the frequency of the fourth clock signal CK4 is f, and the predetermined value is m, the interval is n×m/f seconds. . For example, if n is 32, the frequency of the fourth clock signal CK4 is 8 Hz, and m is 8, the interval is 32×8/8=32 seconds. At this time, for example, the frequency of the reference signal REF is 1 Hz, and the interval is 32 times as long as one period of the reference signal REF. Further, when n is 256, the frequency of the fourth clock signal CK4 is 10 Hz, and m is 8, the interval is 32×8/10=25.6 seconds. At this time, for example, the frequency of the reference signal REF is 1.25 Hz, and the interval is 32 times as long as one cycle of the reference signal REF. In this way, the correction period setting data PN is information specifying an interval synchronized with the reference signal REF described above.

また、本実施形態では、論理回路50は、補正期間において、第4クロック信号CK4の周期で第1分周回路20に対して緩急処理を行う。例えば、第2クロック信号CK2の周波数が1.024kHzである場合、第4クロック信号CK4の周波数は8Hzであるので、論理回路50は0.125秒間隔で緩急処理を行う。また、第2クロック信号CK2の周波数が1kHzである場合、第4クロック信号CK4の周波数は10Hzであるので、論理回路50は0.1秒間隔で緩急処理を行う。 In addition, in the present embodiment, the logic circuit 50 performs slowing/fastening processing on the first frequency dividing circuit 20 at the cycle of the fourth clock signal CK4 during the correction period. For example, when the frequency of the second clock signal CK2 is 1.024 kHz, the frequency of the fourth clock signal CK4 is 8 Hz, so the logic circuit 50 performs the speed-up process at intervals of 0.125 seconds. Furthermore, when the frequency of the second clock signal CK2 is 1 kHz, the frequency of the fourth clock signal CK4 is 10 Hz, so the logic circuit 50 performs the speed-up process at intervals of 0.1 seconds.

ライトバッファー60は、インターフェース回路90からの不図示の書き込み要求信号に応じて、インターフェース回路90から出力される書き込みデータWDATを取得して保持する。ライトバッファー60が保持する書き込みデータWDATの一部は、書き込みデータSUB_WDとして第2分周回路30に出力され、書き込みデータWDATの他の一部は、書き込みデータBCD_WD,BIN_WDとして計時回路40に出力される。 The write buffer 60 acquires and holds write data WDAT output from the interface circuit 90 in response to a write request signal (not shown) from the interface circuit 90. A part of the write data WDAT held by the write buffer 60 is output to the second frequency dividing circuit 30 as write data SUB_WD, and another part of the write data WDAT is output to the clock circuit 40 as write data BCD_WD, BIN_WD. Ru.

リードバッファー70は、インターフェース回路90からの不図示の読み出し要求信号に応じて、第2分周回路30が生成した計時データSUB_T及び計時回路40が生成した計時データBCD_T,BIN_Tの少なくとも1つを取得して保持し、保持した計時データを読み出しデータRDATとしてインターフェース回路90に出力する。 The read buffer 70 acquires at least one of the clock data SUB_T generated by the second frequency dividing circuit 30 and the clock data BCD_T and BIN_T generated by the clock circuit 40 in response to a read request signal (not shown) from the interface circuit 90. and outputs the held time measurement data to the interface circuit 90 as read data RDAT.

イベント時刻レジスター80は、リアルタイムクロック回路3の端子P5から入力される基準信号REFの電圧レベルが遷移する所定のタイミングで、第2分周回路30が生成した計時データSUB_T及び計時回路40が生成した計時データBCD_T,BIN_Tを保持するバッファー回路である。例えば、基準信号REFの電圧レベルが遷移する所定のタイミングは、基準信号REFがローレベルからハイレベルに遷移するタイミングで
あってもよいし、基準信号REFがハイレベルからローレベルに遷移するタイミングであってもよい。イベント時刻レジスター80は、所定数の計時データを保持することが可能なサイズであり、保持した所定数の計時データを時刻データTSTMPとしてインターフェース回路90に出力する。以下では、イベント時刻レジスター80が基準信号REFに基づいて計時データSUB_T,BCD_T,BIN_Tを取得して保持する機能を「タイムスタンプ機能」という。
The event time register 80 stores the clock data SUB_T generated by the second frequency dividing circuit 30 and the clock data SUB_T generated by the clock circuit 40 at a predetermined timing when the voltage level of the reference signal REF inputted from the terminal P5 of the real-time clock circuit 3 changes. This is a buffer circuit that holds time measurement data BCD_T and BIN_T. For example, the predetermined timing at which the voltage level of the reference signal REF transitions may be the timing at which the reference signal REF transitions from a low level to a high level, or the timing at which the reference signal REF transitions from a high level to a low level. There may be. The event time register 80 has a size capable of holding a predetermined number of time measurement data, and outputs the held predetermined number of time measurement data to the interface circuit 90 as time data TSTMP. Hereinafter, the function by which the event time register 80 acquires and holds time measurement data SUB_T, BCD_T, and BIN_T based on the reference signal REF will be referred to as a "time stamp function."

インターフェース回路90は、リアルタイムクロックモジュール1とホストデバイス6との間の通信のインターフェース回路である。本実施形態では、インターフェース回路90は、IC(Inter-Integrated Circuit)バス対応のインターフェース回路であり、リアルタイムクロック回路3の端子P6を介して入力されるシリアルクロック信号SCLと、リアルタイムクロック回路3の端子P7を介して入出力されるシリアルデータ信号SDAとに基づいて、ホストデバイス6と通信する。ただし、インターフェース回路90は、SPI(Serial Peripheral Interface)などの他のシリアルバス対応のインターフェース回路であってもよいし、パラレルバス対応のインターフェース回路であってもよい。 The interface circuit 90 is an interface circuit for communication between the real-time clock module 1 and the host device 6. In this embodiment, the interface circuit 90 is an interface circuit compatible with an I 2 C (Inter-Integrated Circuit) bus, and receives a serial clock signal SCL input via a terminal P6 of the real-time clock circuit 3 and The host device 6 communicates with the host device 6 based on the serial data signal SDA input/output via the terminal P7. However, the interface circuit 90 may be an interface circuit compatible with other serial buses such as SPI (Serial Peripheral Interface), or may be an interface circuit compatible with parallel buses.

インターフェース回路90は、ホストデバイス6から端子P6,P7を介してアクセス信号を受信し、受信したアクセス信号に応じた各種の処理を行う。 The interface circuit 90 receives an access signal from the host device 6 via terminals P6 and P7, and performs various processes according to the received access signal.

具体的には、インターフェース回路90は、計時データSUB_T,BCD_T,BIN_Tの少なくとも1つの書き換えを要求するアクセス信号を受信した場合、書き換え対象となる計時データの書き込みを要求する不図示の書き込み要求信号を発生する。そして、インターフェース回路90は、書き込み要求信号及び書き込みデータWDATをライトバッファー60に出力する。その後、計時データSUB_Tが書き換え対象である場合は、インターフェース回路90は、書き込みクロック信号SUB_WCKを第2分周回路30に出力し、第2分周回路30は、書き込みクロック信号SUB_WCKに応じて、計時データSUB_Tを、書き込みデータWDATの一部である書き込みデータSUB_WDに更新する。また、計時データBCD_Tが書き換え対象である場合は、インターフェース回路90は、書き込みクロック信号BCD_WCKを計時回路40に出力し、計時回路40は、書き込みクロック信号BCD_WCKに応じて、計時データBCD_Tを、書き込みデータWDATの一部である書き込みデータBCD_WDに更新する。また、計時データBIN_Tが書き換え対象である場合は、インターフェース回路90は、書き込みクロック信号BIN_WCKを計時回路40に出力し、計時回路40は、書き込みクロック信号BIN_WCKに応じて、計時データBIN_Tを、書き込みデータWDATの一部である書き込みデータBIN_WDに更新する。 Specifically, when the interface circuit 90 receives an access signal requesting rewriting of at least one of the clock data SUB_T, BCD_T, and BIN_T, the interface circuit 90 sends a write request signal (not shown) requesting writing of the clock data to be rewritten. Occur. The interface circuit 90 then outputs the write request signal and write data WDAT to the write buffer 60. After that, if the time measurement data SUB_T is to be rewritten, the interface circuit 90 outputs the write clock signal SUB_WCK to the second frequency dividing circuit 30, and the second frequency dividing circuit 30 performs time measurement according to the write clock signal SUB_WCK. Data SUB_T is updated to write data SUB_WD, which is part of write data WDAT. Further, when the clock data BCD_T is to be rewritten, the interface circuit 90 outputs the write clock signal BCD_WCK to the clock circuit 40, and the clock circuit 40 converts the clock data BCD_T into the write data according to the write clock signal BCD_WCK. Update to write data BCD_WD which is part of WDAT. Further, when the clock data BIN_T is to be rewritten, the interface circuit 90 outputs the write clock signal BIN_WCK to the clock circuit 40, and the clock circuit 40 converts the clock data BIN_T into the write data in accordance with the write clock signal BIN_WCK. Update to write data BIN_WD which is part of WDAT.

また、インターフェース回路90は、計時データSUB_T,BCD_T,BIN_Tの少なくとも1つの読み出しを要求するアクセス信号を受信した場合、読み出し対象となる計時データの読み出しを要求する不図示の読み出し要求信号を発生し、リードバッファー70に出力する。そして、インターフェース回路90は、リードバッファー70が取得して保持した読み出し対象の計時データである読み出しデータRDATを取得し、読み出しデータRDATをシリアルデータ信号SDAに変換して端子P7を介してホストデバイス6に送信する。 Further, when the interface circuit 90 receives an access signal requesting reading of at least one of the clock data SUB_T, BCD_T, and BIN_T, it generates a read request signal (not shown) requesting reading of the clock data to be read, Output to read buffer 70. Then, the interface circuit 90 acquires read data RDAT, which is the time measurement data to be read acquired and held by the read buffer 70, converts the read data RDAT into a serial data signal SDA, and sends the serial data signal SDA to the host device 6 via the terminal P7. Send to.

また、インターフェース回路90は、時刻データTSTMPの読み出しを要求するアクセス信号を受信した場合、イベント時刻レジスター80が保持する時刻データTSTMPに含まれる計時データSUB_T,BCD_T,BIN_Tのうち読み出し対象となる計時データを取得し、当該計時データをシリアルデータ信号SDAに変換して端子P7を介してホストデバイス6に送信する。 Further, when the interface circuit 90 receives an access signal requesting to read the time data TSTMP, the interface circuit 90 selects the time measurement data to be read out of the time measurement data SUB_T, BCD_T, and BIN_T included in the time data TSTMP held by the event time register 80. , converts the time measurement data into a serial data signal SDA, and transmits it to the host device 6 via the terminal P7.

なお、本実施形態では、タイムスタンプ機能が有効の場合に、インターフェース回路90がタイムスタンプ機能を無効にすることを指示するアクセス信号を受信した場合、インターフェース回路90は、タイムスタンプ機能を無効にするための不図示の制御信号をイベント時刻レジスター80に出力する。また、タイムスタンプ機能が無効の場合に、インターフェース回路90がタイムスタンプ機能を有効にすることを指示するアクセス信号を受信した場合、インターフェース回路90は、タイムスタンプ機能を有効にするための不図示の制御信号をイベント時刻レジスター80に出力する。 Note that in this embodiment, when the time stamp function is enabled and the interface circuit 90 receives an access signal instructing to disable the time stamp function, the interface circuit 90 disables the time stamp function. A control signal (not shown) for this purpose is output to the event time register 80. Further, when the time stamp function is disabled and the interface circuit 90 receives an access signal instructing to enable the time stamp function, the interface circuit 90 performs a process (not shown) to enable the time stamp function. A control signal is output to the event time register 80.

また、インターフェース回路90は、記憶部100に対するデータの書き込みや読み出しを要求するアクセス信号を受信した場合、記憶部100に対するデータの書き込みや読み出しを行う。特に、本実施形態では、インターフェース回路90は、ホストデバイス6から補正データTDを受信して記憶部100に書き込む。また、インターフェース回路90は、ホストデバイス6から補正期間設定データPNを受信して記憶部100に書き込んでもよい。これにより、ホストデバイス6は、リアルタイムクロック回路3の環境変化や計時変化に応じて、補正期間設定データPNを適宜最適な値に変更することができる。同様に、インターフェース回路90は、ホストデバイス6から選択データSELを受信して記憶部100に書き込んでもよい。 Further, when the interface circuit 90 receives an access signal requesting writing or reading data to or from the storage unit 100, the interface circuit 90 writes or reads data to or from the storage unit 100. In particular, in this embodiment, the interface circuit 90 receives the correction data TD from the host device 6 and writes it into the storage unit 100. Further, the interface circuit 90 may receive the correction period setting data PN from the host device 6 and write it into the storage unit 100. Thereby, the host device 6 can appropriately change the correction period setting data PN to an optimal value in accordance with environmental changes and time measurement changes of the real-time clock circuit 3. Similarly, the interface circuit 90 may receive selection data SEL from the host device 6 and write it into the storage unit 100.

記憶部100は、各種のデータを記憶する回路である。本実施形態では、記憶部100は、不図示の不揮発性メモリーとレジスターとを備えている。不揮発性メモリーには、各種データが記憶されており、電源電圧VLOGICが0Vから上昇して所定の電圧値に達すると、不揮発性メモリーに記憶されている各種データはレジスターに転送される。そして、レジスターに転送された各種データが各回路に出力される。 The storage unit 100 is a circuit that stores various data. In this embodiment, the storage unit 100 includes a non-volatile memory and a register (not shown). Various data are stored in the non-volatile memory, and when the power supply voltage VLOGIC rises from 0V and reaches a predetermined voltage value, the various data stored in the non-volatile memory is transferred to the register. The various data transferred to the registers are then output to each circuit.

例えば、記憶部100の不揮発性メモリーには、選択データSELや補正期間設定データPNの初期値が記憶されており、レジスターに転送された選択データSELは第2分周回路30に出力され、レジスターに転送された補正期間設定データPNは論理回路50及び割込発生回路110に出力される。その後、選択データSELや補正期間設定データPNは、ホストデバイス6からインターフェース回路90を介して記憶部100のレジスターに書き込まれることによって更新されてもよい。なお、選択データSELや補正期間設定データPNを変更する必要がなければ、選択データSELや補正期間設定データPNは初期値のまま更新されなくてもよい。また、補正データTDは、ホストデバイス6からインターフェース回路90を介して記憶部100のレジスターに書き込まれ、論理回路50に出力される。 For example, the nonvolatile memory of the storage unit 100 stores the selection data SEL and the initial values of the correction period setting data PN, and the selection data SEL transferred to the register is output to the second frequency dividing circuit 30 and stored in the register. The correction period setting data PN transferred to is output to the logic circuit 50 and the interrupt generation circuit 110. Thereafter, the selection data SEL and the correction period setting data PN may be updated by being written from the host device 6 to the register of the storage unit 100 via the interface circuit 90. Note that if there is no need to change the selection data SEL or the correction period setting data PN, the selection data SEL or the correction period setting data PN do not need to be updated as they are at their initial values. Further, the correction data TD is written from the host device 6 to the register of the storage unit 100 via the interface circuit 90 and output to the logic circuit 50.

割込発生回路110は、基準信号REFと補正期間設定データPNとに基づいて割込み信号IRQを発生し、割込み信号IRQを、リアルタイムクロック回路3の端子P8を介してホストデバイス6に出力する。具体的には、補正期間設定データPNの値をnとすると、割込発生回路110は、基準信号REFの電圧レベルが遷移する所定のタイミングがn+1回発生すると割込み信号IRQを発生する。例えば、基準信号REFの電圧レベルが遷移する所定のタイミングは、基準信号REFがローレベルからハイレベルに遷移するタイミングであってもよいし、基準信号REFがハイレベルからローレベルに遷移するタイミングであってもよい。ホストデバイス6は、割込み信号IRQを受けると、割込み処理を行って時刻データTSTMPに含まれる2つの計時データを読み出し、当該2つの計時データに基づいて補正データTDを生成する。ホストデバイス6が読み出す2つの計時データは、例えば、基準信号REFの電圧レベルが1回目とn+1回目に遷移したタイミングでイベント時刻レジスター80に保持された2つの計時データである。ホストデバイス6は、当該2つの計時データにそれぞれ含まれる計時データSUB_Tの差分により、基準信号REFのn周期の間隔での計時データSUB_Tの変化量を算出し、補正データTDを生成する。 The interrupt generation circuit 110 generates an interrupt signal IRQ based on the reference signal REF and the correction period setting data PN, and outputs the interrupt signal IRQ to the host device 6 via the terminal P8 of the real-time clock circuit 3. Specifically, assuming that the value of the correction period setting data PN is n, the interrupt generation circuit 110 generates the interrupt signal IRQ when a predetermined timing at which the voltage level of the reference signal REF changes occurs n+1 times. For example, the predetermined timing at which the voltage level of the reference signal REF transitions may be the timing at which the reference signal REF transitions from a low level to a high level, or the timing at which the reference signal REF transitions from a high level to a low level. There may be. Upon receiving the interrupt signal IRQ, the host device 6 performs an interrupt process, reads out two pieces of clock data included in the time data TSTMP, and generates correction data TD based on the two pieces of clock data. The two pieces of clock data read by the host device 6 are, for example, two pieces of clock data held in the event time register 80 at the timings when the voltage level of the reference signal REF changes for the first time and the (n+1) time. The host device 6 calculates the amount of change in the clock data SUB_T at intervals of n cycles of the reference signal REF based on the difference between the clock data SUB_T included in the two clock data, and generates correction data TD.

なお、計時データSUB_Tは「第1計時データ」の一例であり、計時データBCD_T又は計時データBIN_Tは「第2計時データ」の一例である。 Note that the clock data SUB_T is an example of "first clock data", and the clock data BCD_T or clock data BIN_T is an example of "second clock data".

1-1-2.計時回路の構成
図2は、計時回路40の構成例を示す図である。図2に示すように、計時回路40は、カウンター41~47を備える。
1-1-2. Configuration of Time Counting Circuit FIG. 2 is a diagram showing an example of the configuration of the time counting circuit 40. As shown in FIG. As shown in FIG. 2, the clock circuit 40 includes counters 41 to 47.

カウンター41は、秒カウンターであり、第3クロック信号CK3に同期してカウント動作を行うことにより、秒単位の時刻を表すカウント値を生成する。例えば、カウンター41は、60進BCD(Binary Coded Decimal)カウンターであり、第3クロック信号CK3のパルスに同期して、十進数の0~59を表すBCDカウント値を順次生成する。カウント値が十進数の59を表す値に等しくなると、カウンター41は、第3クロック信号CK3の次のパルスに同期して、カウント値を0にリセットすると共に、キャリー信号CA1を出力する。カウンター41によって生成されるカウント値は、秒単位の時刻を表す計時データBCD_T1として用いられる。すなわち、カウンター41は、1秒単位で計時データBCD_T1を更新する。また、カウンター41は、書き込みクロック信号BCD_WCKのパルスに同期して、カウント値、すなわち計時データBCD_T1を書き込みデータBCD_WDのビット0~7の1バイトの値に更新する。 The counter 41 is a second counter, and generates a count value representing time in seconds by performing a counting operation in synchronization with the third clock signal CK3. For example, the counter 41 is a sexagesimal BCD (Binary Coded Decimal) counter, and sequentially generates BCD count values representing decimal numbers 0 to 59 in synchronization with the pulses of the third clock signal CK3. When the count value becomes equal to the value representing decimal number 59, the counter 41 resets the count value to 0 and outputs the carry signal CA1 in synchronization with the next pulse of the third clock signal CK3. The count value generated by the counter 41 is used as time measurement data BCD_T1 representing time in seconds. That is, the counter 41 updates the clock data BCD_T1 in units of one second. Further, the counter 41 updates the count value, that is, the clock data BCD_T1, to the value of 1 byte of bits 0 to 7 of the write data BCD_WD in synchronization with the pulse of the write clock signal BCD_WCK.

カウンター42は、分カウンターであり、キャリー信号CA1に同期してカウント動作を行うことにより、分単位の時刻を表すカウント値を生成する。例えば、カウンター42は、60進BCDカウンターであり、キャリー信号CA1のパルスに同期して、十進数の0~59を表すBCDカウント値を順次生成する。カウント値が十進数の59を表す値に等しくなると、カウンター42は、キャリー信号CA1の次のパルスに同期して、カウント値を0にリセットすると共に、キャリー信号CA2を出力する。カウンター42によって生成されるカウント値は、分単位の時刻を表す計時データBCD_T2として用いられる。すなわち、カウンター42は、分単位で計時データBCD_T2を更新する。また、カウンター42は、書き込みクロック信号BCD_WCKのパルスに同期して、カウント値、すなわち計時データBCD_T2を書き込みデータBCD_WDのビット8~15の1バイトの値に更新する。 The counter 42 is a minute counter, and generates a count value representing time in minutes by performing a counting operation in synchronization with the carry signal CA1. For example, the counter 42 is a sexagesimal BCD counter, and sequentially generates BCD count values representing decimal numbers 0 to 59 in synchronization with the pulses of the carry signal CA1. When the count value becomes equal to a value representing decimal number 59, the counter 42 resets the count value to 0 and outputs the carry signal CA2 in synchronization with the next pulse of the carry signal CA1. The count value generated by the counter 42 is used as time measurement data BCD_T2 representing time in minutes. That is, the counter 42 updates the clock data BCD_T2 on a minute-by-minute basis. Further, the counter 42 updates the count value, that is, the clock data BCD_T2, to the value of 1 byte of bits 8 to 15 of the write data BCD_WD in synchronization with the pulse of the write clock signal BCD_WCK.

カウンター43は、時カウンターであり、キャリー信号CA2に同期してカウント動作を行うことにより、時単位の時刻を表すカウント値を生成する。例えば、カウンター43は、24進BCDカウンターであり、キャリー信号CA2のパルスに同期して、十進数の0~23を表すBCDカウント値を順次生成する。カウント値が十進数の23を表す値に等しくなると、カウンター43は、キャリー信号CA2の次のパルスに同期して、カウント値を0にリセットすると共に、キャリー信号CA3を出力する。カウンター43によって生成されるカウント値は、時単位の時刻を表す計時データBCD_T3として用いられる。すなわち、カウンター43は、時単位で計時データBCD_T3を更新する。また、カウンター43は、書き込みクロック信号BCD_WCKのパルスに同期して、カウント値、すなわち計時データBCD_T3を書き込みデータBCD_WDのビット16~23の1バイトの値に更新する。 The counter 43 is an hour counter, and generates a count value representing time in hours by performing a counting operation in synchronization with the carry signal CA2. For example, the counter 43 is a 24-ary BCD counter, and sequentially generates BCD count values representing decimal numbers 0 to 23 in synchronization with the pulses of the carry signal CA2. When the count value becomes equal to the value representing decimal number 23, the counter 43 resets the count value to 0 and outputs the carry signal CA3 in synchronization with the next pulse of the carry signal CA2. The count value generated by the counter 43 is used as time measurement data BCD_T3 representing time in hours. That is, the counter 43 updates the clock data BCD_T3 on an hourly basis. Further, the counter 43 updates the count value, that is, the clock data BCD_T3, to the value of 1 byte of bits 16 to 23 of the write data BCD_WD in synchronization with the pulse of the write clock signal BCD_WCK.

カウンター44は、日カウンターであり、キャリー信号CA3に同期してカウント動作を行うことにより、日単位の時刻を表すカウント値を生成する。例えば、カウンター44は、10進BCDカウンターであり、キャリー信号CA3のパルスに同期して、十進数の1~31を表すBCDカウント値を順次生成する。ただし、月によっては、月の最後の日のカウント値を28又は30とする必要があり、うるう年の2月の場合には、月の最後の日のカウント値を29とする必要がある。そこで、カウンター44は、日単位の時刻を表
すカウント値を、月単位の時刻を表すカウント値及び年単位の時刻を表すカウント値に基づいて設定されたカウント上限値と比較する。カウント値がカウント上限値に等しくなると、カウンター44は、キャリー信号CA3の次のパルスに同期して、カウント値を1にリセットすると共に、キャリー信号CA4を出力する。カウンター44によって生成されるカウント値は、日単位の時刻を表す計時データBCD_T4として用いられる。すなわち、カウンター44は、日単位で計時データBCD_T4を更新する。また、カウンター44は、書き込みクロック信号BCD_WCKのパルスに同期して、カウント値、すなわち計時データBCD_T4を書き込みデータBCD_WDのビット24~31の1バイトの値に更新する。
The counter 44 is a day counter, and generates a count value representing time in days by performing a counting operation in synchronization with the carry signal CA3. For example, the counter 44 is a decimal BCD counter, and sequentially generates BCD count values representing decimal numbers 1 to 31 in synchronization with the pulses of the carry signal CA3. However, depending on the month, the count value on the last day of the month needs to be 28 or 30, and in February of a leap year, the count value on the last day of the month needs to be 29. Therefore, the counter 44 compares a count value representing time on a daily basis with a count upper limit value set based on a count value representing time on a monthly basis and a count value representing time on a yearly basis. When the count value becomes equal to the count upper limit value, the counter 44 resets the count value to 1 and outputs the carry signal CA4 in synchronization with the next pulse of the carry signal CA3. The count value generated by the counter 44 is used as time measurement data BCD_T4 representing the time on a daily basis. That is, the counter 44 updates the clock data BCD_T4 on a daily basis. Further, the counter 44 updates the count value, that is, the clock data BCD_T4, to the value of 1 byte of bits 24 to 31 of the write data BCD_WD in synchronization with the pulse of the write clock signal BCD_WCK.

カウンター45は、月カウンターであり、キャリー信号CA4に同期してカウント動作を行うことにより、月単位の時刻を表すカウント値を生成する。例えば、カウンター45は、12進BCDカウンターで構成され、キャリー信号CA4のパルスに同期して、十進数の1~12を表すBCDカウント値を順次生成する。カウント値が十進数の12を表す値に等しくなると、カウンター45は、キャリー信号CA4の次のパルスに同期して、カウント値を1にリセットすると共に、キャリー信号CA5を出力する。カウンター45によって生成されるカウント値は、月単位の時刻を表す計時データBCD_T5として用いられる。すなわち、カウンター45は、月単位で計時データBCD_T5を更新する。また、カウンター45は、書き込みクロック信号BCD_WCKのパルスに同期して、カウント値、すなわち計時データBCD_T5を書き込みデータBCD_WDのビット32~39の1バイトの値に更新する。 The counter 45 is a monthly counter, and generates a count value representing time on a monthly basis by performing a counting operation in synchronization with the carry signal CA4. For example, the counter 45 is composed of a hexadecimal BCD counter, and sequentially generates BCD count values representing decimal numbers 1 to 12 in synchronization with the pulses of the carry signal CA4. When the count value becomes equal to the value representing decimal number 12, the counter 45 resets the count value to 1 and outputs the carry signal CA5 in synchronization with the next pulse of the carry signal CA4. The count value generated by the counter 45 is used as time measurement data BCD_T5 representing time on a monthly basis. That is, the counter 45 updates the clock data BCD_T5 on a monthly basis. Further, the counter 45 updates the count value, that is, the clock data BCD_T5, to the value of 1 byte of bits 32 to 39 of the write data BCD_WD in synchronization with the pulse of the write clock signal BCD_WCK.

カウンター46は、年カウンターであり、キャリー信号CA5に同期してカウント動作を行うことにより、年単位の時刻を表すカウント値を生成する。例えば、カウンター46は、10進BCDカウンターで構成され、キャリー信号CA5のパルスに同期して、西暦年号の場合に、十進数の2020、2021、2022・・・の下2桁を表すBCDカウント値を順次生成する。カウンター46によって生成されるカウント値は、年単位の時刻を表す計時データBCD_T6として用いられる。すなわち、カウンター46は、年単位で計時データBCD_T6を更新する。また、カウンター46は、書き込みクロック信号BCD_WCKのパルスに同期して、カウント値、すなわち計時データBCD_T6を書き込みデータBCD_WDのビット40~47の1バイトの値に更新する。 The counter 46 is a year counter, and generates a count value representing time in units of years by performing a counting operation in synchronization with the carry signal CA5. For example, the counter 46 is composed of a decimal BCD counter, and in synchronization with the pulse of the carry signal CA5, a BCD count representing the lower two digits of the decimal number 2020, 2021, 2022, etc. in the case of the Western calendar year. Generate values sequentially. The count value generated by the counter 46 is used as time measurement data BCD_T6 representing time in units of years. That is, the counter 46 updates the time measurement data BCD_T6 on a yearly basis. Further, the counter 46 updates the count value, that is, the clock data BCD_T6, to the value of 1 byte of bits 40 to 47 of the write data BCD_WD in synchronization with the pulse of the write clock signal BCD_WCK.

前述の計時データBCD_Tは、年、月、日、時、分及び秒のカウント値である計時データBCD_T6~BCD_T1によって構成される。 The aforementioned time measurement data BCD_T is composed of time measurement data BCD_T6 to BCD_T1, which are count values of year, month, day, hour, minute, and second.

カウンター47は、秒カウンターであり、第3クロック信号CK3に同期してカウント動作を行うことにより、秒単位の時刻を表すカウント値を生成する。例えば、カウンター41は、2進カウンターであり、第3クロック信号CK3のパルスに同期して増加する2進数の値を順次生成する。カウンター47によって生成されるカウント値は、年、月、日、時、分及び秒を秒単位の時刻として表す計時データBIN_Tとして用いられる。すなわち、カウンター47は、1秒単位で計時データBIN_Tを更新する。また、カウンター47は、書き込みクロック信号BIN_WCKのパルスに同期して、カウント値、すなわち計時データBIN_Tを書き込みデータBIN_WDの値に更新する。 The counter 47 is a second counter, and generates a count value representing time in seconds by performing a counting operation in synchronization with the third clock signal CK3. For example, the counter 41 is a binary counter and sequentially generates binary values that increase in synchronization with the pulses of the third clock signal CK3. The count value generated by the counter 47 is used as time measurement data BIN_T representing year, month, day, hour, minute, and second as time in seconds. That is, the counter 47 updates the time measurement data BIN_T in units of one second. Further, the counter 47 updates the count value, that is, the clock data BIN_T, to the value of the write data BIN_WD in synchronization with the pulse of the write clock signal BIN_WCK.

このように、本実施形態では、計時回路40は、年、月、日、時、分及び秒をそれぞれBCDカウント値で表す計時データBCD_Tを生成するとともに、年、月、日、時、分及び秒を秒単位の2進数の値で表す計時データBIN_Tも生成する。ホストデバイス6は、システムの用途に応じて、リアルタイムクロックモジュール1から計時データBCD_T,BIN_Tの一方又は両方に対して読み出しや書き込みを行い、システムに必要な処理を行うことができる。 As described above, in the present embodiment, the timekeeping circuit 40 generates timekeeping data BCD_T that represents the year, month, day, hour, minute, and second using BCD count values, and also generates the year, month, day, hour, minute, and second. Time measurement data BIN_T representing seconds as a binary value in units of seconds is also generated. The host device 6 can read or write one or both of the clock data BCD_T and BIN_T from the real-time clock module 1 depending on the purpose of the system, and can perform processes necessary for the system.

1-1-3.第1分周回路の構成
図3は、第1分周回路20の構成例を示す図である。図3に示すように、第1分周回路20は、分周回路21及び2分周回路22~25を備える。
1-1-3. Configuration of First Frequency Divider Circuit FIG. 3 is a diagram showing a configuration example of the first frequency divider circuit 20. As shown in FIG. 3, the first frequency dividing circuit 20 includes a frequency dividing circuit 21 and frequency dividing circuits 22 to 25.

分周回路21は、基本的には第1クロック信号CK1を2分周することによってクロック信号CKAを生成する。2分周回路22は、クロック信号CKAを2分周することによってクロック信号CKBを生成する。2分周回路23は、クロック信号CKBを2分周することによってクロック信号CKCを生成する。2分周回路24は、クロック信号CKCを2分周することによってクロック信号CKDを生成する。2分周回路25は、クロック信号CKDを2分周することによって第2クロック信号CK2を生成する。 The frequency dividing circuit 21 basically generates the clock signal CKA by dividing the frequency of the first clock signal CK1 by two. The divide-by-2 circuit 22 generates the clock signal CKB by dividing the frequency of the clock signal CKA by two. The divide-by-2 circuit 23 generates the clock signal CKC by dividing the clock signal CKB by two. The divide-by-2 circuit 24 generates the clock signal CKD by dividing the clock signal CKC by two. The divide-by-2 circuit 25 generates a second clock signal CK2 by dividing the clock signal CKD by two.

このように構成されている第1分周回路20は、バイナリーカウンターとして動作し、第1クロック信号CK1を32分周した第2クロック信号CK2を生成する。例えば、第1クロック信号CK1の周波数が32.764kHzである場合、第2クロック信号CK2の周波数は1.024kHzとなる。また、第1クロック信号CK1の周波数が32kHzである場合、第2クロック信号CK2の周波数は1kHzとなる。 The first frequency dividing circuit 20 configured in this manner operates as a binary counter and generates a second clock signal CK2 by dividing the frequency of the first clock signal CK1 by 32. For example, when the frequency of the first clock signal CK1 is 32.764 kHz, the frequency of the second clock signal CK2 is 1.024 kHz. Furthermore, when the frequency of the first clock signal CK1 is 32 kHz, the frequency of the second clock signal CK2 is 1 kHz.

しかしながら、例えば、環境温度が25℃のときに第1クロック信号CK1の周波数が目標周波数となるように調整されている場合、高温や低温の環境では、振動子2の温度特性によって第1クロック信号CK1の周波数の目標周波数に対する誤差が大きくなる。また、振動子2の経時変化によっても第1クロック信号CK1の周波数の目標周波数に対する誤差が大きくなる。 However, for example, if the frequency of the first clock signal CK1 is adjusted to be the target frequency when the environmental temperature is 25 degrees Celsius, the temperature characteristics of the vibrator 2 may cause the first clock signal to The error of the frequency of CK1 with respect to the target frequency becomes large. Furthermore, due to changes in the vibrator 2 over time, the error in the frequency of the first clock signal CK1 relative to the target frequency increases.

そこで、本実施形態では、図3に示すように、論理回路50から出力される制御信号PE,PDが分周回路21に入力され、分周回路21に対して制御信号PE,PDに応じた緩急処理が行われる。本実施形態では、制御信号PE,PDは、ともにローレベルか一方のみがハイレベルとなる信号であり、分周回路21は、制御信号PE,PDがともにローレベルのときは第1クロック信号CK1を2分周したクロック信号CKAを出力する。また、分周回路21は、制御信号PEがハイレベルのときは、第1クロック信号CK1を2分周せずにそのままクロック信号CKAとして出力する。また、分周回路21は、制御信号PDがハイレベルのときは、第1クロック信号CK1を4分周したクロック信号CKAを出力する。このように、分周回路21に対して緩急処理が行われることにより、第2クロック信号CK2の平均周波数が所望の周波数に近づくことになる。 Therefore, in this embodiment, as shown in FIG. Gradual processing is carried out. In this embodiment, the control signals PE and PD are both low level signals or only one signal is high level, and when the control signals PE and PD are both low level, the frequency dividing circuit 21 outputs the first clock signal CK1. A clock signal CKA obtained by dividing the frequency by two is output. Further, when the control signal PE is at a high level, the frequency dividing circuit 21 outputs the first clock signal CK1 as it is as the clock signal CKA without dividing the frequency by two. Furthermore, when the control signal PD is at a high level, the frequency dividing circuit 21 outputs a clock signal CKA obtained by dividing the first clock signal CK1 by four. In this way, by performing the speed-up process on the frequency dividing circuit 21, the average frequency of the second clock signal CK2 approaches the desired frequency.

1-1-4.第2分周回路の構成
前述の通り、第2分周回路30は、選択データSELの値に応じて、バイナリーカウンター又はBCDカウンターとして動作する。
1-1-4. Configuration of Second Frequency Divider Circuit As described above, the second frequency divider circuit 30 operates as a binary counter or a BCD counter depending on the value of the selection data SEL.

図4は、選択データSELが0である場合の第2分周回路30の構成例を示す図である。図4に示すように、第2分周回路30は、2分周回路31~3Aを備える。選択データSELが0である場合、第2分周回路30に入力される第2クロック信号CK2の周波数は1.024kHzである。 FIG. 4 is a diagram showing a configuration example of the second frequency dividing circuit 30 when the selection data SEL is 0. As shown in FIG. 4, the second frequency divider circuit 30 includes frequency divider circuits 31 to 3A. When the selection data SEL is 0, the frequency of the second clock signal CK2 input to the second frequency dividing circuit 30 is 1.024 kHz.

2分周回路31は、1.024kHzの第2クロック信号CK2を2分周して512Hzのクロック信号を生成する。この512Hzのクロック信号は、計時データSUB_Tのビット0として用いられる。また、2分周回路31は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット0の値を書き込みデータSUB_WDのビット0の値に更新する。 The divide-by-2 circuit 31 divides the second clock signal CK2 of 1.024 kHz by two to generate a clock signal of 512 Hz. This 512 Hz clock signal is used as bit 0 of time measurement data SUB_T. Furthermore, the divide-by-2 circuit 31 updates the value of bit 0 of the clock data SUB_T to the value of bit 0 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路32は、2分周回路31が生成した512Hzのクロック信号を2分周して256Hzのクロック信号を生成する。この256Hzのクロック信号は、計時データSUB_Tのビット1として用いられる。また、2分周回路32は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット1の値を書き込みデータSUB_WDのビット1の値に更新する。 The divide-by-2 circuit 32 divides the frequency of the 512 Hz clock signal generated by the divide-by-2 circuit 31 by two to generate a 256 Hz clock signal. This 256 Hz clock signal is used as bit 1 of time measurement data SUB_T. Further, the divide-by-2 circuit 32 updates the value of bit 1 of the clock data SUB_T to the value of bit 1 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路33は、2分周回路32が生成した256Hzのクロック信号を2分周して128Hzのクロック信号を生成する。この128Hzのクロック信号は、計時データSUB_Tのビット2として用いられる。また、2分周回路33は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット2の値を書き込みデータSUB_WDのビット2の値に更新する。 The divide-by-2 circuit 33 divides the 256 Hz clock signal generated by the divide-by-2 circuit 32 by two to generate a 128 Hz clock signal. This 128 Hz clock signal is used as bit 2 of time measurement data SUB_T. Further, the divide-by-2 circuit 33 updates the value of bit 2 of the clock data SUB_T to the value of bit 2 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路34は、2分周回路33が生成した128Hzのクロック信号を2分周して64Hzのクロック信号を生成する。この64Hzのクロック信号は、計時データSUB_Tのビット3として用いられる。また、2分周回路34は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット3の値を書き込みデータSUB_WDのビット3の値に更新する。 The divide-by-2 circuit 34 divides the 128 Hz clock signal generated by the divide-by-2 circuit 33 by two to generate a 64 Hz clock signal. This 64 Hz clock signal is used as bit 3 of time measurement data SUB_T. Further, the divide-by-2 circuit 34 updates the value of bit 3 of the clock data SUB_T to the value of bit 3 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路35は、2分周回路34が生成した64Hzのクロック信号を2分周して32Hzのクロック信号を生成する。この32Hzのクロック信号は、計時データSUB_Tのビット4として用いられる。また、2分周回路35は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット4の値を書き込みデータSUB_WDのビット4の値に更新する。 The divide-by-2 circuit 35 divides the frequency of the 64 Hz clock signal generated by the divide-by-2 circuit 34 by two to generate a 32 Hz clock signal. This 32 Hz clock signal is used as bit 4 of time measurement data SUB_T. Further, the divide-by-2 circuit 35 updates the value of bit 4 of the clock data SUB_T to the value of bit 4 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路36は、2分周回路35が生成した32Hzのクロック信号を2分周して16Hzのクロック信号を生成する。この16Hzのクロック信号は、計時データSUB_Tのビット5として用いられる。また、2分周回路36は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット5の値を書き込みデータSUB_WDのビット5の値に更新する。 The divide-by-2 circuit 36 divides the frequency of the 32 Hz clock signal generated by the divide-by-2 circuit 35 by two to generate a 16 Hz clock signal. This 16 Hz clock signal is used as bit 5 of time measurement data SUB_T. Further, the divide-by-2 circuit 36 updates the value of bit 5 of the clock data SUB_T to the value of bit 5 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路37は、2分周回路36が生成した16Hzのクロック信号を2分周して8Hzのクロック信号を生成する。この8Hzのクロック信号は、計時データSUB_Tのビット6として用いられるとともに、第4クロック信号CK4として用いられる。また、2分周回路37は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット6の値を書き込みデータSUB_WDのビット6の値に更新する。 The divide-by-2 circuit 37 divides the frequency of the 16 Hz clock signal generated by the divide-by-2 circuit 36 by two to generate an 8 Hz clock signal. This 8 Hz clock signal is used as bit 6 of the time measurement data SUB_T and is also used as the fourth clock signal CK4. Further, the divide-by-2 circuit 37 updates the value of bit 6 of the clock data SUB_T to the value of bit 6 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路38は、2分周回路37が生成した8Hzのクロック信号を2分周して4Hzのクロック信号を生成する。この4Hzのクロック信号は、計時データSUB_Tのビット7として用いられる。また、2分周回路38は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット7の値を書き込みデータSUB_WDのビット7の値に更新する。 The divide-by-2 circuit 38 divides the frequency of the 8 Hz clock signal generated by the divide-by-2 circuit 37 by two to generate a 4 Hz clock signal. This 4Hz clock signal is used as bit 7 of time measurement data SUB_T. Furthermore, the divide-by-2 circuit 38 updates the value of bit 7 of the clock data SUB_T to the value of bit 7 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路39は、2分周回路38が生成した4Hzのクロック信号を2分周して2Hzのクロック信号を生成する。この2Hzのクロック信号は、計時データSUB_Tのビット8として用いられる。また、2分周回路39は、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット8の値を書き込みデータSUB_WDのビット8の値に更新する。 The divide-by-2 circuit 39 divides the frequency of the 4 Hz clock signal generated by the divide-by-2 circuit 38 by two to generate a 2 Hz clock signal. This 2Hz clock signal is used as bit 8 of time measurement data SUB_T. Further, the divide-by-2 circuit 39 updates the value of bit 8 of the clock data SUB_T to the value of bit 8 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

2分周回路3Aは、2分周回路39が生成した2Hzのクロック信号を2分周して1Hzの第3クロック信号CK3を生成する。第3クロック信号CK3は、計時データSUB
_Tのビット9として用いられる。また、2分周回路3Aは、書き込みクロック信号SUB_WCKのパルスに同期して、計時データSUB_Tのビット9の値を書き込みデータSUB_WDのビット9の値に更新する。
The divide-by-2 circuit 3A divides the frequency of the 2 Hz clock signal generated by the divide-by-2 circuit 39 by two to generate a third clock signal CK3 of 1 Hz. The third clock signal CK3 is the clock data SUB
Used as bit 9 of _T. Further, the divide-by-2 circuit 3A updates the value of bit 9 of the clock data SUB_T to the value of bit 9 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

このように、選択データSELが0である場合、第2分周回路30は、1.024kHzの第2クロック信号CK2を1024分周して1Hzの第3クロック信号CK3を生成するとともに、1.024kHzの第2クロック信号CK2を128分周して8Hzの第4クロック信号CK4を生成する。 In this way, when the selection data SEL is 0, the second frequency dividing circuit 30 divides the second clock signal CK2 of 1.024 kHz by 1024 to generate the third clock signal CK3 of 1 Hz, and also generates the third clock signal CK3 of 1 Hz. The second clock signal CK2 of 0.024 kHz is divided by 128 to generate a fourth clock signal CK4 of 8 Hz.

図5は、選択データSELが1である場合の第2分周回路30の構成例を示す図である。図5に示すように、第2分周回路30は、カウンター3B,3C,3Dを備える。選択データSELが0である場合、第2分周回路30に入力される第2クロック信号CK2の周波数は1kHzである。 FIG. 5 is a diagram showing a configuration example of the second frequency dividing circuit 30 when the selection data SEL is 1. As shown in FIG. 5, the second frequency dividing circuit 30 includes counters 3B, 3C, and 3D. When the selection data SEL is 0, the frequency of the second clock signal CK2 input to the second frequency dividing circuit 30 is 1 kHz.

カウンター3Bは、1kHzの第2クロック信号CK2に同期してカウント動作を行うことにより、1/1000秒単位の時刻を表すカウント値を生成する。例えば、カウンター3Bは、10進BCDカウンターであり、第2クロック信号CK2のパルスに同期して、十進数の0~9を表すBCDカウント値を順次生成する。カウント値が十進数の9を表す値に等しくなると、カウンター3Bは、第2クロック信号CK2の次のパルスに同期して、カウント値を0にリセットすると共に、100Hzのキャリー信号CA11を出力する。カウンター3Bによって生成されるカウント値は、1/1000秒単位の時刻を表す計時データSUB_T1として用いられる。すなわち、カウンター3Bは、1/1000秒単位で計時データSUB_T1を更新する。また、カウンター3Bは、書き込みクロック信号SUB_WCKのパルスに同期して、カウント値、すなわち計時データSUB_T1を書き込みデータSUB_WDのビット0~7の1バイトの値に更新する。 The counter 3B generates a count value representing time in units of 1/1000 seconds by performing a counting operation in synchronization with the second clock signal CK2 of 1 kHz. For example, the counter 3B is a decimal BCD counter, and sequentially generates BCD count values representing decimal numbers 0 to 9 in synchronization with the pulses of the second clock signal CK2. When the count value becomes equal to a value representing 9 in decimal, the counter 3B resets the count value to 0 and outputs a 100 Hz carry signal CA11 in synchronization with the next pulse of the second clock signal CK2. The count value generated by the counter 3B is used as time measurement data SUB_T1 representing time in units of 1/1000 seconds. That is, the counter 3B updates the time measurement data SUB_T1 in units of 1/1000 seconds. Further, the counter 3B updates the count value, that is, the time measurement data SUB_T1, to the value of 1 byte of bits 0 to 7 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

カウンター3Cは、100Hzのキャリー信号CA11に同期してカウント動作を行うことにより、1/100秒単位の時刻を表すカウント値を生成する。例えば、カウンター3Cは、10進BCDカウンターであり、キャリー信号CA11のパルスに同期して、十進数の0~9を表すBCDカウント値を順次生成する。カウント値が十進数の9を表す値に等しくなると、カウンター3Cは、キャリー信号CA11の次のパルスに同期して、カウント値を0にリセットすると共に、10Hzのキャリー信号CA12を出力する。カウンター3Cによって生成されるカウント値は、1/100秒単位の時刻を表す計時データSUB_T2として用いられる。すなわち、カウンター3Cは、1/100秒単位で計時データSUB_T2を更新する。また、10Hzのキャリー信号CA12は、第4クロック信号CK4として用いられる。また、カウンター3Cは、書き込みクロック信号SUB_WCKのパルスに同期して、カウント値、すなわち計時データSUB_T2を書き込みデータSUB_WDのビット8~15の1バイトの値に更新する。 The counter 3C generates a count value representing time in units of 1/100 seconds by performing a counting operation in synchronization with the 100 Hz carry signal CA11. For example, the counter 3C is a decimal BCD counter, and sequentially generates BCD count values representing decimal numbers 0 to 9 in synchronization with the pulses of the carry signal CA11. When the count value becomes equal to the value representing 9 in decimal, the counter 3C resets the count value to 0 and outputs a 10 Hz carry signal CA12 in synchronization with the next pulse of the carry signal CA11. The count value generated by the counter 3C is used as time measurement data SUB_T2 representing time in units of 1/100 seconds. That is, the counter 3C updates the time measurement data SUB_T2 in units of 1/100 seconds. Furthermore, the 10 Hz carry signal CA12 is used as the fourth clock signal CK4. Further, the counter 3C updates the count value, that is, the time measurement data SUB_T2, to the value of 1 byte of bits 8 to 15 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

カウンター3Dは、10Hzのキャリー信号CA12に同期してカウント動作を行うことにより、1/10秒単位の時刻を表すカウント値を生成する。例えば、カウンター3Dは、10進BCDカウンターであり、キャリー信号CA12のパルスに同期して、十進数の0~9を表すBCDカウント値を順次生成する。カウント値が十進数の9を表す値に等しくなると、カウンター3Dは、キャリー信号CA12の次のパルスに同期して、カウント値を0にリセットすると共に、1Hzの第3クロック信号CK3を出力する。カウンター3Dによって生成されるカウント値は、1/10秒単位の時刻を表す計時データSUB_T3として用いられる。すなわち、カウンター3Dは、1/10秒単位で計時データSUB_T3を更新する。また、カウンター3Dは、書き込みクロック信号SUB_WCKのパルスに同期して、カウント値、すなわち計時データSUB_T3を書き込みデータSUB_WDのビット16~23の1バイトの値に更新する。 The counter 3D generates a count value representing time in units of 1/10 seconds by performing a counting operation in synchronization with the 10 Hz carry signal CA12. For example, the counter 3D is a decimal BCD counter and sequentially generates BCD count values representing decimal numbers 0 to 9 in synchronization with the pulses of the carry signal CA12. When the count value becomes equal to the value representing 9 in decimal, the counter 3D resets the count value to 0 in synchronization with the next pulse of the carry signal CA12, and outputs the third clock signal CK3 of 1 Hz. The count value generated by the counter 3D is used as time measurement data SUB_T3 representing time in 1/10 second units. That is, the counter 3D updates the time measurement data SUB_T3 in units of 1/10 seconds. Further, the counter 3D updates the count value, that is, the time measurement data SUB_T3, to the value of 1 byte of bits 16 to 23 of the write data SUB_WD in synchronization with the pulse of the write clock signal SUB_WCK.

このように、選択データSELが1である場合、第2分周回路30は、1kHzの第2クロック信号CK2を1000分周して1Hzの第3クロック信号CK3を生成するとともに、1kHzの第2クロック信号CK2を100分周して10Hzの第4クロック信号CK4を生成する。また、前述の計時データSUB_Tは、1/10秒、1/100秒及び1/1000秒のカウント値である計時データSUB_T3,SUB_T2,SUB_T1によって構成される。 In this way, when the selection data SEL is 1, the second frequency dividing circuit 30 divides the 1 kHz second clock signal CK2 by 1000 to generate the 1 Hz third clock signal CK3, and also generates the 1 kHz second clock signal CK3. The clock signal CK2 is divided by 100 to generate a fourth clock signal CK4 of 10 Hz. Further, the aforementioned time measurement data SUB_T is composed of time measurement data SUB_T3, SUB_T2, and SUB_T1, which are count values of 1/10 second, 1/100 second, and 1/1000 second.

1-1-5.論理回路による緩急処理
前述の通り、選択データSELの値に応じて、論理回路50による緩急処理が行われる補正期間の長さが異なる。
1-1-5. Slow/Slow Processing by Logic Circuit As described above, the length of the correction period in which the slow/fast process is performed by the logic circuit 50 differs depending on the value of the selection data SEL.

図6は、選択データSELが0の場合の補正期間と緩急処理のタイミングとの関係の一例を示す図である。図6に示すように、選択データSELが0の場合は、1回の補正期間は、8Hzの第4クロック信号CK4の1周期の時間である0.125秒の256倍に相当する32秒である。また、緩急処理のタイミングは、第4クロック信号CK4の1周期毎に、すなわち0.125秒間隔で到来する。すなわち、1回の補正期間において、最大256回の緩急処理が可能である。 FIG. 6 is a diagram illustrating an example of the relationship between the correction period and the timing of the adjustment process when the selection data SEL is 0. As shown in FIG. 6, when the selection data SEL is 0, one correction period is 32 seconds, which is 256 times 0.125 seconds, which is the time of one cycle of the 8Hz fourth clock signal CK4. be. Further, the timing of the slow/fast processing comes every cycle of the fourth clock signal CK4, that is, at intervals of 0.125 seconds. That is, in one correction period, a maximum of 256 slow and fast processes are possible.

図7は、選択データSELが1の場合の補正期間と緩急処理のタイミングとの関係の一例を示す図である。図7に示すように、選択データSELが1の場合は、1回の補正期間は、10Hzの第4クロック信号CK4の1周期の時間である0.1秒の256倍に相当する25.6秒である。また、緩急処理のタイミングは、第4クロック信号CK4の1周期毎に、すなわち0.1秒間隔で到来する。すなわち、1回の補正期間において、最大256回の緩急処理が可能である。 FIG. 7 is a diagram illustrating an example of the relationship between the correction period and the timing of the adjustment process when the selection data SEL is 1. As shown in FIG. 7, when the selection data SEL is 1, one correction period is 25.6 times, which is 256 times the time of 0.1 second, which is the time of one period of the fourth clock signal CK4 of 10 Hz. Seconds. Further, the timing of the slow/fast processing occurs every cycle of the fourth clock signal CK4, that is, at intervals of 0.1 seconds. That is, in one correction period, a maximum of 256 slow and fast processes are possible.

なお、図6及び図7では、1つの補正期間のみが図示されているが、実際には、1つの補正期間が終了する毎に次の補正期間が開始する。すなわち、図6又は図7に示す補正期間が間隔を空けずに繰り返される。 Although only one correction period is illustrated in FIGS. 6 and 7, in reality, the next correction period starts every time one correction period ends. That is, the correction period shown in FIG. 6 or 7 is repeated without any interval.

補正期間において各タイミングで行われる緩急処理は、制御信号PE,PDによって制御される。図8、図9及び図10は、制御信号PE,PDに応じて行われる緩急処理について説明するための図である。図8は、緩急処理のタイミングで制御信号PE,PDがともにローレベルのときのタイミングチャート図である。図9は、緩急処理のタイミングで制御信号PEがハイレベル、制御信号PDがローレベルのときのタイミングチャート図である。図10は、緩急処理のタイミングで制御信号PEがローレベル、制御信号PDがハイレベルのときのタイミングチャート図である。 The slow and fast processing performed at each timing during the correction period is controlled by control signals PE and PD. FIG. 8, FIG. 9, and FIG. 10 are diagrams for explaining the speed and speed processing performed in response to the control signals PE and PD. FIG. 8 is a timing chart when the control signals PE and PD are both at a low level at the timing of the speed-up process. FIG. 9 is a timing chart when the control signal PE is at a high level and the control signal PD is at a low level at the timing of the speed-up process. FIG. 10 is a timing chart when the control signal PE is at a low level and the control signal PD is at a high level at the timing of the speed-up process.

図8に示すように、緩急処理のタイミングで制御信号PE,PDがともにローレベルのときは、クロック信号CKAは第1クロック信号CK1を2分周した信号のままである。その結果、当該タイミングの直後の第2クロック信号CK2の半周期における第1クロック信号CK1のパルス数は16のままである。すなわち、第2クロック信号CK2の1周期における第1クロック信号CK1のパルス数は32のまま変わらない。 As shown in FIG. 8, when the control signals PE and PD are both at a low level at the timing of the speed-up process, the clock signal CKA remains a signal obtained by dividing the first clock signal CK1 by two. As a result, the number of pulses of the first clock signal CK1 in the half cycle of the second clock signal CK2 immediately after the timing remains 16. That is, the number of pulses of the first clock signal CK1 in one period of the second clock signal CK2 remains unchanged at 32.

これに対して、図9に示すように、緩急処理のタイミングで制御信号PEがハイレベル、制御信号PDがローレベルのときは、クロック信号CKAは第1クロック信号CK1と一致する。その結果、当該タイミングの直後の第2クロック信号CK2の半周期における第1クロック信号CK1のパルス数は15となる。すなわち、緩急処理のタイミングで制御信号PEがハイレベル、制御信号PDがローレベルとなる場合、その直後の第2クロック信号CK2の1周期だけ第1クロック信号CK1のパルス数が31となり、第2クロッ
ク信号CK2の当該周期は他の各周期よりも第1クロック信号CK1の1周期分だけ短くなる。
On the other hand, as shown in FIG. 9, when the control signal PE is at a high level and the control signal PD is at a low level at the timing of the slow/fast process, the clock signal CKA matches the first clock signal CK1. As a result, the number of pulses of the first clock signal CK1 in the half cycle of the second clock signal CK2 immediately after the timing is 15. In other words, when the control signal PE is at a high level and the control signal PD is at a low level at the timing of the adjustment process, the number of pulses of the first clock signal CK1 becomes 31 for one cycle of the second clock signal CK2 immediately after that, and the number of pulses of the first clock signal CK1 becomes 31, and The period of the clock signal CK2 is shorter than each other period by one period of the first clock signal CK1.

また、図10に示すように、緩急処理のタイミングで制御信号PEがローレベル、制御信号PDがハイレベルのときは、クロック信号CKAは第1クロック信号CK1を4分周した信号となる。その結果、当該タイミングの直後の第2クロック信号CK2の半周期における第1クロック信号CK1のパルス数は17となる。すなわち、緩急処理のタイミングで制御信号PEがローレベル、制御信号PDがハイレベルとなる場合、その直後の第2クロック信号CK2の1周期だけ第1クロック信号CK1のパルス数が33となり、第2クロック信号CK2の当該周期は他の各周期よりも第1クロック信号CK1の1周期分だけ長くなる。 Further, as shown in FIG. 10, when the control signal PE is at a low level and the control signal PD is at a high level at the timing of the slow/fast process, the clock signal CKA becomes a signal obtained by dividing the first clock signal CK1 by four. As a result, the number of pulses of the first clock signal CK1 in the half cycle of the second clock signal CK2 immediately after the timing is 17. In other words, when the control signal PE is at a low level and the control signal PD is at a high level at the timing of the adjustment process, the number of pulses of the first clock signal CK1 becomes 33 for one cycle of the second clock signal CK2 immediately after that, and the number of pulses of the first clock signal CK1 becomes 33, and This period of the clock signal CK2 is longer than each other period by one period of the first clock signal CK1.

補正データTDを9ビットのデータとして-255以上+255以下の511個の整数値を取り得るものとしたとき、論理回路50は、補正データTDの値に応じて、1回の補正期間における256回の緩急処理のタイミングのうちの0~255回のタイミングで緩急処理を行う。 When the correction data TD is 9-bit data that can take on 511 integer values from −255 to +255, the logic circuit 50 performs 256 times in one correction period according to the value of the correction data TD. The slow and fast processing is performed at timings from 0 to 255 of the slow and fast processing timings.

例えば、基準信号REFでカウントした32秒間における第1クロック信号CK1のパルス数が32×32768=1048576である場合、第1クロック信号CK1の周波数が目標周波数の32.768kHzと一致しているため、補正データTDの値は0となる。この場合、論理回路50は、各補正期間において制御信号PE,PDをローレベルに固定することにより、常に第2クロック信号CK2の1周期の長さが第1クロック信号CK1の32周期の長さと等しくなるようにする。これにより、1.024kHzの第2クロック信号CK2の32768周期における第1クロック信号CK1のパルス数は1048576となり、第2クロック信号CK2の32768周期が基準信号REFでカウントした32秒と一致する。 For example, if the number of pulses of the first clock signal CK1 in 32 seconds counted by the reference signal REF is 32 x 32768 = 1048576, the frequency of the first clock signal CK1 matches the target frequency of 32.768 kHz. The value of the correction data TD becomes 0. In this case, the logic circuit 50 fixes the control signals PE and PD to a low level in each correction period, so that the length of one cycle of the second clock signal CK2 is always equal to the length of 32 cycles of the first clock signal CK1. make them equal. As a result, the number of pulses of the first clock signal CK1 in 32,768 cycles of the second clock signal CK2 of 1.024 kHz is 1048,576, and the 32,768 cycles of the second clock signal CK2 match the 32 seconds counted by the reference signal REF.

これに対して、基準信号REFでカウントした32秒間における第1クロック信号CK1のパルス数が1048576-255=1048321である場合、第1クロック信号CK1の周波数が目標周波数の32.768kHzよりも低く、補正データTDの値は+255となる。この場合、論理回路50は、各補正期間において256回の緩急処理のタイミングのうち255回のタイミングで制御信号PEをハイレベルにすることにより、255回だけ第2クロック信号CK2の1周期の長さが第1クロック信号CK1の31周期の長さと等しくなるようにする。これにより、1.024kHzの第2クロック信号CK2の32768周期における第1クロック信号CK1のパルス数は1048576-255=1048321となり、第2クロック信号CK2の32768周期が基準信号REFでカウントした32秒と一致する。 On the other hand, if the number of pulses of the first clock signal CK1 in 32 seconds counted by the reference signal REF is 1048576-255=1048321, the frequency of the first clock signal CK1 is lower than the target frequency of 32.768kHz, The value of the correction data TD becomes +255. In this case, the logic circuit 50 sets the control signal PE to a high level at 255 timings out of 256 timings of slow/fast processing in each correction period, thereby increasing the length of one cycle of the second clock signal CK2 only 255 times. is made equal to the length of 31 cycles of the first clock signal CK1. As a result, the number of pulses of the first clock signal CK1 in 32768 periods of the second clock signal CK2 of 1.024 kHz is 1048576-255=1048321, and the 32768 periods of the second clock signal CK2 are equal to 32 seconds counted by the reference signal REF. Match.

また、基準信号REFでカウントした32秒間における第1クロック信号CK1のパルス数が1048576+255=1048831である場合、第1クロック信号CK1の周波数が目標周波数の32.768kHzよりも高く、補正データTDの値は-255となる。この場合、論理回路50は、各補正期間において256回の緩急処理のタイミングのうち255回のタイミングで制御信号PDをハイレベルにすることにより、255回だけ第2クロック信号CK2の1周期の長さが第1クロック信号CK1の33周期の長さと等しくなるようにする。これにより、1.024kHzの第2クロック信号CK2の32768周期における第1クロック信号CK1のパルス数は1048576+255=1048831となり、第2クロック信号CK2の32768周期が基準信号REFでカウントした32秒と一致する。 Further, if the number of pulses of the first clock signal CK1 in 32 seconds counted by the reference signal REF is 1048576+255=1048831, the frequency of the first clock signal CK1 is higher than the target frequency of 32.768kHz, and the value of the correction data TD is becomes -255. In this case, the logic circuit 50 sets the control signal PD to a high level at 255 timings out of 256 timings of slow/fast processing in each correction period, thereby increasing the length of one period of the second clock signal CK2 by 255 times. is made equal to the length of 33 cycles of the first clock signal CK1. As a result, the number of pulses of the first clock signal CK1 in 32,768 cycles of the second clock signal CK2 of 1.024 kHz is 1048,576 + 255 = 1048,831, and the 32,768 cycles of the second clock signal CK2 match the 32 seconds counted by the reference signal REF. .

このように、本実施形態のリアルタイムクロック回路3では、論理回路50は、第3ク
ロック信号CK3の周期である1秒よりも長い間隔に相当する補正期間において第1分周回路20に対して緩急処理を行う。これにより、リアルタイムクロック回路3は、第2クロック信号CK2を高い分解能で補正することができる。例えば、第1クロック信号CK1の目標周波数が32.768kHzであり、補正期間が32秒である場合は、分解能は1/32.768kH/32=0.954ppmである。また、第1クロック信号CK1の目標周波数が32kHzであり、補正期間が25.6秒である場合は、分解能は1/32kH/25.6=1.22ppmである。
In this way, in the real-time clock circuit 3 of the present embodiment, the logic circuit 50 controls the first frequency dividing circuit 20 to adjust speed or speed during the correction period corresponding to an interval longer than 1 second, which is the period of the third clock signal CK3. Perform processing. Thereby, the real-time clock circuit 3 can correct the second clock signal CK2 with high resolution. For example, if the target frequency of the first clock signal CK1 is 32.768 kHz and the correction period is 32 seconds, the resolution is 1/32.768 kHz/32=0.954 ppm. Further, when the target frequency of the first clock signal CK1 is 32 kHz and the correction period is 25.6 seconds, the resolution is 1/32 kHz/25.6=1.22 ppm.

また、本実施形態では、論理回路50が、補正期間において、第2クロック信号CK2の周期よりも長い時間間隔で第1分周回路20に対して緩急処理を行う。すなわち、論理回路50が時間的に分散して緩急処理を行うことにより、第2クロック信号CK2の周波数変動量のばらつきを小さくすることができる。 Furthermore, in the present embodiment, the logic circuit 50 performs the slowing/fastening process on the first frequency dividing circuit 20 at time intervals longer than the cycle of the second clock signal CK2 during the correction period. That is, the logic circuit 50 performs the speed and speed processing in a time-distributed manner, thereby making it possible to reduce variations in the amount of frequency fluctuation of the second clock signal CK2.

1-1-6.リアルタイムクロック回路の補正方法
図11は、第1実施形態のリアルタイムクロック回路3の補正方法の手順の一例を示す図である。
1-1-6. Method for correcting real-time clock circuit FIG. 11 is a diagram illustrating an example of a procedure for a method for correcting real-time clock circuit 3 according to the first embodiment.

図11に示すように、まず、ホストデバイス6がリアルタイムクロック回路3のタイムスタンプ機能を有効にする(工程S1)。 As shown in FIG. 11, first, the host device 6 enables the time stamp function of the real-time clock circuit 3 (step S1).

次に、ホストデバイス6がリアルタイムクロック回路3に基準信号REFを送信する(工程S2)。 Next, the host device 6 transmits the reference signal REF to the real-time clock circuit 3 (step S2).

次に、リアルタイムクロック回路3が、基準信号REFの電圧レベルが遷移する所定のタイミングで、イベント時刻レジスター80に計時データを保持する(工程S3)。工程S3において保持される計時データは、計時データSUB_Tを含み、さらに計時データBCD_T又は計時データBIN_Tを含む。 Next, the real-time clock circuit 3 holds time measurement data in the event time register 80 at a predetermined timing when the voltage level of the reference signal REF changes (step S3). The clock data held in step S3 includes clock data SUB_T, and further includes clock data BCD_T or clock data BIN_T.

そして、リアルタイムクロック回路3が基準信号REFをn+1回受信するまで(工程S4のN)、工程S2及び工程S3が繰り返される。整数nは、前述の補正期間設定データPNの値である。例えば、nが32であり、基準信号REFの周期が1秒であれば、リアルタイムクロック回路3が基準信号REFを33回受信するまで、すなわち、基準信号REFの1回目の受信から32秒が経過するまで工程S2及び工程S3が繰り返される。 Then, steps S2 and S3 are repeated until the real-time clock circuit 3 receives the reference signal REF n+1 times (N in step S4). The integer n is the value of the correction period setting data PN described above. For example, if n is 32 and the period of the reference signal REF is 1 second, until the real-time clock circuit 3 receives the reference signal REF 33 times, that is, 32 seconds have elapsed since the first reception of the reference signal REF. Steps S2 and S3 are repeated until the process is completed.

リアルタイムクロック回路3が基準信号REFをn+1回受信すると(工程S4のY)、ホストデバイス6がリアルタイムクロック回路3のタイムスタンプ機能を無効にする(工程S5)。 When the real-time clock circuit 3 receives the reference signal REF n+1 times (Y in step S4), the host device 6 disables the time stamp function of the real-time clock circuit 3 (step S5).

次に、リアルタイムクロック回路3が、ホストデバイス6に割込み信号IRQを送信する(工程S6)。 Next, the real-time clock circuit 3 transmits an interrupt signal IRQ to the host device 6 (step S6).

次に、ホストデバイス6が、割込み信号IRQを受信し、リアルタイムクロック回路3からイベント時刻レジスター80に保持された1番目とn+1番目の計時データを読み出す(工程S7)。 Next, the host device 6 receives the interrupt signal IRQ and reads out the first and (n+1)th time measurement data held in the event time register 80 from the real-time clock circuit 3 (step S7).

次に、ホストデバイス6が、n+1番目の計時データと1番目の計時データとの差分ΔTを計算する(工程S8)。例えば、nが32であり、基準信号REFの周期が1秒であれば、差分ΔTは計時データの32秒間の増加量に相当する。 Next, the host device 6 calculates the difference ΔT between the (n+1)th clock data and the first clock data (step S8). For example, if n is 32 and the period of the reference signal REF is 1 second, the difference ΔT corresponds to the amount of increase in the time measurement data for 32 seconds.

そして、差分ΔTの期待値に対する誤差が1秒以内である場合は(工程S9のY)、ホ
ストデバイス6が、1秒未満の変化量ΔSubCntに基づき補正データTDを生成し、生成した補正データTDをリアルタイムクロック回路3の記憶部100に書き込む(工程S10)。変化量ΔSubCntは、n+1番目の計時データSUB_Tと1番目の計時データSUB_Tとの差分である。例えば、nが32であり、基準信号REFの周期が1秒であれば、差分ΔTの期待値は32秒であるので、差分ΔTが31秒以上33秒以下である場合に工程S10が行われる。また、工程S10において、ホストデバイス6は、変化量ΔSubCntが-255~+255の範囲の値である前提で、補正データTDの値を200h-ΔSubCntによって計算する。
Then, if the error of the difference ΔT with respect to the expected value is within 1 second (Y in step S9), the host device 6 generates correction data TD based on the variation ΔSubCnt of less than 1 second, and the generated correction data TD is written into the storage unit 100 of the real-time clock circuit 3 (step S10). The amount of change ΔSubCnt is the difference between the (n+1)th time measurement data SUB_T and the first time measurement data SUB_T. For example, if n is 32 and the period of the reference signal REF is 1 second, the expected value of the difference ΔT is 32 seconds, so step S10 is performed when the difference ΔT is 31 seconds or more and 33 seconds or less. . Further, in step S10, the host device 6 calculates the value of the correction data TD by 200h-ΔSubCnt on the premise that the amount of change ΔSubCnt is a value in the range of −255 to +255.

次に、リアルタイムクロック回路3が、工程S10で記憶部100に書き込まれた補正データTDを用いて第1分周回路20に対して緩急処理を行う(工程S11)。以降、リアルタイムクロック回路3は、補正データTDが更新されるまで、各補正期間において当該補正データTDを用いて時間的に分散して緩急処理を行う。 Next, the real-time clock circuit 3 uses the correction data TD written to the storage unit 100 in step S10 to perform speed-up processing on the first frequency dividing circuit 20 (step S11). Thereafter, the real-time clock circuit 3 uses the correction data TD in each correction period to perform slow and fast processing in a temporally distributed manner until the correction data TD is updated.

一方、差分ΔTが1秒よりも大きい場合は(工程S9のN)、ホストデバイス6が、現在時刻のデータをリアルタイムクロック回路3のライトバッファー60に書き込む(工程S12)。例えば、ホストデバイス6は、年、月、日、時、分及び秒の時刻データ及び年、月、日、時、分及び秒を秒単位で表した時刻データをライトバッファー60に書き込む。 On the other hand, if the difference ΔT is larger than 1 second (N in step S9), the host device 6 writes the current time data to the write buffer 60 of the real-time clock circuit 3 (step S12). For example, the host device 6 writes time data of the year, month, day, hour, minute, and second, and time data representing the year, month, day, hour, minute, and second in seconds to the write buffer 60.

次に、リアルタイムクロック回路3が、計時回路40の計時データBCD_T,BIN_Tをライトバッファー60が保持する現在時刻のデータに更新する(工程S13)。 Next, the real-time clock circuit 3 updates the clock data BCD_T, BIN_T of the clock circuit 40 to the current time data held by the write buffer 60 (step S13).

そして、工程S11又は工程S13の後、所定のインターバル時間が経過する毎に(工程S14のY)、工程S1~工程S13が繰り返し行われる。 Then, after step S11 or step S13, steps S1 to S13 are repeatedly performed every time a predetermined interval time elapses (Y in step S14).

このように、本実施形態では、論理回路50は、例えば、32秒間の1秒未満の変化量ΔSubCntに基づいて生成された補正データTDに基づいて、同じく32秒間の補正期間における第2クロック信号CK2の周波数が平均して1.024kHzとなるように緩急処理を行う。あるいは、論理回路50は、25.6秒間の1秒未満の変化量ΔSubCntに基づいて生成された補正データTDに基づいて、同じく25.6秒である補正期間における第2クロック信号CK2の周波数が平均して1kHzとなるように緩急処理を行う。例えば、変化量ΔSubCntが-255~+255の範囲とすると、第1クロック信号CK1の目標周波数が32.768kHzであり、補正期間が32秒である場合は、前述の通り、緩急処理の分解能が約0.954ppmであるので、緩急幅は-243.19ppm~+243.19ppmである。また、第1クロック信号CK1の目標周波数が32kHzであり、補正期間が25.6秒である場合は、緩急処理の分解能が約1.22ppmであるので、緩急幅は-311.28ppm~+311.28ppmである。したがって、環境温度の変化や経時変化による第1クロック信号CK1の最大周波数変動量を数ppm~数十ppmであるとすると、リアルタイムクロック回路3は十分な幅で緩急処理を行うことができる。 As described above, in the present embodiment, the logic circuit 50 adjusts the second clock signal in the same 32-second correction period based on the correction data TD generated based on the change amount ΔSubCnt of less than 1 second during 32 seconds, for example. Slow and fast processing is performed so that the frequency of CK2 becomes 1.024 kHz on average. Alternatively, the logic circuit 50 determines that the frequency of the second clock signal CK2 during the correction period, which is also 25.6 seconds, is Slow and fast processing is performed so that the average frequency is 1 kHz. For example, if the amount of change ΔSubCnt is in the range of -255 to +255, the target frequency of the first clock signal CK1 is 32.768 kHz, and the correction period is 32 seconds, then as mentioned above, the resolution of the slow/fast processing is approximately Since it is 0.954 ppm, the speed range is -243.19 ppm to +243.19 ppm. Further, when the target frequency of the first clock signal CK1 is 32 kHz and the correction period is 25.6 seconds, the resolution of the adjustment process is approximately 1.22 ppm, so the adjustment width is -311.28 ppm to +311. It is 28 ppm. Therefore, assuming that the maximum frequency fluctuation amount of the first clock signal CK1 due to changes in environmental temperature or changes over time is several ppm to several tens of ppm, the real-time clock circuit 3 can perform slow and fast processing with a sufficient width.

また、1秒未満の変化量ΔSubCntを計算するための期間である基準信号REFに同期した間隔と補正期間の長さを一致させることにより、補正データTDの値を変化量ΔSubCntの符号を反転した値とすればよく、ホストデバイス6による補正データTDの計算負荷を低減させることができる。 In addition, by matching the length of the correction period with the interval synchronized with the reference signal REF, which is the period for calculating the change amount ΔSubCnt of less than 1 second, the value of the correction data TD is reversed with the sign of the change amount ΔSubCnt. The calculation load of the correction data TD by the host device 6 can be reduced.

1-1-7.作用効果
以上に説明したように、第1実施形態では、リアルタイムクロック回路3において、論理回路50が、基準信号REFに同期した間隔での1秒よりも短い時間の計時データSU
B_Tの変化量に基づいて生成された補正データTDを用いて、第2クロック信号CK2を生成する第1分周回路20に対して緩急処理を行う。したがって、1秒以上の任意の短時間で生成された補正データTDを用いて、第2クロック信号CK2が補正される。そして、第2分周回路30が第2クロック信号CK2を分周して第3クロック信号CK3を生成し、計時回路40が第3クロック信号CK3に基づいて1秒以上の時間の計時データBCD_T,BIN_Tを生成するので、計時データBCD_T,BIN_Tが短時間で補正される。また、リアルタイムクロック回路3では、基準信号REFに同期した間隔での計時データSUB_Tの変化量に基づいて補正データTDが生成される。そのため、リアルタイムクロック回路3が第3クロック信号CK3をホストデバイス6に出力し、ホストデバイス6が第3クロック信号CK3の周波数を計測して補正データTDを作成する必要がない。したがって、第1実施形態によれば、リアルタイムクロック回路3は、短時間で簡易に計時データの補正データTDを取得することができる。さらに、第1実施形態では、リアルタイムクロック回路3において、補正データTDを用いた緩急処理が行われる期間の長さが、補正データTDを生成するために計時データSUB_Tの変化量が算出される間隔と一致するので、計時データSUB_Tの変化量の符号を反転した値を補正データTDの値とすることができる。したがって、第1実施形態によれば、ホストデバイス6による補正データTDの生成が容易である。以上より、第1実施形態によれば、優れたユーザー利便性を実現することができる。
1-1-7. Effects As explained above, in the first embodiment, in the real-time clock circuit 3, the logic circuit 50 outputs time measurement data SU for a time shorter than one second at intervals synchronized with the reference signal REF.
Using the correction data TD generated based on the amount of change in B_T, the first frequency divider circuit 20 that generates the second clock signal CK2 performs a speed adjustment process. Therefore, the second clock signal CK2 is corrected using the correction data TD generated in an arbitrary short time period of one second or more. Then, the second frequency dividing circuit 30 divides the frequency of the second clock signal CK2 to generate a third clock signal CK3, and the clock circuit 40 generates clock data BCD_T for a time of one second or more based on the third clock signal CK3. Since BIN_T is generated, the clock data BCD_T and BIN_T are corrected in a short time. Further, in the real-time clock circuit 3, correction data TD is generated based on the amount of change in the time measurement data SUB_T at intervals synchronized with the reference signal REF. Therefore, there is no need for the real-time clock circuit 3 to output the third clock signal CK3 to the host device 6, and for the host device 6 to measure the frequency of the third clock signal CK3 and create the correction data TD. Therefore, according to the first embodiment, the real-time clock circuit 3 can easily acquire the correction data TD of the time measurement data in a short time. Furthermore, in the first embodiment, in the real-time clock circuit 3, the length of the period during which the speed-up/down process using the correction data TD is performed is the interval during which the amount of change in the time measurement data SUB_T is calculated in order to generate the correction data TD. Therefore, the value obtained by inverting the sign of the amount of change in the time measurement data SUB_T can be set as the value of the correction data TD. Therefore, according to the first embodiment, the host device 6 can easily generate the correction data TD. As described above, according to the first embodiment, excellent user convenience can be achieved.

また、第1実施形態では、リアルタイムクロック回路3において、補正データTDを生成するために計時データSUB_Tの変化量が算出される間隔が、第3クロック信号CK3の周期である1秒よりも長いので、論理回路50は高い分解能で第2クロック信号CK2を補正することができる。また、計時データSUB_Tの誤差が平均化されるため、第1クロック信号CK1のジッター等の影響も低減される。さらに、リアルタイムクロック回路3において、論理回路50が、第2クロック信号CK2の周期よりも長い時間間隔で時間的に分散して第1分周回路20に対して緩急処理を行うので、第2クロック信号CK2の周波数変動量のばらつきを小さくすることができる。例えば、前述の通り、緩急処理による補正の分解能を0.954ppmとすることにより、計時データBCD_T,BIN_Tの1秒の誤差を1ppm以下にすることも可能である。特に、論理回路50が、第1分周回路20に含まれる先頭の分周回路21に対して緩急処理を行うことにより、1秒未満の計時データSUB_Tの誤差も小さくすることができる。 Furthermore, in the first embodiment, in the real-time clock circuit 3, the interval at which the amount of change in the clock data SUB_T is calculated in order to generate the correction data TD is longer than 1 second, which is the period of the third clock signal CK3. , the logic circuit 50 can correct the second clock signal CK2 with high resolution. Furthermore, since the errors in the time measurement data SUB_T are averaged, the influence of jitter and the like on the first clock signal CK1 is also reduced. Furthermore, in the real-time clock circuit 3, the logic circuit 50 performs slowing/fastening processing on the first frequency dividing circuit 20 in a temporally distributed manner at time intervals longer than the period of the second clock signal CK2. It is possible to reduce variations in the amount of frequency fluctuation of the signal CK2. For example, as described above, by setting the resolution of the correction by the slow and fast processing to 0.954 ppm, it is possible to reduce the 1 second error between the clock data BCD_T and BIN_T to 1 ppm or less. In particular, when the logic circuit 50 performs the adjustment process on the first frequency dividing circuit 21 included in the first frequency dividing circuit 20, it is possible to reduce the error in the time measurement data SUB_T of less than one second.

また、第1実施形態では、リアルタイムクロック回路3において、選択データSELの値に応じて第2分周回路30の動作が切り替わることにより、第4クロック信号CK4の周波数が8Hz又は10Hzに切り替わる。これに対して、選択データSELの値によらず、ホストデバイス6が補正データTDを作成するための期間や、補正期間と基準信号REFの周期との比を共通にすることによって、論理回路50による緩急処理の論理が共通化される。したがって、第1実施形態によれば、リアルタイムクロック回路3において、第2分周回路30の動作が切り替わっても緩急処理の制御に対する影響が小さい。 Furthermore, in the first embodiment, in the real-time clock circuit 3, the frequency of the fourth clock signal CK4 is switched to 8 Hz or 10 Hz by switching the operation of the second frequency dividing circuit 30 according to the value of the selection data SEL. On the other hand, the logic circuit 5 The logic of slow and urgent processing will be standardized. Therefore, according to the first embodiment, even if the operation of the second frequency divider circuit 30 is switched in the real-time clock circuit 3, the influence on the control of the speed-up process is small.

また、第1実施形態では、ホストデバイス6は、リアルタイムクロック回路3のタイムスタンプ機能によってイベント時刻レジスター80に保持された計時データSUB_Tに基づいて、補正データTDを生成する。したがって、第1実施形態によれば、イベント時刻レジスター80に保持された計時データSUB_Tの読み出しに要する遅延時間にばらつきがあっても、遅延時間のばらつきによる計時データSUB_Tの誤差が生じないので、ホストデバイス6は正確な補正データTDを生成することができる。また、ホストデバイス6は、リアルタイムクロックモジュール1の動作を停止することなく短時間で補正データTDを生成することができるので、例えば、エージング補正にも適用可能である。特に、発振回路10に対してエージング補正を行った場合には、振動子2の温度特性の影響で、高温や低温の環境では第1クロック信号CK1の周波数誤差が大きくなり、その結果
、1秒の誤差が大きくなるのに対して、第1実施形態では、論理回路50の緩急処理により、振動子2の温度特性による第1クロック信号CK1の周波数誤差を加味して第2クロック信号CK2の周波数が補正されるので、1秒の誤差を小さくすることができる。
Further, in the first embodiment, the host device 6 generates the correction data TD based on the time measurement data SUB_T held in the event time register 80 by the time stamp function of the real-time clock circuit 3. Therefore, according to the first embodiment, even if there is variation in the delay time required to read the time measurement data SUB_T held in the event time register 80, an error in the time measurement data SUB_T due to the variation in delay time does not occur, so that the host The device 6 is able to generate accurate correction data TD. Furthermore, since the host device 6 can generate the correction data TD in a short time without stopping the operation of the real-time clock module 1, it is also applicable to aging correction, for example. In particular, when aging correction is performed on the oscillation circuit 10, the frequency error of the first clock signal CK1 becomes large in high or low temperature environments due to the influence of the temperature characteristics of the resonator 2. In contrast, in the first embodiment, the frequency error of the first clock signal CK1 due to the temperature characteristics of the resonator 2 is taken into account and the frequency of the second clock signal CK2 is adjusted by the slowing/slowing process of the logic circuit 50. is corrected, so the error of 1 second can be reduced.

また、第1実施形態によれば、ホストデバイス6が補正データTDを生成するので、リアルタイムクロック回路3が補正データTDを生成する必要がなく、リアルタイムクロック回路3のサイズを低減させることができる。 Further, according to the first embodiment, since the host device 6 generates the correction data TD, the real-time clock circuit 3 does not need to generate the correction data TD, and the size of the real-time clock circuit 3 can be reduced.

また、第1実施形態では、ホストデバイス6がリアルタイムクロック回路3の記憶部100に補正期間設定データPNを書き込むことができる。しったがって、第1実施形態によれば、ホストデバイス6が補正データTDを生成するために計時データSUB_Tの変化量が算出される間隔、すなわち、補正期間の長さを、補正の精度と補正に要する時間とのトレードオフを考慮して、ユーザーが任意に設定することができる。 Further, in the first embodiment, the host device 6 can write the correction period setting data PN into the storage section 100 of the real-time clock circuit 3. Therefore, according to the first embodiment, in order for the host device 6 to generate the correction data TD, the interval at which the amount of change in the clock data SUB_T is calculated, that is, the length of the correction period, is determined as the accuracy of the correction. The user can set it arbitrarily, taking into consideration the trade-off with the time required for correction.

1-2.第2実施形態
第1実施形態では、ホストデバイス6が補正データTDを生成するのに対して、第2実施形態では、リアルタイムクロック回路3が補正データTDを生成する。以下、第2実施形態について、第1実施形態と同様の構成要素には同じ符号を付し、第1実施形態と重複する説明は省略または簡略し、主に第1実施形態と異なる内容について説明する。
1-2. Second Embodiment In the first embodiment, the host device 6 generates the correction data TD, whereas in the second embodiment, the real-time clock circuit 3 generates the correction data TD. Hereinafter, regarding the second embodiment, components similar to those of the first embodiment will be given the same reference numerals, explanations that overlap with those of the first embodiment will be omitted or simplified, and mainly contents different from the first embodiment will be explained. do.

図12は、第2実施形態のリアルタイムクロックモジュール1の機能ブロック図である。図12において、図1と同様の構成要素には同じ符号が付されている。 FIG. 12 is a functional block diagram of the real-time clock module 1 of the second embodiment. In FIG. 12, the same components as in FIG. 1 are given the same reference numerals.

図12に示すように、第2実施形態のリアルタイムクロックモジュール1では、リアルタイムクロック回路3は、図1と同様の構成要素を含み、さらに補正データ生成回路150を備える。 As shown in FIG. 12, in the real-time clock module 1 of the second embodiment, the real-time clock circuit 3 includes the same components as in FIG. 1, and further includes a correction data generation circuit 150.

補正データ生成回路150は、イベント時刻レジスター80が保持した計時データに基づいて補正データTDを生成する。補正データ生成回路150は、時刻データTSTMPに含まれる2つの計時データを取得し、当該2つの計時データに基づいて補正データTDを生成する。具体的には、補正データ生成回路150は、基準信号REFの電圧レベルが遷移する所定のタイミングが発生した回数をカウントし、基準信号REFの電圧レベルが1回目とn+1回目に遷移したタイミングでイベント時刻レジスター80に保持された2つの計時データを取得する。例えば、基準信号REFの電圧レベルが遷移する所定のタイミングは、基準信号REFがローレベルからハイレベルに遷移するタイミングであってもよいし、基準信号REFがハイレベルからローレベルに遷移するタイミングであってもよい。また、整数nは、前述の補正期間設定データPNの値である。そして、補正データ生成回路150は、取得した2つの計時データにそれぞれ含まれる計時データSUB_Tの差分により、基準信号REFのn周期の間隔での計時データSUB_Tの変化量を算出し、補正データTDを生成する。このように、補正データTDは、基準信号REFに同期した間隔での計時データSUB_Tの変化量に基づいて生成されたデータである。 The correction data generation circuit 150 generates correction data TD based on the clock data held by the event time register 80. The correction data generation circuit 150 acquires two pieces of clock data included in the time data TSTMP, and generates correction data TD based on the two pieces of clock data. Specifically, the correction data generation circuit 150 counts the number of times a predetermined timing at which the voltage level of the reference signal REF changes occurs, and generates an event at the timing when the voltage level of the reference signal REF changes for the first time and the (n+1) time. Two pieces of time measurement data held in the time register 80 are acquired. For example, the predetermined timing at which the voltage level of the reference signal REF transitions may be the timing at which the reference signal REF transitions from a low level to a high level, or the timing at which the reference signal REF transitions from a high level to a low level. There may be. Further, the integer n is the value of the correction period setting data PN described above. Then, the correction data generation circuit 150 calculates the amount of change in the time measurement data SUB_T at intervals of n cycles of the reference signal REF based on the difference between the time measurement data SUB_T included in the two acquired time measurement data, and generates the correction data TD. generate. In this way, the correction data TD is data generated based on the amount of change in the clock data SUB_T at intervals synchronized with the reference signal REF.

論理回路50は、補正データ生成回路150が生成した補正データTDを用いて、第1実施形態と同様に、補正期間において第1分周回路20に対して緩急処理を行う。 Using the correction data TD generated by the correction data generation circuit 150, the logic circuit 50 performs a speed adjustment process on the first frequency dividing circuit 20 during the correction period, similarly to the first embodiment.

また、補正データ生成回路150は、基準信号REFのn周期の間隔での計時データSUB_Tの変化量が所定値よりも大きい場合は、割込発生回路110に割込み制御信号IREを出力する。所定値は、例えば1秒である。割込発生回路110は、割込み制御信号IREを受けると割込み信号IRQを発生し、割込み信号IRQを、リアルタイムクロック回路3の端子P8を介してホストデバイス6に出力する。ホストデバイス6は、割込み
信号IRQを受けると、割込み処理を行って現在時刻のデータをリアルタイムクロック回路3のライトバッファー60に書き込み、計時回路40の計時データBCD_T,BIN_Tを更新する。
Further, the correction data generation circuit 150 outputs an interrupt control signal IRE to the interrupt generation circuit 110 when the amount of change in the clock data SUB_T at intervals of n cycles of the reference signal REF is larger than a predetermined value. The predetermined value is, for example, 1 second. The interrupt generation circuit 110 generates an interrupt signal IRQ upon receiving the interrupt control signal IRE, and outputs the interrupt signal IRQ to the host device 6 via the terminal P8 of the real-time clock circuit 3. When the host device 6 receives the interrupt signal IRQ, it performs interrupt processing, writes the current time data to the write buffer 60 of the real-time clock circuit 3, and updates the clock data BCD_T and BIN_T of the clock circuit 40.

第2実施形態のリアルタイムクロックモジュール1のその他の構成は、第1実施形態と同様であるため、その設営を省略する。 The rest of the configuration of the real-time clock module 1 of the second embodiment is the same as that of the first embodiment, so its construction will be omitted.

図13は、第2実施形態のリアルタイムクロック回路3の補正方法の手順の一例を示す図である。 FIG. 13 is a diagram showing an example of a procedure of a correction method for the real-time clock circuit 3 according to the second embodiment.

図13に示すように、まず、ホストデバイス6がリアルタイムクロック回路3のタイムスタンプ機能を有効にする(工程S101)。 As shown in FIG. 13, first, the host device 6 enables the time stamp function of the real-time clock circuit 3 (step S101).

次に、ホストデバイス6がリアルタイムクロック回路3に基準信号REFを送信する(工程S102)。 Next, the host device 6 transmits the reference signal REF to the real-time clock circuit 3 (step S102).

次に、リアルタイムクロック回路3が、基準信号REFの電圧レベルが遷移する所定のタイミングで、イベント時刻レジスター80に計時データを保持する(工程S103)。工程S3において保持される計時データは、計時データSUB_Tを含み、さらに計時データBCD_T又は計時データBIN_Tを含む。 Next, the real-time clock circuit 3 holds time measurement data in the event time register 80 at a predetermined timing when the voltage level of the reference signal REF changes (step S103). The clock data held in step S3 includes clock data SUB_T, and further includes clock data BCD_T or clock data BIN_T.

そして、リアルタイムクロック回路3が基準信号REFをn+1回受信するまで(工程S104のN)、工程S102及び工程S103が繰り返される。整数nは、前述の補正期間設定データPNの値である。例えば、nが32であり、基準信号REFの周期が1秒であれば、リアルタイムクロック回路3が基準信号REFを33回受信するまで、すなわち、基準信号REFの1回目の受信から32秒が経過するまで工程S102及び工程S103が繰り返される。 Then, steps S102 and S103 are repeated until the real-time clock circuit 3 receives the reference signal REF n+1 times (N in step S104). The integer n is the value of the correction period setting data PN described above. For example, if n is 32 and the period of the reference signal REF is 1 second, until the real-time clock circuit 3 receives the reference signal REF 33 times, that is, 32 seconds have elapsed since the first reception of the reference signal REF. Steps S102 and S103 are repeated until the process is completed.

リアルタイムクロック回路3が基準信号REFをn+1回受信すると(工程S104のY)、ホストデバイス6がリアルタイムクロック回路3のタイムスタンプ機能を無効にする(工程S105)。 When the real-time clock circuit 3 receives the reference signal REF n+1 times (Y in step S104), the host device 6 disables the time stamp function of the real-time clock circuit 3 (step S105).

次に、リアルタイムクロック回路3が、イベント時刻レジスター80に保持されたn+1番目の計時データと1番目の計時データとの差分ΔTを計算する(工程S106)。例えば、nが32であり、基準信号REFの周期が1秒であれば、差分ΔTは計時データの32秒間の増加量に相当する。 Next, the real-time clock circuit 3 calculates the difference ΔT between the (n+1)th clock data and the first clock data held in the event time register 80 (step S106). For example, if n is 32 and the period of the reference signal REF is 1 second, the difference ΔT corresponds to the amount of increase in the time measurement data for 32 seconds.

そして、差分ΔTの期待値に対する誤差が1秒以内である場合は(工程S107のY)、リアルタイムクロック回路3が、1秒未満の変化量ΔSubCntに基づき補正データTDを生成する(工程S108)。変化量ΔSubCntは、n+1番目の計時データSUB_Tと1番目の計時データSUB_Tとの差分である。例えば、nが32であり、基準信号REFの周期が1秒であれば、差分ΔTの期待値は32秒であるので、差分ΔTが31秒以上33秒以下である場合に工程S108が行われる。また、工程S108において、ホストデバイス6は、変化量ΔSubCntが-255~+255の範囲の値である前提で、補正データTDの値を200h-ΔSubCntによって計算する。 If the error of the difference ΔT from the expected value is within 1 second (Y in step S107), the real-time clock circuit 3 generates correction data TD based on the variation ΔSubCnt of less than 1 second (step S108). The amount of change ΔSubCnt is the difference between the (n+1)th time measurement data SUB_T and the first time measurement data SUB_T. For example, if n is 32 and the period of the reference signal REF is 1 second, the expected value of the difference ΔT is 32 seconds, so step S108 is performed when the difference ΔT is between 31 seconds and 33 seconds. . Further, in step S108, the host device 6 calculates the value of the correction data TD by 200h-ΔSubCnt on the premise that the amount of change ΔSubCnt is a value in the range of −255 to +255.

次に、リアルタイムクロック回路3が、工程S108で生成された補正データTDを用いて第1分周回路20に対して緩急処理を行う(工程S109)。以降、リアルタイムクロック回路3は、補正データTDが更新されるまで、各補正期間において当該補正データTDを用いて時間的に分散して緩急処理を行う。 Next, the real-time clock circuit 3 uses the correction data TD generated in step S108 to perform speed-up processing on the first frequency dividing circuit 20 (step S109). Thereafter, the real-time clock circuit 3 uses the correction data TD in each correction period to perform slow and fast processing in a temporally distributed manner until the correction data TD is updated.

一方、差分ΔTが1秒よりも大きい場合は(工程S107のN)、リアルタイムクロック回路3が、ホストデバイス6に割込み信号IRQを送信する(工程S110)。 On the other hand, if the difference ΔT is larger than 1 second (N in step S107), the real-time clock circuit 3 transmits the interrupt signal IRQ to the host device 6 (step S110).

次に、ホストデバイス6が、割込み信号IRQを受信し、現在時刻のデータをリアルタイムクロック回路3のライトバッファー60に書き込む(工程S111)。例えば、ホストデバイス6は、年、月、日、時、分及び秒の時刻データ及び年、月、日、時、分及び秒を秒単位で表した時刻データをライトバッファー60に書き込む。 Next, the host device 6 receives the interrupt signal IRQ and writes the current time data into the write buffer 60 of the real-time clock circuit 3 (step S111). For example, the host device 6 writes time data of the year, month, day, hour, minute, and second, and time data representing the year, month, day, hour, minute, and second in seconds to the write buffer 60.

次に、リアルタイムクロック回路3が、計時回路40の計時データBCD_T,BIN_Tをライトバッファー60が保持する現在時刻のデータに更新する(工程S112)。 Next, the real-time clock circuit 3 updates the clock data BCD_T, BIN_T of the clock circuit 40 to the current time data held by the write buffer 60 (step S112).

そして、工程S109又は工程S112の後、所定のインターバル時間が経過する毎に(工程S113のY)、工程S101~工程S112が繰り返し行われる。 Then, after step S109 or step S112, steps S101 to S112 are repeatedly performed every time a predetermined interval time elapses (Y in step S113).

このように、本実施形態では、論理回路50は、例えば、32秒間の1秒未満の変化量ΔSubCntに基づいて生成された補正データTDに基づいて、同じく32秒間の補正期間における第2クロック信号CK2の周波数が平均して1.024kHzとなるように緩急処理を行う。あるいは、論理回路50は、25.6秒間の1秒未満の変化量ΔSubCntに基づいて生成された補正データTDに基づいて、同じく25.6秒である補正期間における第2クロック信号CK2の周波数が平均して1kHzとなるように緩急処理を行う。このように、1秒未満の変化量ΔSubCntを計算するための期間である基準信号REFに同期した間隔と補正期間の長さを一致させることにより、補正データTDの値を変化量ΔSubCntの符号を反転した値とすればよく、補正データ生成回路150のサイズを低減させることができる。 As described above, in the present embodiment, the logic circuit 50 adjusts the second clock signal in the same 32-second correction period based on the correction data TD generated based on the change amount ΔSubCnt of less than 1 second during 32 seconds, for example. Slow and fast processing is performed so that the frequency of CK2 becomes 1.024 kHz on average. Alternatively, the logic circuit 50 determines that the frequency of the second clock signal CK2 during the correction period, which is also 25.6 seconds, is Slow and fast processing is performed so that the average frequency is 1 kHz. In this way, by matching the length of the correction period with the interval synchronized with the reference signal REF, which is the period for calculating the change amount ΔSubCnt of less than 1 second, the value of the correction data TD can be changed to the sign of the change amount ΔSubCnt. It is sufficient to use an inverted value, and the size of the correction data generation circuit 150 can be reduced.

以上に説明したように、第2実施形態では、リアルタイムクロック回路3において、補正データ生成回路150が、基準信号REFの電圧レベルが遷移する所定のタイミングでイベント時刻レジスター80に保持された計時データSUB_Tに基づいて、補正データTDを生成する。したがって、第2実施形態によれば、ホストデバイス6が補正データTDを生成する必要がないので、ホストデバイス6の計算負荷を低減させることができる。 As described above, in the second embodiment, in the real-time clock circuit 3, the correction data generation circuit 150 generates the time measurement data SUB_T held in the event time register 80 at a predetermined timing when the voltage level of the reference signal REF changes. Based on this, correction data TD is generated. Therefore, according to the second embodiment, there is no need for the host device 6 to generate the correction data TD, so that the calculation load on the host device 6 can be reduced.

また、第2実施形態によれば、ホストデバイス6が計時データSUB_Tを読み出す必要がないので、読み出しに要する遅延時間のばらつきによる計時データSUB_Tの誤差が生じないので、補正データ生成回路150は正確な補正データTDを生成することができる。 Further, according to the second embodiment, there is no need for the host device 6 to read out the time measurement data SUB_T, and therefore an error in the time measurement data SUB_T due to variations in the delay time required for reading does not occur, so that the correction data generation circuit 150 can accurately Correction data TD can be generated.

その他、第2実施形態のリアルタイムクロックモジュール1は、適宜、第1実施形態のリアルタイムクロックモジュール1と同様の効果を奏する。 In addition, the real-time clock module 1 of the second embodiment has the same effects as the real-time clock module 1 of the first embodiment, as appropriate.

1-3.第3実施形態
第1実施形態では、ホストデバイス6はリアルタイムクロック回路3のイベント時刻レジスター80に保持されている計時データを読み出して補正データTDを生成するのに対して、第3実施形態では、ホストデバイス6はリアルタイムクロック回路3から現在時刻の計時データを読み出して補正データTDを生成する。以下、第3実施形態について、第1実施形態と同様の構成要素には同じ符号を付し、第1実施形態と重複する説明は省略または簡略し、主に第1実施形態と異なる内容について説明する。
1-3. Third Embodiment In the first embodiment, the host device 6 reads the clock data held in the event time register 80 of the real-time clock circuit 3 and generates the correction data TD, whereas in the third embodiment, The host device 6 reads current time measurement data from the real-time clock circuit 3 and generates correction data TD. Hereinafter, regarding the third embodiment, the same reference numerals are given to the same components as in the first embodiment, explanations that overlap with those in the first embodiment are omitted or simplified, and mainly contents different from the first embodiment will be explained. do.

第3実施形態のリアルタイムクロックモジュール1の機能ブロック図は、図1と同様であるため、その図示を省略する。 The functional block diagram of the real-time clock module 1 of the third embodiment is the same as that in FIG. 1, so its illustration is omitted.

本実施形態では、ホストデバイス6は、内部で発生し、あるいは外部から受け取った基準信号REFに同期した間隔で、リアルタイムクロック回路3から計時データを読み出す。ホストデバイス6が読み出す計時データは、計時データSUB_Tを含み、さらに計時データBCD_T又は計時データBIN_Tを含む。 In this embodiment, the host device 6 reads time measurement data from the real-time clock circuit 3 at intervals synchronized with the reference signal REF generated internally or received from the outside. The clock data read by the host device 6 includes clock data SUB_T, and further includes clock data BCD_T or clock data BIN_T.

具体的には、ホストデバイス6は、基準信号REFの電圧レベルが遷移する所定のタイミングで、リアルタイムクロック回路3に、計時データSUB_T及び計時データBCD_T又は計時データBIN_Tの読み出しを要求するアクセス信号を送信する。例えば、基準信号REFの電圧レベルが遷移する所定のタイミングは、基準信号REFがローレベルからハイレベルに遷移するタイミングであってもよいし、基準信号REFがハイレベルからローレベルに遷移するタイミングであってもよい。リアルタイムクロック回路3のインターフェース回路90は、当該アクセス信号を受信し、読み出し対象となる計時データの読み出しを要求する不図示の読み出し要求信号を発生し、リードバッファー70に出力する。そして、インターフェース回路90は、リードバッファー70が取得して保持した読み出し対象の計時データである読み出しデータRDATを取得し、読み出しデータRDATをシリアルデータ信号SDAに変換して端子P7を介してホストデバイス6に送信し、ホストデバイス6は、計時データを取得する。 Specifically, the host device 6 transmits an access signal requesting the real-time clock circuit 3 to read the clock data SUB_T and the clock data BCD_T or the clock data BIN_T at a predetermined timing when the voltage level of the reference signal REF changes. do. For example, the predetermined timing at which the voltage level of the reference signal REF transitions may be the timing at which the reference signal REF transitions from a low level to a high level, or the timing at which the reference signal REF transitions from a high level to a low level. There may be. The interface circuit 90 of the real-time clock circuit 3 receives the access signal, generates a read request signal (not shown) requesting reading of the time measurement data to be read, and outputs it to the read buffer 70. Then, the interface circuit 90 acquires read data RDAT, which is the time measurement data to be read acquired and held by the read buffer 70, converts the read data RDAT into a serial data signal SDA, and sends the serial data signal SDA to the host device 6 via the terminal P7. The host device 6 acquires the clock data.

その後、ホストデバイス6は、基準信号REFの電圧レベルが遷移する所定のタイミングがn回発生すると、リアルタイムクロック回路3に、計時データSUB_T及び計時データBCD_T又は計時データBIN_Tの読み出しを要求するアクセス信号を再度送信し、当該計時データを取得する。整数nは、前述の補正期間設定データPNの値である。そして、ホストデバイス6は、取得した2つの計時データにそれぞれ含まれる計時データSUB_Tの差分により、基準信号REFのn周期の間隔での計時データSUB_Tの変化量を算出し、補正データTDを生成する。このように、補正データTDは、基準信号REFに同期した間隔での計時データSUB_Tの変化量に基づいて生成されたデータである。 Thereafter, when a predetermined timing at which the voltage level of the reference signal REF changes occurs n times, the host device 6 sends an access signal requesting the real-time clock circuit 3 to read the clock data SUB_T and the clock data BCD_T or the clock data BIN_T. Send again and obtain the relevant time measurement data. The integer n is the value of the correction period setting data PN described above. Then, the host device 6 calculates the amount of change in the clock data SUB_T at intervals of n cycles of the reference signal REF based on the difference between the clock data SUB_T included in the two acquired clock data, and generates correction data TD. . In this way, the correction data TD is data generated based on the amount of change in the clock data SUB_T at intervals synchronized with the reference signal REF.

論理回路50は、記憶部100に記憶された補正データTDを用いて、第1実施形態と同様に、補正期間において第1分周回路20に対して緩急処理を行う。 Using the correction data TD stored in the storage unit 100, the logic circuit 50 performs slowing/fastening processing on the first frequency dividing circuit 20 during the correction period, similarly to the first embodiment.

また、ホストデバイス6は、基準信号REFのn周期の間隔での計時データSUB_Tの変化量が所定値よりも大きい場合は、現在時刻のデータをリアルタイムクロック回路3のライトバッファー60に書き込み、計時回路40の計時データBCD_T,BIN_Tを更新する。 Furthermore, if the amount of change in the time measurement data SUB_T at intervals of n cycles of the reference signal REF is larger than a predetermined value, the host device 6 writes the current time data to the write buffer 60 of the real-time clock circuit 3, and writes the current time data to the write buffer 60 of the real-time clock circuit 3, The clock data BCD_T and BIN_T of 40 are updated.

第3実施形態のリアルタイムクロックモジュール1のその他の構成は、第1実施形態と同様であるため、その設営を省略する。なお、リアルタイムクロック回路3は、タイムスタンプ機能及び割込発生機能がなくてもよいので、端子P5、イベント時刻レジスター80及び割込発生回路110を備えていなくてもよい。 The rest of the configuration of the real-time clock module 1 of the third embodiment is the same as that of the first embodiment, so its construction will be omitted. Note that the real-time clock circuit 3 does not need to have a time stamp function and an interrupt generation function, so it does not need to include the terminal P5, the event time register 80, and the interrupt generation circuit 110.

図14は、第3実施形態のリアルタイムクロック回路3の補正方法の手順の一例を示す図である。 FIG. 14 is a diagram showing an example of a procedure of a correction method for the real-time clock circuit 3 according to the third embodiment.

図14に示すように、まず、基準信号REFの電圧レベルが例えばローレベルからハイレベルに遷移すると(工程S201のY)、ホストデバイス6がリアルタイムクロック回路3から計時データを読み出す(工程S202)。工程S202において読み出される計時データは、計時データSUB_Tを含み、さらに計時データBCD_T又は計時データBIN_Tを含む。 As shown in FIG. 14, first, when the voltage level of the reference signal REF transitions from, for example, a low level to a high level (Y in step S201), the host device 6 reads time measurement data from the real-time clock circuit 3 (step S202). The clock data read in step S202 includes clock data SUB_T, and further includes clock data BCD_T or clock data BIN_T.

次に、基準信号REFの電圧レベルが例えばローレベルからハイレベルにn回遷移すると(工程S203のY)、ホストデバイス6がリアルタイムクロック回路3から計時データを読み出す(工程S204)。工程S204において読み出される計時データは、計時データSUB_Tを含み、さらに計時データBCD_T又は計時データBIN_Tを含む。整数nは、前述の補正期間設定データPNの値である。例えば、nが32であり、基準信号REFの周期が1秒であれば、リアルタイムクロック回路3が基準信号REFを32回受信すると、すなわち、工程S201で基準信号REFの電圧レベルが遷移してから32秒が経過すると、再度、計時データが読み出される。 Next, when the voltage level of the reference signal REF changes, for example, from a low level to a high level n times (Y in step S203), the host device 6 reads time measurement data from the real-time clock circuit 3 (step S204). The clock data read in step S204 includes clock data SUB_T, and further includes clock data BCD_T or clock data BIN_T. The integer n is the value of the correction period setting data PN described above. For example, if n is 32 and the period of the reference signal REF is 1 second, when the real-time clock circuit 3 receives the reference signal REF 32 times, that is, after the voltage level of the reference signal REF changes in step S201. After 32 seconds have elapsed, the clock data is read out again.

次に、ホストデバイス6が、工程S204で読み出した計時データと工程S202で読み出した計時データとの差分ΔTを計算する(工程S205)。例えば、nが32であり、基準信号REFの周期が1秒であれば、差分ΔTは計時データの32秒間の増加量に相当する。 Next, the host device 6 calculates the difference ΔT between the clock data read in step S204 and the clock data read in step S202 (step S205). For example, if n is 32 and the period of the reference signal REF is 1 second, the difference ΔT corresponds to the amount of increase in the time measurement data for 32 seconds.

そして、差分ΔTの期待値に対する誤差が1秒以内である場合は(工程S206のY)、ホストデバイス6が、1秒未満の変化量ΔSubCntに基づき補正データTDを生成し、生成した補正データTDをリアルタイムクロック回路3の記憶部100に書き込む(工程S207)。変化量ΔSubCntは、工程S204で読み出した計時データSUB_Tと工程S202で読み出した計時データSUB_Tとの差分である。例えば、nが32であり、基準信号REFの周期が1秒であれば、差分ΔTの期待値は32秒であるので、差分ΔTが31秒以上33秒以下である場合に工程S207が行われる。また、工程S207において、ホストデバイス6は、変化量ΔSubCntが-255~+255の範囲の値である前提で、補正データTDの値を200h-ΔSubCntによって計算する。 If the error of the difference ΔT with respect to the expected value is within 1 second (Y in step S206), the host device 6 generates the correction data TD based on the variation ΔSubCnt of less than 1 second, and the generated correction data TD is written into the storage unit 100 of the real-time clock circuit 3 (step S207). The amount of change ΔSubCnt is the difference between the clock data SUB_T read in step S204 and the clock data SUB_T read in step S202. For example, if n is 32 and the period of the reference signal REF is 1 second, the expected value of the difference ΔT is 32 seconds, so step S207 is performed when the difference ΔT is between 31 seconds and 33 seconds. . Further, in step S207, the host device 6 calculates the value of the correction data TD by 200h-ΔSubCnt on the premise that the amount of change ΔSubCnt is a value in the range of −255 to +255.

次に、リアルタイムクロック回路3が、工程S207で記憶部100に書き込まれた補正データTDを用いて第1分周回路20に対して緩急処理を行う(工程S208)。以降、リアルタイムクロック回路3は、補正データTDが更新されるまで、各補正期間において当該補正データTDを用いて時間的に分散して緩急処理を行う。 Next, the real-time clock circuit 3 uses the correction data TD written in the storage unit 100 in step S207 to perform speed-up processing on the first frequency dividing circuit 20 (step S208). Thereafter, the real-time clock circuit 3 uses the correction data TD in each correction period to perform slow and fast processing in a temporally distributed manner until the correction data TD is updated.

一方、差分ΔTが1秒よりも大きい場合は(工程S206のN)、ホストデバイス6が、現在時刻のデータをリアルタイムクロック回路3のライトバッファー60に書き込む(工程S209)。例えば、ホストデバイス6は、年、月、日、時、分及び秒の時刻データ及び年、月、日、時、分及び秒を秒単位で表した時刻データをライトバッファー60に書き込む。 On the other hand, if the difference ΔT is larger than 1 second (N in step S206), the host device 6 writes the current time data to the write buffer 60 of the real-time clock circuit 3 (step S209). For example, the host device 6 writes time data of the year, month, day, hour, minute, and second, and time data representing the year, month, day, hour, minute, and second in seconds to the write buffer 60.

次に、リアルタイムクロック回路3が、計時回路40の計時データBCD_T,BIN_Tをライトバッファー60が保持する現在時刻のデータに更新する(工程S210)。 Next, the real-time clock circuit 3 updates the clock data BCD_T, BIN_T of the clock circuit 40 to the current time data held by the write buffer 60 (step S210).

そして、工程S208又は工程S210の後、所定のインターバル時間が経過する毎に(工程S211のY)、工程S201~工程S210が繰り返し行われる。 After step S208 or step S210, steps S201 to S210 are repeatedly performed every time a predetermined interval time elapses (Y in step S211).

以上に説明したように、第3実施形態では、ホストデバイス6が、リアルタイムクロック回路3から計時データを読み出して補正データTDを生成し、生成した補正データTDをリアルタイムクロック回路3の記憶部100に書き込む。したがって、第3実施形態によれば、リアルタイムクロック回路3が補正データTDを生成する必要がないので、リアルタイムクロック回路3のサイズを低減させることができる。 As described above, in the third embodiment, the host device 6 reads the clock data from the real-time clock circuit 3 to generate correction data TD, and stores the generated correction data TD in the storage section 100 of the real-time clock circuit 3. Write. Therefore, according to the third embodiment, there is no need for the real-time clock circuit 3 to generate the correction data TD, so that the size of the real-time clock circuit 3 can be reduced.

また、第3実施形態では、リアルタイムクロック回路3が、基準信号REFの電圧レベ
ルが遷移する所定のタイミング毎に計時データを保持する必要がないので、リアルタイムクロック回路3のサイズを低減させ、あるいは、リアルタイムクロック回路3の処理負荷を低減させることができる。
Further, in the third embodiment, since the real-time clock circuit 3 does not need to hold time measurement data at each predetermined timing when the voltage level of the reference signal REF changes, the size of the real-time clock circuit 3 can be reduced, or The processing load on the real-time clock circuit 3 can be reduced.

その他、第3実施形態のリアルタイムクロックモジュール1は、適宜、第1実施形態のリアルタイムクロックモジュール1と同様の効果を奏する。 In addition, the real-time clock module 1 of the third embodiment has the same effects as the real-time clock module 1 of the first embodiment, as appropriate.

1-4.変形例
上記の各実施形態では、第2分周回路30がバイナリーカウンターとして動作する場合は、補正データTDが生成される間隔及び補正期間の長さが、1Hzの基準信号REFの1周期の長さの32倍に相当する32秒である例を挙げ、第2分周回路30がBCDカウンターとして動作する場合は、補正データTDが生成される間隔及び補正期間の長さが、1.25Hzの基準信号REFの1周期の長さの32倍に相当する25.6秒である例を挙げたが、補正データTDが生成される間隔及び補正期間の長さや基準信号REFの周期はこれに限られない。例えば、基準信号REFの1周期を、補正データTDが生成される間隔及び補正期間の長さである32秒又は25.6秒と一致させてもよい。
1-4. Modifications In each of the above embodiments, when the second frequency dividing circuit 30 operates as a binary counter, the interval at which the correction data TD is generated and the length of the correction period are equal to the length of one period of the 1Hz reference signal REF. For example, if the second frequency dividing circuit 30 operates as a BCD counter, the interval at which the correction data TD is generated and the length of the correction period are 1.25 Hz. Although we have given an example of 25.6 seconds, which is 32 times the length of one period of the reference signal REF, the interval at which the correction data TD is generated, the length of the correction period, and the period of the reference signal REF are limited to this. I can't do it. For example, one period of the reference signal REF may be made to coincide with 32 seconds or 25.6 seconds, which is the interval at which the correction data TD is generated and the length of the correction period.

また、上記の各実施形態では、第2分周回路30がBCDカウンターとして動作する場合、1.25Hzの基準信号REFの1周期の長さは0.8秒であり、1PPSの信号の1周期の長さである1秒の整数倍となっていないが、基準信号REFの1周期の長さが1秒の整数倍となるようにしてもよい。例えば、基準信号REFの1周期の長さを256秒とし、基準信号REFの1周期の間隔で取得された2つの計時データSUB_Tの差分を1/10して符号を反転した値を補正データTDの値としてもよい。あるいは、基準信号REFの1周期の長さを1秒とし、すなわち、1PPSの信号を基準信号REFとし、基準信号REFの256周期の間隔で取得された2つの計時データSUB_Tの差分を1/10して符号を反転した値を補正データTDの値としてもよい。 Furthermore, in each of the above embodiments, when the second frequency dividing circuit 30 operates as a BCD counter, the length of one period of the 1.25 Hz reference signal REF is 0.8 seconds, and the length of one period of the 1 PPS signal is 0.8 seconds. Although the length of one cycle of the reference signal REF is not an integral multiple of 1 second, the length of one cycle of the reference signal REF may be an integral multiple of 1 second. For example, assuming that the length of one cycle of the reference signal REF is 256 seconds, the difference between two pieces of time measurement data SUB_T acquired at an interval of one cycle of the reference signal REF is 1/10 and the sign is inverted, and the correction data TD is It may be the value of Alternatively, if the length of one cycle of the reference signal REF is 1 second, that is, a signal of 1 PPS is used as the reference signal REF, and the difference between two time measurement data SUB_T acquired at an interval of 256 cycles of the reference signal REF is 1/10. The value obtained by inverting the sign may be used as the value of the correction data TD.

また、上記の各実施形態では、第1分周回路20、第2分周回路30及び計時回路40が非同期リップル回路である例を挙げたが、第1分周回路20、第2分周回路30及び計時回路40は同期型カウンター回路であってもよい。例えば、第1分周回路20は第1クロック信号CK1に同期して動作するカウンター回路であってもよいし、第2分周回路20は第2クロック信号CK2に同期して動作するカウンター回路であってもよいし、計時回路40は第2クロック信号CK2又は第3クロック信号CK3に同期して動作するカウンター回路であってもよい。 Further, in each of the above embodiments, an example has been given in which the first frequency dividing circuit 20, the second frequency dividing circuit 30, and the clock circuit 40 are asynchronous ripple circuits, but the first frequency dividing circuit 20, the second frequency dividing circuit 30 and the clock circuit 40 may be synchronous counter circuits. For example, the first frequency dividing circuit 20 may be a counter circuit that operates in synchronization with the first clock signal CK1, and the second frequency dividing circuit 20 may be a counter circuit that operates in synchronization with the second clock signal CK2. Alternatively, the clock circuit 40 may be a counter circuit that operates in synchronization with the second clock signal CK2 or the third clock signal CK3.

2.電子機器
図15は、上述した各実施形態のリアルタイムクロックモジュール1又はリアルタイムクロック回路3を用いた電子機器の実施形態の構成の一例を示す機能ブロック図である。また、図16は、本実施形態の電子機器の一例であるスマートフォンの外観の一例を示す図である。
2. Electronic Device FIG. 15 is a functional block diagram showing an example of the configuration of an electronic device using the real-time clock module 1 or the real-time clock circuit 3 of each embodiment described above. Further, FIG. 16 is a diagram showing an example of the appearance of a smartphone, which is an example of the electronic device of this embodiment.

本実施形態の電子機器300は、リアルタイムクロックモジュール1、ホストデバイス320、操作部330、記憶部340、通信部350、表示部360及び音出力部370を含んで構成されている。なお、本実施形態の電子機器300は、図15の構成要素の一部を省略又は変更し、あるいは、他の構成要素を付加した構成としてもよい。 The electronic device 300 of this embodiment includes a real-time clock module 1, a host device 320, an operation section 330, a storage section 340, a communication section 350, a display section 360, and a sound output section 370. Note that the electronic device 300 of this embodiment may have a configuration in which some of the components shown in FIG. 15 are omitted or changed, or other components are added.

前述の通り、リアルタイムクロックモジュール1は、振動子2と、リアルタイムクロック回路3とを備える。 As mentioned above, the real-time clock module 1 includes the vibrator 2 and the real-time clock circuit 3.

ホストデバイス320は、記憶部340等に記憶されているプログラムに従い、各種の
計算処理や制御処理を行う。具体的には、ホストデバイス320は、操作部330からの操作信号に応じた各種の処理、他の機器とデータ通信を行うために通信部350を制御する処理、表示部360に各種の情報を表示させるための表示信号を送信する処理、音出力部370から各種の音を出力させるための音信号を送信する処理等を行う。
The host device 320 performs various calculation processes and control processes according to programs stored in the storage unit 340 and the like. Specifically, the host device 320 performs various processes according to operation signals from the operation unit 330, processes that control the communication unit 350 to perform data communication with other devices, and displays various information on the display unit 360. It performs a process of transmitting a display signal for display, a process of transmitting a sound signal for outputting various sounds from the sound output unit 370, and the like.

また、ホストデバイス320は、リアルタイムクロック回路3と通信する。例えば、ホストデバイス320は、リアルタイムクロック回路3から計時データ等を読み出して各種の計算処理や制御処理を行う。また、ホストデバイス320は、リアルタイムクロック回路3に対して計時データの書き換え等を行う。また、ホストデバイス320は、リアルタイムクロック回路3に対して、前述の補正データTDを含む各種のデータや基準信号REFを送信してもよい。ホストデバイス320は、例えば、MCU(Micro Controller Unit)やMPU(Micro Processor Unit)によって実現される。なお、ホストデバイス320は、上述したホストデバイス6に対応する。 The host device 320 also communicates with the real-time clock circuit 3. For example, the host device 320 reads time data and the like from the real-time clock circuit 3 and performs various calculation processes and control processes. In addition, the host device 320 rewrites time measurement data in the real-time clock circuit 3. Further, the host device 320 may transmit various data including the above-mentioned correction data TD and the reference signal REF to the real-time clock circuit 3. The host device 320 is realized by, for example, an MCU (Micro Controller Unit) or an MPU (Micro Processor Unit). Note that the host device 320 corresponds to the host device 6 described above.

操作部330は、操作キーやボタンスイッチ等により構成される入力装置であり、ユーザーによる操作に応じた操作信号をホストデバイス320に出力する。ホストデバイス320は、例えば、操作部330から入力される信号に応じて、リアルタイムクロック回路3に時刻情報を設定することができる。 The operation unit 330 is an input device including operation keys, button switches, and the like, and outputs an operation signal to the host device 320 in accordance with a user's operation. For example, the host device 320 can set time information in the real-time clock circuit 3 according to a signal input from the operation unit 330.

記憶部340は、ホストデバイス320が各種の計算処理や制御処理を行うためのプログラムやデータ等を記憶している。また、記憶部340は、ホストデバイス320の作業領域として用いられ、記憶部340から読み出されたプログラムやデータ、操作部330から入力されたデータ、ホストデバイス320が各種プログラムに従って実行した演算結果等を一時的に記憶する。記憶部340は、ROM(Read Only Memory)やRAM(Random Access Memory)を含んで構成され、例えば、ハードディスク、フレキシブルディスク、MO、MT、各種のメモリー、CD-ROM、又は、DVD-ROM等によって実現される。 The storage unit 340 stores programs, data, etc. for the host device 320 to perform various calculation processes and control processes. The storage unit 340 is also used as a work area for the host device 320, and includes programs and data read from the storage unit 340, data input from the operation unit 330, calculation results executed by the host device 320 according to various programs, etc. temporarily memorize. The storage unit 340 includes a ROM (Read Only Memory) and a RAM (Random Access Memory), and is configured by, for example, a hard disk, a flexible disk, an MO, an MT, various types of memories, a CD-ROM, a DVD-ROM, etc. Realized.

通信部350は、ホストデバイス320と外部装置との間のデータ通信を成立させるための各種制御を行う。 The communication unit 350 performs various controls for establishing data communication between the host device 320 and an external device.

表示部360は、LCD(Liquid Crystal Display)等により構成される表示装置であり、ホストデバイス320から入力される表示信号に基づいて各種の情報を表示する。表示部360には操作部330として機能するタッチパネルが設けられていてもよい。 The display unit 360 is a display device configured with an LCD (Liquid Crystal Display) or the like, and displays various information based on display signals input from the host device 320. The display section 360 may be provided with a touch panel that functions as the operation section 330.

音出力部370は、スピーカー等によって構成され、ホストデバイス320から入力される音信号に基づいて各種の情報を音や音声として出力する。 The sound output unit 370 is configured with a speaker or the like, and outputs various information as sound or audio based on the sound signal input from the host device 320.

本実施形態の電子機器300は、短時間で簡易に計時データの補正データを取得することが可能なリアルタイムクロック回路3を備えるので、高い信頼性を実現することができる。 Since the electronic device 300 of this embodiment includes the real-time clock circuit 3 that can easily acquire correction data for time measurement data in a short time, it can achieve high reliability.

このような電子機器300としては種々の電子機器が考えられ、例えば、電子時計、モバイル型、ラップトップ型、タブレット型などのパーソナルコンピューター、スマートフォンや携帯電話機などの移動体端末、ディジタルカメラ、インクジェットプリンターなどのインクジェット式吐出装置、ルーターやスイッチなどのストレージエリアネットワーク機器、ローカルエリアネットワーク機器、移動体端末基地局用機器、テレビ、ビデオカメラ、ビデオレコーダー、カーナビゲーション装置、リアルタイムクロック装置、ページャー、電子手帳、電子辞書、電卓、電子ゲーム機器、ゲーム用コントローラー、ワードプロセッサー、ワークステーション、テレビ電話、防犯用テレビモニター、電子双眼鏡、PO
S端末、電子体温計、血圧計、血糖計、心電図計測装置、超音波診断装置、電子内視鏡等の医療機器、魚群探知機、各種測定機器、車両、航空機、船舶等の計器類、フライトシミュレーター、ヘッドマウントディスプレイ、モーショントレース、モーショントラッキング、モーションコントローラー、歩行者自立航法(PDR:Pedestrian Dead Reckoning)装置等が挙げられる。
Various electronic devices can be considered as the electronic device 300, such as an electronic watch, a personal computer such as a mobile type, a laptop type, or a tablet type, a mobile terminal such as a smartphone or a mobile phone, a digital camera, an inkjet printer, etc. Inkjet ejection devices such as routers and switches, storage area network devices such as routers and switches, local area network devices, mobile terminal base station devices, televisions, video cameras, video recorders, car navigation devices, real-time clock devices, pagers, electronic notebooks , electronic dictionaries, calculators, electronic game devices, game controllers, word processors, workstations, videophones, security TV monitors, electronic binoculars, PO
Medical devices such as S terminals, electronic thermometers, blood pressure monitors, blood sugar meters, electrocardiogram measuring devices, ultrasound diagnostic devices, electronic endoscopes, fish finders, various measuring devices, instruments for vehicles, aircraft, ships, etc., flight simulators , head-mounted displays, motion tracing, motion tracking, motion controllers, pedestrian dead reckoning (PDR) devices, etc.

本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。 The present invention is not limited to this embodiment, and various modifications can be made within the scope of the gist of the present invention.

上述した実施形態および変形例は一例であって、これらに限定されるわけではない。例えば、各実施形態および各変形例を適宜組み合わせることも可能である。 The above-described embodiments and modifications are merely examples, and the present invention is not limited thereto. For example, it is also possible to combine each embodiment and each modification as appropriate.

本発明は、実施の形態で説明した構成と実質的に同一の構成(例えば、機能、方法及び結果が同一の構成、あるいは目的及び効果が同一の構成)を含む。また、本発明は、実施の形態で説明した構成の本質的でない部分を置き換えた構成を含む。また、本発明は、実施の形態で説明した構成と同一の作用効果を奏する構成又は同一の目的を達成することができる構成を含む。また、本発明は、実施の形態で説明した構成に公知技術を付加した構成を含む。 The present invention includes configurations that are substantially the same as those described in the embodiments (for example, configurations that have the same functions, methods, and results, or configurations that have the same objectives and effects). Further, the present invention includes a configuration in which non-essential parts of the configuration described in the embodiments are replaced. Further, the present invention includes a configuration that has the same effects or a configuration that can achieve the same objective as the configuration described in the embodiment. Further, the present invention includes a configuration in which a known technique is added to the configuration described in the embodiment.

上述した実施形態および変形例から以下の内容が導き出される。 The following content is derived from the above-described embodiment and modification.

リアルタイムクロック回路の一態様は、
振動子を発振させて第1クロック信号を生成する発振回路と、
前記第1クロック信号を分周して第2クロック信号を生成する第1分周回路と、
前記第2クロック信号を分周して第3クロック信号を生成するとともに、前記第2クロック信号に基づいて1秒よりも短い時間の第1計時データを生成する第2分周回路と、
前記第3クロック信号に基づいて1秒以上の時間の第2計時データを生成する計時回路と、
基準信号に同期した間隔での前記第1計時データの変化量に基づいて生成された補正データを用いて、前記間隔に相当する長さの期間において、前記第1分周回路に対して緩急処理を行う論理回路と、を備える。
One aspect of the real-time clock circuit is
an oscillation circuit that generates a first clock signal by oscillating a vibrator;
a first frequency dividing circuit that divides the first clock signal to generate a second clock signal;
a second frequency dividing circuit that frequency divides the second clock signal to generate a third clock signal, and generates first time measurement data for a time shorter than one second based on the second clock signal;
a timekeeping circuit that generates second timekeeping data for a time of one second or more based on the third clock signal;
Using correction data generated based on the amount of change in the first time measurement data at intervals synchronized with the reference signal, the first frequency dividing circuit is subjected to slow and fast processing during a period of length corresponding to the intervals. and a logic circuit that performs.

このリアルタイムクロック回路では、論理回路が、基準信号に同期した間隔での1秒よりも短い時間の第1計時データの変化量に基づいて生成された補正データを用いて、第2クロック信号を生成する第1分周回路に対して緩急処理を行う。したがって、1秒以上の任意の短時間で生成された補正データを用いて、第2クロック信号が補正される。そして、第2分周回路が第2クロック信号を分周して第3クロック信号を生成し、計時回路が第3クロック信号に基づいて1秒以上の時間の第2計時データを生成するので、第2計時データが短時間で補正される。また、このリアルタイムクロック回路では、基準信号に同期した間隔での第1計時データの変化量に基づいて補正データが生成される。そのため、リアルタイムクロック回路が第3クロック信号を外部装置に出力し、外部装置が第3クロック信号の周波数を計測して補正データを作成する必要がない。したがって、このリアルタイムクロック回路によれば、短時間で簡易に計時データの補正データを取得することができる。さらに、このリアルタイムクロック回路では、補正データを用いた緩急処理が行われる期間の長さが、補正データを生成するために第1計時データの変化量が算出される間隔と一致するので、第1計時データの変化量の符号を反転した値を補正データの値とすることができる。したがって、このリアルタイムクロック回路によれば、補正データの生成が容易である。以上より、このリアルタイムクロック回路によれば、優れたユーザー利便性を実現することができる。 In this real-time clock circuit, the logic circuit generates the second clock signal using correction data generated based on the amount of change in the first clock data for a time shorter than one second at intervals synchronized with the reference signal. A slow/fast process is performed on the first frequency dividing circuit. Therefore, the second clock signal is corrected using correction data generated in an arbitrary short time period of one second or more. Then, the second frequency dividing circuit divides the frequency of the second clock signal to generate a third clock signal, and the time measurement circuit generates second time measurement data for a time of one second or more based on the third clock signal. The second time measurement data is corrected in a short time. Further, in this real-time clock circuit, correction data is generated based on the amount of change in the first time measurement data at intervals synchronized with the reference signal. Therefore, there is no need for the real-time clock circuit to output the third clock signal to the external device and for the external device to measure the frequency of the third clock signal and create correction data. Therefore, according to this real-time clock circuit, correction data for time measurement data can be easily obtained in a short time. Furthermore, in this real-time clock circuit, the length of the period in which the adjustment data is performed using the correction data matches the interval at which the amount of change in the first clock data is calculated to generate the correction data. A value obtained by inverting the sign of the amount of change in the time measurement data can be used as the value of the correction data. Therefore, according to this real-time clock circuit, it is easy to generate correction data. As described above, this real-time clock circuit can realize excellent user convenience.

前記リアルタイムクロック回路の一態様において、
前記間隔は、前記第3クロック信号の周期よりも長く、
前記論理回路は、前記期間において、前記第2クロック信号の周期よりも長い時間間隔で前記緩急処理を行ってもよい。
In one aspect of the real-time clock circuit,
The interval is longer than the period of the third clock signal,
The logic circuit may perform the adjustment/acceleration processing at time intervals longer than a cycle of the second clock signal during the period.

このリアルタイムクロック回路によれば、補正データを生成するために第1計時データの変化量が算出される間隔が、1秒以上の第2計時データを生成する計時回路が用いる第3クロック信号の周期よりも長いので、論理回路は高い分解能で第2クロック信号を補正することができる。さらに、このリアルタイムクロック回路によれば、論理回路が、第2クロック信号の周期よりも長い時間間隔で時間的に分散して第1分周回路に対して緩急処理を行うので、第2クロック信号の周波数変動量のばらつきを小さくすることができる。 According to this real-time clock circuit, the interval at which the amount of change in the first time measurement data is calculated to generate the correction data is one second or more, and the period of the third clock signal used by the time measurement circuit that generates the second time measurement data. , the logic circuit can correct the second clock signal with high resolution. Furthermore, according to this real-time clock circuit, the logic circuit performs slowing/fastening processing on the first frequency dividing circuit in a temporally distributed manner at time intervals longer than the period of the second clock signal. It is possible to reduce the variation in the amount of frequency fluctuation.

前記リアルタイムクロック回路の一態様は、
前記基準信号の電圧レベルが遷移する所定のタイミングで前記第1計時データを保持するバッファー回路を備えてもよい。
One aspect of the real-time clock circuit is:
The device may include a buffer circuit that holds the first time measurement data at a predetermined timing when the voltage level of the reference signal changes.

このリアルタイムクロック回路では、補正データが、基準信号の電圧レベルが遷移する所定のタイミングでバッファー回路に保持された第1計時データに基づいて生成される。したがって、このリアルタイムクロック回路によれば、例えば、外部装置がバッファー回路に保持された第1計時データを読み出して補正データを生成する場合において、第1計時データの読み出しに要する遅延時間にばらつきがあっても、遅延時間のばらつきによる第1計時データの誤差が生じないので、高い精度で計時データを補正することができる。 In this real-time clock circuit, the correction data is generated based on the first clock data held in the buffer circuit at a predetermined timing when the voltage level of the reference signal changes. Therefore, according to this real-time clock circuit, for example, when an external device reads the first clock data held in the buffer circuit and generates correction data, there is variation in the delay time required to read the first clock data. However, since no error occurs in the first clock data due to variations in delay time, the clock data can be corrected with high accuracy.

前記リアルタイムクロック回路の一態様は、
保持した前記第1計時データに基づいて前記補正データを生成する補正データ生成回路を備えてもよい。
One aspect of the real-time clock circuit is:
The device may include a correction data generation circuit that generates the correction data based on the held first time measurement data.

このリアルタイムクロック回路では、補正データ生成回路が、基準信号の電圧レベルが遷移する所定のタイミングでバッファー回路に保持された第1計時データに基づいて、補正データを生成する。したがって、このリアルタイムクロック回路によれば、外部装置が補正データを生成する必要がないので、外部装置の計算負荷を低減させることができる。また、このリアルタイムクロックによれば、外部装置が第1計時データを読み出す必要がないので、読み出しに要する遅延時間のばらつきによる第1計時データの誤差が生じないので、高い精度で計時データを補正することができる。 In this real-time clock circuit, the correction data generation circuit generates correction data based on the first clock data held in the buffer circuit at a predetermined timing when the voltage level of the reference signal changes. Therefore, according to this real-time clock circuit, there is no need for the external device to generate correction data, so that the calculation load on the external device can be reduced. Furthermore, according to this real-time clock, there is no need for an external device to read out the first time measurement data, so errors in the first time measurement data due to variations in the delay time required for reading do not occur, so the time measurement data can be corrected with high precision. be able to.

前記リアルタイムクロック回路の一態様は、
前記第1計時データを送信するインターフェース回路を備えてもよい。
One aspect of the real-time clock circuit is:
The device may also include an interface circuit that transmits the first time measurement data.

このリアルタイムクロック回路によれば、外部装置が、インターフェース回路が送信する第1計時データを受信して補正データを生成することができる。したがって、リアルタイムクロック回路が補正データを生成する必要がないので、リアルタイムクロック回路のサイズを低減させることができる。 According to this real-time clock circuit, the external device can receive the first time measurement data transmitted by the interface circuit and generate correction data. Therefore, since the real-time clock circuit does not need to generate correction data, the size of the real-time clock circuit can be reduced.

前記リアルタイムクロック回路の一態様において、
前記インターフェース回路は、前記間隔を指定する情報を受信してもよい。
In one aspect of the real-time clock circuit,
The interface circuit may receive information specifying the interval.

このリアルタイムクロック回路によれば、補正データを生成するために第1計時データの変化量が算出される間隔、すなわち、補正データを用いた緩急処理が行われる期間の長さを、補正の精度と補正に要する時間とのトレードオフを考慮して、ユーザーが任意に設定することができる。 According to this real-time clock circuit, the interval at which the amount of change in the first time measurement data is calculated to generate the correction data, that is, the length of the period in which the adjustment data is performed using the correction data, is determined as the accuracy of the correction. The user can set it arbitrarily, taking into consideration the trade-off with the time required for correction.

リアルタイムクロックモジュールの一態様は、
前記リアルタイムクロック回路の一態様と、
前記振動子と、を備える。
One aspect of the real-time clock module is
One aspect of the real-time clock circuit,
and the vibrator.

電子機器の一態様は、
前記リアルタイムクロック回路の一態様と、
前記リアルタイムクロック回路と通信するホストデバイスと、を備える。
One aspect of electronic equipment is
One aspect of the real-time clock circuit,
a host device communicating with the real-time clock circuit.

リアルタイムクロック回路の補正方法の一態様は、
振動子を発振させて第1クロック信号を生成する発振回路と、前記第1クロック信号を分周して第2クロック信号を生成する第1分周回路と、前記第2クロック信号を分周して第3クロック信号を生成するとともに、前記第2クロック信号に基づいて1秒よりも短い時間の第1計時データを生成する第2分周回路と、前記第3クロック信号に基づいて1秒以上の時間の第2計時データを生成する計時回路と、を備えたリアルタイムクロック回路の補正方法であって、
前記リアルタイムクロック回路が、基準信号に同期した間隔での前記第1計時データの変化量に基づいて生成された補正データを用いて、前記間隔に相当する長さの期間において、前記第1分周回路に対して緩急処理を行う工程を備える。
One aspect of the correction method for the real-time clock circuit is
an oscillation circuit that oscillates a vibrator to generate a first clock signal; a first frequency divider circuit that divides the frequency of the first clock signal to generate a second clock signal; and a first frequency divider circuit that divides the frequency of the second clock signal. a second frequency dividing circuit that generates a third clock signal based on the second clock signal, and generates first time measurement data for a time shorter than one second based on the third clock signal; A method for correcting a real-time clock circuit, comprising: a clock circuit that generates second clock data for a time of
The real-time clock circuit performs the first frequency division in a period corresponding to the interval using correction data generated based on the amount of change in the first clock data at intervals synchronized with the reference signal. It includes a step of performing slow and fast processing on the circuit.

このリアルタイムクロック回路の補正方法では、リアルタイムクロック回路が、基準信号に同期した間隔での1秒よりも短い時間の第1計時データの変化量に基づいて生成された補正データを用いて、第2クロック信号を生成する第1分周回路に対して緩急処理を行う。したがって、1秒以上の任意の短時間で生成された補正データを用いて、第2クロック信号が補正される。そして、第2分周回路が第2クロック信号を分周して第3クロック信号を生成し、計時回路が第3クロック信号に基づいて1秒以上の時間の第2計時データを生成するので、第2計時データが短時間で補正される。また、このリアルタイムクロック回路の補正方法では、基準信号に同期した間隔での第1計時データの変化量に基づいて補正データが生成される。そのため、リアルタイムクロック回路が第3クロック信号を外部装置に出力し、外部装置が第3クロック信号の周波数を計測して補正データを作成する必要がない。したがって、このリアルタイムクロック回路の補正方法によれば、短時間で簡易に計時データの補正データを取得することができる。さらに、このリアルタイムクロック回路の補正方法では、補正データを用いた緩急処理が行われる期間の長さが、補正データを生成するために第1計時データの変化量が算出される間隔と一致するので、第1計時データの変化量の符号を反転した値を補正データの値とすることができる。したがって、このリアルタイムクロック回路の補正方法によれば、補正データの生成が容易である。以上より、このリアルタイムクロック回路の補正方法によれば、優れたユーザー利便性を実現することができる。 In this correction method for a real-time clock circuit, the real-time clock circuit uses correction data generated based on the amount of change in first clock data at intervals shorter than one second at intervals synchronized with a reference signal to Slow and fast processing is performed on the first frequency dividing circuit that generates the clock signal. Therefore, the second clock signal is corrected using correction data generated in an arbitrary short time period of one second or more. Then, the second frequency dividing circuit divides the frequency of the second clock signal to generate a third clock signal, and the time measurement circuit generates second time measurement data for a time of one second or more based on the third clock signal. The second time measurement data is corrected in a short time. Further, in this real-time clock circuit correction method, correction data is generated based on the amount of change in the first time measurement data at intervals synchronized with the reference signal. Therefore, there is no need for the real-time clock circuit to output the third clock signal to the external device and for the external device to measure the frequency of the third clock signal and create correction data. Therefore, according to this real-time clock circuit correction method, correction data for time measurement data can be easily obtained in a short time. Furthermore, in this method of correcting the real-time clock circuit, the length of the period during which the adjustment process using the correction data is performed matches the interval at which the amount of change in the first clock data is calculated to generate the correction data. , a value obtained by inverting the sign of the amount of change in the first time measurement data can be used as the value of the correction data. Therefore, according to this real-time clock circuit correction method, it is easy to generate correction data. As described above, according to this real-time clock circuit correction method, excellent user convenience can be achieved.

前記リアルタイムクロック回路の補正方法の一態様は、
ホストデバイスが、前記リアルタイムクロック回路に前記基準信号を送信する工程と、
前記リアルタイムクロック回路が、前記基準信号の電圧レベルが遷移する所定のタイミング毎に前記第1計時データを保持する工程と、
前記リアルタイムクロック回路が、前記ホストデバイスに割込み信号を送信する工程と、
前記ホストデバイスが、前記割込み信号を受信し、前記間隔で保持された2つの前記第1計時データを読み出す工程と、
前記ホストデバイスが、読み出した2つの前記第1計時データに基づいて前記補正データを生成し、生成した前記補正データを前記リアルタイムクロック回路の記憶部に書き込む工程と、を含んでもよい。
One aspect of the method for correcting the real-time clock circuit is
a host device transmitting the reference signal to the real-time clock circuit;
a step in which the real-time clock circuit holds the first time measurement data at each predetermined timing when the voltage level of the reference signal changes;
the real-time clock circuit transmitting an interrupt signal to the host device;
the host device receiving the interrupt signal and reading the two pieces of first time measurement data held at the interval;
The method may include a step in which the host device generates the correction data based on the two read first clock data, and writes the generated correction data into a storage section of the real-time clock circuit.

このリアルタイムクロック回路の補正方法では、ホストデバイスが、リアルタイムクロック回路から第1計時データを読み出して補正データを生成し、生成した補正データをリアルタイムクロック回路の記憶部に書き込む。したがって、このリアルタイムクロック回路の補正方法によれば、リアルタイムクロック回路が補正データを生成する必要がないので、リアルタイムクロック回路のサイズを低減させることができる。また、このリアルタイムクロック回路の補正方法では、リアルタイムクロック回路が基準信号の電圧レベルが遷移する所定のタイミングで保持した第1計時データに基づいて、ホストデバイスが補正データを生成する。したがって、このリアルタイムクロック回路の補正方法によれば、ホストデバイスが第1計時データの読み出しに要する遅延時間にばらつきがあっても、遅延時間のばらつきによる第1計時データの誤差が生じないので、高い精度で計時データを補正することができる。 In this real-time clock circuit correction method, a host device reads first time measurement data from a real-time clock circuit, generates correction data, and writes the generated correction data into a storage section of the real-time clock circuit. Therefore, according to this real-time clock circuit correction method, there is no need for the real-time clock circuit to generate correction data, so that the size of the real-time clock circuit can be reduced. Further, in this real-time clock circuit correction method, the host device generates correction data based on first time measurement data held by the real-time clock circuit at a predetermined timing when the voltage level of the reference signal changes. Therefore, according to this method of correcting the real-time clock circuit, even if there is variation in the delay time required for the host device to read the first time measurement data, an error in the first time measurement data due to the variation in delay time does not occur, resulting in a high Timing data can be corrected with precision.

前記リアルタイムクロック回路の補正方法の一態様は、
ホストデバイスが、前記リアルタイムクロック回路に前記基準信号を送信する工程と、
前記リアルタイムクロック回路が、前記基準信号の電圧レベルが遷移する所定のタイミング毎に前記第1計時データを保持する工程と、
前記リアルタイムクロック回路が、前記間隔で保持された2つの前記第1計時データに基づいて前記補正データを生成する工程と、を含んでもよい。
One aspect of the method for correcting the real-time clock circuit is
a host device transmitting the reference signal to the real-time clock circuit;
a step in which the real-time clock circuit holds the first time measurement data at each predetermined timing when the voltage level of the reference signal changes;
The real-time clock circuit may include a step of generating the correction data based on the two pieces of first time measurement data held at the interval.

このリアルタイムクロック回路の補正方法では、リアルタイムクロック回路が、基準信号の電圧レベルが遷移する所定のタイミングでバッファー回路に保持された第1計時データに基づいて、補正データを生成する。したがって、このリアルタイムクロック回路の補正方法によれば、ホストデバイスが補正データを生成する必要がないので、ホストデバイスの計算負荷を低減させることができる。また、このリアルタイムクロック回路の補正方法では、リアルタイムクロック回路が、基準信号の電圧レベルが遷移する所定のタイミングで保持した第1計時データに基づいて、補正データを生成する。したがって、このリアルタイムクロック回路の補正方法によれば、ホストデバイスが第1計時データを読み出す必要がないので、読み出しに要する遅延時間のばらつきによる第1計時データの誤差が生じないので、高い精度で計時データを補正することができる。 In this method of correcting a real-time clock circuit, the real-time clock circuit generates correction data based on the first clock data held in the buffer circuit at a predetermined timing when the voltage level of the reference signal changes. Therefore, according to this real-time clock circuit correction method, there is no need for the host device to generate correction data, so that the calculation load on the host device can be reduced. Further, in this real-time clock circuit correction method, the real-time clock circuit generates correction data based on the first time measurement data held at a predetermined timing when the voltage level of the reference signal changes. Therefore, according to this method of correcting the real-time clock circuit, there is no need for the host device to read the first time measurement data, so there is no error in the first time measurement data due to variations in the delay time required for reading, and therefore time can be measured with high accuracy. Data can be corrected.

前記リアルタイムクロック回路の補正方法の一態様は、
ホストデバイスが、前記間隔で前記リアルタイムクロック回路から2つの前記第1計時データを読み出す工程と、
前記ホストデバイスが、読み出した2つの前記第1計時データに基づいて前記補正データを生成し、生成した前記補正データを前記リアルタイムクロック回路の記憶部に書き込む工程と、を含んでもよい。
One aspect of the method for correcting the real-time clock circuit is
a host device reading two pieces of the first time measurement data from the real-time clock circuit at the intervals;
The method may include a step in which the host device generates the correction data based on the two read first clock data, and writes the generated correction data into a storage section of the real-time clock circuit.

このリアルタイムクロック回路の補正方法では、ホストデバイスが、リアルタイムクロック回路から第1計時データを読み出して補正データを生成し、生成した補正データをリアルタイムクロック回路の記憶部に書き込む。したがって、このリアルタイムクロック回路の補正方法によれば、リアルタイムクロック回路が補正データを生成する必要がないので、リアルタイムクロック回路のサイズを低減させることができる。また、このリアルタイムクロック回路の補正方法では、リアルタイムクロック回路が、基準信号の電圧レベルが遷移する所定のタイミング毎に第1計時データを保持する必要がないので、リアルタイムクロック回路のサイズを低減させ、あるいは、リアルタイムクロック回路の処理負荷を低減させることができる。 In this real-time clock circuit correction method, a host device reads first time measurement data from a real-time clock circuit, generates correction data, and writes the generated correction data into a storage section of the real-time clock circuit. Therefore, according to this real-time clock circuit correction method, there is no need for the real-time clock circuit to generate correction data, so that the size of the real-time clock circuit can be reduced. In addition, in this real-time clock circuit correction method, the real-time clock circuit does not need to hold the first time measurement data at each predetermined timing when the voltage level of the reference signal changes, so the size of the real-time clock circuit can be reduced. Alternatively, the processing load on the real-time clock circuit can be reduced.

1…リアルタイムクロックモジュール、2…振動子、3…リアルタイムクロック回路、4
…メイン電源、5…バックアップ電源、6…ホストデバイス、10…発振回路、20…第1分周回路、21…分周回路、22~25…2分周回路、30…第2分周回路、31~3A…2分周回路、3B,3C,3D…カウンター、40…計時回路、41~47…カウンター、50…論理回路、60…ライトバッファー、70…リードバッファー、80…イベント時刻レジスター、90…インターフェース回路、100…記憶部、110…割込発生回路、120…電源電圧選択回路、130…電源電圧判定回路、140…レギュレーター、150…補正データ生成回路、300…電子機器、320…ホストデバイス、330…操作部、340…記憶部、350…通信部、360…表示部、370…音出力部
1... Real-time clock module, 2... Oscillator, 3... Real-time clock circuit, 4
... Main power supply, 5... Backup power supply, 6... Host device, 10... Oscillator circuit, 20... First frequency dividing circuit, 21... Frequency dividing circuit, 22 to 25... 2 frequency dividing circuit, 30... Second frequency dividing circuit, 31 to 3A...2 frequency divider circuit, 3B, 3C, 3D... Counter, 40... Time measurement circuit, 41 to 47... Counter, 50... Logic circuit, 60... Write buffer, 70... Read buffer, 80... Event time register, 90 ...Interface circuit, 100...Storage unit, 110...Interrupt generation circuit, 120...Power supply voltage selection circuit, 130...Power supply voltage determination circuit, 140...Regulator, 150...Correction data generation circuit, 300...Electronic equipment, 320...Host device , 330...Operation unit, 340...Storage unit, 350...Communication unit, 360...Display unit, 370...Sound output unit

Claims (12)

振動子を発振させて第1クロック信号を生成する発振回路と、
前記第1クロック信号を分周して第2クロック信号を生成する第1分周回路と、
前記第2クロック信号を分周して第3クロック信号を生成するとともに、前記第2クロック信号に基づいて1秒よりも短い時間の第1計時データを生成する第2分周回路と、
前記第3クロック信号に基づいて1秒以上の時間の第2計時データを生成する計時回路と、
基準信号に同期した間隔での前記第1計時データの変化量に基づいて生成された補正データを用いて、前記間隔に相当する長さの期間において、前記第1分周回路に対して緩急処理を行う論理回路と、を備える、リアルタイムクロック回路。
an oscillation circuit that generates a first clock signal by oscillating a vibrator;
a first frequency divider circuit that divides the first clock signal to generate a second clock signal;
a second frequency dividing circuit that frequency divides the second clock signal to generate a third clock signal, and generates first time measurement data for a time shorter than one second based on the second clock signal;
a timekeeping circuit that generates second timekeeping data for a time of one second or more based on the third clock signal;
Using correction data generated based on the amount of change in the first time measurement data at intervals synchronized with the reference signal, the first frequency dividing circuit is subjected to slow and fast processing during a period of length corresponding to the intervals. A real-time clock circuit comprising: a logic circuit for performing
前記間隔は、前記第3クロック信号の周期よりも長く、
前記論理回路は、前記期間において、前記第2クロック信号の周期よりも長い時間間隔で前記緩急処理を行う、請求項1に記載のリアルタイムクロック回路。
The interval is longer than the period of the third clock signal,
2. The real-time clock circuit according to claim 1, wherein the logic circuit performs the slow/fast processing at time intervals longer than a cycle of the second clock signal during the period.
前記基準信号の電圧レベルが遷移する所定のタイミングで前記第1計時データを保持するバッファー回路を備える、請求項1又は2に記載のリアルタイムクロック回路。 3. The real-time clock circuit according to claim 1, further comprising a buffer circuit that holds the first time measurement data at a predetermined timing when the voltage level of the reference signal changes. 保持した前記第1計時データに基づいて前記補正データを生成する補正データ生成回路を備える、請求項3に記載のリアルタイムクロック回路。 The real-time clock circuit according to claim 3, further comprising a correction data generation circuit that generates the correction data based on the held first time measurement data. 前記第1計時データを送信するインターフェース回路を備える、請求項1乃至4のいずれか一項に記載のリアルタイムクロック回路。 The real-time clock circuit according to any one of claims 1 to 4, comprising an interface circuit that transmits the first time measurement data. 前記インターフェース回路は、前記間隔を指定する情報を受信する、請求項5に記載のリアルタイムクロック回路。 6. The real-time clock circuit of claim 5, wherein the interface circuit receives information specifying the interval. 請求項1乃至6のいずれか一項に記載のリアルタイムクロック回路と、
前記振動子と、を備えた、リアルタイムクロックモジュール。
A real-time clock circuit according to any one of claims 1 to 6,
A real-time clock module comprising the vibrator.
請求項1乃至6のいずれか一項に記載のリアルタイムクロック回路と、
前記リアルタイムクロック回路と通信するホストデバイスと、を備えた、電子機器。
A real-time clock circuit according to any one of claims 1 to 6,
An electronic device, comprising: a host device communicating with the real-time clock circuit.
振動子を発振させて第1クロック信号を生成する発振回路と、前記第1クロック信号を分周して第2クロック信号を生成する第1分周回路と、前記第2クロック信号を分周して第3クロック信号を生成するとともに、前記第2クロック信号に基づいて1秒よりも短い時間の第1計時データを生成する第2分周回路と、前記第3クロック信号に基づいて1秒以上の時間の第2計時データを生成する計時回路と、を備えたリアルタイムクロック回路の補正方法であって、
前記リアルタイムクロック回路が、基準信号に同期した間隔での前記第1計時データの変化量に基づいて生成された補正データを用いて、前記間隔に相当する長さの期間において、前記第1分周回路に対して緩急処理を行う工程を備える、リアルタイムクロック回路の補正方法。
an oscillation circuit that oscillates a vibrator to generate a first clock signal; a first frequency divider circuit that divides the frequency of the first clock signal to generate a second clock signal; and a first frequency divider circuit that divides the frequency of the second clock signal. a second frequency dividing circuit that generates a third clock signal based on the second clock signal, and generates first time measurement data for a time shorter than one second based on the third clock signal; A method for correcting a real-time clock circuit, comprising: a clock circuit that generates second clock data for a time of
The real-time clock circuit performs the first frequency division in a period corresponding to the interval using correction data generated based on the amount of change in the first clock data at intervals synchronized with the reference signal. A method for correcting a real-time clock circuit, which includes a step of performing slow and fast processing on the circuit.
ホストデバイスが、前記リアルタイムクロック回路に前記基準信号を送信する工程と、
前記リアルタイムクロック回路が、前記基準信号の電圧レベルが遷移する所定のタイミング毎に前記第1計時データを保持する工程と、
前記リアルタイムクロック回路が、前記ホストデバイスに割込み信号を送信する工程と、
前記ホストデバイスが、前記割込み信号を受信し、前記間隔で保持された2つの前記第1計時データを読み出す工程と、
前記ホストデバイスが、読み出した2つの前記第1計時データに基づいて前記補正データを生成し、生成した前記補正データを前記リアルタイムクロック回路の記憶部に書き込む工程と、を含む、請求項9に記載のリアルタイムクロック回路の補正方法。
a host device transmitting the reference signal to the real-time clock circuit;
a step in which the real-time clock circuit holds the first time measurement data at each predetermined timing when the voltage level of the reference signal changes;
the real-time clock circuit transmitting an interrupt signal to the host device;
the host device receiving the interrupt signal and reading the two pieces of first time measurement data held at the interval;
The host device generates the correction data based on the two pieces of read first time measurement data, and writes the generated correction data into a storage section of the real-time clock circuit. How to correct real-time clock circuit.
ホストデバイスが、前記リアルタイムクロック回路に前記基準信号を送信する工程と、
前記リアルタイムクロック回路が、前記基準信号の電圧レベルが遷移する所定のタイミング毎に前記第1計時データを保持する工程と、
前記リアルタイムクロック回路が、前記間隔で保持された2つの前記第1計時データに基づいて前記補正データを生成する工程と、を含む、請求項9に記載のリアルタイムクロック回路の補正方法。
a host device transmitting the reference signal to the real-time clock circuit;
a step in which the real-time clock circuit holds the first time measurement data at each predetermined timing when the voltage level of the reference signal changes;
10. The method for correcting a real-time clock circuit according to claim 9, comprising the step of: generating the correction data based on the two pieces of first time measurement data held at the interval.
ホストデバイスが、前記間隔で前記リアルタイムクロック回路から2つの前記第1計時データを読み出す工程と、
前記ホストデバイスが、読み出した2つの前記第1計時データに基づいて前記補正データを生成し、生成した前記補正データを前記リアルタイムクロック回路の記憶部に書き込む工程と、を含む、請求項9に記載のリアルタイムクロック回路の補正方法。
a host device reading two pieces of the first time measurement data from the real-time clock circuit at the intervals;
The host device generates the correction data based on the two pieces of read first time measurement data, and writes the generated correction data into a storage section of the real-time clock circuit. How to correct real-time clock circuit.
JP2020094443A 2020-05-29 2020-05-29 Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method Active JP7392576B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020094443A JP7392576B2 (en) 2020-05-29 2020-05-29 Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020094443A JP7392576B2 (en) 2020-05-29 2020-05-29 Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method

Publications (2)

Publication Number Publication Date
JP2021189037A JP2021189037A (en) 2021-12-13
JP7392576B2 true JP7392576B2 (en) 2023-12-06

Family

ID=78848468

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020094443A Active JP7392576B2 (en) 2020-05-29 2020-05-29 Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method

Country Status (1)

Country Link
JP (1) JP7392576B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185128A (en) * 2023-03-06 2023-05-30 珠海极海半导体有限公司 MCU chip internal clock calibration method and circuit

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002228778A (en) 2001-01-31 2002-08-14 Seiko Epson Corp Real-time clock and clocking circuit
JP2004301753A (en) 2003-03-31 2004-10-28 Seiko Epson Corp Radio-controlled watch and control method therefor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002228778A (en) 2001-01-31 2002-08-14 Seiko Epson Corp Real-time clock and clocking circuit
JP2004301753A (en) 2003-03-31 2004-10-28 Seiko Epson Corp Radio-controlled watch and control method therefor

Also Published As

Publication number Publication date
JP2021189037A (en) 2021-12-13

Similar Documents

Publication Publication Date Title
US10725497B2 (en) Clocking device, electronic apparatus, and vehicle
US10135391B2 (en) Oscillation circuit, electronic apparatus, and moving object
US10379571B2 (en) Timing device, electronic apparatus, and moving object
CN113031428B (en) Real-time clock device and electronic apparatus
TW201349754A (en) Temperature information generation circuit, oscillator, electronic apparatus, temperature compensation system, and temperature compensation method of electronic component
US9503108B2 (en) Oscillation circuit, oscillator, electronic device, and moving object
US9389636B2 (en) Clock generating device, electronic apparatus, moving object, clock generating method
JP6115715B2 (en) CLOCK GENERATION DEVICE, ELECTRONIC DEVICE, MOBILE BODY, AND CLOCK GENERATION METHOD
US10128854B2 (en) Oscillation circuit, electronic apparatus, and moving object
JP7392576B2 (en) Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method
CN106557019B (en) Timing device and timing method and electronic equipment
CN111614322B (en) Real-time clock module, electronic device, and moving object
US11231743B2 (en) Timer, electronic apparatus, and vehicle
JP6958296B2 (en) Timekeeping devices, electronic devices and mobiles
JP6946773B2 (en) Real-time clock modules, electronic devices, mobiles and information processing systems
JP6540478B2 (en) Timekeeping device, electronic device, and moving body
JP2023161696A (en) Real-time clock module and electronic apparatus
JP5831853B2 (en) Temperature compensated oscillation circuit, real-time clock device and electronic equipment
JP2000284077A (en) Electronic apparatus and adjusting method for the electronic apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230404

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20231018

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20231024

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231106

R150 Certificate of patent or registration of utility model

Ref document number: 7392576

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150