JP2018205293A - Clocking device, electronic apparatus, and movable body - Google Patents

Clocking device, electronic apparatus, and movable body Download PDF

Info

Publication number
JP2018205293A
JP2018205293A JP2017228243A JP2017228243A JP2018205293A JP 2018205293 A JP2018205293 A JP 2018205293A JP 2017228243 A JP2017228243 A JP 2017228243A JP 2017228243 A JP2017228243 A JP 2017228243A JP 2018205293 A JP2018205293 A JP 2018205293A
Authority
JP
Japan
Prior art keywords
timing
data
time
circuit
counter
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.)
Granted
Application number
JP2017228243A
Other languages
Japanese (ja)
Other versions
JP6958296B2 (en
Inventor
正之 神山
Masayuki Kamiyama
正之 神山
俊也 臼田
Toshiya Usuda
俊也 臼田
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 CN201810567102.XA priority Critical patent/CN109001970B/en
Priority to US16/000,957 priority patent/US10725497B2/en
Publication of JP2018205293A publication Critical patent/JP2018205293A/en
Application granted granted Critical
Publication of JP6958296B2 publication Critical patent/JP6958296B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To provide a clocking device capable of more easily performing clocking correction than the prior art.SOLUTION: A clocking device comprises: a first clocking circuit synchronizing with a clock signal and generating first clocking data; a second clocking circuit generating second clocking data updated in a longer cycle than a cycle when the first clocking data is updated; an interface circuit transmitting the first clocking data to an external device and receiving a first correction value from the external device; and a storage circuit storing the first correction value. The first clocking circuit corrects update timing of the second clocking data by setting the first correction value to the first clocking data.SELECTED DRAWING: Figure 7

Description

本発明は、計時装置、電子機器及び移動体に関する。   The present invention relates to a timing device, an electronic device, and a moving object.

特許文献1には、スレーブをマスターに時刻同期させる時刻同期装置が開示されている。また、特許文献2には、マスターが有するマスタークロックの時刻に基づいてスレーブのスレーブクロックの時刻を補正するシステムが開示されている。   Patent Document 1 discloses a time synchronization apparatus that synchronizes the time of a slave with a master. Patent Document 2 discloses a system that corrects the slave clock time of a slave based on the master clock time of the master.

特許文献1に記載の装置や特許文献2に記載のシステムは、いずれもスレーブの時刻情報をマスターが有する時刻情報に同期させるものであるため、マスターへの電源供給が停止してその時刻情報が消失した場合、マスターが電源供給の再開後に時刻情報を取得するまではスレーブの時刻情報をマスターの時刻情報に同期させることができないという問題がある。この問題を解消するために、マスターの時刻情報と同期し、かつ、マスターへの電源供給が停止してもバックアップ電源で計時可能な計時装置(リアルタイムクロック装置)が用いられる場合がある。このような計時装置を用いた一般的なシステムでは、マスターがスレーブの時刻を1秒単位で設定し、計時装置における設定時刻の反映やカウントの開始タイミングは、マスターからのコマンドの送信タイミングに基づく場合が多い。   Since both the device described in Patent Document 1 and the system described in Patent Document 2 synchronize slave time information with time information held by the master, the power supply to the master stops and the time information is If it disappears, there is a problem that the time information of the slave cannot be synchronized with the time information of the master until the master acquires the time information after resuming the power supply. In order to solve this problem, there is a case in which a clocking device (real-time clock device) that synchronizes with the time information of the master and can count with a backup power supply even when power supply to the master is stopped may be used. In a general system using such a timing device, the master sets the slave time in units of one second, and the reflection of the set time and the count start timing in the timing device are based on the transmission timing of the command from the master. There are many cases.

特開2015−203667号公報Japanese Patent Laying-Open No. 2015-203667 特開平4−96115号公報JP-A-4-96115

ところで、微小な誤差を問題にするシステムにおいては、計時装置の計時精度を確保するために、マスターが計時装置への時刻設定を周期的に繰り返し行なう場合がある。これにより、計時装置の時刻が周期的に補正される。しかしながら、例えばこのようなシステムでは1Hz未満の分周回路のカウント初期値を絶対値で設定できないため、複雑な通信制御によるタイミング調整を行わなければ、最大で1秒の時刻の設定ずれが発生する可能性がある。さらに、計時装置から時刻を読み出しする際にも、通信時間等による時刻ずれが発生する可能性が考えられる。このような時刻のずれが発生する結果、計時装置による計時を正確に補正することが難しいという問題がある。   By the way, in a system in which a minute error is a problem, there is a case where the master periodically repeats the time setting to the time measuring device in order to ensure the time measuring accuracy of the time measuring device. Thereby, the time of the time measuring device is periodically corrected. However, for example, in such a system, the count initial value of the frequency divider circuit of less than 1 Hz cannot be set as an absolute value, and therefore, a time setting deviation of 1 second at maximum occurs unless timing adjustment is performed by complicated communication control. there is a possibility. Furthermore, when reading the time from the timing device, there is a possibility that a time lag due to communication time or the like may occur. As a result of such time lag, there is a problem that it is difficult to accurately correct the time measured by the time measuring device.

本発明のいくつかの態様によれば、従来よりも簡単に計時補正が可能な計時装置を提供することができる。また、本発明のいくつかの態様によれば、当該計時装置を用いた電子機器及び移動体を提供することができる。   According to some aspects of the present invention, it is possible to provide a time measuring device capable of performing time correction more easily than in the past. In addition, according to some aspects of the present invention, it is possible to provide an electronic apparatus and a moving body using the time measuring device.

本発明は前述の課題の少なくとも一部を解決するためになされたものであり、以下の態様または適用例として実現することが可能である。   SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following aspects or application examples.

[適用例1]
本適用例に係る計時装置は、クロック信号に同期して第1の計時データを生成する第1の計時回路と、前記第1の計時データが更新される周期よりも長い周期で更新される第2の計時データを生成する第2の計時回路と、前記第1の計時データを外部装置に送信し、第1の補正値を前記外部装置から受信するインターフェース回路と、前記第1の補正値を
記憶する記憶回路と、を備え、前記第1の計時回路は、前記第1の計時データに前記第1の補正値を設定することで、前記第2の計時データの更新タイミングを補正する。
[Application Example 1]
The timing device according to this application example includes a first timing circuit that generates first timing data in synchronization with a clock signal, and a first timing circuit that is updated at a cycle longer than a cycle at which the first timing data is updated. A second timing circuit that generates two timing data, an interface circuit that transmits the first timing data to an external device and receives a first correction value from the external device, and the first correction value. And a storage circuit for storing, wherein the first timing circuit corrects the update timing of the second timing data by setting the first correction value to the first timing data.

本適用例に係る計時装置は、前記クロック信号を出力する発振回路をさらに備えてもよい。また、前記第2の計時回路は、前記クロック信号に基づいて、前記第1の計時データが更新される周期よりも長い周期で更新される前記第2の計時データを生成してもよい。ここで、「前記クロック信号に基づいて、前記第1の計時データが更新される周期よりも長い周期で更新される前記第2の計時データを生成する」とは、クロック信号の各パルスの立ち上がり又は立ち下がりのタイミングで第2の計時データが更新される場合のみならず、クロック信号の少なくとも一部のパルスの立ち上がり又は立ち下がりのタイミングで生成される信号(例えば、第1の計時回路からの桁上げ信号)によって第2の計時データが更新される場合も含まれる。   The timing device according to this application example may further include an oscillation circuit that outputs the clock signal. The second timing circuit may generate the second timing data that is updated at a longer period than the period at which the first timing data is updated based on the clock signal. Here, “based on the clock signal, the second timing data that is updated at a period longer than the period at which the first timing data is updated” is generated by the rising edge of each pulse of the clock signal. In addition to the case where the second timing data is updated at the falling timing, a signal generated at the rising or falling timing of at least some of the pulses of the clock signal (for example, from the first timing circuit) The case where the second time measurement data is updated by a carry signal) is also included.

本適用例によれば、外部装置は、計時装置がインターフェース回路を介して送信する第1の計時データによって計時のずれを認識し、ずれを無くすための第1の補正値を計時装置に送信することができる。そして、計時装置は、インターフェース回路を介して第1の補正値を受信して記憶回路に記憶させ、記憶回路に記憶されている第1の補正値が第1の計時データに設定されることで、第2の計時データの更新タイミングが補正される。すなわち、本適用例に係る計時装置によれば、通信遅延も含めた計時のずれが第1の補正値によって補正されるので、従来よりも簡単に計時補正を行うことが可能である。   According to this application example, the external device recognizes a time shift based on the first time data transmitted from the time measuring device via the interface circuit, and transmits a first correction value for eliminating the time shift to the time measuring device. be able to. Then, the timing device receives the first correction value via the interface circuit, stores the first correction value in the storage circuit, and the first correction value stored in the storage circuit is set as the first timing data. The update timing of the second timing data is corrected. That is, according to the time measuring device according to this application example, the time lag including the communication delay is corrected by the first correction value, so that it is possible to perform time correction more easily than in the past.

[適用例2]
上記適用例に係る計時装置において、前記第1の計時回路は、前記第1の計時データが所定値のときに前記第1の計時データに前記第1の補正値を設定することで、前記更新タイミングを補正してもよい。
[Application Example 2]
In the timing device according to the application example, the first timing circuit sets the first correction value to the first timing data when the first timing data is a predetermined value, so that the update is performed. The timing may be corrected.

本適用例に係る計時装置によれば、固定されたタイミングで、第1の計時データに第1の補正値が設定されるので、外部装置は、第2の計時データの更新タイミングの補正が精度よく行われるための第1の補正値を送信することができる。   According to the timing device according to this application example, since the first correction value is set in the first timing data at a fixed timing, the external device can accurately correct the update timing of the second timing data. The first correction value to be often performed can be transmitted.

[適用例3]
上記適用例に係る計時装置において、前記第1の補正値は、前記第1の計時データと前記外部装置が有する計時データとに基づいて前記外部装置によって生成された値であってもよい。
[Application Example 3]
In the timing device according to the application example, the first correction value may be a value generated by the external device based on the first timing data and the timing data included in the external device.

本適用例によれば、外部装置は、計時装置がインターフェース回路を介して送信する第1の計時データと基準となる計時データとによって計時のずれを認識し、ずれを無くすための正確な第1の補正値を計時装置に送信することができる。従って、本適用例に係る計時装置によれば、通信遅延も含めた計時のずれを第1の補正値によって正確に補正可能である。   According to this application example, the external device recognizes a time shift based on the first time measurement data transmitted from the time measuring device via the interface circuit and the reference time measurement data, and an accurate first for eliminating the time shift. The correction value can be transmitted to the timing device. Therefore, according to the timing device according to this application example, it is possible to accurately correct the time lag including the communication delay with the first correction value.

[適用例4]
上記適用例に係る計時装置において、前記第1の計時回路は、1/1000秒単位で前記第1の計時データを更新し、前記第2の計時回路は、1秒単位で前記第2の計時データを更新してもよい。
[Application Example 4]
In the timing device according to the application example, the first timing circuit updates the first timing data in units of 1/1000 second, and the second timing circuit updates the second timing in units of 1 second. Data may be updated.

本適用例に係る計時装置によれば、通信遅延も含めた計時のずれを1/1000秒単位で精度良く補正可能である。   According to the timing device according to this application example, it is possible to accurately correct a time lag including a communication delay in units of 1/1000 seconds.

[適用例5]
上記適用例に係る計時装置において、前記クロック信号の周波数は4096Hzであり、前記第1の計時回路は、4対96の比率で40と41とを選択して前記クロック信号のパルスの数を6ビットでカウントするカウンターを有し、前記第1の計時データの一部として、前記カウンターが出力する6ビットのカウント値の上位4ビットのカウント値を出力してもよい。
[Application Example 5]
In the timing device according to the application example described above, the frequency of the clock signal is 4096 Hz, and the first timing circuit selects 40 and 41 at a ratio of 4 to 96 and sets the number of pulses of the clock signal to 6 A counter that counts in bits may be included, and a count value of the upper 4 bits of the 6-bit count value output by the counter may be output as part of the first time measurement data.

本適用例に係る計時装置によれば、下位計時部は、カウンターがカウントする6ビットのカウント値「000000」〜「100111」の上位4ビットのカウント値「0000」〜「1001」により、簡単な回路構成によって消費電流も殆ど増加させずに、1/1000秒単位の時刻として十進数の「0」〜「9」を表す計時データを出力することができる。   According to the timing device according to this application example, the low-order time measuring unit can easily calculate the high-order 4-bit count values “0000” to “1001” of the 6-bit count values “000000” to “100111” counted by the counter. With the circuit configuration, it is possible to output time measurement data representing decimal numbers “0” to “9” as 1/1000 second time without increasing current consumption.

[適用例6]
上記適用例に係る計時装置において、前記記憶回路は、第2の補正値と、補正周期とをさらに記憶し、前記第1の計時回路は、前記補正周期で、前記第1の計時データに前記第2の補正値を設定することで、前記更新タイミングを補正してもよい。
[Application Example 6]
In the timing device according to the application example, the storage circuit further stores a second correction value and a correction cycle, and the first timing circuit adds the first timing data to the first timing data in the correction cycle. The update timing may be corrected by setting a second correction value.

本適用例に係る計時装置によれば、記憶回路に記憶されている補正周期で、記憶回路に記憶されている第2の補正値が第1の計時データに設定されることで、第2の計時データの更新タイミングが補正される。従って、本適用例に係る計時装置によれば、例えば、第1の補正値による第2の計時データの更新タイミングの補正が長期間行われないような状況であっても、経年変化等によって生じる計時のずれを補正することが可能である。   According to the timing device according to this application example, the second correction value stored in the storage circuit is set to the first timing data in the correction cycle stored in the storage circuit, so that the second The timing for updating the timing data is corrected. Therefore, according to the timing device according to this application example, for example, even when the correction of the update timing of the second timing data by the first correction value is not performed for a long time, it occurs due to secular change or the like. It is possible to correct the time difference.

[適用例7]
本適用例に係る電子機器は、上記のいずれかの計時装置と、前記外部装置として、前記計時装置に前記第1の補正値を送信する制御装置と、を備えている。
[Application Example 7]
An electronic apparatus according to this application example includes any one of the above timing devices and a control device that transmits the first correction value to the timing device as the external device.

本適用例に係る電子機器によれば、通信遅延も含めた計時装置の計時のずれが、制御装置が送信する第1の補正値によって補正されるので、従来よりも簡単に計時装置の計時補正を行うことが可能である。従って、例えば、従来よりも信頼性の電子機器をより低コストで実現することも可能である。   According to the electronic apparatus according to this application example, since the time lag of the time measuring device including the communication delay is corrected by the first correction value transmitted by the control device, the time correction of the time measuring device is easier than before. Can be done. Therefore, for example, it is possible to realize a more reliable electronic device at a lower cost than in the past.

[適用例8]
本適用例に係る移動体は、上記のいずれかの計時装置を備えている。
[Application Example 8]
The moving body according to this application example includes any one of the above timing devices.

本適用例に係る移動体によれば、従来よりも簡単に計時装置の計時補正を行うことが可能である。従って、例えば、従来よりも信頼性の高い移動体をより低コストで実現することも可能である。   According to the moving body according to this application example, it is possible to perform time correction of the time measuring device more easily than in the past. Therefore, for example, it is possible to realize a moving body having higher reliability than the conventional one at a lower cost.

第1実施形態の計時装置の機能ブロック及び処理システムの構成例を示す図。The figure which shows the functional block of the timing device of 1st Embodiment, and the structural example of a processing system. 発振回路の構成例を示す図。The figure which shows the structural example of an oscillation circuit. 分周回路の構成例を示す回路図。The circuit diagram which shows the structural example of a frequency divider. 上位計時部の構成例を示す図。The figure which shows the structural example of a high-order time measuring part. 第1実施形態における下位計時部の構成例を示す図。The figure which shows the structural example of the low-order time measuring part in 1st Embodiment. 秒更新前後のタイミングチャートの一例を示す図。The figure which shows an example of the timing chart before and behind a second update. 秒更新前後のタイミングチャートの他の一例を示す図。The figure which shows another example of the timing chart before and behind the second update. 秒更新前後のタイミングチャートの他の一例を示す図。The figure which shows another example of the timing chart before and behind the second update. マスター制御装置による計時補正のための処理の手順の一例を示すフローチャート図。The flowchart figure which shows an example of the procedure of the process for the time correction by a master control apparatus. 第1実施形態の計時装置による計時補正のための処理の手順の一例を示すフローチャート図。The flowchart figure which shows an example of the procedure of the process for the time correction by the time measuring device of 1st Embodiment. 第2実施形態の計時装置の機能ブロック及び処理システムの構成例を示す図。The figure which shows the functional block of the timing device of 2nd Embodiment, and the structural example of a processing system. 第2実施形態における下位計時部の構成例を示す図。The figure which shows the structural example of the low-order time measuring part in 2nd Embodiment. 第2実施形態の計時装置による計時補正のための処理の手順の一例を示すフローチャート図。The flowchart figure which shows an example of the procedure of the process for the time correction by the time measuring device of 2nd Embodiment. 変形例1の計時装置の構成例を示す図。The figure which shows the structural example of the time measuring device of the modification 1. 本実施形態の電子機器の構成の一例を示す機能ブロック図。FIG. 3 is a functional block diagram illustrating an example of a configuration of an electronic apparatus according to the embodiment. 本実施形態の電子機器の外観の一例を示す図。1 is a diagram illustrating an example of an appearance of an electronic apparatus according to an embodiment. 本実施形態の移動体の構成の一例を示す機能ブロック図。The functional block diagram which shows an example of a structure of the mobile body of this embodiment. 本実施形態の移動体の外観の一例を示す図。The figure which shows an example of the external appearance of the mobile body of this embodiment.

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

1.計時装置(リアルタイムクロック装置)
1−1.第1実施形態
[計時装置の構成及び動作]
図1は、第1実施形態の計時装置(リアルタイムクロック装置)1の機能ブロック及び計時装置1を用いた処理システムの構成例を示す図である。図1に示すように、当該処理システムは、計時装置1、マスター制御装置2、複数のスレーブ装置3、メイン電源4及びバックアップ電源5を含んで構成されている。
1. Timekeeping device (real-time clock device)
1-1. First Embodiment [Configuration and Operation of Timekeeping Device]
FIG. 1 is a diagram illustrating a configuration example of a functional block of a timing device (real-time clock device) 1 according to the first embodiment and a processing system using the timing device 1. As shown in FIG. 1, the processing system includes a timing device 1, a master control device 2, a plurality of slave devices 3, a main power supply 4, and a backup power supply 5.

マスター制御装置2は、極めて正確な時刻情報であり、基準となるマスター計時データ200を有しており、各スレーブ装置3からの要求に応じて、あるいは定期的に各スレーブ装置3に配信する。各スレーブ装置3は、自己の内部時刻をマスター計時データ200に合わせて各種の処理を行う。マスター計時データ200は、例えば、マスター制御装置2がGPS(Global Positioning System)あるいはネットワークから取得した時刻情報であり、その計時誤差は、例えば10−6秒以下である。マスター計時データ200は、必要なタイミングで、あるいは定期的に更新される。 The master control device 2 is extremely accurate time information, has master timing data 200 as a reference, and distributes it to each slave device 3 in response to a request from each slave device 3 or periodically. Each slave device 3 performs various processes according to its own internal time in accordance with the master timing data 200. The master timing data 200 is, for example, time information acquired from the GPS (Global Positioning System) or the network by the master control device 2, and the timing error is, for example, 10 −6 seconds or less. The master timing data 200 is updated at a necessary timing or periodically.

マスター制御装置2及び各スレーブ装置3は、メイン電源4から電力が供給されて動作し、メイン電源4からの電力供給が遮断されると動作を停止する。これに対して、計時装置1は、通常はメイン電源4から電力が供給されて計時動作を行うが、メイン電源4からの電力供給が遮断されると、直ちに、バックアップ電源5から供給される電力による計時動作に切り替わる。すなわち、計時装置1は、メイン電源4からの電力供給が遮断されている間も計時動作を継続する。   The master control device 2 and each slave device 3 operate with power supplied from the main power supply 4 and stop operating when power supply from the main power supply 4 is interrupted. On the other hand, the timing device 1 normally performs the timing operation by being supplied with power from the main power supply 4, but immediately after the power supply from the main power supply 4 is cut off, the power supplied from the backup power supply 5. Switches to the timing operation by. That is, the timing device 1 continues the timing operation while the power supply from the main power supply 4 is interrupted.

そして、メイン電源4からの電力供給が再開すると、マスター制御装置2は、マスター計時データ200の更新を試みるが、更新に長い時間(例えば、数分から数十分)を要する場合もある。そこで、マスター制御装置2は、メイン電源4からの電力供給が再開すると、計時装置1から計時データを読み出してマスター計時データ200として代用する。本実施形態では、マスター制御装置2は、計時装置1から年、月、日、時、分、秒、ミリ秒の情報を含む計時データを読み出し、GPSあるいはネットワークから正確な計時データを取得できるまで、計時装置1から読み出した計時データをマスター計時データ200とする。この場合、計時装置1からの計時データには、例えば誤差が1か月当たり13秒
程度(基準周波数からの偏差に換算した場合±5ppm程度)以内となる程度の正確さが求められる。
When the power supply from the main power supply 4 is resumed, the master control device 2 tries to update the master timing data 200, but the update may take a long time (for example, several minutes to several tens of minutes). Therefore, when the power supply from the main power supply 4 is resumed, the master control device 2 reads the timing data from the timing device 1 and substitutes it as the master timing data 200. In the present embodiment, the master control device 2 reads time data including year, month, day, hour, minute, second, and millisecond information from the time measuring device 1 until it can acquire accurate time data from the GPS or the network. The timing data read from the timing device 1 is set as master timing data 200. In this case, the timing data from the timing device 1 is required to be accurate to an extent that the error is within about 13 seconds per month (about ± 5 ppm when converted to a deviation from the reference frequency), for example.

図1に示すように、計時装置1は、発振回路10、分周回路20、分周回路30、調停回路40、下位計時部50、調停回路60、上位計時部70、インターフェース回路80、記憶回路(記憶部)90及び電源切替回路100を含んで構成されている。ただし、計時装置1は、これらの要素の一部を省略又は変更し、あるいは他の要素を追加した構成としてもよい。この計時装置1は、クロック信号に同期して計時動作を行うことにより計時データを生成するリアルタイムクロック(RTC)の機能を有している。   As shown in FIG. 1, the timing device 1 includes an oscillation circuit 10, a frequency dividing circuit 20, a frequency dividing circuit 30, an arbitration circuit 40, a lower timing unit 50, an arbitration circuit 60, an upper timing unit 70, an interface circuit 80, and a storage circuit. (Storage unit) 90 and a power supply switching circuit 100 are included. However, the timing device 1 may have a configuration in which some of these elements are omitted or changed, or other elements are added. The time measuring device 1 has a function of a real time clock (RTC) that generates time measuring data by performing a time measuring operation in synchronization with a clock signal.

発振回路10は、発振動作を行うことにより、2のべき乗の周波数、例えば、32768Hz(=215Hz)の周波数を有するクロック信号CLK0を生成する。 The oscillation circuit 10 performs an oscillation operation to generate a clock signal CLK0 having a power of 2 frequency, for example, 32768 Hz (= 2 15 Hz).

図2は、発振回路10の構成例を示す図である。図2に示すように、発振回路10は、振動子11、インバーター(論理反転素子)12、抵抗13、キャパシター14、キャパシター群15、スイッチ回路16及びデコード回路17を含んで構成されている。   FIG. 2 is a diagram illustrating a configuration example of the oscillation circuit 10. As shown in FIG. 2, the oscillation circuit 10 includes a vibrator 11, an inverter (logic inversion element) 12, a resistor 13, a capacitor 14, a capacitor group 15, a switch circuit 16, and a decode circuit 17.

インバーター12は、入力端子が振動子11の一端と接続され、出力端子が振動子11の他端と接続されている。抵抗13は、一端がインバーター12の入力端子と接続され、他端がインバーター12の出力端子と接続されている。キャパシター14は、一端が抵抗13の他端と接続され、他端が接地されている。   The inverter 12 has an input terminal connected to one end of the vibrator 11 and an output terminal connected to the other end of the vibrator 11. The resistor 13 has one end connected to the input terminal of the inverter 12 and the other end connected to the output terminal of the inverter 12. The capacitor 14 has one end connected to the other end of the resistor 13 and the other end grounded.

キャパシター群15は、複数のキャパシターで構成され、当該複数のキャパシターの各々は、一端がインバーター12の入力端子と接続され、他端がスイッチ回路16を介して接地され、あるいはオープン(ハイインピーダンス)となる。スイッチ回路16は、デコード回路17が出力する制御信号に従って、キャパシター群15に含まれる各キャパシターの他端を接地又はオープン(ハイインピーダンス)にする。デコード回路17は、例えば、記憶回路90(図1参照)に記憶されているデータ(容量選択データ)をデコードし、スイッチ回路16の制御信号を出力する。   The capacitor group 15 includes a plurality of capacitors, and each of the plurality of capacitors has one end connected to the input terminal of the inverter 12 and the other end grounded via the switch circuit 16 or open (high impedance). Become. The switch circuit 16 makes the other end of each capacitor included in the capacitor group 15 ground or open (high impedance) in accordance with a control signal output from the decode circuit 17. For example, the decode circuit 17 decodes data (capacity selection data) stored in the storage circuit 90 (see FIG. 1) and outputs a control signal for the switch circuit 16.

このように構成されている発振回路10では、インバーター12が、振動子11の出力信号を反転増幅し、反転増幅した信号を振動子11にフィードバックする。これにより、振動子11が固有の共振周波数あるいはこれに近い周波数で発振し、インバーター12の出力信号(振動子11の出力信号を反転増幅した信号)は、クロック信号CLK0として発振回路10から出力される。キャパシター群15の合成容量値を変えることで発振回路10の発振周波数の微調整が可能であるため、例えば、計時装置1の検査工程において、所望の発振周波数が得られる容量選択データが決定されて、記憶回路90が有する不揮発性メモリー(不図示)に書き込まれる。   In the oscillation circuit 10 configured as described above, the inverter 12 inverts and amplifies the output signal of the vibrator 11 and feeds back the inverted and amplified signal to the vibrator 11. As a result, the vibrator 11 oscillates at a natural resonance frequency or a frequency close thereto, and the output signal of the inverter 12 (a signal obtained by inverting and amplifying the output signal of the vibrator 11) is output from the oscillation circuit 10 as the clock signal CLK0. The Since it is possible to finely adjust the oscillation frequency of the oscillation circuit 10 by changing the combined capacitance value of the capacitor group 15, for example, in the inspection process of the time measuring device 1, the capacitance selection data for obtaining a desired oscillation frequency is determined. The data is written in a nonvolatile memory (not shown) included in the memory circuit 90.

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

図1に戻り、発振回路10から出力されるクロック信号CLK0は、分周回路20に供給される。ただし、計時装置1は、発振回路10を省略して、外部から分周回路20にクロック信号CLK0が供給されるようにしても良い。分周回路20は、クロック信号CL
K0を分周することにより、4096Hz(=212Hz)の周波数を有するクロック信号CLK1を生成する。
Returning to FIG. 1, the clock signal CLK <b> 0 output from the oscillation circuit 10 is supplied to the frequency dividing circuit 20. However, the timing device 1 may omit the oscillation circuit 10 and supply the clock signal CLK0 to the frequency dividing circuit 20 from the outside. The frequency dividing circuit 20 generates a clock signal CL.
By dividing K0, a clock signal CLK1 having a frequency of 4096 Hz (= 2 12 Hz) is generated.

図3は、分周回路20の構成例を示す回路図である。図3に示すように、分周回路20は、例えば、T(トグル)型フリップフロップ21〜23を直列に接続して構成される。T型フリップフロップ21〜23の各々は、入力端子Tに入力される信号が1周期変化する毎に出力信号を反転することにより、入力端子Tに入力される信号を2分周する。これにより、分周回路20は、例えば、32768Hz(=215Hz)の周波数を有するクロック信号CLK0を8(=2)分周して、4096Hz(=212Hz)の周波数を有するクロック信号CLK1を生成する。なお、図3には、クロック信号CLK0が32768Hz(=215Hz)の場合の分周回路20の構成例が示されているが、クロック信号CLK0が2Hz(Nは13以上の整数)であれば、N−12個のT型フリップフロップが直列に接続された構成にすればよい。 FIG. 3 is a circuit diagram illustrating a configuration example of the frequency dividing circuit 20. As shown in FIG. 3, the frequency dividing circuit 20 is configured by connecting, for example, T (toggle) type flip-flops 21 to 23 in series. Each of the T-type flip-flops 21 to 23 divides the signal input to the input terminal T by 2 by inverting the output signal every time the signal input to the input terminal T changes by one cycle. Accordingly, the frequency dividing circuit 20 divides the clock signal CLK0 having a frequency of 32768 Hz (= 2 15 Hz), for example, by 8 (= 2 3 ), and has a frequency of 4096 Hz (= 2 12 Hz). Generate CLK1. FIG. 3 shows a configuration example of the frequency dividing circuit 20 when the clock signal CLK0 is 32768 Hz (= 2 15 Hz). The clock signal CLK0 is 2 N Hz (N is an integer of 13 or more). If so, a configuration in which N-12 T-type flip-flops are connected in series may be used.

図1に戻り、クロック信号CLK1は、分周回路30に供給されると共に、調停回路40を介して下位計時部50に供給される。分周回路30は、クロック信号CLK1を分周することにより、任意の周波数を有するクロック信号CLK2を生成する。分周回路30は、分周回路20(図3)と同様、分周比に対応した個数のT型フリップフロップによって構成されてもよい。クロック信号CLK2は、計時装置1の内部の各種の回路に供給されてもよいし、計時装置1の外部に出力されて各種の装置に供給されてもよい。   Returning to FIG. 1, the clock signal CLK <b> 1 is supplied to the frequency dividing circuit 30 and is also supplied to the lower timer unit 50 through the arbitration circuit 40. The frequency dividing circuit 30 divides the clock signal CLK1 to generate a clock signal CLK2 having an arbitrary frequency. Similarly to the frequency divider circuit 20 (FIG. 3), the frequency divider circuit 30 may be configured by a number of T-type flip-flops corresponding to the frequency division ratio. The clock signal CLK2 may be supplied to various circuits inside the timing device 1, or may be output to the outside of the timing device 1 and supplied to various devices.

下位計時部50(「第1の計時回路」の一例)は、クロック信号CLK1に同期して計時動作を行うことにより、計時データT1,T0(「第1の計時データ」の一例)を生成する。計時データT1は1/100秒単位の時刻を表す計時データであり、計時データT0は1/1000秒単位の時刻を表す計時データである。すなわち、下位計時部50は、1/1000秒単位で計時データT1,T0を更新する。また、下位計時部50は、クロック信号CLK1に基づいて、1Hzの周波数を有するクロック信号CLK3を生成する。クロック信号CLK3は調停回路40を介して上位計時部70に供給される。さらに、下位計時部50は、上位計時部70の計時動作を停止させるカウントディスエーブル信号CNTDISを生成する。   The lower timing unit 50 (an example of “first timing circuit”) generates timing data T1 and T0 (an example of “first timing data”) by performing a timing operation in synchronization with the clock signal CLK1. . The time data T1 is time data representing time in units of 1/100 seconds, and the time data T0 is time data representing time in units of 1/1000 seconds. That is, the lower timing unit 50 updates the timing data T1 and T0 in units of 1/1000 second. Further, the lower timing unit 50 generates a clock signal CLK3 having a frequency of 1 Hz based on the clock signal CLK1. The clock signal CLK3 is supplied to the upper timer unit 70 via the arbitration circuit 40. Further, the lower timing unit 50 generates a count disable signal CNTDIS that stops the timing operation of the upper timing unit 70.

上位計時部70は、クロック信号CLK1に基づいて生成されたクロック信号CLK3に同期して計時動作を行うことにより、計時データT1,T0が更新される周期よりも長い周期で更新される計時データ、例えば、秒単位の時刻を表す計時データT2〜年単位の時刻を表す計時データT8を生成する。   The upper timer unit 70 performs timing operation in synchronization with the clock signal CLK3 generated on the basis of the clock signal CLK1, thereby measuring time data updated in a longer cycle than the cycle in which the time data T1 and T0 are updated. For example, the time data T8 representing the time in seconds and the time data T8 representing the time in years are generated.

インターフェース回路80は、計時装置1とマスター制御装置2との間の通信のインターフェース回路であり、マスター制御装置2から各種のコマンドを受信し、受信したコマンドに従って、記憶回路90に対する各種のデータの書き込みや読み出し、各種の制御信号の生成、下位計時部50及び上位計時部70からの計時データの読み出し等を行う。インターフェース回路80は、例えば、SPI(Serial Peripheral Interface)やIC(Inter-Integrated Circuit)などの各種のシリアルバス対応のインターフェース回路であってもよいし、パラレルバス対応のインターフェース回路であってもよい。 The interface circuit 80 is an interface circuit for communication between the timing device 1 and the master control device 2, receives various commands from the master control device 2, and writes various data to the storage circuit 90 in accordance with the received commands. And reading, generation of various control signals, reading of timing data from the lower timing unit 50 and the upper timing unit 70, and the like. The interface circuit 80 may be an interface circuit compatible with various serial buses such as SPI (Serial Peripheral Interface) and I 2 C (Inter-Integrated Circuit), or may be an interface circuit compatible with a parallel bus. Good.

本実施形態では、インターフェース回路80は、アドレスが指定された計時データ読み出しコマンドを受信すると、受信したコマンドにおいて指定されたアドレスに従い、リードイネーブル信号E0〜E8の1つをアクティブ(例えば、ハイレベル)にする。下位計時部50は、リードイネーブル信号E0がアクティブになると、インターフェース回路80に計時データT0を出力し、リードイネーブル信号E1がアクティブになると、インターフェース回路80に計時データT1を出力する。同様に、上位計時部70は、リードイ
ネーブル信号E2〜E8がそれぞれアクティブになると、インターフェース回路80に計時データT2〜T8をそれぞれ出力する。そして、インターフェース回路80は、下位計時部50又は上位計時部70から出力された計時データT0〜T8のいずれかをマスター制御装置2(「外部装置」の一例)に送信する。なお、インターフェース回路80は、計時データ読み出しコマンドを受信すると、リードイネーブル信号E0〜E8を順次アクティブにし、計時データT0〜T8を順次取得し、連続してマスター制御装置2に送信してもよい。
In the present embodiment, when the interface circuit 80 receives a timing data read command with an address specified, the interface circuit 80 activates one of the read enable signals E0 to E8 (for example, high level) according to the address specified in the received command. To. When the read enable signal E0 becomes active, the lower timing unit 50 outputs the timing data T0 to the interface circuit 80, and outputs the timing data T1 to the interface circuit 80 when the read enable signal E1 becomes active. Similarly, when the read enable signals E <b> 2 to E <b> 8 are activated, the upper timer unit 70 outputs time measurement data T <b> 2 to T <b> 8 to the interface circuit 80, respectively. Then, the interface circuit 80 transmits any of the timing data T0 to T8 output from the lower timing unit 50 or the upper timing unit 70 to the master control device 2 (an example of “external device”). Note that when receiving the time data read command, the interface circuit 80 may sequentially activate the read enable signals E0 to E8, sequentially acquire the time data T0 to T8, and continuously transmit them to the master controller 2.

また、本実施形態では、インターフェース回路80は、下位計時部50による計時に用いられる−999ミリ秒〜+999ミリ秒の範囲における1/1000秒単位のオフセットデータが指定されたオフセット設定コマンドを受信すると、受信したコマンドにおいて指定されたオフセットデータを記憶回路90が有するオフセットレジスター91に書き込むと共に、フラグセット信号FSをアクティブ(例えば、ハイレベル)にして下位計時部50に出力する。オフセットレジスター91が保持するオフセットデータOFSは、下位計時部50に供給され、下位計時部50が出力するクリア信号CLR1がアクティブになるとゼロにクリアされる。   In the present embodiment, the interface circuit 80 receives an offset setting command in which offset data in units of 1/1000 second in a range of −999 milliseconds to +999 milliseconds used for time measurement by the lower time measuring unit 50 is specified. The offset data specified in the received command is written in the offset register 91 of the storage circuit 90, and the flag set signal FS is activated (for example, high level) and output to the lower time measuring unit 50. The offset data OFS held in the offset register 91 is supplied to the lower timer unit 50 and cleared to zero when the clear signal CLR1 output from the lower timer unit 50 becomes active.

記憶回路90は、例えば、オフセットレジスター91を含むレジスター群と、容量選択データ等の制御用の各種データを記憶する不揮発性メモリーとを含んで構成される。不揮発性メモリーに記憶されている各データは、計時装置1の起動時に、不揮発性メモリーから各レジスターに転送されて保持され、各レジスターに保持されたデータに従って、計時装置1の各部が制御される。不揮発性メモリーは、例えば、EEPROM(Electrically
Erasable Programmable Read-Only Memory)やフラッシュメモリーなどの書き換え可能な種々の不揮発性メモリーであってもよいし、ワンタイムPROM(One Time Programmable Read Only Memory)のような書き換え不可能な種々の不揮発性メモリーであってもよい。
The storage circuit 90 includes, for example, a register group including an offset register 91 and a nonvolatile memory that stores various control data such as capacity selection data. Each data stored in the nonvolatile memory is transferred from the nonvolatile memory to each register and held when the timing device 1 is started, and each part of the timing device 1 is controlled according to the data held in each register. . Non-volatile memory is, for example, EEPROM (Electrically
Various rewritable nonvolatile memories such as Erasable Programmable Read-Only Memory (Erasable Programmable Read-Only Memory) and flash memory, and various non-rewritable nonvolatile memories such as One Time Programmable Read Only Memory (PROM) It may be.

調停回路40は、下位計時部50又は上位計時部70から計時データが読み出されている間に計時データが変化しないように、計時データが読み出されている期間においてクロック信号CLK1に含まれているパルスを遅延させる。それ以外の期間において、調停回路40は、分周回路20から供給されるクロック信号CLK1をそのまま出力する。同様に、調停回路60は、上位計時部70から計時データが読み出されている間に計時データが変化しないように、計時データが読み出されている期間においてクロック信号CLK3に含まれているパルスを遅延させる。それ以外の期間において、調停回路60は、下位計時部50から供給されるクロック信号CLK3をそのまま出力する。なお、インターフェース回路80が、必ず、計時データT0〜T8を連続してマスター制御装置2に送信するのであれば、その間、調停回路40がクロック信号CLK1に含まれているパルスを遅延させることにより、調停回路60は不要となる。   The arbitration circuit 40 is included in the clock signal CLK1 during a period in which the timing data is read so that the timing data does not change while the timing data is being read from the lower timing unit 50 or the upper timing unit 70. Delay the pulse. In other periods, the arbitration circuit 40 outputs the clock signal CLK1 supplied from the frequency dividing circuit 20 as it is. Similarly, the arbitration circuit 60 uses a pulse included in the clock signal CLK3 during a period in which the time data is being read so that the time data does not change while the time data is being read from the higher-order time unit 70. Delay. In other periods, the arbitration circuit 60 outputs the clock signal CLK3 supplied from the lower timing unit 50 as it is. If the interface circuit 80 always transmits the timing data T0 to T8 continuously to the master control device 2, the arbitration circuit 40 delays the pulse included in the clock signal CLK1 during that period. The arbitration circuit 60 is not necessary.

電源切替回路100は、計時装置1の各部の電源電圧(動作電圧)として、メイン電源4から所定の電圧値以上の電源電圧VAが供給されている時は電源電圧VAを出力し、メイン電源4からの電源電圧VAが所定の電圧値未満になると、バックアップ電源5から出力される電源電圧VBを出力するように切り替える。すなわち、計時装置1は、電源切替回路100により、メイン電源4から所望の電源電圧VAが供給されない状態でもバックアップ電源5から供給される電源電圧VBによって計時動作を継続することができる。   The power supply switching circuit 100 outputs the power supply voltage VA as the power supply voltage (operating voltage) of each part of the time measuring device 1 when the main power supply 4 is supplied with a power supply voltage VA equal to or higher than a predetermined voltage value. Is switched to output the power supply voltage VB output from the backup power supply 5. In other words, the timing device 1 can continue the timing operation by the power supply switching circuit 100 using the power supply voltage VB supplied from the backup power supply 5 even when the desired power supply voltage VA is not supplied from the main power supply 4.

[上位計時部の構成及び動作]
図4は、上位計時部70の構成例を示す図である。図4に示すように、上位計時部70は、カウンター71a〜74a、シフトレジスター75a、カウンター76a,77a及び出力制御回路71b〜77bを含んで構成されている。出力制御回路71b〜77bの
各々は、例えば、複数のトランスミッションゲート等で構成される。
[Configuration and operation of the upper timing unit]
FIG. 4 is a diagram illustrating a configuration example of the upper timer unit 70. As shown in FIG. 4, the upper timer unit 70 includes counters 71a to 74a, a shift register 75a, counters 76a and 77a, and output control circuits 71b to 77b. Each of the output control circuits 71b to 77b includes, for example, a plurality of transmission gates.

カウンター71a(「第2の計時回路」の一例)は、クロック信号CLK3に同期してカウント動作を行うことにより、秒単位の時刻を表すカウント値を生成する。例えば、カウンター71aは、60進BCD(バイナリー・コーデッド・デシマル)カウンターであり、クロック信号CLK3のパルスに同期して、十進数の「0」〜「59」を表すBCDカウント値を順次生成する。カウント値が十進数の「59」を表す値に等しくなると、カウンター71aは、クロック信号CLK3の次のパルスに同期して、カウント値を「0」にリセットすると共に、キャリー信号CA1を出力する。ただし、カウンター71aは、カウントディスエーブル信号CNTDISがアクティブのときは、クロック信号CLK3のパルスが供給されてもカウント動作を行わず、その時のBCDカウント値を保持する。   The counter 71a (an example of a “second clock circuit”) generates a count value representing time in seconds by performing a count operation in synchronization with the clock signal CLK3. For example, the counter 71a is a 60-digit BCD (binary coded decimal) counter, and sequentially generates BCD count values representing decimal numbers “0” to “59” in synchronization with the pulse of the clock signal CLK3. When the count value becomes equal to the value representing the decimal number “59”, the counter 71a resets the count value to “0” and outputs the carry signal CA1 in synchronization with the next pulse of the clock signal CLK3. However, when the count disable signal CNTDIS is active, the counter 71a does not perform the counting operation even if the pulse of the clock signal CLK3 is supplied, and holds the BCD count value at that time.

カウンター71aによって生成されるカウント値は、秒単位の時刻を表す計時データT2(「第2の計時データ」の一例)として用いられる。すなわち、カウンター71aは、1秒単位で計時データT2を更新する。出力制御回路71bは、リードイネーブル信号E2がアクティブになると、カウンター71aによって生成される計時データT2をインターフェース回路80に出力する。   The count value generated by the counter 71a is used as time data T2 (an example of “second time data”) representing time in seconds. That is, the counter 71a updates the time measurement data T2 in units of 1 second. When the read enable signal E2 becomes active, the output control circuit 71b outputs the time measurement data T2 generated by the counter 71a to the interface circuit 80.

カウンター72aは、キャリー信号CA1に同期してカウント動作を行うことにより、分単位の時刻を表すカウント値を生成する。例えば、カウンター72aは、60進BCDカウンターであり、キャリー信号CA1のパルスに同期して、十進数の「0」〜「59」を表すBCDカウント値を順次生成する。カウント値が十進数の「59」を表す値に等しくなると、カウンター72aは、キャリー信号CA1の次のパルスに同期して、カウント値を「0」にリセットすると共に、キャリー信号CA2を出力する。   The counter 72a generates a count value representing time in minutes by performing a count operation in synchronization with the carry signal CA1. For example, the counter 72a is a 60-digit BCD counter, and sequentially generates BCD count values representing decimal numbers “0” to “59” in synchronization with the pulse of the carry signal CA1. When the count value becomes equal to the value representing the decimal number “59”, the counter 72a resets the count value to “0” and outputs the carry signal CA2 in synchronization with the next pulse of the carry signal CA1.

カウンター72aによって生成されるカウント値は、分単位の時刻を表す計時データT3として用いられる。すなわち、カウンター72aは、分単位で計時データT3を更新する。出力制御回路72bは、リードイネーブル信号E3がアクティブになると、カウンター72aによって生成される計時データT3をインターフェース回路80に出力する。   The count value generated by the counter 72a is used as time measurement data T3 representing the time in minutes. That is, the counter 72a updates the time measurement data T3 in units of minutes. When the read enable signal E3 becomes active, the output control circuit 72b outputs the timing data T3 generated by the counter 72a to the interface circuit 80.

カウンター73aは、キャリー信号CA2に同期してカウント動作を行うことにより、時単位の時刻を表すカウント値を生成する。例えば、カウンター73aは、24進BCDカウンターであり、キャリー信号CA2のパルスに同期して、十進数の「0」〜「23」を表すBCDカウント値を順次生成する。カウント値が十進数の「23」を表す値に等しくなると、カウンター73aは、キャリー信号CA2の次のパルスに同期して、カウント値を「0」にリセットすると共に、キャリー信号CA3を出力する。   The counter 73a performs a count operation in synchronization with the carry signal CA2, thereby generating a count value representing time in hours. For example, the counter 73a is a 24 BCD counter and sequentially generates BCD count values representing decimal numbers “0” to “23” in synchronization with the pulse of the carry signal CA2. When the count value becomes equal to the value representing the decimal number “23”, the counter 73a resets the count value to “0” and outputs the carry signal CA3 in synchronization with the next pulse of the carry signal CA2.

カウンター73aによって生成されるカウント値は、時単位の時刻を表す計時データT4として用いられる。すなわち、カウンター73aは、時単位で計時データT4を更新する。出力制御回路73bは、リードイネーブル信号E4がアクティブになると、カウンター73aによって生成される計時データT4をインターフェース回路80に出力する。   The count value generated by the counter 73a is used as time-measurement data T4 representing time in time units. That is, the counter 73a updates the time measurement data T4 on an hourly basis. When the read enable signal E4 becomes active, the output control circuit 73b outputs the timing data T4 generated by the counter 73a to the interface circuit 80.

カウンター74aは、キャリー信号CA3に同期してカウント動作を行うことにより、日単位の時刻を表すカウント値を生成する。例えば、カウンター74aは、10進BCDカウンターであり、キャリー信号CA3のパルスに同期して、十進数の「1」〜「31」を表すBCDカウント値を順次生成する。   The counter 74a performs a count operation in synchronization with the carry signal CA3, thereby generating a count value that represents a time in days. For example, the counter 74a is a decimal BCD counter, and sequentially generates BCD count values representing decimal numbers “1” to “31” in synchronization with the pulse of the carry signal CA3.

ただし、月によっては、月の最後の日を「28」又は「30」とする必要があり、うるう年の2月の場合には、月の最後の日を「29」とする必要がある。そこで、カウンター74aは、日単位の時刻を表すカウント値を、月単位の時刻を表すカウント値及び年単位
の時刻を表すカウント値に基づいて設定されたカウント上限値と比較する。カウント値がカウント上限値に等しくなると、カウンター74aは、キャリー信号CA3の次のパルスに同期して、カウント値を「1」にリセットすると共に、キャリー信号CA4を出力する。
However, depending on the month, the last day of the month needs to be “28” or “30”, and in the case of February in a leap year, the last day of the month needs to be “29”. Thus, the counter 74a compares the count value representing the time in the day with the count upper limit value set based on the count value representing the time in the month and the count value representing the time in the year. When the count value becomes equal to the count upper limit value, the counter 74a resets the count value to “1” and outputs the carry signal CA4 in synchronization with the next pulse of the carry signal CA3.

カウンター74aによって生成されるカウント値は、日単位の時刻を表す計時データT5として用いられる。すなわち、カウンター74aは、日単位で計時データT5を更新する。出力制御回路74bは、リードイネーブル信号E5がアクティブになると、カウンター74aによって生成される計時データT5をインターフェース回路80に出力する。   The count value generated by the counter 74a is used as time measurement data T5 representing the time in days. That is, the counter 74a updates the time measurement data T5 on a daily basis. When the read enable signal E5 becomes active, the output control circuit 74b outputs the timing data T5 generated by the counter 74a to the interface circuit 80.

シフトレジスター75aは、キャリー信号CA3に同期して、曜日を表す計時データT6を生成する。例えば、シフトレジスター75aは、リング状に接続された7つのD型フリップフロップを含む7ビットのシフトレジスターである。7つのフリップフロップは、日曜〜土曜の7つの曜日に対応している。   The shift register 75a generates time measurement data T6 representing the day of the week in synchronization with the carry signal CA3. For example, the shift register 75a is a 7-bit shift register including seven D-type flip-flops connected in a ring shape. The seven flip-flops correspond to seven days of the week from Sunday to Saturday.

初期状態設定時に、インターフェース回路80は、マスター制御装置2から供給される7ビットの初期値データに従って、1つのフリップフロップのデータを「1」にセットすると共に、他のフリップフロップのデータを「0」にリセットする。その後、シフトレジスター75aは、キャリー信号CA3に同期して曜日データを一方向にシフトする。従って、シフトレジスター75aの7つのフリップフロップにおけるデータ「1」の位置によって、現在の曜日が表される。   When setting the initial state, the interface circuit 80 sets the data of one flip-flop to “1” and sets the data of the other flip-flop to “0” according to the 7-bit initial value data supplied from the master control device 2. To "". Thereafter, the shift register 75a shifts the day data in one direction in synchronization with the carry signal CA3. Therefore, the current day of the week is represented by the position of data “1” in the seven flip-flops of the shift register 75a.

シフトレジスター75aによって生成される曜日データは、曜日を表す計時データT6として用いられる。すなわち、シフトレジスター75aは、日単位で計時データT6を更新する。出力制御回路75bは、リードイネーブル信号E6がアクティブになると、シフトレジスター75aによって生成される計時データT6をインターフェース回路80に出力する。   The day of the week data generated by the shift register 75a is used as time measurement data T6 representing the day of the week. That is, the shift register 75a updates the time measurement data T6 in units of days. When the read enable signal E6 becomes active, the output control circuit 75b outputs the timing data T6 generated by the shift register 75a to the interface circuit 80.

カウンター76aは、キャリー信号CA4に同期してカウント動作を行うことにより、月単位の時刻を表すカウント値を生成する。例えば、カウンター76aは、12進BCDカウンターで構成され、キャリー信号CA4のパルスに同期して、十進数の「1」〜「12」を表すBCDカウント値を順次生成する。カウント値が十進数の「12」を表す値に等しくなると、カウンター76aは、キャリー信号CA4の次のパルスに同期して、カウント値を「1」にリセットすると共に、キャリー信号CA5を出力する。   The counter 76a performs a count operation in synchronization with the carry signal CA4, thereby generating a count value representing the time in units of months. For example, the counter 76a is composed of a decimal BCD counter, and sequentially generates BCD count values representing decimal numbers “1” to “12” in synchronization with the pulse of the carry signal CA4. When the count value becomes equal to the value representing the decimal number “12”, the counter 76a resets the count value to “1” and outputs the carry signal CA5 in synchronization with the next pulse of the carry signal CA4.

カウンター76aによって生成されるカウント値は、月単位の時刻を表す計時データT7として用いられる。すなわち、カウンター76aは、月単位で計時データT7を更新する。出力制御回路76bは、リードイネーブル信号E7がアクティブになると、カウンター76aによって生成される計時データT7をインターフェース回路80に出力する。   The count value generated by the counter 76a is used as time measurement data T7 representing the time in units of months. That is, the counter 76a updates the time measurement data T7 on a monthly basis. When the read enable signal E7 becomes active, the output control circuit 76b outputs the timing data T7 generated by the counter 76a to the interface circuit 80.

カウンター77aは、キャリー信号CA5に同期してカウント動作を行うことにより、年単位の時刻を表すカウント値を生成する。例えば、カウンター77aは、10進BCDカウンターで構成され、キャリー信号CA5のパルスに同期して、西暦年号の場合に、十進数の「2015」、「2016」、「2017」・・・の下2桁を表すBCDカウント値を順次生成する。   The counter 77a performs a count operation in synchronization with the carry signal CA5, thereby generating a count value representing time in units of years. For example, the counter 77a is composed of a decimal BCD counter, and in synchronization with the pulse of the carry signal CA5, the decimal number “2015”, “2016”, “2017”,. BCD count values representing two digits are sequentially generated.

カウンター77aによって生成されるカウント値は、年単位の時刻を表す計時データT8として用いられる。すなわち、カウンター77aは、年単位で計時データT8を更新する。出力制御回路77bは、リードイネーブル信号E8がアクティブになると、カウンター77aによって生成される計時データT8をインターフェース回路80に出力する。   The count value generated by the counter 77a is used as time-measurement data T8 representing time in units of years. That is, the counter 77a updates the time measurement data T8 in units of years. When the read enable signal E8 becomes active, the output control circuit 77b outputs the timing data T8 generated by the counter 77a to the interface circuit 80.

[下位計時部の構成及び動作]
図5は、下位計時部50の構成例を示す図である。図5に示すように、下位計時部50は、カウント制御回路51、カウンター52、出力制御回路53、制御フラグレジスター54、カウンター55、出力制御回路56、データ変換回路57、状態フラグレジスター58及び分周回路59a,59bを含んで構成されている。
[Configuration and operation of sub-timer]
FIG. 5 is a diagram illustrating a configuration example of the lower timing unit 50. As shown in FIG. 5, the lower timing unit 50 includes a count control circuit 51, a counter 52, an output control circuit 53, a control flag register 54, a counter 55, an output control circuit 56, a data conversion circuit 57, a status flag register 58, and a minute. The circuit includes peripheral circuits 59a and 59b.

カウンター52は、例えば、6ビットバイナリーカウンターで構成される。カウンター52は、1/100秒単位の計時動作を行うために、4096Hzの周波数を有するクロック信号CLK1のパルスに同期してカウント動作を行うことにより、各々のカウントサイクルにおいて、十進数の「0」から「39」までを表す6ビットC5〜C0のカウント値を生成する。ここで、C5は最上位ビットであり、C0は最下位ビットである。   The counter 52 is composed of, for example, a 6-bit binary counter. The counter 52 performs a counting operation in synchronization with a pulse of the clock signal CLK1 having a frequency of 4096 Hz in order to perform a timekeeping operation in units of 1/100 second, and thereby, in each count cycle, a decimal number “0”. To “39” are generated as 6-bit C5 to C0 count values. Here, C5 is the most significant bit and C0 is the least significant bit.

出力制御回路53は、例えば、複数のトランスミッションゲート等で構成される。出力制御回路53は、リードイネーブル信号E0がアクティブになると、カウンター52によって生成されるカウント値の上位4ビットC5〜C2を、1/1000秒単位の時刻を表す4ビットの計時データT0としてインターフェース回路80に出力する。   The output control circuit 53 is composed of, for example, a plurality of transmission gates. When the read enable signal E0 becomes active, the output control circuit 53 uses the upper 4 bits C5 to C2 of the count value generated by the counter 52 as 4-bit timing data T0 representing time in units of 1/1000 second. Output to 80.

クロック信号CLK1の1周期は約244マイクロ秒であるので、カウンター52のカウント値の上位4ビットC5〜C2を選択することにより、1/1000秒単位の時刻を表す計時データT0が生成される。このように、本実施形態によれば、1/100秒単位の計時動作を行うために生成される6ビットのカウント値「000000」〜「100111」の上位4ビット「0000」〜「1001」を選択することにより、簡単な回路構成によって消費電流も殆ど増加させずに、1/1000秒単位の時刻として十進数の「0」〜「9」を表す4ビットの計時データT0を生成することができる。   Since one cycle of the clock signal CLK1 is about 244 microseconds, the time data T0 representing the time in units of 1/1000 second is generated by selecting the upper 4 bits C5 to C2 of the count value of the counter 52. As described above, according to the present embodiment, the upper 4 bits “0000” to “1001” of the 6-bit count values “000000” to “100111” generated in order to perform the timing operation in units of 1/100 second are calculated. By selecting, it is possible to generate 4-bit timing data T0 representing decimal numbers “0” to “9” as a time in 1/1000 second without increasing current consumption by a simple circuit configuration. it can.

ただし、クロック信号CLK1の4周期は、1/1000秒に対して約−23.4マイクロ秒の誤差を含んでいる。この誤差を無くすために、カウンター52によって行われるカウント動作には、カウント値が「0」〜「39」に順次変化した後に「0」に戻る40カウントのサイクルと、カウント値が2回続けて「39」になった後に「0」に戻る41カウントのサイクルとが含まれる。そこで、下位計時部50には、第40カウントの情報を表す1ビットのカウント制御フラグFL1を格納する制御フラグレジスター54が設けられている。制御フラグレジスター54は、例えば、D型フリップフロップ等で構成される。   However, the four periods of the clock signal CLK1 include an error of about −23.4 microseconds with respect to 1/1000 second. In order to eliminate this error, the counting operation performed by the counter 52 includes a 40-count cycle in which the count value sequentially changes from “0” to “39” and then returns to “0”, and the count value continues twice. 41 count cycles returning to “0” after becoming “39” are included. Therefore, the low-order time measuring unit 50 is provided with a control flag register 54 for storing a 1-bit count control flag FL1 representing information of the 40th count. The control flag register 54 is composed of, for example, a D-type flip-flop.

カウント制御回路51は、初期状態設定時に、インターフェース回路80から供給されるカウント初期値をカウンター52及びカウンター55に設定すると共に、制御フラグレジスター54に格納されているカウント制御フラグFL1を「0」にリセットする。カウント制御回路51は、例えば、順序回路を含むステートマシンで構成される。   When setting the initial state, the count control circuit 51 sets the count initial value supplied from the interface circuit 80 in the counter 52 and the counter 55, and sets the count control flag FL1 stored in the control flag register 54 to “0”. Reset. The count control circuit 51 is configured by a state machine including a sequential circuit, for example.

カウンター52によって生成される6ビットC5〜C0のカウント値は、カウント制御回路51にも供給される。カウントサイクルが所定の回数である場合に、カウント制御回路51は、カウンター52によって生成されるカウント値が十進数の「39」を表す値に等しくなると、カウント制御フラグFL1を「1」に設定する。これにより、カウンター52が、クロック信号CLK1の次のパルスが到来してもカウント値を維持し、クロック信号CLK1のさらに次のパルスに同期してカウント値を「0」にリセットする第1の状態遷移が設定される。   The count values of 6 bits C5 to C0 generated by the counter 52 are also supplied to the count control circuit 51. When the count cycle is a predetermined number of times, the count control circuit 51 sets the count control flag FL1 to “1” when the count value generated by the counter 52 becomes equal to the value representing the decimal number “39”. . Thereby, the counter 52 maintains the count value even when the next pulse of the clock signal CLK1 arrives, and the first state in which the counter value is reset to “0” in synchronization with the further next pulse of the clock signal CLK1. A transition is set.

一方、カウントサイクルが所定の回数でない場合に、カウント制御回路51は、カウンター52によって生成されるカウント値が十進数の「39」を表す値に等しくなっても、
カウント制御フラグFL1を「0」に維持する。これにより、カウンター52が、クロック信号CLK1の次のパルスに同期してカウント値を「0」にリセットする第2の状態遷移が設定される。
On the other hand, when the count cycle is not a predetermined number of times, the count control circuit 51 determines that the count value generated by the counter 52 is equal to the value representing the decimal number “39”.
The count control flag FL1 is maintained at “0”. Thereby, the second state transition is set in which the counter 52 resets the count value to “0” in synchronization with the next pulse of the clock signal CLK1.

41カウントのサイクルにおいては、1カウントサイクルの期間が、4096Hzの周波数を有するクロック信号CLK1の41周期に相当し、約10.01ミリ秒となる。一方、40カウントのサイクルにおいては、1カウントサイクルの期間が、クロック信号CLK1の40周期に相当し、約9.77ミリ秒となる。従って、カウント制御回路51は、連続する100回のカウントサイクルの内で、41カウントのサイクルを96回設定すると共に、40カウントのサイクルを4回設定することにより、41カウントのサイクルと40カウントのサイクルとにおける誤差が緩和されて、計時データによって表される時刻の誤差を低減することができる。   In the 41 count cycle, the period of one count cycle corresponds to 41 cycles of the clock signal CLK1 having a frequency of 4096 Hz, which is about 10.01 milliseconds. On the other hand, in the 40 count cycle, the period of one count cycle corresponds to 40 cycles of the clock signal CLK1, which is about 9.77 milliseconds. Therefore, the count control circuit 51 sets the 41-count cycle 96 times and the 40-count cycle 4 times among the 100 consecutive count cycles, thereby setting the 41-count cycle and the 40-count cycle. The error in the cycle can be relaxed, and the time error represented by the time measurement data can be reduced.

例えば、カウント制御回路51は、連続する100回のサイクルの内で、第13回、第38回、第63回、及び、第88回以外のサイクルにおいて、カウンター52によって生成されるカウント値が十進数の「39」を表す値に等しくなると、カウント制御フラグFL1を「1」に設定することによって第1の状態遷移を設定する。カウント制御回路51は、第1の状態遷移において、カウンター52のカウント動作を停止すると共に、クロック信号CLK1の次のパルスに同期して、カウント制御フラグFL1を「0」にリセットする。また、カウント制御回路51は、クロック信号CLK1のさらに次のパルスに同期して、カウンター52のカウント動作の停止を解除してカウント値を「0」にリセットすると共に、当該1パルスの間だけカウントイネーブル信号CNTENをアクティブ(例えば、ハイレベル)にする。これにより、41カウントのサイクルが実現される。   For example, in the count control circuit 51, the count value generated by the counter 52 is sufficient in cycles other than the thirteenth, thirty-eighth, the thirty-sixth, and the eighty-eighth out of 100 consecutive cycles. When it becomes equal to the value representing the decimal number “39”, the first state transition is set by setting the count control flag FL1 to “1”. In the first state transition, the count control circuit 51 stops the count operation of the counter 52 and resets the count control flag FL1 to “0” in synchronization with the next pulse of the clock signal CLK1. In addition, the count control circuit 51 cancels the stop of the counting operation of the counter 52 and resets the count value to “0” in synchronization with the next pulse of the clock signal CLK1, and counts only during the one pulse. The enable signal CNTEN is activated (for example, high level). Thereby, a cycle of 41 counts is realized.

また、カウント制御回路51は、連続する100回のサイクルの内で、第13回、第38回、第63回、及び、第88回のサイクルにおいて、カウンター52によって生成されるカウント値が十進数の「39」を表す値に等しくなると、カウント制御フラグFL1を「0」に維持することによって第2の状態遷移を設定する。カウント制御回路51は、第2の状態遷移において、クロック信号CLK1の次のパルスに同期して、カウンター52のカウント値を「0」にリセットすると共に、当該1パルスの間だけカウントイネーブル信号CNTENをアクティブにする。これにより、40カウントのサイクルが実現される。   In addition, the count control circuit 51 determines that the count value generated by the counter 52 is a decimal number in the thirteenth, thirty-eighth, the thirty-sixth, and the eighty-eighth cycles in 100 consecutive cycles. Is set equal to a value representing “39”, the second state transition is set by maintaining the count control flag FL1 at “0”. In the second state transition, the count control circuit 51 resets the count value of the counter 52 to “0” in synchronization with the next pulse of the clock signal CLK1, and also outputs the count enable signal CNTEN only during the one pulse. Activate. Thereby, a cycle of 40 counts is realized.

このように、カウンター52は、4対96の比率で40と41とを選択して4096Hzの周波数を有するクロック信号CLK1のパルスの数を6ビットでカウントし、下位計時部50は、計時データT1,T0の一部である計時データT0として、カウンター52が出力する6ビットのカウント値の上位4ビットのカウント値を出力する。従って、下位計時部50は、カウンター52がカウントする6ビットのカウント値「000000」〜「100111」の上位4ビットのカウント値「0000」〜「1001」により、簡単な回路構成によって消費電流も殆ど増加させずに、1/1000秒単位の時刻として十進数の「0」〜「9」を表す計時データT0を出力することができる。   In this way, the counter 52 selects 40 and 41 at a ratio of 4 to 96, and counts the number of pulses of the clock signal CLK1 having a frequency of 4096 Hz with 6 bits. , T0, the upper 4 bit count value of the 6 bit count value output by the counter 52 is output as the timing data T0. Therefore, the low-order time measuring unit 50 consumes almost no current with a simple circuit configuration by the high-order 4-bit count values “0000” to “1001” of the 6-bit count values “000000” to “100111” counted by the counter 52. Without increasing, it is possible to output time measurement data T0 representing decimal numbers “0” to “9” as a time in units of 1/1000 second.

カウント制御回路51から出力されるカウントイネーブル信号CNTENは、カウンター55に供給される。カウンター55は、カウントイネーブル信号CNTENがアクティブのときにクロック信号CLK1に同期してカウント動作を行うことにより、1/100秒単位の時刻を表すカウント値を生成する。   The count enable signal CNTEN output from the count control circuit 51 is supplied to the counter 55. The counter 55 performs a count operation in synchronization with the clock signal CLK1 when the count enable signal CNTEN is active, thereby generating a count value representing a time in units of 1/100 seconds.

カウンター55は、例えば、8ビット10進BCDカウンターで構成される。カウンター55によって生成されるBCDカウント値は、十進数の1/10秒の位を表す4ビットB7〜B4と、十進数の1/100秒の位を表す4ビットB3〜B0とを含んでいる。   The counter 55 is composed of, for example, an 8-bit decimal BCD counter. The BCD count value generated by the counter 55 includes 4 bits B7 to B4 representing 1 / 10th of a decimal number and 4 bits B3 to B0 representing 1 / 100th of a decimal. .

カウンター55は、カウントイネーブル信号CNTENがアクティブのときにクロック信号CLK1のパルスに同期して、十進数の「0」〜「99」を表すカウント値を順次生成する。カウンター55は、カウント値が十進数の「99」を表す値に等しくなると、次にカウントイネーブル信号CNTENがアクティブのときのクロック信号CLK1のパルスに同期して、カウント値を「0」にリセットする。   The counter 55 sequentially generates count values representing decimal numbers “0” to “99” in synchronization with the pulse of the clock signal CLK1 when the count enable signal CNTEN is active. When the count value becomes equal to the value representing the decimal number “99”, the counter 55 resets the count value to “0” in synchronization with the pulse of the clock signal CLK1 when the count enable signal CNTEN is active next. .

カウンター55の100カウントの期間は、4096−1×(41×96+40×4)=1秒となる。また、カウンター55の1カウントの期間は、最大で約±117マイクロ秒の誤差を含むものの、長期的には1/100秒の期間に正確に対応している。 The period of 100 counts of the counter 55 is 4096 −1 × (41 × 96 + 40 × 4) = 1 second. In addition, although one count period of the counter 55 includes an error of about ± 117 microseconds at the maximum, it accurately corresponds to a 1/100 second period in the long term.

カウンター55によって生成されるカウント値の上位4ビットB7〜B4及び下位4ビットB3〜B0は、1/100秒単位の時刻を表す計時データT1として用いられる。出力制御回路56は、例えば、複数のトランスミッションゲート等で構成され、リードイネーブル信号E1がアクティブになると、カウンター55によって生成される計時データT1をインターフェース回路80に出力する。   The upper 4 bits B7 to B4 and the lower 4 bits B3 to B0 of the count value generated by the counter 55 are used as time measurement data T1 representing the time in units of 1/100 seconds. The output control circuit 56 is configured by, for example, a plurality of transmission gates and the like, and outputs the timing data T1 generated by the counter 55 to the interface circuit 80 when the read enable signal E1 becomes active.

また、カウンター55は、十進数の「0」〜「99」をカウントする100回のカウントのサイクルの内で、供給されたクロック信号CLK1の先頭のパルスのみをそのまま出力するサイクルを4回設定すると共に、クロック信号CLK1のパルスを出力しないサイクルを96回設定することにより、4Hzの周波数を有するクロック信号CLK4を出力する。例えば、カウンター55は、カウント値が十進数の「0」、「25」、「50」、「75」である4回のサイクルにおいてのみ、クロック信号CLK1の先頭のパルスを出力することで、クロック信号CLK1に基づいてクロック信号CLK4を生成する。   Further, the counter 55 sets four cycles in which only the first pulse of the supplied clock signal CLK1 is output as it is, out of 100 count cycles in which decimal numbers “0” to “99” are counted. At the same time, the clock signal CLK4 having a frequency of 4 Hz is output by setting a cycle in which no pulse of the clock signal CLK1 is output 96 times. For example, the counter 55 outputs the first pulse of the clock signal CLK1 only in four cycles in which the count values are decimal numbers “0”, “25”, “50”, and “75”. A clock signal CLK4 is generated based on the signal CLK1.

分周回路59aは、4Hzの周波数を有するクロック信号CLK4を2分周することにより、2Hzの周波数を有するクロック信号CLK5を生成する。また、分周回路59bは、2Hzの周波数を有するクロック信号CLK5を2分周することにより、1Hzの周波数を有するクロック信号CLK3を生成する。クロック信号CLK3の立ち上がりは、カウンター55のカウント値が十進数の「99」から「0」に更新されるタイミングと一致する。   The frequency dividing circuit 59a divides the clock signal CLK4 having a frequency of 4 Hz by 2 to generate a clock signal CLK5 having a frequency of 2 Hz. Further, the frequency dividing circuit 59b generates a clock signal CLK3 having a frequency of 1 Hz by dividing the clock signal CLK5 having a frequency of 2 Hz by two. The rising edge of the clock signal CLK3 coincides with the timing at which the count value of the counter 55 is updated from the decimal number “99” to “0”.

データ変換回路57は、オフセットレジスター91に保持されている−999ミリ秒〜+999ミリ秒の範囲における1/1000秒単位のオフセットデータOFSを、符号付き13ビットのBCDオフセット値に変換して出力する。この符号付き13ビットのBCDオフセット値は、第12ビットが符号値SIGNであり、第11〜4ビットがカウンター55のビットB7〜B0にセットされるオフセット値OFS1であり、第3〜0ビットがカウンター52のビットC5〜C2にセットされるオフセット値OFS0である。オフセットデータOFSが0〜+999ミリ秒の範囲では、符号値SIGNは「0」であり、オフセット値OFS1及びオフセット値OFS0は、それぞれ、オフセットデータOFSに対応する十進数の上位2桁の数値及び下位1桁の数値に相当する。例えば、オフセットデータOFSが+123ミリ秒であれば、13ビットのBCDオフセット値は「0000100100011」(+123に相当)である。一方、オフセットデータOFSが−999ミリ秒〜−1ミリ秒の範囲では、符号値SIGNは「1」であり、オフセット値OFS1及びオフセット値OFS0は、それぞれ、十進数の「1000」からオフセットデータOFSに対応する十進数を減算した上位2桁の数値及び下位1桁の数値に相当する。例えば、オフセットデータOFSが+123ミリ秒であれば、13ビットのBCDオフセット値は「1100001110111」(−877に相当)である。   The data conversion circuit 57 converts the offset data OFS in units of 1/1000 second in the range of −999 milliseconds to +999 milliseconds held in the offset register 91 into a signed 13-bit BCD offset value and outputs the result. . In this signed 13-bit BCD offset value, the 12th bit is the code value SIGN, the 11th to 4th bits are the offset value OFS1 set in the bits B7 to B0 of the counter 55, and the 3rd to 0th bits are This is the offset value OFS0 set in the bits C5 to C2 of the counter 52. In the range where the offset data OFS is 0 to +999 milliseconds, the sign value SIGN is “0”, and the offset value OFS1 and the offset value OFS0 are respectively the upper two digits of the decimal number corresponding to the offset data OFS and the lower order. Corresponds to a single digit value. For example, if the offset data OFS is +123 milliseconds, the 13-bit BCD offset value is “00001001000011” (corresponding to +123). On the other hand, when the offset data OFS is in the range of −999 milliseconds to −1 milliseconds, the code value SIGN is “1”, and the offset value OFS1 and the offset value OFS0 are respectively changed from the decimal number “1000” to the offset data OFS. It corresponds to the numerical value of the upper 2 digits and the numerical value of the lower 1 digit obtained by subtracting the decimal number corresponding to. For example, if the offset data OFS is +123 milliseconds, the 13-bit BCD offset value is “1100001110111” (corresponding to −877).

状態フラグレジスター58は、状態フラグFL2を格納する。状態フラグFL2は、フ
ラグセット信号FSが非アクティブからアクティブに変化するときに「1」に設定される。状態フラグレジスター58は、例えば、SR(セット/リセット)型フリップフロップ等で構成される。
The status flag register 58 stores a status flag FL2. The status flag FL2 is set to “1” when the flag set signal FS changes from inactive to active. The status flag register 58 is composed of, for example, an SR (set / reset) type flip-flop.

カウント制御回路51は、カウンター55のカウント値が十進数の「99」の時にカウントイネーブル信号CNTENがアクティブとなるタイミングで、状態フラグFL2が「1」であれば、クロック信号CLK1のパルスに同期して、カウンター55のカウント値のビットB7〜B0をオフセット値OFS1に更新すると共に、カウンター52のカウント値のビットC5〜C2をオフセット値OFS0に更新し、ビットC1,C0を「00」に更新する。これと同時に、カウント制御回路51は、クロック信号CLK1の1パルスの間だけクリア信号CLR1を出力し、クリア信号CLR1によりオフセットデータOFSがゼロにクリアされる。また、カウント制御回路51は、符号値SIGNが「1」であれば、クロック信号CLK1のパルスの間だけカウントディスエーブル信号CNTDISをアクティブにすると共に、4Hzの周波数を有するクロック信号CLK4のパルスを出力しない。このカウンター55及びカウンター52の各カウント値をオフセット値OFS1,OFS0に更新する処理(オフセット設定処理)により、上位計時部70による計時データT2(秒)の更新タイミングを1/1000秒単位で変更することができる。オフセット設定処理は、カウンター55及びカウンター52のカウント動作(カウント値を1だけ進める動作)よりも優先して行われる。   The count control circuit 51 synchronizes with the pulse of the clock signal CLK1 when the count enable signal CNTEN becomes active when the count value of the counter 55 is decimal "99" and the status flag FL2 is "1". Then, the bits B7 to B0 of the count value of the counter 55 are updated to the offset value OFS1, the bits C5 to C2 of the counter value of the counter 52 are updated to the offset value OFS0, and the bits C1 and C0 are updated to “00”. . At the same time, the count control circuit 51 outputs the clear signal CLR1 only for one pulse of the clock signal CLK1, and the offset data OFS is cleared to zero by the clear signal CLR1. If the code value SIGN is “1”, the count control circuit 51 activates the count disable signal CNTDIS only during the pulse of the clock signal CLK1, and outputs a pulse of the clock signal CLK4 having a frequency of 4 Hz. do not do. By updating the count values of the counter 55 and the counter 52 to the offset values OFS1 and OFS0 (offset setting process), the update timing of the timing data T2 (seconds) by the upper timing unit 70 is changed in units of 1/1000 second. be able to. The offset setting process is performed in preference to the counting operation of the counter 55 and the counter 52 (operation for advancing the count value by 1).

図6は、オフセット設定処理が行われない場合の秒更新前後のタイミングチャートの一例を示す図である。また、図7及び図8は、オフセット設定処理が行われる場合の秒更新前後のタイミングチャートの一例を示す図である。   FIG. 6 is a diagram illustrating an example of a timing chart before and after the second update when the offset setting process is not performed. 7 and 8 are diagrams illustrating examples of timing charts before and after the second update when the offset setting process is performed.

図6の例では、計時データT1(1/100秒)は「99」から「0」に更新されると共に、計時データT0(1/1000秒)は「9」から「0」に更新されるタイミング(秒更新タイミング)において、計時データT2(秒)が「59」から「0」に更新されている。   In the example of FIG. 6, the timing data T1 (1/100 second) is updated from “99” to “0”, and the timing data T0 (1/1000 seconds) is updated from “9” to “0”. At the timing (second update timing), the time measurement data T2 (seconds) is updated from “59” to “0”.

これに対して、図7及び図8の例では、下位計時部50は、計時データT1(1/100秒)が「99」であり、かつ、計時データT0(1/1000秒)が「9」のときに(計時データT1,T0があらかじめ決められた所定値「999」のときに)、すなわち、計時データT2(秒)を更新する予定のタイミング(秒更新予定タイミング)において、計時データT1(1/100秒),T0(1/1000秒)にオフセット値OFS1,OFS0を設定することで、計時データT2(秒)の更新タイミングを補正している。そのため、図7の例では、クロック信号CLK1(不図示)に同期して、計時データT1(1/100秒)が「99」から「0」(オフセット値OFS1)に更新されると共に、計時データT0(1/1000秒)が「9」から「3」(オフセット値OFS0)に更新されている。また、この秒更新予定タイミングにおいて、計時データT2(秒)が「59」から「0」に更新されている。すなわち、符号値SIGNが「0」(オフセットデータOFSがゼロ又は正の値)の時は、オフセット設定処理のタイミング(秒更新予定タイミング)と秒更新タイミングが一致する。   On the other hand, in the example of FIG. 7 and FIG. 8, the lower timing unit 50 has the timing data T1 (1/100 second) of “99” and the timing data T0 (1/1000 second) of “9”. ”(When the timing data T1 and T0 are a predetermined value“ 999 ”determined in advance), that is, at the timing when the timing data T2 (seconds) is scheduled to be updated (second update scheduled timing), the timing data T1 By setting the offset values OFS1, OFS0 in (1/100 seconds) and T0 (1/1000 seconds), the update timing of the timing data T2 (seconds) is corrected. Therefore, in the example of FIG. 7, the time measurement data T1 (1/100 second) is updated from “99” to “0” (offset value OFS1) in synchronization with the clock signal CLK1 (not shown), and the time measurement data is updated. T0 (1/1000 second) is updated from “9” to “3” (offset value OFS0). At the second update scheduled timing, the time measurement data T2 (seconds) is updated from “59” to “0”. That is, when the code value SIGN is “0” (the offset data OFS is zero or a positive value), the timing of the offset setting process (second update scheduled timing) coincides with the second update timing.

一方、図8の例では、秒更新予定タイミングにおいて、計時データT1(1/100秒)が「99」を維持する(「99」(オフセット値OFS1)が設定される)と共に、クロック信号CLK1(不図示)に同期して、計時データT0(1/1000秒)が「9」から「7」(オフセット値OFS0)に更新されている。計時データT2(秒)は、この秒更新予定タイミングにおいて「59」を維持し、3/1000秒後に「59」から「0」に更新されている。すなわち、符号値SIGNが「1」(オフセットデータOFSが負の値)の時は、秒更新タイミングがオフセット設定処理のタイミング(秒更新予定タイミ
ング)よりも遅れる。
On the other hand, in the example of FIG. 8, the time measurement data T1 (1/100 second) maintains “99” (“99” (offset value OFS1) is set) and the clock signal CLK1 ( In synchronization with (not shown), the timing data T0 (1/1000 second) is updated from “9” to “7” (offset value OFS0). The time measurement data T2 (seconds) maintains “59” at the second update scheduled timing, and is updated from “59” to “0” after 3/1000 seconds. That is, when the code value SIGN is “1” (offset data OFS is a negative value), the second update timing is delayed from the offset setting processing timing (second update scheduled timing).

[計時補正]
上述した計時装置1によるオフセット設定処理は、1/1000秒単位での計時補正に利用される。図9は、マスター制御装置2による計時装置1の計時補正のための処理の手順の一例を示すフローチャート図である。また、図10は、計時装置1による計時補正のための処理の手順の一例を示すフローチャート図である。
[Time correction]
The above-described offset setting process by the time measuring device 1 is used for time correction in units of 1/1000 second. FIG. 9 is a flowchart illustrating an example of a processing procedure for the time correction of the time measuring device 1 by the master control device 2. FIG. 10 is a flowchart illustrating an example of a processing procedure for timing correction by the timing device 1.

図9に示すように、マスター制御装置2は、メイン電源4からの電力供給が開始すると(ステップS10のY)、まず、計時装置1の計時データを使用可能であるか否かを判断する(S20)。例えば、マスター制御装置2は、計時装置1によるバックアップ動作中に(メイン電源からの電力が遮断されている期間に)計時動作に異常がなかったか否かを判定し、異常がなかった場合は計時装置1の計時データを使用可能であると判断し、異常があった場合は使用可能ではないと判断する。例えば、計時装置1が、発振回路10の発振停止や計時装置1の電源電圧(電源切替回路100の出力電圧)が所定の電圧値よりも低下した等の異常を検出する回路を備え、異常検出の結果を示すフラグ情報を記憶回路90に記憶する。そして、マスター制御装置2は、計時装置1から異常検出の結果を示すフラグ情報を読み出して、計時装置1の計時データを使用可能であるか否かを判断してもよい。   As shown in FIG. 9, when the power supply from the main power supply 4 starts (Y in step S10), the master control device 2 first determines whether or not the timing data of the timing device 1 can be used ( S20). For example, the master control device 2 determines whether or not there is an abnormality in the timing operation during the backup operation by the timing device 1 (while the power from the main power supply is cut off). It is determined that the timing data of the device 1 can be used, and if there is an abnormality, it is determined that it cannot be used. For example, the timing device 1 includes a circuit for detecting an abnormality such as oscillation stop of the oscillation circuit 10 or a power supply voltage of the timing device 1 (an output voltage of the power supply switching circuit 100) being lower than a predetermined voltage value. Is stored in the memory circuit 90. Then, the master control device 2 may read flag information indicating a result of abnormality detection from the timing device 1 and determine whether or not the timing data of the timing device 1 can be used.

マスター制御装置2は、計時装置1の計時データを使用可能であると判断した場合(ステップS20のY)、計時データ読み出しコマンドを計時装置1に送信する(ステップS30)。   When it is determined that the timing data of the timing device 1 can be used (Y in Step S20), the master control device 2 transmits a timing data read command to the timing device 1 (Step S30).

次に、マスター制御装置2は、計時装置1から計時データを受信するまで待機し(ステップS40のN)、計時データを受信すると(ステップS40のY)、受信した計時データT0〜T8に基づいてマスター計時データ200を更新する(ステップS50)。なお、図9の手順では、ステップS30,S40により、計時データT0〜T8のすべてを受信するものとするが、少なくとも計時データT0,T1を含む必要な計時データのみを順次受信するようにしてもよい。   Next, the master control device 2 waits until time data is received from the time measuring device 1 (N in step S40). When time data is received (Y in step S40), the master control device 2 is based on the received time data T0 to T8. The master timing data 200 is updated (step S50). In the procedure of FIG. 9, it is assumed that all the timing data T0 to T8 are received in steps S30 and S40, but only the necessary timing data including at least the timing data T0 and T1 is sequentially received. Good.

一方、マスター制御装置2は、計時装置1の計時データを使用可能でないと判断した場合(ステップS20のN)計時装置1に対して、初期時刻合わせ処理を別途行う(ステップS60)。   On the other hand, when it is determined that the timing data of the timing device 1 cannot be used (N in Step S20), the master control device 2 separately performs an initial time adjustment process on the timing device 1 (Step S60).

次に、マスター制御装置2は、各種の処理を開始する(ステップS70)。マスター制御装置2は、例えば、各スレーブ装置3にマスター計時データ200を配信する処理等を行う。   Next, the master control device 2 starts various processes (step S70). The master control device 2 performs, for example, processing for distributing the master timing data 200 to each slave device 3.

次に、マスター制御装置2は、GPSやネットワークから時刻情報を取得するまで待機し(ステップS80のN)、時刻情報を取得すると(ステップS80のY)、取得した時刻情報に基づいて、マスター計時データ200を更新する(ステップS90)。   Next, the master control device 2 waits until the time information is acquired from the GPS or the network (N in Step S80). When the time information is acquired (Y in Step S80), the master timekeeping is performed based on the acquired time information. Data 200 is updated (step S90).

次に、マスター制御装置2は、計時データ読み出しコマンドを計時装置1に送信する(ステップS100)。   Next, the master control device 2 transmits a timing data read command to the timing device 1 (step S100).

次に、マスター制御装置2は、計時装置1から計時データを受信するまで待機し(ステップS110のN)、計時データを受信すると(ステップS110のY)、マスター計時データ200と受信した計時データT0〜T8との相対的なずれを算出し、ずれに応じたオフセットデータを生成する(ステップS120)。マスター制御装置2は、計時データ
T0〜T8がマスター計時データ200よりも遅れている場合は遅れ時間に対応する正の値のオフセットデータを生成し、計時データT0〜T8がマスター計時データ200よりも進んでいる場合は進み時間に対応する負の値のオフセットデータを生成する。
Next, the master control device 2 waits until receiving time data from the time measuring device 1 (N in step S110). When time data is received (Y in step S110), the master time data 200 and the received time data T0 are received. The relative deviation from ~ T8 is calculated, and offset data corresponding to the deviation is generated (step S120). The master control device 2 generates positive offset data corresponding to the delay time when the timing data T0 to T8 is behind the master timing data 200, and the timing data T0 to T8 is greater than the master timing data 200. If it is advanced, negative offset data corresponding to the advance time is generated.

次に、マスター制御装置2は、生成したオフセットデータが指定されたオフセット設定コマンドを計時装置1に送信する(ステップS130)。これにより、計時装置1において、オフセット設定処理が行われ、計時補正が実現される。   Next, the master control device 2 transmits an offset setting command in which the generated offset data is designated to the timing device 1 (step S130). Thereby, in the time measuring apparatus 1, an offset setting process is performed and time correction is implement | achieved.

次に、マスター制御装置2は、所定時間が経過すると(ステップS140のN)、ステップS100以降の処理を再度行う。ここで、所定時間は、計時補正の周期に対応し、例えば、マスター計時データ200と計時データT0〜T8との相対的なずれが±1秒以上にならない時間であってもよい。このようにすれば、計時補正のために計時データT2〜T8を再設定する必要がなくなり、マスター制御装置2の処理が簡易になる。   Next, when a predetermined time has elapsed (N in Step S140), the master control device 2 performs the processes after Step S100 again. Here, the predetermined time corresponds to the timing correction period, and may be, for example, a time in which the relative deviation between the master timing data 200 and the timing data T0 to T8 does not become ± 1 second or more. In this way, it is not necessary to reset the time measurement data T2 to T8 for time correction, and the processing of the master control device 2 is simplified.

一方、所定時間が経過する前にメイン電源4からの電力が遮断されると(ステップS140のN、かつ、ステップS150のY)、マスター制御装置2は、メイン電源4からの電力供給が再開するまで待機する(ステップS10のN)。そして、メイン電源4からの電力供給が再開すると(ステップS10のY)、マスター制御装置2は、ステップS20以降の処理を再度行う。なお、計時装置1は、メイン電源4からの電力が遮断されている間も、バックアップ電源5から供給される電力によって計時動作を継続している。従って、マスター制御装置2は、メイン電源4からの電力供給が再開した直後、計時装置1から、前回のステップS130の処理によって計時補正された比較的精度の高い計時データT0〜T8を用いてマスター計時データ200を更新することができる。その後、マスター制御装置2は、GPSやネットワークから時刻情報を取得してマスター計時データ200を正確な時刻に更新し、正確なマスター計時データ200に基づいて計時装置1の計時補正を行うことができる。   On the other hand, when the power from the main power supply 4 is cut off before the predetermined time has elapsed (N in step S140 and Y in step S150), the master control device 2 resumes the power supply from the main power supply 4 (N in step S10). Then, when the power supply from the main power supply 4 is resumed (Y in step S10), the master control device 2 performs the processes after step S20 again. Note that the timing device 1 continues the timing operation with the power supplied from the backup power source 5 even while the power from the main power source 4 is cut off. Therefore, immediately after the power supply from the main power supply 4 is restarted, the master control device 2 uses the time data T0 to T8 with relatively high accuracy from the time measuring device 1 that has been time-corrected by the processing of the previous step S130. The timing data 200 can be updated. Thereafter, the master control device 2 can acquire time information from the GPS or the network, update the master timing data 200 to an accurate time, and can correct the timing of the timing device 1 based on the accurate master timing data 200. .

これに対して、図10に示すように、計時装置1は、マスター制御装置2が図9のステップS30又はステップS100で送信する計時データ読み出しコマンドを受信すると(ステップS210のY)、計時データT0〜T8をマスター制御装置2に送信する(ステップS220)。   On the other hand, as shown in FIG. 10, when the master control device 2 receives the time data read command transmitted in step S30 or step S100 in FIG. 9 (Y in step S210), the time measuring device 1 measures the time data T0. -T8 is transmitted to the master controller 2 (step S220).

また、計時装置1は、マスター制御装置2が図9のステップS130で送信するオフセット設定コマンドを受信すると(ステップS230のY)、まず、受信したオフセット設定コマンドで指定されたオフセットデータをオフセットレジスター91に書き込む(ステップS240)。   When the time measuring device 1 receives the offset setting command transmitted by the master control device 2 in step S130 of FIG. 9 (Y in step S230), first, the offset data specified by the received offset setting command is stored in the offset register 91. (Step S240).

次に、計時装置1は、オフセットレジスター91に保持されているオフセットデータOFSを符号値SIGN及びオフセット値OFS1,OFS0に変換する(ステップS250)。   Next, the timing device 1 converts the offset data OFS held in the offset register 91 into a code value SIGN and offset values OFS1, OFS0 (step S250).

次に、計時装置1は、秒更新予定タイミングが到来するまで待機する(ステップS260のN)。そして、計時装置1は、秒更新予定タイミングが到来すると(ステップS260のY)、下位計時部50のカウンター55,52のカウント値をオフセット値OFS1,OFS0に更新し(ステップS270)、ステップS210以降の処理を再度行う。   Next, the timing device 1 stands by until the second update scheduled timing arrives (N in step S260). Then, when the second update scheduled timing arrives (Y in step S260), the timing device 1 updates the count values of the counters 55 and 52 of the lower timing unit 50 to the offset values OFS1 and OFS0 (step S270), and after step S210. Repeat the process.

このように、マスター制御装置2及び計時装置1がそれぞれ図9及び図10に示す処理を行うことにより、定期的に、計時データT1,T0とマスター計時データ200とに基づいてマスター制御装置2によって生成されたオフセットデータOFS(「第1の補正値」の一例)が記憶回路90(オフセットレジスター91)に記憶され、計時データT2の
更新予定タイミングで、計時データT1,T0にオフセットデータOFS(オフセット値OFS1,OFS0)が設定される。これにより、計時装置1の1/1000秒単位での計時補正が定期的に行われる。
As described above, the master control device 2 and the timing device 1 perform the processing shown in FIGS. 9 and 10, respectively, so that the master control device 2 periodically performs the processing based on the timing data T1 and T0 and the master timing data 200. The generated offset data OFS (an example of “first correction value”) is stored in the storage circuit 90 (offset register 91), and the offset data OFS (offset) is added to the timing data T1 and T0 at the scheduled update timing of the timing data T2. The value OFS1, OFS0) is set. As a result, the time correction in the 1/1000 second unit of the time measuring device 1 is periodically performed.

[作用効果]
以上に説明したように、本実施形態では、マスター制御装置2は、計時装置1から読み出した計時データT0〜T8と正確なマスター計時データ200との相対的なずれを算出し、ずれを無くすためのオフセットデータOFSを計時装置1に送信する。そして、計時装置1は、オフセットデータOFSを受信してオフセットレジスター91に記憶させる。計時装置1の下位計時部50は、オフセットレジスター91に記憶されているオフセットデータOFS(オフセット値OFS1,OFS0)を計時データT1(1/100秒),T0(1/1000秒)に設定することで、計時データT2(秒)の更新タイミングを補正する。具体的には、計時装置1は、−999ミリ秒〜−1ミリ秒の範囲のオフセットデータOFSが設定されることで、計時データT2(秒)の更新タイミングを1/1000秒単位で遅らせ、+1ミリ秒〜+999ミリ秒の範囲のオフセットデータOFSが設定されることで、計時データT2(秒)の更新タイミングを1/1000秒単位で進める。ここで、計時データT0〜T8の読み出しに要する通信遅延は1/1000秒単位では毎回同じなので、仮に、マスター制御装置2が補正直後の計時データT0〜T8を読み出すと、マスター計時データ200とのずれがゼロとなる。換言すれば、計時装置1がマスター計時データ200に対して計時データT0〜T8の読み出しに要する遅延時間分だけずれて計時を行うことにより、マスター制御装置2が読み出した計時データT0〜T8がマスター計時データ200と一致する状態(計時データT0〜T8をマスター計時データ200として代用可能な状態)となる。このように、第1実施形態の計時装置1によれば、マスター制御装置2との通信遅延も含めた計時のずれがオフセットデータOFSによって補正されるので、従来よりも簡単に正確な計時補正を行うことができる。
[Function and effect]
As described above, in the present embodiment, the master control device 2 calculates the relative deviation between the timing data T0 to T8 read from the timing device 1 and the accurate master timing data 200, and eliminates the deviation. The offset data OFS is transmitted to the timing device 1. Then, the timing device 1 receives the offset data OFS and stores it in the offset register 91. The lower timing unit 50 of the timing device 1 sets the offset data OFS (offset values OFS1, OFS0) stored in the offset register 91 to the timing data T1 (1/100 seconds) and T0 (1/1000 seconds). Thus, the update timing of the timing data T2 (seconds) is corrected. Specifically, the timing device 1 sets the offset data OFS in the range of −999 milliseconds to −1 milliseconds, thereby delaying the update timing of the timing data T2 (seconds) in units of 1/1000 seconds. By setting the offset data OFS in the range of +1 millisecond to +999 milliseconds, the update timing of the timing data T2 (second) is advanced in units of 1/1000 second. Here, since the communication delay required for reading the timing data T0 to T8 is the same every time in 1/1000 second units, if the master control device 2 reads the timing data T0 to T8 immediately after correction, Deviation is zero. In other words, the timing device 1 measures the time difference T0 to T8 read from the master timing data 200 by a delay time required for reading the timing data T0 to T8, so that the timing data T0 to T8 read by the master control device 2 becomes the master. The state coincides with the timing data 200 (the timing data T0 to T8 can be substituted as the master timing data 200). As described above, according to the time measuring device 1 of the first embodiment, the time lag including the communication delay with the master control device 2 is corrected by the offset data OFS. It can be carried out.

1−2.第2実施形態
図11は、第2実施形態の計時装置(リアルタイムクロック装置)1の機能ブロック及び計時装置1を用いた処理システムの構成例を示す図である。図11において、図1と同様の構成要素には同じ符号を付しており、以下では、第2実施形態について、第1実施形態と異なる内容を中心に説明し、第1実施形態と重複する説明を省略する。
1-2. Second Embodiment FIG. 11 is a diagram illustrating a configuration example of a processing system using a functional block of a timing device (real-time clock device) 1 and a timing device 1 according to a second embodiment. In FIG. 11, the same components as those in FIG. Description is omitted.

図11に示すように、第2実施形態の計時装置1は、第1実施形態の計時装置1と同様、発振回路10、分周回路20、分周回路30、調停回路40、下位計時部50、調停回路60、上位計時部70、インターフェース回路80、記憶回路90及び電源切替回路100を含み、さらに計時補正部110を含む。また、第2実施形態の計時装置1では、記憶回路90に計時補正データ92が記憶されている。   As shown in FIG. 11, the timing device 1 according to the second embodiment is similar to the timing device 1 according to the first embodiment. The oscillation circuit 10, the frequency dividing circuit 20, the frequency dividing circuit 30, the arbitration circuit 40, and the subordinate time measuring unit 50. , An arbitration circuit 60, a host timing unit 70, an interface circuit 80, a storage circuit 90, and a power supply switching circuit 100, and further includes a timing correction unit 110. In the time measuring device 1 of the second embodiment, the time correction data 92 is stored in the storage circuit 90.

計時補正データ92は、時間の経過に伴って生じる計時のずれを補正するためのデータであり、補正値(「第2の補正値」の一例)の情報と補正周期の情報とを含んでいる。例えば、振動子11の精度や振動子11の経年変化等の情報に基づいて、計時装置1の計時が1年間にX秒程度遅れる(あるいは進む)ことがあらかじめ分かっている場合は、補正周期をYか月、補正値を+X×Y/12秒(あるいは−X×Y/12秒)とする計時補正データが設定されてもよい。例えば、補正値が−999ミリ秒〜+999ミリ秒の範囲となるように(X×Y/12<1)となるようなYが選択される。計時補正データ92(補正値及び補正周期)は、計時装置1の検査工程等において、あらかじめ記憶回路90が有する不揮発性メモリー(不図示)に書き込まれてもよいし、マスター制御装置2によって記憶回路90に書き込まれてもよい。また、計時補正データ92(補正値及び補正周期)は、計時装置1の動作中に可変であってもよい。   The time correction data 92 is data for correcting a time shift that occurs with the passage of time, and includes information on a correction value (an example of a “second correction value”) and information on a correction cycle. . For example, when it is known in advance that the timekeeping of the time measuring device 1 is delayed (or advanced) by about X seconds in one year based on information such as the accuracy of the vibrator 11 and the secular change of the vibrator 11, the correction cycle is set. Time correction data with a correction value of + X × Y / 12 seconds (or −X × Y / 12 seconds) may be set for Y months. For example, Y is selected such that (X × Y / 12 <1) so that the correction value is in the range of −999 milliseconds to +999 milliseconds. The time correction data 92 (correction value and correction cycle) may be written in advance in a non-volatile memory (not shown) of the storage circuit 90 in the inspection process or the like of the time measuring device 1, or the master control device 2 stores the storage circuit. 90 may be written. Further, the time correction data 92 (correction value and correction cycle) may be variable during the operation of the time measuring device 1.

計時補正部110は、記憶回路90に記憶されている計時補正データ92に基づいて、計時データT1(1/100秒),T0(1/1000秒)を補正する。具体的には、計時補正部110は、計時補正データ92に含まれる補正周期と計時データT2〜T8とに基づいて、補正周期が経過したか否かを判断する。そして、計時補正部110は、補正周期が経過する毎に、計時補正データ92に含まれる補正値をオフセットデータOFSとしてオフセットレジスター91に書き込むと共に、フラグセット信号FS2をアクティブ(例えば、ハイレベル)にして下位計時部50に出力する。オフセットレジスター91が保持するオフセットデータOFSは、下位計時部50に供給され、下位計時部50が出力するクリア信号CLR1がアクティブになるとゼロにクリアされる。   The time correction unit 110 corrects the time measurement data T1 (1/100 seconds) and T0 (1/1000 seconds) based on the time correction data 92 stored in the storage circuit 90. Specifically, the time correction unit 110 determines whether or not the correction period has elapsed based on the correction period included in the time correction data 92 and the time measurement data T2 to T8. The time correction unit 110 writes the correction value included in the time correction data 92 to the offset register 91 as the offset data OFS and activates the flag set signal FS2 (for example, high level) every time the correction period elapses. Is output to the lower timing unit 50. The offset data OFS held in the offset register 91 is supplied to the lower timer unit 50 and cleared to zero when the clear signal CLR1 output from the lower timer unit 50 becomes active.

このように、第2実施形態の計時装置1では、オフセットレジスター91を兼用し、第1実施形態の計時装置1と同様、マスター制御装置2からオフセット設定コマンドを受信することによって1/1000秒単位での計時補正を行うことが可能であると共に、計時補正データ92に含まれる補正周期で周期的に1/1000秒単位での計時補正を行うことができる。   As described above, in the timing device 1 of the second embodiment, the offset register 91 is also used, and in the same way as the timing device 1 of the first embodiment, by receiving the offset setting command from the master control device 2, a unit of 1/1000 second is obtained. In addition, it is possible to perform the time correction in the period of 1/1000 second periodically in the correction cycle included in the time correction data 92.

なお、計時補正データ92に含まれる補正値として+1秒以上又は−1秒以下の値を許容してもよい。この場合、計時補正部110は、補正値の1秒未満の値をオフセットレジスター91に書き込んで計時データT1(1/100秒),T0(1/1000秒)を補正(オフセット補正)すると共に、補正値の1秒以上の値に基づいて計時データT2(秒)〜T8(年)の少なくとも一部を補正すればよい。   Note that a value of +1 second or more or −1 second or less may be allowed as a correction value included in the time correction data 92. In this case, the time correction unit 110 writes a value less than 1 second of the correction value to the offset register 91 to correct the time measurement data T1 (1/100 seconds) and T0 (1/1000 seconds) (offset correction). What is necessary is just to correct | amend at least one part of time-measurement data T2 (second)-T8 (year) based on the value of 1 second or more of a correction value.

図12は、第2実施形態における下位計時部50の構成例を示す図である。図12に示すように、第2実施形態における下位計時部50は、第1実施形態における下位計時部50(図5)と同様の構成に加えて、さらに、論理和回路120を含んで構成されている。   FIG. 12 is a diagram illustrating a configuration example of the lower timing unit 50 in the second embodiment. As shown in FIG. 12, the lower timing unit 50 in the second embodiment is configured to include an OR circuit 120 in addition to the same configuration as the lower timing unit 50 (FIG. 5) in the first embodiment. ing.

論理和回路120は、フラグセット信号FSとフラグセット信号FS2の論理和信号を出力する。すなわち、論理和回路120は、フラグセット信号FS及びフラグセット信号FS2の少なくとも一方がハイレベル(アクティブ)のときはハイレベル(アクティブ)の信号を出力し、フラグセット信号FS及びフラグセット信号FS2が共にローレベル(非アクティブ)のときはローレベル(非アクティブ)の信号を出力する。そして、状態フラグレジスター58が格納する状態フラグFL2は、論理和回路120の出力信号が非アクティブからアクティブに変化するときに「1」に設定される。すなわち、状態フラグFL2は、フラグセット信号FS又はフラグセット信号FS2が非アクティブからアクティブに変化するときに「1」に設定される。   The logical sum circuit 120 outputs a logical sum signal of the flag set signal FS and the flag set signal FS2. That is, the OR circuit 120 outputs a high level (active) signal when at least one of the flag set signal FS and the flag set signal FS2 is at a high level (active), and the flag set signal FS and the flag set signal FS2 are When both are low level (inactive), a low level (inactive) signal is output. The state flag FL2 stored in the state flag register 58 is set to “1” when the output signal of the OR circuit 120 changes from inactive to active. That is, the state flag FL2 is set to “1” when the flag set signal FS or the flag set signal FS2 changes from inactive to active.

第2実施形態における下位計時部50のその他の構成及び機能は、第1実施形態における下位計時部50(図5)と同様であるため、その説明を省略する。   Other configurations and functions of the lower timing unit 50 according to the second embodiment are the same as those of the lower timing unit 50 (FIG. 5) according to the first embodiment, and thus description thereof is omitted.

なお、オフセット設定コマンドの受信による計時補正及び計時補正データ92に基づく計時補正の一方が行われている間に他方の開始タイミングが到来することが生じ得る場合には、先に開始タイミングが到来した計時補正が終了するのを待ってから後に開始タイミングが到来した計時補正が行われるように、調停回路を設ければよい。   In addition, when one of the timing correction based on the reception of the offset setting command and the timing correction based on the timing correction data 92 can be performed while the other start timing may occur, the start timing has arrived first. An arbitration circuit may be provided so that the time correction is performed after the start timing comes after waiting for the time correction to end.

図13は、第2実施形態の計時装置1による計時補正のための処理の手順の一例を示すフローチャート図である。図13において、図10と同じ処理を行うステップには同じ符号が付されている。なお、マスター制御装置2による計時補正のための処理の手順は、第1実施形態(図9)と同様であるため、その図示及び説明を省略する。   FIG. 13 is a flowchart illustrating an example of a processing procedure for timing correction by the timing device 1 according to the second embodiment. In FIG. 13, steps that perform the same processing as in FIG. Note that the processing procedure for time correction by the master control device 2 is the same as that in the first embodiment (FIG. 9), and therefore illustration and description thereof are omitted.

図10に示すように、まず、計時装置1は、記憶回路90から計時補正データを読み出
し、補正周期を設定する(ステップS200)。
As shown in FIG. 10, first, the timing device 1 reads time correction data from the storage circuit 90 and sets a correction cycle (step S200).

次に、計時装置1は、計時データ読み出しコマンドを受信すると(ステップS210のY)、計時データT0〜T8をマスター制御装置2に送信する(ステップS220)。   Next, when the timing device 1 receives the timing data read command (Y in step S210), the timing device 1 transmits the timing data T0 to T8 to the master control device 2 (step S220).

また、計時装置1は、オフセット設定コマンドを受信すると(ステップS230のY)、オフセット設定コマンドで指定されたオフセットデータをオフセットレジスター91に書き込み(ステップS240)、オフセットレジスター91に保持されているオフセットデータOFSを符号値SIGN及びオフセット値OFS1,OFS0に変換する(ステップS250)。   When the time measuring apparatus 1 receives the offset setting command (Y in step S230), it writes the offset data specified by the offset setting command to the offset register 91 (step S240), and the offset data held in the offset register 91 OFS is converted into a code value SIGN and offset values OFS1, OFS0 (step S250).

次に、計時装置1は、秒更新予定タイミングが到来するまで待機し(ステップS260のN)、秒更新予定タイミングが到来すると(ステップS260のY)、下位計時部50のカウンター55,52のカウント値をオフセット値OFS1,OFS0に更新し(ステップS270)、ステップS210以降の処理を再度行う。   Next, the timing device 1 waits until the second update scheduled timing arrives (N in Step S260), and when the second update scheduled timing comes (Y in Step S260), the counters 55 and 52 of the lower timing unit 50 count. The value is updated to the offset value OFS1, OFS0 (step S270), and the processing after step S210 is performed again.

一方、計時装置1は、計時データ読み出しコマンドを受信しなければ(ステップS210のN)、計時データT2〜T8に基づいて、ステップS200で設定した補正周期が経過したか否かを判定する(ステップS232)。そして、計時装置1は、補正周期が経過していなければ(ステップS232のN)、ステップS210以降の処理を再度行う。   On the other hand, if the timing device 1 does not receive the timing data read command (N in Step S210), it determines whether or not the correction cycle set in Step S200 has elapsed based on the timing data T2 to T8 (Step S210). S232). And if the correction period has not passed (N of step S232), the time measuring apparatus 1 will perform the process after step S210 again.

また、計時装置1は、補正周期が経過していれば(ステップS232のY)、記憶回路90から計時補正データを読み出し、補正値をオフセットデータとし、かつ、補正周期を設定する(ステップS234)。   If the correction cycle has elapsed (Y in step S232), the time measuring device 1 reads the time correction data from the storage circuit 90, sets the correction value as offset data, and sets the correction cycle (step S234). .

次に、計時装置1は、オフセットデータ(補正値)をオフセットレジスター91に書き込み(ステップS240)、オフセットレジスター91に保持されているオフセットデータOFSを符号値SIGN及びオフセット値OFS1,OFS0に変換する(ステップS250)。   Next, the timing device 1 writes the offset data (correction value) in the offset register 91 (step S240), and converts the offset data OFS held in the offset register 91 into the code value SIGN and the offset values OFS1, OFS0 ( Step S250).

次に、計時装置1は、秒更新予定タイミングが到来するまで待機し(ステップS260のN)、秒更新予定タイミングが到来すると(ステップS260のY)、下位計時部50のカウンター55,52のカウント値をオフセット値OFS1,OFS0に更新し(ステップS270)、ステップS210以降の処理を再度行う。   Next, the timing device 1 waits until the second update scheduled timing arrives (N in Step S260), and when the second update scheduled timing comes (Y in Step S260), the counters 55 and 52 of the lower timing unit 50 count. The value is updated to the offset value OFS1, OFS0 (step S270), and the processing after step S210 is performed again.

このような処理により、計時補正データ92で指定された補正周期で、計時データT1,T0に計時補正データ92で指定された補正値が設定されて計時補正が行われる。   By such processing, the correction value specified by the time correction data 92 is set to the time measurement data T1 and T0 at the correction cycle specified by the time correction data 92, and the time correction is performed.

以上に説明した第2実施形態の計時装置1では、計時装置1の下位計時部50は、計時補正データ92で指定された補正周期で、オフセットレジスター91に記憶されているオフセットデータOFS(オフセット値OFS1,OFS0)(計時補正データ92で指定された補正値)を計時データT1(1/100秒),T0(1/1000秒)に設定することで、計時データT2(秒)の更新タイミングを補正する。従って、例えば、マスター制御装置2からオフセット設定コマンドを受信することによる計時補正が長期間行われないような状況であっても、計時補正データ92に含まれる補正周期で周期的に1/1000秒単位での計時補正を行うことにより、経年変化等によって生じる計時のずれを補正することができる。   In the timing device 1 according to the second embodiment described above, the lower timing unit 50 of the timing device 1 uses the offset data OFS (offset value) stored in the offset register 91 at the correction cycle specified by the time correction data 92. By setting OFS1, OFS0) (correction value specified by time correction data 92) to time data T1 (1/100 seconds) and T0 (1/1000 seconds), the update timing of time data T2 (seconds) is set. to correct. Therefore, for example, even when the time correction by receiving the offset setting command from the master control device 2 is not performed for a long period of time, the correction cycle included in the time correction data 92 is periodically 1/1000 second. By performing the time correction in units, it is possible to correct a time shift caused by a secular change or the like.

1−3.変形例
[変形例1]
上記各実施形態では、1Hzの周波数のクロック信号CLK3は、下位計時部50が生成して出力しているが、分周回路によって4096Hzのクロック信号CLK1を4096分周して生成されてもよい。図14は、変形例1の計時装置1の構成例を示す図である。図14の例は、第2実施形態(図11)を変形したものであるが、第1実施形態(図1)を同様に変形してもよい。図14において、図11と同様の構成要素には同じ符号を付しており、第1実施形態又は第2実施形態と異なる内容を中心に説明し、第1実施形態又は第2実施形態と重複する説明を省略する。
1-3. Modification [Modification 1]
In each of the above embodiments, the clock signal CLK3 having a frequency of 1 Hz is generated and output by the lower timer unit 50. However, the clock signal CLK1 having a frequency of 4096 may be generated by dividing the frequency of the clock signal CLK1 of 4096 Hz by a frequency dividing circuit. FIG. 14 is a diagram illustrating a configuration example of the timing device 1 according to the first modification. The example of FIG. 14 is a modification of the second embodiment (FIG. 11), but the first embodiment (FIG. 1) may be similarly modified. In FIG. 14, the same components as those in FIG. 11 are denoted by the same reference numerals, and the description will focus on the contents different from the first embodiment or the second embodiment, and overlap with the first embodiment or the second embodiment. Description to be omitted is omitted.

図14に示すように、変形例1の計時装置1は、第2実施形態の計時装置1(図11)に対して、分周回路30及び調停回路60に代えて分周回路130及び調停回路140を備えている。分周回路130は、4096Hz(=212Hz)の周波数を有するクロック信号CLK1を4096分周することにより、1Hzの周波数を有するクロック信号CLK3を生成する。分周回路130は、分周回路20(図3)と同様、分周比に対応した12個のT型フリップフロップによって構成されてもよい。クロック信号CLK3は、調停回路140を介して上位計時部70に供給される。 As shown in FIG. 14, the timing device 1 of the first modification is different from the timing device 1 (FIG. 11) of the second embodiment in that a frequency divider 130 and an arbitration circuit are used instead of the frequency divider 30 and the arbitration circuit 60. 140. The frequency dividing circuit 130 divides the clock signal CLK1 having a frequency of 4096 Hz (= 2 12 Hz) by 4096 to generate a clock signal CLK3 having a frequency of 1 Hz. Similarly to the frequency divider circuit 20 (FIG. 3), the frequency divider circuit 130 may be configured by 12 T-type flip-flops corresponding to the frequency division ratio. The clock signal CLK3 is supplied to the upper timer unit 70 via the arbitration circuit 140.

調停回路140は、上位計時部70から計時データが読み出されている間に計時データが変化しないように、計時データが読み出されている期間においてクロック信号CLK3に含まれているパルスを遅延させる。それ以外の期間において、調停回路140は、分周回路130から供給されるクロック信号CLK3をそのまま出力する。また、調停回路140は、上位計時部70が計時データを更新する際に秒単位以上の計時データT2〜T8と1/100秒単位の計時データT1及び1/1000秒単位の計時データT0との間で矛盾が生じないように、クロック信号CLK3に同期して下位計時部50のカウンター55,52(図5参照)を強制的にリセットする。調停回路140は、例えば、組み合わせ回路又は順序回路を含む論理回路等で構成される。   The arbitration circuit 140 delays a pulse included in the clock signal CLK3 during a period in which the time measurement data is being read so that the time measurement data does not change while the time measurement data is being read from the upper time measurement unit 70. . In other periods, the arbitration circuit 140 outputs the clock signal CLK3 supplied from the frequency divider circuit 130 as it is. In addition, the arbitration circuit 140 includes the timing data T2 to T8 in units of seconds or more, the timing data T1 in units of 1/100 seconds, and the timing data T0 in units of 1/1000 seconds when the upper timing unit 70 updates the timing data. The counters 55 and 52 (see FIG. 5) of the lower timer unit 50 are forcibly reset in synchronization with the clock signal CLK3 so that no inconsistency occurs. The arbitration circuit 140 is configured by a logic circuit including a combinational circuit or a sequential circuit, for example.

なお、下位計時部50は、クロック信号CLK3を出力する必要がないので、図12に示した構成のうち、分周回路59a,59bは不要である。   Since the low-order time measuring unit 50 does not need to output the clock signal CLK3, the frequency dividing circuits 59a and 59b are unnecessary in the configuration shown in FIG.

変形例1の計時装置1によれば、上記の各実施形態と同様の効果を奏すると共に、例えば、クロック信号CLK3を生成して秒単位以上の時刻を表す複数のカウント値を生成するための回路構成が、秒単位以上の計時動作を行う従来の機種と同様のシンプルな構成を保つことができるので、回路レイアウト等に関して従来の機種との互換性を高めることができる。   According to the timing device 1 of the first modification, the same effect as that of each of the embodiments described above is obtained, and, for example, a circuit for generating a clock signal CLK3 and generating a plurality of count values representing times in seconds or more. Since the configuration can maintain a simple configuration similar to that of a conventional model that performs a timekeeping operation in units of seconds or more, compatibility with the conventional model in terms of circuit layout and the like can be improved.

[変形例2]
上記の各実施形態では、1Hzの周波数を有するクロック信号CLK3の生成を容易にするために、発振回路10が2のべき乗の周波数(32768Hz(=215Hz))を有するクロック信号CLK0を出力するようにしている。すなわち、上記の各実施形態では、例えば、共振周波数が32768Hz付近である振動子11が用いられており、そのため、カウンター52が40と41とを選択して4096Hzの周波数を有するクロック信号CLK1のパルスの数をカウントし、擬似的に1/1000秒単位の計時データT0を作成している。これに対して、変形例2の計時装置1は、共振周波数が2のべき乗×1kHzの周波数を有する振動子11を用いることにより、正確な1/1000秒単位の計時データT0を作成する。例えば、共振周波数が32000Hz付近である振動子11を用いて、発振回路10が32000Hzのクロック信号CLK0を出力し、分周回路20がクロック信号CLK0を32分周して1kHzのクロック信号CLK1を生成し、下位計時部50に供給する。図示を省略するが、下位計時部50は、図5に示した構成に対してカウンター52が4ビット10進BCDカウンターに置き換えられ、カウンター52がクロック信号CLK1のパルスをカウントして計時データT0(1/1000秒)を生成
し、カウント制御回路51がカウンター52の桁上げ時にカウントイネーブル信号CNTENをアクティブ(例えば、ハイレベル)にする。また、8ビット10進BCDカウンターであるカウンター55が、カウントイネーブル信号CNTENがアクティブのときにクロック信号CLK1に同期してカウント動作を行うことにより、計時データT1(1/100秒)を生成する。そして、上位計時部70は、クロック信号CLK1に基づいて、具体的には下位計時部50のカウンター55からの桁上げ信号(1秒周期の信号)に基づいて、計時データT2〜T8を生成すればよい。なお、図5の構成における制御フラグレジスター54及び分周回路59a,59bは不要である。
[Modification 2]
In each of the embodiments described above, the oscillation circuit 10 outputs the clock signal CLK0 having a power of 2 (32768 Hz (= 2 15 Hz)) in order to facilitate the generation of the clock signal CLK3 having a frequency of 1 Hz. I am doing so. That is, in each of the above-described embodiments, for example, the vibrator 11 having a resonance frequency near 32768 Hz is used. Therefore, the counter 52 selects 40 and 41 and the pulse of the clock signal CLK1 having a frequency of 4096 Hz. The count data T0 is created in a pseudo 1/1000 second unit. On the other hand, the time measuring device 1 of the modification 2 creates accurate time measuring data T0 in units of 1/1000 second by using the vibrator 11 having a resonance frequency that is a power of 2 × 1 kHz. For example, using the vibrator 11 whose resonance frequency is around 32000 Hz, the oscillation circuit 10 outputs a clock signal CLK0 of 32000 Hz, and the frequency divider circuit 20 divides the clock signal CLK0 by 32 to generate a clock signal CLK1 of 1 kHz. Then, it is supplied to the lower timing unit 50. Although not shown in the figure, in the lower timing unit 50, the counter 52 is replaced with a 4-bit decimal BCD counter in the configuration shown in FIG. 5, and the counter 52 counts the pulses of the clock signal CLK1 to measure the time data T0 ( 1/1000 second), and the count control circuit 51 activates the count enable signal CNTEN (for example, high level) when the counter 52 carries. Further, the counter 55, which is an 8-bit decimal BCD counter, performs the count operation in synchronization with the clock signal CLK1 when the count enable signal CNTEN is active, thereby generating the time measurement data T1 (1/100 second). Then, the upper timer unit 70 generates the time data T2 to T8 based on the clock signal CLK1, specifically, based on the carry signal (the signal having a period of 1 second) from the counter 55 of the lower timer unit 50. That's fine. Note that the control flag register 54 and the frequency dividing circuits 59a and 59b in the configuration of FIG. 5 are unnecessary.

上記の各実施形態と同様、この変形例2の計時装置1においても、計時データT2(秒)の更新予定タイミングで、オフセットデータOFS(オフセット値OFS1,OFS0)が計時データT1(1/100秒),T0(1/1000秒)に設定されて計時データT2(秒)の更新タイミングが補正されるので、従来よりも簡単に正確な計時補正を行うことができる。   Similarly to each of the above-described embodiments, in the timing device 1 of the second modified example, the offset data OFS (offset values OFS1, OFS0) is stored in the timing data T1 (1/100 seconds) at the scheduled update timing of the timing data T2 (seconds). ), T0 (1/1000 seconds) and the update timing of the timing data T2 (seconds) is corrected, so that accurate timing correction can be performed more easily than in the past.

2.電子機器
図15は、本実施形態の電子機器の構成の一例を示す機能ブロック図である。また、図16は、本実施形態の電子機器の一例であるスマートフォンの外観の一例を示す図である。
2. Electronic Device FIG. 15 is a functional block diagram showing an example of the configuration of the electronic device of the present embodiment. FIG. 16 is a diagram illustrating an example of the appearance of a smartphone that is an example of the electronic apparatus of the present embodiment.

本実施形態の電子機器300は、計時装置310、制御部320、操作部330、記憶部340、通信部350、表示部360及び音出力部370を含んで構成されている。なお、本実施形態の電子機器300は、図15の構成要素(各部)の一部を省略又は変更し、あるいは、他の構成要素を付加した構成としてもよい。   The electronic device 300 according to the present embodiment includes a timing device 310, a control unit 320, an operation unit 330, a storage unit 340, a communication unit 350, a display unit 360, and a sound output unit 370. Note that the electronic device 300 of the present embodiment may be configured such that some of the components (each unit) in FIG. 15 are omitted or changed, or other components are added.

計時装置310は、計時動作を行い、制御部320からのコマンドに従って計時データを出力する。   The timing device 310 performs a timing operation and outputs timing data in accordance with a command from the control unit 320.

制御部320は、記憶部340等に記憶されているプログラムに従い、各種の計算処理や制御処理を行う。具体的には、制御部320は、操作部330からの操作信号に応じた各種の処理、他の機器とデータ通信を行うために通信部350を制御する処理、表示部360に各種の情報を表示させるための表示信号を送信する処理、音出力部370から各種の音を出力させるための音信号を送信する処理等を行う。また、制御部320は、計時装置310から計時データを読み出して(受信して)各種の計算処理や制御処理を行うと共に、計時データの補正値としての例えば1/1000秒単位でのオフセットデータを送信する。制御部320は、例えば、MCU(Micro Controller Unit)やMPU(Micro Processor Unit)によって実現される。   The control unit 320 performs various calculation processes and control processes in accordance with programs stored in the storage unit 340 and the like. Specifically, the control unit 320 performs various processes in accordance with operation signals from the operation unit 330, processes for controlling the communication unit 350 to perform data communication with other devices, and various types of information on the display unit 360. Processing for transmitting a display signal for display, processing for transmitting a sound signal for outputting various sounds from the sound output unit 370, and the like are performed. In addition, the control unit 320 reads (receives) the time data from the time measuring device 310 and performs various calculation processes and control processes, and also, for example, offset data in units of 1/1000 second as a correction value of the time data. Send. The control unit 320 is realized by, for example, an MCU (Micro Controller Unit) or an MPU (Micro Processor Unit).

操作部330は、操作キーやボタンスイッチ等により構成される入力装置であり、ユーザーによる操作に応じた操作信号を制御部320に出力する。制御部320は、例えば、操作部330から入力される信号に応じて、計時装置310に時刻情報を設定することができる。   The operation unit 330 is an input device including operation keys, button switches, and the like, and outputs an operation signal corresponding to an operation by the user to the control unit 320. For example, the control unit 320 can set time information in the time measuring device 310 in accordance with 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, and the like for the control unit 320 to perform various types of calculation processing and control processing. The storage unit 340 is used as a work area of the control unit 320, and programs and data read from the storage unit 340, data input from the operation unit 330, calculation results executed by the control unit 320 according to various programs, and the like. Is temporarily stored. The storage unit 340 includes a ROM (Read Only Memory) and a RAM (Random Access Memory), and includes, for example, a hard disk, a flexible disk, an MO, an MT, various memories, a CD-ROM, or a DVD-ROM. Realized.

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

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

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

計時装置310として例えば上述した各実施形態の計時装置1を適用することにより、例えば、長期間にわたって高い信頼性を維持する電子機器を実現することができる。なお、制御部320、あるいは、制御部320及び記憶部340が上述した各実施形態のマスター制御装置2に相当し、表示部360、音出力部370、あるいは、制御部320が通信部350を介して通信する外部装置がスレーブ装置3に相当する。   By applying the timing device 1 of each embodiment described above as the timing device 310, for example, an electronic device that maintains high reliability over a long period of time can be realized. The control unit 320, or the control unit 320 and the storage unit 340 correspond to the master control device 2 of each embodiment described above, and the display unit 360, the sound output unit 370, or the control unit 320 is connected via the communication unit 350. The external device that performs communication corresponds to the slave device 3.

このような電子機器300としては種々の電子機器が考えられ、例えば、電子時計、パーソナルコンピューター(例えば、モバイル型パーソナルコンピューター、ラップトップ型パーソナルコンピューター、タブレット型パーソナルコンピューター)、スマートフォンや携帯電話機などの移動体端末、ディジタルカメラ、インクジェット式吐出装置(例えば、インクジェットプリンター)、サーバー(タイムサーバー)やルーター、スイッチなどのストレージエリアネットワーク機器、ローカルエリアネットワーク機器、移動体端末基地局用機器、テレビ、ビデオカメラ、ビデオレコーダー、カーナビゲーション装置、リアルタイムクロック装置、ページャー、電子手帳(通信機能付も含む)、電子辞書、電卓、電子ゲーム機器、ゲーム用コントローラー、ワードプロセッサー、ワークステーション、テレビ電話、防犯用テレビモニター、電子双眼鏡、POS端末、医療機器(例えば電子体温計、血圧計、血糖計、心電図計測装置、超音波診断装置、電子内視鏡)、魚群探知機、有線又は無線の通信機能を有し各種のデータを送信可能なガスメーターや水道メーターや電力量計(スマートメーター)等の各種測定機器、計器類(例えば、車両、航空機、船舶の計器類)、フライトシミュレーター、ヘッドマウントディスプレイ、モーショントレース、モーショントラッキング、モーションコントローラー、PDR(歩行者位置方位計測)等が挙げられる。   Various electronic devices can be considered as such an electronic device 300, for example, movement of an electronic watch, a personal computer (for example, a mobile personal computer, a laptop personal computer, a tablet personal computer), a smartphone, a mobile phone, or the like. Terminals, digital cameras, inkjet discharge devices (for example, inkjet printers), storage area network devices such as servers (time servers), routers, 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 (including those with communication functions), electronic dictionaries, calculators, electronic game devices, game consoles Troller, word processor, workstation, video phone, security TV monitor, electronic binoculars, POS terminal, medical equipment (eg electronic thermometer, blood pressure monitor, blood glucose meter, electrocardiogram measuring device, ultrasonic diagnostic device, electronic endoscope), fish school Detectors, various measuring instruments such as gas meters, water meters, and watt hour meters (smart meters) that have a wired or wireless communication function and can transmit various types of data, meters (for example, vehicles, aircraft, and ship meters) ), Flight simulator, head mounted display, motion trace, motion tracking, motion controller, PDR (pedestrian position and orientation measurement), and the like.

3.移動体
図17は、本実施形態の移動体の構成の一例を示す機能ブロック図である。また、図18は、本実施形態の移動体の一例である自動車の外観の一例を示す図(上面図)である。本実施形態の移動体400は、計時装置410、演算処理装置420及び制御装置430,440,450を含んで構成されている。なお、本実施形態の移動体は、図17及び図18の構成要素(各部)の一部を省略し、あるいは、他の構成要素を付加した構成としてもよい。
3. Mobile Object FIG. 17 is a functional block diagram showing an example of the configuration of the mobile object of this embodiment. FIG. 18 is a diagram (top view) showing an example of the appearance of an automobile that is an example of the moving object of the present embodiment. The moving body 400 according to the present embodiment includes a time measuring device 410, an arithmetic processing device 420, and control devices 430, 440, and 450. Note that the mobile body of the present embodiment may have a configuration in which some of the components (each unit) in FIGS. 17 and 18 are omitted or other components are added.

計時装置410は、計時動作を行い、演算処理装置420からのコマンドに従って計時データを出力する。   The timing device 410 performs a timing operation and outputs timing data in accordance with a command from the arithmetic processing device 420.

演算処理装置420は、内蔵される不図示の記憶部等に記憶されているプログラムに従い、各種の計算処理や制御処理を行う。具体的には、演算処理装置420は、制御装置430,440,450を制御する処理を行う。また、演算処理装置420は、計時装置410から計時データを読み出して(受信して)各種の計算処理を行うと共に、計時データの補正値としての例えば1/1000秒単位でのオフセットデータを送信する。   The arithmetic processing unit 420 performs various calculation processes and control processes in accordance with programs stored in a built-in storage unit (not shown). Specifically, the arithmetic processing unit 420 performs processing for controlling the control devices 430, 440, and 450. The arithmetic processing unit 420 reads out (receives) the time-measurement data from the time-measurement device 410 and performs various calculation processes, and transmits offset data, for example, in units of 1/1000 second as a correction value of the time-measurement data. .

制御装置430,440,450は、例えば、移動体400に対して、エンジンシステム、ブレーキシステム、キーレスエントリーシステム等の各種制御を行う。   The control devices 430, 440, and 450 perform various controls such as an engine system, a brake system, and a keyless entry system on the moving body 400, for example.

計時装置410として例えば上述した各実施形態の計時装置1を適用することにより、例えば、長期間にわたって高い信頼性を維持する移動体を実現することができる。なお、演算処理装置420が上述した各実施形態のマスター制御装置2に相当し、制御装置430,440,450がスレーブ装置3に相当する。   By applying the timing device 1 of each embodiment described above as the timing device 410, for example, it is possible to realize a moving body that maintains high reliability over a long period of time. Note that the arithmetic processing device 420 corresponds to the master control device 2 of each embodiment described above, and the control devices 430, 440, and 450 correspond to the slave device 3.

このような移動体400としては種々の移動体が考えられ、例えば、自動車(電気自動車も含む)、ジェット機やヘリコプター等の航空機、船舶、ロケット、人工衛星等が挙げられる。   As such a moving body 400, various moving bodies can be considered, and examples thereof include automobiles (including electric automobiles), aircraft such as jets and helicopters, ships, rockets, and artificial satellites.

本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。   The present invention is not limited to the present 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 to these. For example, it is possible to appropriately combine each embodiment and each modification.

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

1…計時装置、2…マスター制御装置、3…スレーブ装置、4…メイン電源、5…バックアップ電源、10…発振回路、11…振動子、12…インバーター(論理反転素子)、13…抵抗、14…キャパシター、15…キャパシター群、16…スイッチ回路、17…デコード回路、20…分周回路、21〜23…T型フリップフロップ、30…分周回路、40…調停回路、50…下位計時部、51…カウント制御回路、52…カウンター、53…出力制御回路、54…制御フラグレジスター、55…カウンター、56…出力制御回路、57…データ変換回路、58…状態フラグレジスター、59a,59b…分周回路、60…調停回路、70…上位計時部、71a〜74a…カウンター、75a…シフトレジスター、76a,77a…カウンター、71b〜77b…出力制御回路、80…インターフェース回路、90…記憶回路、91…オフセットレジスター、92…計時補正データ、100…電源切替回路、110…計時補正部、120…論理和回路、130…分周回路、140…調停回路、200…マスター計時データ、300…電子機器、310…計時装置、320…制御部、330…操作部、340…記憶部、350…通信部、360…表示部、370…音出力部、400…移動体、410…計時装置、420…演算処理装置、430,440,450…制御装置 DESCRIPTION OF SYMBOLS 1 ... Time measuring device, 2 ... Master control device, 3 ... Slave device, 4 ... Main power supply, 5 ... Backup power supply, 10 ... Oscillation circuit, 11 ... Vibrator, 12 ... Inverter (logic inversion element), 13 ... Resistance, 14 ... Capacitor, 15 ... Capacitor group, 16 ... Switch circuit, 17 ... Decode circuit, 20 ... Division circuit, 21-23 ... T-type flip-flop, 30 ... Division circuit, 40 ... Arbitration circuit, 50 ... Lower timing unit, 51 ... Count control circuit 52 ... Counter 53 ... Output control circuit 54 ... Control flag register 55 ... Counter 56 ... Output control circuit 57 ... Data conversion circuit 58 ... Status flag register 59a, 59b ... Division Circuit, 60 ... Arbitration circuit, 70 ... Upper clock section, 71a to 74a ... Counter, 75a ... Shift register, 76a, 77a ... Count , 71b to 77b ... output control circuit, 80 ... interface circuit, 90 ... memory circuit, 91 ... offset register, 92 ... time correction data, 100 ... power supply switching circuit, 110 ... time correction unit, 120 ... OR circuit, 130 DESCRIPTION OF SYMBOLS ... Dividing circuit 140 ... Arbitration circuit 200 ... Master timing data 300 ... Electronic device 310 ... Timing device 320 ... Control unit 330 ... Operation unit 340 ... Storage unit 350 ... Communication unit 360 ... Display unit 370, sound output unit, 400, moving body, 410, timing device, 420, arithmetic processing device, 430, 440, 450, control device

Claims (8)

クロック信号に同期して第1の計時データを生成する第1の計時回路と、
前記第1の計時データが更新される周期よりも長い周期で更新される第2の計時データを生成する第2の計時回路と、
前記第1の計時データを外部装置に送信し、第1の補正値を前記外部装置から受信するインターフェース回路と、
前記第1の補正値を記憶する記憶回路と、を備え、
前記第1の計時回路は、
前記第1の計時データに前記第1の補正値を設定することで、前記第2の計時データの更新タイミングを補正する、計時装置。
A first timing circuit that generates first timing data in synchronization with the clock signal;
A second timing circuit that generates second timing data that is updated at a cycle longer than the cycle at which the first timing data is updated;
An interface circuit for transmitting the first timing data to an external device and receiving a first correction value from the external device;
A storage circuit for storing the first correction value,
The first timing circuit includes:
A timing device that corrects the update timing of the second timing data by setting the first correction value in the first timing data.
前記第1の計時回路は、
前記第1の計時データが所定値のときに前記第1の計時データに前記第1の補正値を設定することで、前記更新タイミングを補正する、請求項1に記載の計時装置。
The first timing circuit includes:
The timing device according to claim 1, wherein the update timing is corrected by setting the first correction value in the first timing data when the first timing data is a predetermined value.
前記第1の補正値は、
前記第1の計時データと前記外部装置が有する計時データとに基づいて前記外部装置によって生成された値である、請求項1又は2に記載の計時装置。
The first correction value is
The timing device according to claim 1, wherein the timing device is a value generated by the external device based on the first timing data and the timing data of the external device.
前記第1の計時回路は、
1/1000秒単位で前記第1の計時データを更新し、
前記第2の計時回路は、
1秒単位で前記第2の計時データを更新する、請求項1乃至3のいずれか1項に記載の計時装置。
The first timing circuit includes:
Updating the first timekeeping data in units of 1/1000 second;
The second timing circuit includes:
The timing device according to any one of claims 1 to 3, wherein the second timing data is updated in units of one second.
前記クロック信号の周波数は4096Hzであり、
前記第1の計時回路は、
4対96の比率で40と41とを選択して前記クロック信号のパルスの数を6ビットでカウントするカウンターを有し、前記第1の計時データの一部として、前記カウンターが出力する6ビットのカウント値の上位4ビットのカウント値を出力する、請求項4に記載の計時装置。
The frequency of the clock signal is 4096 Hz;
The first timing circuit includes:
6-bit output from the counter as part of the first time-measurement data, having a counter that selects 40 and 41 at a ratio of 4 to 96 and counts the number of pulses of the clock signal in 6 bits The time measuring device according to claim 4, wherein the count value of the upper 4 bits of the count value is output.
前記記憶回路は、
第2の補正値と、補正周期とをさらに記憶し、
前記第1の計時回路は、
前記補正周期で、前記第1の計時データに前記第2の補正値を設定することで、前記更新タイミングを補正する、請求項1乃至5のいずれか1項に記載の計時装置。
The memory circuit is
Further storing the second correction value and the correction cycle,
The first timing circuit includes:
6. The timing device according to claim 1, wherein the update timing is corrected by setting the second correction value in the first timing data in the correction period. 7.
請求項1乃至6のいずれか1項に記載の計時装置と、
前記外部装置として、前記計時装置に前記第1の補正値を送信する制御装置と、を備えた、電子機器。
A timing device according to any one of claims 1 to 6;
An electronic apparatus comprising: a control device that transmits the first correction value to the time measuring device as the external device.
請求項1乃至6のいずれか1項に記載の計時装置を備えた、移動体。   A moving body comprising the timing device according to claim 1.
JP2017228243A 2017-06-07 2017-11-28 Timekeeping devices, electronic devices and mobiles Active JP6958296B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810567102.XA CN109001970B (en) 2017-06-07 2018-06-05 Timepiece device, electronic apparatus, and moving object
US16/000,957 US10725497B2 (en) 2017-06-07 2018-06-06 Clocking device, electronic apparatus, and vehicle

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2017112383 2017-06-07
JP2017112383 2017-06-07

Publications (2)

Publication Number Publication Date
JP2018205293A true JP2018205293A (en) 2018-12-27
JP6958296B2 JP6958296B2 (en) 2021-11-02

Family

ID=64957034

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017228243A Active JP6958296B2 (en) 2017-06-07 2017-11-28 Timekeeping devices, electronic devices and mobiles

Country Status (1)

Country Link
JP (1) JP6958296B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918337A (en) * 2019-02-21 2019-06-21 广州技象科技有限公司 A kind of time automatic calibrating method applied to SCM system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918337A (en) * 2019-02-21 2019-06-21 广州技象科技有限公司 A kind of time automatic calibrating method applied to SCM system

Also Published As

Publication number Publication date
JP6958296B2 (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN109001970B (en) Timepiece device, electronic apparatus, and moving object
JP6686390B2 (en) Timing device, electronic device, and moving body
CN106487332B (en) Oscillation circuit, electronic apparatus, and moving object
US9252749B2 (en) Clock generation device, electronic apparatus, moving object, and clock generation method
JP6115715B2 (en) CLOCK GENERATION DEVICE, ELECTRONIC DEVICE, MOBILE BODY, AND CLOCK GENERATION METHOD
US9389636B2 (en) Clock generating device, electronic apparatus, moving object, clock generating method
US9075396B2 (en) Timer device and electronic apparatus
JP6958296B2 (en) Timekeeping devices, electronic devices and mobiles
JP6728598B2 (en) Oscillation circuit, electronic equipment and mobile
CN111614322B (en) Real-time clock module, electronic device, and moving object
CN106557019B (en) Timing device and timing method and electronic equipment
JP7314685B2 (en) Timepieces, electronic devices and moving bodies
JP5920564B2 (en) Timer device and electronic device
US10732670B2 (en) Real-time clock module, electronic device, vehicle, and information processing system
JP7392576B2 (en) Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method
US20230341894A1 (en) Real-Time Clock Module And Electronic Device
JP6540478B2 (en) Timekeeping device, electronic device, and moving body
US20230341893A1 (en) Real-Time Clock Module

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201019

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210810

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: 20210907

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210920

R150 Certificate of patent or registration of utility model

Ref document number: 6958296

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150