JP3421508B2 - Clock LSI correction circuit - Google Patents

Clock LSI correction circuit

Info

Publication number
JP3421508B2
JP3421508B2 JP17707996A JP17707996A JP3421508B2 JP 3421508 B2 JP3421508 B2 JP 3421508B2 JP 17707996 A JP17707996 A JP 17707996A JP 17707996 A JP17707996 A JP 17707996A JP 3421508 B2 JP3421508 B2 JP 3421508B2
Authority
JP
Japan
Prior art keywords
count value
counting
counting means
clock
value
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.)
Expired - Fee Related
Application number
JP17707996A
Other languages
Japanese (ja)
Other versions
JPH102974A (en
Inventor
研次 本舘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHINKO MECHATROTECH CO., LTD.
Original Assignee
SHINKO MECHATROTECH CO., LTD.
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 SHINKO MECHATROTECH CO., LTD. filed Critical SHINKO MECHATROTECH CO., LTD.
Priority to JP17707996A priority Critical patent/JP3421508B2/en
Publication of JPH102974A publication Critical patent/JPH102974A/en
Application granted granted Critical
Publication of JP3421508B2 publication Critical patent/JP3421508B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electric Clocks (AREA)

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、時計LSI(大規
模集積回路)の補正回路に関する。 【0002】 【従来の技術】計時動作を行って、年月日及び時分秒の
時計データを出力する時計LSIは、計時動作の過程に
おいてそれ自身の要因による累積誤差や予期されない外
来ノイズによる誤差を生じる。このような誤差を補正す
るための補正回路が従来から提案されている。図8は、
従来の時計LSIの補正回路の一例を示すブロック図で
あり、図9〜図11は、その動作フローチャートであ
る。 【0003】図8に示すように、CPU1にはバスBを
介して制御プログラムを保持するROM2、後述する時
計データ保持エリア3a及び12時間カウンタ3bを備
えるRAM3、タイマ4及び時計LSI5が接続されて
いる。タイマ4は、CPU1によって設定された所定周
期で割込信号Stを発生してCPU1の割込端子INT
1に入力するものである。電源装置6は、交流電源Va
cから生成した直流電源を上記CPU1〜タイマ4及び
信号生成手段7に供給するためのものである。電源スイ
ッチSWは、電源装置6に対する交流電源Vacの供給
をオン・オフするものである。信号生成手段7は、交流
電源Vacに基づいてその周波数(例えば50Hz又は
60Hz)と同じ周波数の割込信号Sacを生成してC
PU1の割込端子INT2に入力するものである。この
信号生成手段7は、電源装置6に内蔵されていてもよ
い。また、バッテリ8等のバックアップ手段によってバ
ックアップされているRAM3及び時計LSI5は、電
源装置6のオン・オフに関係なく、それぞれデータの保
持及び計時動作を行っている。 【0004】ここで、12時間カウンタ3bについて説
明しておく。12時間カウンタ3bには、基本的に、交
流電源Vacの周波数によって定まる周期で12時間を
割った値に相当する12時間基本値をそのときの時計デ
ータの秒単位の値に基づいて補正した値がセットされ
る。例えば、交流電源Vacの周波数が50Hzであれ
ば、周期は20msとなるから、12時間を20msで
割った12時間基本値は、「2160000」となる。
この12時間基本値を12時間カウンタ3bにセットし
ておき、20ms周期で−1していけば、計数値が0に
なったときに、12時間00分00秒が経過したことが
わかる。したがって、12時間カウンタ3bの計数値が
0に到達した時点で、時計LSI5の時計データを調べ
ることにより、12時間00分00秒に対する時計デー
タの誤差を知ることができる。 【0005】しかしながら、12時間カウンタ3bを起
動する時点と、時計LSI5の時計データの秒単位の値
が00秒となる時点とが一致するとは限らないので、1
2時間カウンタ3bにセットする12時間基本値を補正
する必要がある。すなわち、12時間カウンタ3bを起
動する時点における時計データの秒単位の値が01秒〜
29秒であれば、その値に対応する値だけ上記12時間
基本値から減算して補正し、上記時計データの秒単位の
値が31秒〜59秒であれば、その値に対応する値だけ
上記12時間基本値に加算して補正する。このようにし
て補正した12時間基本値(以下、補正12時間基本値
という)を12時間カウンタ3bにセットすれば、12
時間カウンタ3bの計数値が0になったときに、時計L
SI5から出力される時計データの秒単位が00秒と比
較してどの程度ずれているかを判定することにより、時
計LSI5の時計データの誤差を認識することができ
る。なお、この場合には、交流電源Vacの周波数が正
確に制御されているということが前提となることはもち
ろんである。 【0006】図9は、電源投入時に行われる初期設定ル
ーチンのフローチャートである。まず、電源スイッチS
Wが投入されると、CPU1は、時計LSI5から出力
される時計データをRAM3の時計データ保持エリア3
aに格納する(ステップS1)。次いで、タイマ4に5
00msの周期データをセットして起動を掛ける(ステ
ップS2)。そして、上記ステップS1でリードした時
計データに対応する補正12時間基本値を12時間カウ
ンタ3bにセットして(ステップS3)、この初期設定
ルーチンを終了する。 【0007】図10は、CPU1の割込端子INT1に
タイマ4からの割込信号Stが入力することによって、
タイマ4にセットされた所定周期である500msごと
に起動される第1の割込処理ルーチンのフローチャート
である。まず、CPU1は、時計LSI5から出力され
る時計データをリードする(ステップS4)。ついで、
RAM3の時計データ保持エリア3aに格納されている
時計データをリードし、この時計データがステップS4
でリードした前回の時計データと比較して1秒以内にあ
るか否かを判定する(ステップS5)。ステップS5が
肯定ならば、時計LSI5の計時動作が正常であるとみ
なして、(ステップSS4でリードした時計データをR
AM3の時計データ保持エリア3aに格納して(ステッ
プS6)、この第1の割込処理ルーチンを終了する。 【0008】一方、ステップS5が否定ならば、時計L
SI5が誤動作してその時計データに1秒を超える誤差
が発生しているものとして、RAM3の時計データ保持
エリア3aに格納されている前回の時計データを時計L
SI5にセットすることにより補正を行い(ステップS
7)、この第1の割込処理ルーチンを終了する。この第
1の割込処理ルーチンによって、500ms毎に時計L
SI5の誤動作の有無が判定されるので、ノイズ等の影
響によって時計データが大きな誤差を生じても、時計L
SI5の時計データを正しい値に補正することができ
る。 【0009】図11は、信号生成手段7の割込信号Sa
cがCPU1の割込端子INT2に入力することによっ
て、交流電源Vacの周波数によって定まる周期で起動
される第2の割込処理ルーチンのフローチャートであ
る。図11を参照して動作を説明する。まず、CPU1
は、割込端子INT2に割込信号Sacが入力すると、
RAM3の12時間カウンタ3bのカウンタ値を−1す
る(ステップS8)。次いで、12時間カウンタ3bの
カウンタ値が0か否かを判定する(ステップS9)。ス
テップS9が否定ならば、12時間が経過していないと
判断して処理ルーチンを終了する。 【0010】ステップS9が肯定ならば、12時間が経
過したと判断して、RAM3の時計データ保持領域3a
に保持されている時計データをリードし(ステップS1
0)、その時計データの秒単位の数値が0秒±5秒の範
囲にあるか否かを判定する(ステップS11)。ステッ
プS11が肯定ならば、CPU1は、時計LSI5に対
して30秒アジャストコマンドを与える(ステップS1
2)。この30秒アジャストコマンドを入力した時計L
SI5は、秒単位の数値を00にセットする。つまり、
時計LSI5は、30秒アジャストコマンドを入力する
と、その際の秒単位の値が00秒〜29秒であれば、分
の単位を保持したままで秒単位の値を00秒にセット
し、秒単位の値が30秒〜59秒であれば、分の単位を
+1分するとともに、秒単位の値を00秒にセットする
ようになっている。すなわち、時計LSI5に生じてい
る±5秒の累積誤差を修正している。 【0011】そして、ステップS12によって秒単位が
00秒となっている時計LSI5の時計データをRAM
3の時計データ保持エリア3aに格納し(ステップS1
3)、RAM3の12時間カウンタ3bに12時間基本
値(2160000)をセットして第2の割込処理ルー
チンを終了する。 【0012】一方、ステップS11が否定ならば、すな
わち、時計LSI5の時計データの累積誤差が±5秒を
超える場合には、12時間カウンタ3bに補正基本値を
セットして(ステップS15)、この第2割込処理ルー
チンを終了する。なお、ステップS15において、12
時間カウンタ3bに補正基本値をセットする際の動作
は、図2のステップS3の動作に準じた動作である。こ
の場合には、時計LSI5に対する補正動作はなされな
いままで、動作が継続される。 【0013】以上説明したように、従来回路にあって
は、第1の割込処理ルーチンによって、500ms毎に
時計LSI5の誤動作をチェックして、誤動作による時
計データの誤差が生じている場合には、時計LSI5の
時計データを修正し、第2の割込処理ルーチンによっ
て、12時間あたり±5秒までの累積誤差を補正してい
る。 【0014】 【発明が解決しようとする課題】しかしながら、上述し
た従来回路は、交流電源Vacにノイズが加わったり、
瞬断が発生したりして、信号生成手段7が誤動作して割
込信号Sacの周期が変動したとしても、その誤動作を
検知する手段を備えていない。このため、前述したステ
ップS11の判定動作において、12時間あたり±5秒
を超える誤差が生じたと判定された場合には、時計LS
I5に起因する誤差が生じたものとはせず、上記ノイズ
等の原因によって信号生成手段7の誤動作が発生したも
のとみなして、時計LSIの補正を禁止している。した
がって、補正する誤差の範囲(補正範囲)を狭い範囲に
限定されている。また、交流電源Vacにノイズが加わ
ったり、瞬断が発生したりした場合には、信号生成手段
7から正確な周期の割込信号Sacが生成されないの
で、この割込信号Sacの周期によって起動される第2
の割込処理によってカウント動作される12時間カウン
タ3bの値も不正確なものとなってしまう。このため、
第2の割込処理ルーチンによって行われる累積誤差の補
正が正しくなされているとはいえず、信頼性に欠ける面
がある。本発明は、このような事情に基づいてなされた
ものであり、その目的は誤差の補正範囲を拡大するとと
もに、交流電源にノイズや瞬断が生じても補正動作を正
しく行って信頼性を確保する時計LSIの補正回路を提
供することにある。 【0015】 【課題を解決するための手段】本発明は、計時動作を行
って少なくとも時分秒の時計データを出力する時計LS
Iの補正回路であって、制御手段と、交流電源に基づい
て前記交流電源の周期と同一周期で第1の信号を生成す
る第1の信号生成手段と、前記交流電源の周期よりも短
い周期で第2の信号を生成する第2の信号生成手段と、
前記第1の信号の回数をその計数値が所定の単位時間t
に相当する単位計数値nに到達するまで計数する動作を
繰り返して行う第1の計数手段と、前記第1の計数手段
の計数値が前記単位計数値nに到達するまで前記第2の
信号の回数を計数する動作を繰り返して行う第2の計数
手段と、前記第1の計数手段の計数値が前記単位計数値
nに到達する回数を計数して、その計数値が前記単位時
間の所定倍数で示される所定の補正単位時間Tに相当す
る補正単位計数値Nに到達するまで計数する第3の計数
手段とを有し、前記制御手段は、前記時計LSIの時計
データの秒単位の値が更新される時点に同期して、前記
第1の計数手段、前記第2の計数手段及び前記第3の計
数手段の計数値をクリアして起動をかける初期化処理
と、前記第1の計数手段の計数値が前記単位計数値tに
到達する都度、その時点での前記第2の計数手段の計数
値mに基づいて前記第1の計数手段の計数値の正誤を判
定する単位時間正誤判定処理と、前記第1の計数手段の
計数値が正しいと判定された場合には、前記第3の計数
手段の計数動作を続行し、前記第1の計数手段の計数値
が誤りと判定された場合には、前記初期化処理に移行す
る補正単位時間計測処理と、前記第3の計数手段の計数
値が前記補正単位計数値Nに到達した時点で、前記補正
単位時間Tに基づいて前記時計LSIの計時動作を補正
する補正処理とを行うことを特徴としている。 【0016】上述の構成によれば、第1の計数手段の計
数値が単位計数値nに到達する都度、その時点での第2
の計数手段の計数値に基づいて第1の計数手段の計数値
の正誤を判定することにより、第1の信号の周期が正常
か否かを判定している。また、交流電源にノイズや瞬断
等の異常が発生して第1の信号の周期が変動して、第1
の計数手段の計数値が誤った値となっても、初期化処理
を行って第1の計数手段〜第3の計数手段の計数動作を
再実行している。したがって、第3の計数手段の計数値
が補正単位時間Tに相当する補正単位計数値Nに到達し
たことをもって、上記補正単位時間Tを正確に計測する
ことができる。そして、この補正単位時間Tに基づいて
時計LSIの計時動作が正確に補正される。また、交流
電源の異常に起因する第1の計数手段の誤動作が防止さ
れているので、従来回路と違って、時計LSIの時計デ
ータに比較的大きな誤差が生じた場合に、その誤差を交
流電源の異常に基づくものとみなす必要がなく、従って
補正を禁止する必要もない。 【0017】 【発明の実施の形態】次に、本発明について図面を参照
して説明する。図1は、本発明の時計LSIの補正回路
の実施の形態を示すブロック図であり、図2〜図7は動
作フローチャートである。なお、図1において、従来例
を示す図8と同一または相当する部材には同一の符号を
付し、その説明を省略する。 【0018】まず、図1を参照して本発明回路の構成に
ついて従来回路と相違する部分について説明する。RA
M31には、従来と同じ時計データ保持エリア3aの他
に、後述する5msタイマ41から出力される5ms周
期の割込信号(第2の信号)Suの回数を計数する5m
sカウンタ3cと、信号生成手段7から出力される交流
電源Vacの周期と同一周期の割込信号(第1の信号)
Sacの回数をその計数値が所定の単位時間t(本実施
の形態では1秒)に相当する単位計数値nに到達するま
で繰り返して計数する1秒カウンタ3dと、1秒カウン
タ3dが上記単位計数値nに到達する都度、つまり1秒
が計測されたときに+1され、その計数値が補正単位時
間(本実施の形態では1時間)Tに相当する補正単位計
数値N(本実施の形態では3600)に到達するまで計
数する1時間カウンタ3eと、時計LSI5の時計デー
タの秒単位の数字が1秒増加したときにONされる秒変
わりフラグ3fと、後述する動作フローチャートの分岐
先を指定するためのモードデータを保持するためのモー
ドデータ保持エリア3gと、上記単位計数値n(交流電
源周波数が50Hzなら50であり、60Hzなら60
である)を保持する単位計数値保持エリア3hとが構成
されている。5msタイマ41は、交流電源Vacの周
期よりも短い周期である5ms周期の割込信号Suを出
力するものである。 【0019】次に、図2〜図7のフローチャートを参照
して動作を説明する。まず、図2は、電源投入時に実行
される初期設定ルーチンのフローチャートである。この
ルーチンは、電源スイッチSWがオンされて、電源装置
6から各部に電源が供給されることにより起動され、時
計LSI5の時計データがRAM31の時計データエリ
ア3aに格納される(ステップS100)。そして、モ
ードデータとして「3」がモードデータ保持エリア3g
に設定されて(ステップS101)、このルーチンを終
了する。 【0020】図3は、5msカウンタ41の動作ルーチ
ンのフローチャートである。このルーチンは、5msタ
イマ41からCPU1の割込端子INT1に5ms周期
の割込信号Suが入力される度に起動される。CPU1
は、割込信号Suの入力に応じてRAM31の5msカ
ウンタ3cを+1して(ステップS110)、ルーチン
を終了する。 【0021】図4は、メインルーチンのフローチャート
である。このメインルーチンは、割込信号SacがCP
U1の割込端子INT2に入力することによって起動さ
れる。すなわち、交流電源Vacの周波数が50Hzで
あれば20ms毎に起動され、60Hzならば16.7
ms毎に起動される。なお、以下の説明では、交流電源
の周波数は50Hzとする。 【0022】まず、時計LSI5の時計データがリード
される(ステップS120)。次いで、リードした時計
データと、RAM31の時計データ保持エリア3aに格
納されている前回の時計データとを比較して一致するか
否かを判定し(ステップS121)、一致すれば後述す
るステップS126へ移行する。 【0023】リードした時計データと前回の時計データ
とが一致しなければ(ステップS121で否定)、リー
ドした時計データと、前回の時計データに+1秒した値
とを比較して一致するか否かを判定し(ステップS12
2)、一致すれば、リードした時計データを時計データ
保持エリア3aに格納して時計データの更新を行い(ス
テップS123)、時計データの秒単位の数値が更新さ
れたことを示す秒変わりフラグ3fをONに設定して
(ステップS124)、1秒カウンタ3eを+1する
(ステップS126)。 【0024】一方、ステップS122で否定ならば、時
計LSI5の誤動作によって時計データが誤っているも
のとみなして、時計データエリア保持エリア3aの時計
データ(前回のデータ)を時計LSI5に設定して(ス
テップS125)、ステップS126に移行する。 【0025】なお、電源投入直後には、時計LSI5か
らリードした時計データと、時計データ保持エリア3a
に保持されている前回の時計データとは当然一致しない
から、上記ステップS121〜S126の動作は、後述
するステップS130,S132の動作によって無効に
されるようになっている。また、電源投入直後には、モ
ードデータが「3」に設定されているので、ステップS
127〜S129を通過して、1秒カウンタ3d及び5
msカウンタ3cをクリアして初期化動作を行う(ステ
ップS130)。そして、モードデータ保持エリア3g
のモードデータを「2」に設定し(ステップS13
1)、秒変わりフラグ3fをOFFに設定して(ステッ
プS132)、電源投入直後の動作を終了する。 【0026】次いで、図4のメインルーチンが起動され
ると、モードデータが「2」に設定されているので、ス
テップS120〜S129が実行され、図5に示す単位
計数値設定ルーチンへ移行する。図5を参照して説明す
ると、まず、5msカウンタ3cの計数値cが202
(5ms×202=1.01sに相当)未満か否かを判
定し(ステップS170)、否定ならば交流電源周波数
を測定するための1秒間を超過したものと判断して1秒
カウンタ及び5msカウンタの双方をクリアして(ステ
ップS175)、図4のステップS132に移行する。 【0027】ステップS170が肯定であれば、1秒カ
ウンタ3dの計数値が50又は60であるか否かを判定
し(ステップS171)、否定ならば図4のメインルー
チンのステップS132に移行し、肯定であれば、5m
sカウンタ3cの計数値cが197(5ms×197=
0.985s)より大か否かを判定し(ステップS17
2)、肯定ならば1秒カウンタ3dの計数値が正しいも
のとみなして、ステップS171で判定された計数値
(交流周波数の値に相当する)である50又は60を単
位計数値nとしてRAM31の単位計数値保持エリア3
hに設定する(ステップS173)。そして、単位計数
値nの設定が終了したので、モードデータ保持エリア3
gのモードデータとして「1」をセットして図4のステ
ップS132に移行する。 【0028】次に、図4のメインルーチンが起動される
と、モードデータが「1」に設定されているので、ステ
ップS128から図6に示されている初期化ルーチンに
移行する。図6を参照して説明すると、秒変わりフラグ
がONか否かを判定し(ステップS160)、否定なら
ば、ステップS132に移行する。一方、肯定ならば、
ステップS123においてRAM31の時計データ保持
エリア3aの時計データが更新された時点であるため、
5msカウンタ3c、1秒カウンタ3d及び1時間カウ
ンタ3eの全てをクリアして初期化する(ステップS1
61)。そして、モードデータとして「0」をセットし
てステップS132に移行する。 【0029】次に、図4のメインルーチンが起動される
と、モードデータが「0」に設定されているので、ステ
ップS127から図7に示されている計時動作補正ルー
チンに移行する。図7の計時動作補正ルーチンでは、ま
ず、1秒カウンタ3dの計数値が1秒分、すなわち、図
5の単位計数値設定ルーチンのステップS173でRA
M31の単位計数値保持エリア3hに保持されている単
位計数値nに一致するか否かを比較する(ステップS1
40)。一致していなければ、図4のメインルーチンの
ステップS132に移行し、一致していれば、RAM3
1の1秒カウンタ3dをクリアし(ステップS14
1)、5msカウンタ3cの計数値cが200±2(1
秒±10ms)以内にあるか否かを判定する(ステップ
S142)。肯定ならば、1秒カウンタ3cの計数値は
正しいものとみなし、5msカウンタ3cをクリアし
(ステップS143)、1時間カウンタ3eを+1(1
秒に相当)する(ステップS144)。 【0030】次いで、この1時間カウンタ3eの計数値
が補正単位時間Tである1時間に相当する補正単位計数
値N(=3600)に到達したか否かを判定し(ステッ
プS145)、否定ならば、図4のメインルーチンのス
テップS132に移行してこの補正ルーチンのループを
反復して実行する。肯定ならば、30秒アジャストコマ
ンドを時計LSI5に発行して時計LSI5の計時動作
を補正し(ステップS146)、補正した後の時計LS
I5の時計データをリードし(ステップS147)、そ
のリードした時計データをRAM31の時計データ保持
エリア3aに格納する(ステップS148)。そして、
1時間カウンタ3eをクリアして図4のメインルーチン
のステップS132に移行する(ステップS149)。 【0031】一方、ステップS142において、否定な
らば、1秒カウンタ3dの計数値が誤っているものとみ
なして、RAM31のモードデータ保持エリア3gにモ
ードデータとして「1」をセットし(ステップS15
0)、図4のメインルーチンのステップS132に移行
する。ここで、モードデータが「1」にセットされてい
るので、ステップS128を経由して先に説明した図6
の初期化ルーチンに移行することにより、5msカウン
タ3c、1秒カウンタ3d及び時間カウンタ3eの全て
をクリアしてから、図7の計時動作補正ルーチンに移行
して計時動作補正ルーチンを再実行する。 【0032】このように、上述の実施の形態によれば、
5msカウンタ3cの計数値cに基づいて、1秒カウン
タ3dの計数値が正常か否かを、換言すれば割込信号S
acの周期が正常か否かを判定することができる。した
がって、交流電源Vacにノイズや瞬断等の異常が発生
して割込信号Sacの周期が変動して、1秒カウンタ3
dの計数値が誤った値となっても、カウンタ3c,3
d,3eをクリアして計時動作補正ルーチンを初めから
やり直す(再実行する)ことができる。このため、従来
回路と違って、交流電源の異常によって誤った補正動作
を時計LSIにすることがなく、補正動作の信頼性を向
上させることができる。 【0033】また、交流電源の異常による第1の計数手
段の誤動作を防止しているため、従来回路と違って、時
計LSIの時計データに比較的大きな誤差が生じた場合
に、その誤差を交流電源の異常に基づくものとみなす必
要がなく、従って補正を禁止する必要もない。このた
め、例えば、1時間毎に±30秒の補正を行うことがで
きるので、24時間に換算して±12分の補正を行うこ
とが可能となり、従来回路に比較して、補正範囲を拡大
することができる。 【0034】次に、上述した実施の形態の説明と請求項
の記載との対応を説明する。図1に示す信号生成手段7
は、交流電源に基づいて交流電源の周期と同一周期で第
1の信号を生成する「第1の信号生成手段」を構成して
いる。5msタイマ41は、交流電源の周期よりも短い
周期で第2の信号を生成する「第2の信号生成手段」を
構成している。また、CPU1及び1秒カウンタ3d
は、第1の信号の回数をその計数値が所定の単位時間t
に相当する単位計数値nに到達するまで計数する動作を
繰り返して行う「第1の計数手段」を構成している。C
PU1及び5msカウンタ3cは、第1の計数手段の計
数値が上記単位計数値nに到達するまで第2の信号の回
数を計数する動作を繰り返して行う「第2の計数手段」
を構成している。CPU1及び1時間カウンタ3eは、
第1の計数手段の計数値が上記単位計数値nに到達する
回数を計数して、その計数値が単位時間tの所定倍数で
示される所定の補正単位時間Tに相当する補正単位計数
値Nに到達するまで計数する「第3の計数手段」を構成
している。CPU1は、「制御手段」に相当している。 【0035】また、図6に示したステップS160〜S
162の動作は、時計LSIの時計データの秒単位の値
が更新される時点に同期して、第1の計数手段、第2の
計数手段及び第3の計数手段の計数値をクリアして起動
をかける「初期化処理」に相当している。図7に示した
ステップS140及びS142の動作は、第1の計数手
段の計数値が前記単位計数値nに到達する都度、その時
点での前記第2の計数手段の計数値に基づいて前記第1
の計数手段の計数値の正誤を判定する「単位時間正誤判
定処理」に相当している。そして、図7に示したステッ
プS144及びS150の動作は、第1の計数手段の計
数値が正しいと判定された場合には、第3の計数手段の
計数動作を続行し、第1の計数手段の計数値が誤りと判
定された場合には、初期化処理に移行する「補正単位時
間計測処理」に相当している。また、図7に示したステ
ップS145及びS146の動作は、第3の計数手段の
計数値が補正単位時間に相当する所定値に到達した時点
で、補正単位時間に基づいて時計LSIの計時動作を補
正する「補正処理」に相当している。 【0036】また、この実施の形態では、第1の計数手
段を構成するCPU1及び1秒カウンタ3dによって、
第1の信号Sacの回数が所定の単位時間である1秒に
相当する単位計数値nに到達するまで計数しているが、
上記単位時間は、1秒に限られるものではなく、第1の
信号Sacの周期の異常の有無を判定するために十分な
時間であればよい。 【0037】なお、第2の信号生成手段によって生成さ
れる第2の信号の周期は、5msに限定されるものでは
なく、第1の信号の周期、すなわち交流電源の周期に比
較して短い周期であればよいことはもちろんである。 【0038】また、第3の計数手段を構成するCPU1
及び1時間カウンタ3eによって、第1の計数手段の計
数値が単位計数値nに到達する回数を計数して、その計
数値が単位時間の所定倍数で示される所定の補正単位時
間Tである1時間に相当する所定値N(=3600)に
到達するまで計数しているが、上記補正単位時間は、1
時間に限定されるものではなく、時計LSIの計時動作
を補正する時間間隔として十分な時間であればよい。 【0039】また、本実施の形態では、第1の計数手段
〜第3の計数手段を、CPU1及びRAM31上に設け
た1秒カウンタ3d、5msカウンタ3c及び1時間カ
ウンタ3eによってソフトウェア的に構成したが、上記
第1の計数手段〜第3の計数手段は、それぞれカウンタ
ICによってハードウェア的に構成することもできる。 【0040】 【発明の効果】以上詳述したように、本発明の時計LS
Iの補正回路によれば、交流電源にノイズや瞬断等の異
常が発生して第1の信号の周期が変動して、第1の計数
手段の計数値が誤った値となっても、初期化処理を行っ
て第1の計数手段〜第3の計数手段の計数動作を再実行
している。したがって、第3の計数手段の計数値が補正
単位時間に相当する補正単位計数値に到達したことをも
って、補正単位時間を正確に計測することができる。そ
して、この補正単位時間に基づいて時計LSIの計時動
作が正確に補正される。このため、従来回路と違って、
交流電源の異常によって誤った補正動作を時計LSIに
することがなく、補正動作の信頼性を向上させることが
できる。 【0041】また、交流電源の異常に起因する第1の計
数手段の誤動作が防止されているので、従来と違って、
時計LSIの時計データに比較的大きな誤差が生じた場
合に、その誤差を交流電源の異常に基づくものとして補
正を禁止する必要がない。従来回路に比較して、補正範
囲を拡大することができる。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a clock LSI
(Integrated circuit). 2. Description of the Related Art A timekeeping operation is performed to determine the date, hour, minute, and second.
A clock LSI that outputs clock data is used in the process of timekeeping operation.
Error due to its own factors and unexpected
Error due to noise. Compensate for such errors
There has been conventionally proposed a correction circuit for this. FIG.
FIG. 9 is a block diagram showing an example of a conventional correction circuit of a timepiece LSI.
FIG. 9 to FIG. 11 are flowcharts of the operation.
You. As shown in FIG. 8, a bus B is connected to a CPU 1.
ROM 2 which holds the control program via
Total data holding area 3a and 12 hour counter 3b
RAM 3, timer 4, and clock LSI 5 are connected
I have. The timer 4 has a predetermined cycle set by the CPU 1.
Generates an interrupt signal St at the interrupt period INT
1 is input. The power supply 6 includes an AC power supply Va.
c from the CPU 1 to the timer 4 and
This is for supplying the signal to the signal generating means 7. Power switch
Switch SW supplies AC power Vac to the power supply device 6.
Is turned on and off. The signal generation means 7
The frequency (for example, 50 Hz or
60 Hz) to generate an interrupt signal Sac having the same frequency
This is input to the interrupt terminal INT2 of PU1. this
The signal generating means 7 may be built in the power supply device 6.
No. Also, the backup means such as the battery 8
The RAM 3 and the clock LSI 5 that have been backed up
Regardless of whether the power supply 6 is on or off,
Holding and timing operations. Here, the 12-hour counter 3b will be described.
I will tell you. Basically, the 12-hour counter 3b
12 hours at a cycle determined by the frequency of the power supply Vac
The 12-hour basic value corresponding to the divided value is
The value corrected based on the data value in seconds is set.
You. For example, if the frequency of the AC power supply Vac is 50 Hz
For example, the cycle is 20 ms, so 12 hours is 20 ms
The 12-hour basic value obtained by the division is “2160000”.
This 12-hour basic value is set in the 12-hour counter 3b.
In advance, if the value is decremented by 1 in 20 ms cycle, the count value becomes 0
When 12 hours, 00 minutes, and 00 seconds have passed,
Understand. Therefore, the count value of the 12-hour counter 3b is
When it reaches 0, check the clock data of clock LSI5
The clock data for 12 hours 00 minutes 00 seconds
Data error. However, the 12-hour counter 3b is started.
Time of operation and the value in seconds of the clock data of the clock LSI5
Is not always coincident with 00 seconds.
Correct 12-hour basic value set in 2-hour counter 3b
There is a need to. That is, the 12-hour counter 3b is started.
The time value of the clock data at the time of
If it is 29 seconds, only the value corresponding to that value is the above 12 hours
Corrected by subtracting from the basic value,
If the value is between 31 seconds and 59 seconds, only the value corresponding to that value
The correction is performed by adding to the 12-hour basic value. Like this
12-hour basic value (hereinafter, corrected 12-hour basic value)
Is set in the 12-hour counter 3b,
When the count value of the time counter 3b becomes 0, the clock L
Second unit of clock data output from SI5 is 00 seconds.
To determine how far they are
Error of clock data of LSI5 can be recognized.
You. In this case, the frequency of the AC power supply Vac is correct.
It is presumed that it is controlled precisely.
It is stiff. FIG. 9 shows an initial setting routine performed when the power is turned on.
It is a flowchart of a routine. First, power switch S
When W is input, the CPU 1 outputs from the clock LSI 5
The clock data to be stored is stored in the clock data holding area 3 of the RAM 3.
a (step S1). Next, 5
Set the 00ms cycle data and start
Step S2). And when reading in the above step S1
12-hour basic value corrected for 12-hour
(Step S3) to set the initial setting.
End the routine. FIG. 10 shows a state where the interrupt terminal INT1 of the CPU 1
When the interrupt signal St from the timer 4 is input,
Every 500 ms, which is the predetermined period set in timer 4
Of the first interrupt processing routine started by the CPU
It is. First, the CPU 1 outputs from the clock LSI 5
The clock data is read (step S4). Then
It is stored in the clock data holding area 3a of the RAM 3.
The clock data is read, and this clock data is stored in step S4.
Within 1 second compared to the previous clock data
It is determined whether or not it is (Step S5). Step S5
If affirmative, it is determined that the clock operation of the clock LSI 5 is normal.
(The clock data read in step SS4 is
Stored in the clock data holding area 3a of AM3 (step
Step S6), the first interrupt processing routine ends. On the other hand, if step S5 is negative, the clock L
SI5 malfunctions and its clock data has an error exceeding 1 second
Of the clock data in RAM 3
The previous clock data stored in area 3a is stored in clock L
Correction is performed by setting SI5 (step S5).
7), the first interrupt processing routine ends. This second
The clock L is generated every 500 ms by the interrupt processing routine of FIG.
Since the presence or absence of malfunction of SI5 is determined, the shadow
Even if the clock data causes a large error due to the sound, the clock L
Clock data of SI5 can be corrected to correct value
You. FIG. 11 shows an interrupt signal Sa of the signal generation means 7.
c is input to the interrupt terminal INT2 of the CPU 1
And starts at a cycle determined by the frequency of the AC power supply Vac
9 is a flowchart of a second interrupt processing routine to be executed.
You. The operation will be described with reference to FIG. First, CPU1
When the interrupt signal Sac is input to the interrupt terminal INT2,
The count value of the 12-hour counter 3b of the RAM 3 is decremented by one.
(Step S8). Next, the 12-hour counter 3b
It is determined whether the counter value is 0 (step S9). S
If step S9 is negative, it means that 12 hours have not passed
Judge and end the processing routine. If step S9 is affirmative, 12 hours have passed.
It is determined that the time has passed, and the clock data holding area 3a of the RAM 3
Is read from the clock data stored in the memory (step S1).
0), the value of the clock data in units of seconds is in the range of 0 seconds ± 5 seconds.
It is determined whether or not it is enclosed (step S11). Step
If the step S11 is affirmative, the CPU 1 checks the clock LSI5.
To give an adjustment command for 30 seconds (step S1
2). The clock L to which this 30-second adjustment command is input
SI5 sets the numerical value in seconds to 00. That is,
The clock LSI 5 inputs an adjustment command for 30 seconds.
And if the value in seconds at that time is 00 seconds to 29 seconds,
Set the value in seconds to 00 seconds while keeping the unit of
If the value of the second unit is 30 seconds to 59 seconds, the unit of the minute is
+1 minute, and set the value in seconds to 00 seconds
It has become. That is, the clock LSI 5
The cumulative error of ± 5 seconds has been corrected. Then, in step S12, the second unit is
The clock data of the clock LSI 5 which is 00 seconds is stored in the RAM.
3 in the clock data holding area 3a (step S1).
3), 12-hour counter 3b of RAM 3 is 12-hour basic
Set the value (2160000) to the second interrupt processing
Quit Chin. On the other hand, if step S11 is negative,
That is, the accumulated error of the clock data of the clock LSI 5 is ± 5 seconds.
If it exceeds, the correction basic value is stored in the 12-hour counter 3b.
Set (step S15), the second interrupt processing
Quit Chin. In step S15, 12
Operation when setting the correction basic value to the time counter 3b
Is an operation similar to the operation of step S3 in FIG. This
In the case of, the correction operation for the clock LSI 5 is not performed.
Until now, the operation is continued. As described above, in the conventional circuit,
Is executed every 500 ms by the first interrupt processing routine.
Check the malfunction of the clock LSI5,
If there is an error in the total data,
Correct the clock data and execute the second interrupt processing routine.
To correct the accumulated error up to ± 5 seconds per 12 hours.
You. [0014] However, as described above,
The conventional circuit that adds noise to the AC power supply Vac,
For example, an instantaneous interruption may occur, and the signal generation means 7 may malfunction and be interrupted.
Even if the period of the input signal Sac fluctuates,
There is no means to detect. For this reason, the aforementioned steps
In the judgment operation of step S11, ± 5 seconds per 12 hours
When it is determined that an error exceeding
It is not assumed that an error caused by I5 has occurred, and the noise
A malfunction of the signal generating means 7 has occurred
Therefore, the correction of the clock LSI is prohibited. did
Therefore, the range of error to be corrected (correction range) is narrowed
Limited. Also, noise is added to the AC power supply Vac.
Signal generation means
7 does not generate the interrupt signal Sac of the correct cycle
Then, the second signal activated by the cycle of the interrupt signal Sac
12-hour count counted by interrupt processing
The value of the parameter 3b is also incorrect. For this reason,
Compensation for accumulated errors performed by the second interrupt processing routine
Possibility of correctness, lack of reliability
There is. The present invention has been made based on such circumstances.
The purpose is to expand the error correction range.
Even if noise or momentary interruption occurs in the AC power supply, correct
Clock LSI correction circuit to ensure reliability
To provide. According to the present invention, a time measuring operation is performed.
LS that outputs clock data of at least hours, minutes and seconds
I correction circuit, based on control means and AC power supply
To generate the first signal at the same cycle as the cycle of the AC power supply.
A first signal generating means, which is shorter than a cycle of the AC power supply.
Second signal generation means for generating a second signal at a short period;
The number of times of the first signal is determined by counting a predetermined unit time t.
The operation of counting until the unit count value n corresponding to
First counting means for repeatedly performing, and the first counting means
Until the count value reaches the unit count value n.
The second counting which repeats the operation of counting the number of times of the signal
Means, and the count value of the first counting means is the unit count value
n is counted, and the counted value reaches the unit time
A predetermined correction unit time T represented by a predetermined multiple between
Counting until the correction unit count value N is reached
Means, the control means comprising: a clock of the clock LSI
Synchronize with the point in time when the value of the data in seconds is updated,
A first counting unit, the second counting unit, and the third counting unit;
Initialization processing that clears the count value of several means and starts up
And the count value of the first counting means becomes the unit count value t.
Each time it arrives, the count of the second counting means at that time
Whether the count value of the first counting means is correct or not is determined based on the value m.
Unit time correct / incorrect judgment processing to determine
If the count value is determined to be correct, the third count
The counting operation of the first counting means is continued.
Is determined to be incorrect, the process proceeds to the initialization process.
Correction unit time measurement processing and counting by the third counting means
When the value reaches the correction unit count value N, the correction
Correct the clocking operation of the clock LSI based on the unit time T
And performing a correction process. According to the above arrangement, the counting of the first counting means is performed.
Each time the numerical value reaches the unit count value n, the second
Count value of the first counting means based on the counting value of the counting means
The cycle of the first signal is normal
Or not. In addition, noise or momentary interruption in the AC power supply
And so on, the period of the first signal fluctuates,
Initialization process even if the count value of the counting means of
To perform the counting operation of the first to third counting means.
You are running again. Therefore, the count value of the third counting means
Reaches the correction unit count value N corresponding to the correction unit time T.
With this, the correction unit time T is accurately measured.
be able to. Then, based on the correction unit time T,
The clocking operation of the clock LSI is accurately corrected. Also exchange
Malfunction of the first counting means due to power supply abnormality is prevented.
Therefore, unlike the conventional circuit, the clock LSI clock data
If a relatively large error occurs in the data, replace that error.
Need not be considered based on the power supply
There is no need to prohibit correction. Next, the present invention will be described with reference to the drawings.
Will be explained. FIG. 1 shows a correction circuit for a clock LSI according to the present invention.
FIG. 2 to FIG. 7 are block diagrams showing an embodiment of the present invention.
It is a production flowchart. FIG. 1 shows a conventional example.
The same or corresponding members as those shown in FIG.
And description thereof is omitted. First, the configuration of the circuit of the present invention will be described with reference to FIG.
A description will be given of a portion different from the conventional circuit. RA
M31 includes the same clock data holding area 3a as the conventional one.
5 ms output from a 5 ms timer 41 described later.
5m for counting the number of interrupt signals (second signal) Su of the period
AC output from the s counter 3c and the signal generator 7
Interrupt signal having the same cycle as the cycle of power supply Vac (first signal)
The number of times of Sac is counted by a predetermined unit time t (this embodiment
Until the unit count value n corresponding to 1 second) is reached.
1d counter 3d that counts repeatedly with 1 second counter
Every time the data 3d reaches the unit count value n, that is, one second
Is incremented by one when measurement is performed, and the count value is used as the correction unit
Correction unit meter corresponding to T (1 hour in this embodiment)
Until the value reaches N (3600 in the present embodiment)
1 hour counter 3e to count and clock data of clock LSI5
Change when the number in seconds of the data increases by 1 second
Flag 3f and a branch of an operation flowchart described later.
Mode for holding the mode data for specifying the destination
Data storage area 3g and the unit count value n (AC power
If the source frequency is 50 Hz, it is 50;
And a unit count value holding area 3h for holding
Have been. The 5 ms timer 41 is connected to the AC power supply Vac.
The interrupt signal Su with a period of 5 ms, which is shorter than the period
It is something to empower. Next, refer to the flowcharts of FIGS.
The operation will be described. First, Fig. 2 is executed when the power is turned on.
6 is a flowchart of an initialization routine to be performed. this
In the routine, the power switch SW is turned on and the power supply
6 is started by supplying power to each part,
The clock data of the LSI 5 is stored in the clock data area of the RAM 31.
Is stored in the memory 3a (step S100). And mo
"3" is the mode data holding area 3g
Is set (step S101), and this routine is terminated.
Complete. FIG. 3 shows the operation routine of the 5 ms counter 41.
FIG. This routine is 5 ms
5 ms period from Ima 41 to interrupt terminal INT1 of CPU1
Is activated each time the interrupt signal Su is input. CPU1
Is a 5 ms clock of the RAM 31 in response to the input of the interrupt signal Su.
The counter 3c is incremented by 1 (step S110), and the routine
To end. FIG. 4 is a flowchart of the main routine.
It is. In this main routine, the interrupt signal Sac is
It is activated by inputting to the interrupt terminal INT2 of U1.
It is. That is, if the frequency of the AC power supply Vac is 50 Hz,
If it is, it is started every 20 ms, and if it is 60 Hz, it is 16.7
It is started every ms. In the following description, an AC power supply
Is 50 Hz. First, the clock data of the clock LSI 5 is read.
Is performed (step S120). Next, the watch that led
The data and the clock data holding area 3a of the RAM 31 are stored.
Compare with the previous clock data stored and match
It is determined whether or not this is the case (step S121).
The process moves to step S126. Read clock data and previous clock data
Do not match (No at step S121),
Clock data and the previous clock data plus one second
To determine whether they match (step S12).
2) If they match, read the clock data to the clock data
The data is stored in the holding area 3a and the clock data is updated.
Step S123), the numerical value of the clock data in seconds is updated.
Set the second change flag 3f, which indicates that
(Step S124) The one second counter 3e is incremented by one.
(Step S126). On the other hand, if NO in step S122,
The clock data is incorrect due to the malfunction of the LSI 5
The clock of the clock data area holding area 3a
Set the data (previous data) to the clock LSI 5
Step S125), and the process proceeds to step S126. Immediately after the power is turned on, the clock LSI 5
Clock data read from the memory and the clock data holding area 3a
Of course does not match the previous clock data stored in
Therefore, the operations in steps S121 to S126 will be described later.
Invalidated by the operations of steps S130 and S132
It is supposed to be. Immediately after turning on the power,
Since the code data is set to “3”, the step S
127-S129, the 1-second counters 3d and 5
The ms counter 3c is cleared to perform an initialization operation (step
Step S130). And the mode data holding area 3g
Is set to "2" (step S13).
1) Set the second change flag 3f to OFF (step
Step S132), the operation immediately after the power is turned on ends. Next, the main routine of FIG. 4 is started.
Then, the mode data is set to “2”,
Steps S120 to S129 are executed, and the unit shown in FIG.
The process proceeds to the count value setting routine. Description will be given with reference to FIG.
Then, first, the count value c of the 5 ms counter 3c becomes 202
(Equivalent to 5 ms × 202 = 1.01 s)
(Step S170), if not, AC power supply frequency
1 second to judge that it has exceeded 1 second for measuring
Clear both the counter and the 5 ms counter (step
Step S175), and proceeds to the step S132 in FIG. If step S170 is affirmative, one second
Determines whether the counter value of counter 3d is 50 or 60
(Step S171), and if not, the main rule of FIG.
Move to step S132 for Chin, and if affirmative, 5m
When the count value c of the s counter 3c is 197 (5 ms × 197 =
0.985 s) (step S17).
2) If affirmative, the count value of the 1 second counter 3d is correct.
And the count value determined in step S171
50 or 60 (equivalent to the value of the AC frequency)
Unit count value holding area 3 of RAM 31 as order count value n
h (step S173). And the unit count
Since the setting of the value n has been completed, the mode data holding area 3
g is set to “1” as the mode data,
The process moves to step S132. Next, the main routine of FIG. 4 is started.
And the mode data is set to "1".
From step S128 to the initialization routine shown in FIG.
Transition. Explaining with reference to FIG.
Is determined to be ON (step S160).
If so, the process proceeds to step S132. On the other hand, if affirmative,
In step S123, the clock data is stored in the RAM 31.
Since the clock data in the area 3a has been updated,
5ms counter 3c, 1 second counter 3d and 1 hour cow
And clears all the counters 3e (step S1).
61). Then, set "0" as the mode data
Then, control proceeds to a step S132. Next, the main routine of FIG. 4 is started.
And the mode data is set to "0",
Step S127 to the timekeeping operation correction loop shown in FIG.
Transfer to chin. In the timekeeping operation correction routine of FIG.
And the count value of the 1 second counter 3d is for 1 second,
5 in step S173 of the unit count value setting routine.
The unit count held in the unit count value holding area 3h of M31.
A comparison is made to determine whether or not the value matches the order count value n (step S1).
40). If they do not match, the main routine of FIG.
The process proceeds to step S132.
The 1-second counter 3d of 1 is cleared (step S14).
1) The count value c of the 5 ms counter 3c is 200 ± 2 (1
(± 10 ms) is determined (step
S142). If affirmative, the count value of the 1 second counter 3c is
Assuming it is correct, clear 5ms counter 3c
(Step S143) The one-hour counter 3e is incremented by +1 (1
(Equivalent to seconds) (step S144). Next, the count value of the one-hour counter 3e
Is a correction unit time corresponding to one hour, which is the correction unit time T
Value N (= 3600) is determined (step
Step S145), if not, the main routine of FIG.
The process proceeds to step S132 to execute a loop of the correction routine.
Execute iteratively. If affirmative, adjust the top for 30 seconds
Command to the clock LSI 5 and the clock operation of the clock LSI 5
(Step S146), and the corrected clock LS
The clock data of I5 is read (step S147), and
Holds the read clock data in the RAM 31
It is stored in the area 3a (step S148). And
The one-hour counter 3e is cleared and the main routine of FIG. 4 is executed.
The process moves to step S132 (step S149). On the other hand, in step S142,
It seems that the count value of the 1 second counter 3d is wrong.
The mode is stored in the mode data holding area 3g of the RAM 31.
"1" is set as the load data (step S15).
0), proceed to step S132 of the main routine in FIG.
I do. Here, the mode data is set to "1".
Therefore, FIG. 6 described above via step S128
By moving to the initialization routine of
Data 3c, 1 second counter 3d and time counter 3e
Clear and then proceed to the timekeeping operation correction routine in FIG.
Then, the timekeeping operation correction routine is executed again. As described above, according to the above-described embodiment,
1 second count based on the count value c of the 5 ms counter 3c
Whether the count value of the data 3d is normal, in other words, the interrupt signal S
It can be determined whether or not the cycle of ac is normal. did
As a result, abnormalities such as noise and instantaneous interruption occur in the AC power supply Vac
As a result, the cycle of the interrupt signal Sac fluctuates, and the 1-second counter 3
Even if the count value of d becomes an incorrect value, the counters 3c, 3
Clear d and 3e and start the timekeeping operation correction routine from the beginning
You can start over (re-execute). For this reason,
Incorrect correction operation due to AC power supply error unlike circuit
To improve the reliability of the correction operation without using a clock LSI.
Can be up. [0033] Also, the first counter due to the abnormality of the AC power supply.
Since the malfunction of the stage is prevented, unlike the conventional circuit,
When a relatively large error occurs in the clock data of the LSI
In addition, it is necessary to regard the
There is no need and therefore no need to prohibit the correction. others
For example, it is possible to make a correction of ± 30 seconds every hour.
Therefore, it is necessary to make a correction of ± 12 minutes in 24 hours.
And expands the correction range compared to conventional circuits
can do. Next, the description of the above embodiment and the claims
Will be described. Signal generation means 7 shown in FIG.
Is the same as the AC power supply cycle based on the AC power supply.
Constituting a "first signal generating means" for generating the first signal
I have. The 5 ms timer 41 is shorter than the cycle of the AC power supply.
"Second signal generating means" for generating a second signal in a cycle
Make up. CPU 1 and 1 second counter 3d
Indicates that the number of times of the first signal is a predetermined unit time t
The operation of counting until the unit count value n corresponding to
This constitutes a "first counting means" which is repeatedly performed. C
PU1 and the 5 ms counter 3c are provided by the first counting means.
The second signal is repeated until the numerical value reaches the unit count value n.
"Second counting means" that repeats the operation of counting numbers
Is composed. The CPU 1 and the one-hour counter 3e
The count value of the first counting means reaches the unit count value n
The number of times is counted, and the counted value is a predetermined multiple of the unit time t.
A correction unit count corresponding to the indicated predetermined correction unit time T
Constructs "third counting means" that counts until value N is reached
are doing. The CPU 1 corresponds to “control means”. Steps S160-S shown in FIG.
The operation of 162 is a value in seconds of the clock data of the clock LSI.
The first counting means, the second counting means
Start by clearing the count values of the counting means and the third counting means
Is equivalent to “initialization processing”. As shown in FIG.
The operations in steps S140 and S142 are based on the first counting method.
Each time the stage count reaches the unit count n,
Based on the count value of the second counting means at the point.
Judge whether the counting value of the counting means is correct or not
Fixed processing ". Then, the steps shown in FIG.
The operations of steps S144 and S150 are based on the counting of the first counting means.
If it is determined that the numerical value is correct, the third counting means
The counting operation is continued, and the count value of the first counting means is determined to be incorrect.
If it is set, the process proceeds to the initialization process.
Interval measurement process ". In addition, the steps shown in FIG.
The operations of steps S145 and S146 are performed by the third counting means.
The point in time when the count value reaches a predetermined value corresponding to the correction unit time
To supplement the clocking operation of the clock LSI based on the correction unit time.
This corresponds to “correction processing” to be corrected. In this embodiment, the first counter
By the CPU 1 and the 1-second counter 3d constituting the stage,
The number of times of the first signal Sac is reduced to one second which is a predetermined unit time.
Although counting is performed until the corresponding unit count value n is reached,
The above unit time is not limited to one second, but the first
Sufficient to determine whether there is an abnormality in the cycle of the signal Sac.
Any time will do. The signal generated by the second signal generating means is
The period of the second signal is not limited to 5 ms.
The cycle of the first signal, that is, the cycle of the AC power supply.
Needless to say, a shorter cycle is sufficient. The CPU 1 constituting the third counting means
And the one-hour counter 3e counts the first counting means.
Count the number of times the numerical value reaches the unit count value n, and calculate the total
At the time of a predetermined correction unit in which the numerical value is indicated by a predetermined multiple of the unit time
To a predetermined value N (= 3600) corresponding to one hour which is the time T
Although counting is performed until the time reaches, the correction unit time is 1
The time is not limited to the time but the clock LSI
Any time may be sufficient as a time interval for correcting. In the present embodiment, the first counting means
To third counting means are provided on the CPU 1 and the RAM 31
1d counter 3d, 5ms counter 3c and 1 hour counter
The software is configured by the counter 3e.
The first to third counting means are counters, respectively.
It can also be configured in hardware by an IC. As described in detail above, the timepiece LS of the present invention
According to the correction circuit of I, the AC power supply is not affected by noise or instantaneous interruption.
When the cycle of the first signal fluctuates and the first count
Initialization processing is performed even if the count value of the means is incorrect.
Re-execute the counting operation of the first to third counting means
are doing. Therefore, the count value of the third counting means is corrected.
When the correction unit count value corresponding to the unit time is reached,
Thus, the correction unit time can be accurately measured. So
Then, based on this correction unit time, the clock LSI
The work is accurately corrected. For this reason, unlike conventional circuits,
Erroneous correction operation due to AC power supply abnormality in clock LSI
Without improving the reliability of the correction operation.
it can. Further, the first counter due to the abnormality of the AC power supply
Since the malfunction of several means is prevented, unlike the past,
When a relatively large error occurs in the clock data of the clock LSI
In that case, the error is compensated for as a result of the AC power supply abnormality.
There is no need to prohibit positive. Compared with the conventional circuit, the correction range
The enclosure can be enlarged.

【図面の簡単な説明】 【図1】本発明の時計LSIの補正回路の実施の形態を
示すブロック図である。 【図2】電源投入時に実行される初期設定ルーチンを示
すフローチャートである。 【図3】5msカウンタ(第2の計数手段)の動作ルー
チンを示すフローチャートである。 【図4】メインルーチンを示すフローチャートである。 【図5】単位計数値設定ルーチンを示すフローチャート
である。 【図6】初期化ルーチンを示すフローチャートである。 【図7】計時動作補正ルーチンを示すフローチャートで
ある。 【図8】従来の時計LSIの補正回路の一例を示すブロ
ック図である。 【図9】従来回路における初期設定ルーチンを示すフロ
ーチャートである。 【図10】第1の割込処理ルーチンを示すフローチャー
トである。 【図11】第2の割込処理ルーチンを示すフローチャー
トである。 【符号の説明】 1 CPU 2 ROM 31 RAM 3a 時計データ保持エリア 3c 5msカウンタ(第2の計数手段) 3d 1秒カウンタ(第1の計数手段) 3e 1時間カウンタ(第3の計数手段) 3f 秒変わりフラグ 3g モードデータ保持エリア 3h 単位計数値保持エリア 41 5msタイマ(第2の信号生成手段) 5 時計LSI 7 信号生成手段(第1の信号生成手段)
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing an embodiment of a clock LSI correction circuit according to the present invention. FIG. 2 is a flowchart illustrating an initialization routine executed when power is turned on. FIG. 3 is a flowchart showing an operation routine of a 5 ms counter (second counting means). FIG. 4 is a flowchart showing a main routine. FIG. 5 is a flowchart illustrating a unit count value setting routine. FIG. 6 is a flowchart illustrating an initialization routine. FIG. 7 is a flowchart illustrating a timekeeping operation correction routine. FIG. 8 is a block diagram illustrating an example of a conventional correction circuit for a timepiece LSI. FIG. 9 is a flowchart showing an initialization routine in a conventional circuit. FIG. 10 is a flowchart illustrating a first interrupt processing routine. FIG. 11 is a flowchart showing a second interrupt processing routine. [Description of Signs] 1 CPU 2 ROM 31 RAM 3a Clock data holding area 3c 5ms counter (second counting means) 3d 1 second counter (first counting means) 3e 1 hour counter (third counting means) 3f seconds Change flag 3g Mode data holding area 3h Unit count holding area 41 5ms timer (second signal generating means) 5 clock LSI 7 signal generating means (first signal generating means)

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G04G 1/00 G04G 3/00 G04G 5/00 ──────────────────────────────────────────────────続 き Continued on the front page (58) Fields surveyed (Int. Cl. 7 , DB name) G04G 1/00 G04G 3/00 G04G 5/00

Claims (1)

(57)【特許請求の範囲】 【請求項1】 計時動作を行って少なくとも時分秒の時
計データを出力する時計LSIの補正回路であって、 制御手段と、交流電源に基づいて前記交流電源の周期と
同一周期で第1の信号を生成する第1の信号生成手段
と、前記交流電源の周期よりも短い周期で第2の信号を
生成する第2の信号生成手段と、前記第1の信号の回数
をその計数値が所定の単位時間tに相当する単位計数値
nに到達するまで計数する動作を繰り返して行う第1の
計数手段と、前記第1の計数手段の計数値が前記単位計
数値nに到達するまで前記第2の信号の回数を計数する
動作を繰り返して行う第2の計数手段と、前記第1の計
数手段の計数値が前記単位計数値nに到達する回数を計
数して、その計数値が前記単位時間の所定倍数で示され
る所定の補正単位時間Tに相当する補正単位計数値Nに
到達するまで計数する第3の計数手段とを有し、 前記制御手段は、前記時計LSIの時計データの秒単位
の値が更新される時点に同期して、前記第1の計数手
段、前記第2の計数手段及び前記第3の計数手段の計数
値をクリアして起動をかける初期化処理と、前記第1の
計数手段の計数値が前記単位計数値tに到達する都度、
その時点での前記第2の計数手段の計数値mに基づいて
前記第1の計数手段の計数値の正誤を判定する単位時間
正誤判定処理と、前記第1の計数手段の計数値が正しい
と判定された場合には、前記第3の計数手段の計数動作
を続行し、前記第1の計数手段の計数値が誤りと判定さ
れた場合には、前記初期化処理に移行する補正単位時間
計測処理と、前記第3の計数手段の計数値が前記補正単
位計数値Nに到達した時点で、前記補正単位時間Tに基
づいて前記時計LSIの計時動作を補正する補正処理と
を行うこと、 を特徴とする時計LSIの補正回路。
(57) [Claim 1] A correction circuit of a clock LSI for performing clocking operation and outputting clock data of at least hours, minutes, and seconds, comprising: a control unit; and an AC power supply based on the AC power supply. First signal generation means for generating a first signal at the same cycle as the cycle of the second power supply, second signal generation means for generating a second signal at a cycle shorter than the cycle of the AC power supply, First counting means for repeatedly performing an operation of counting the number of times of the signal until the count value reaches a unit count value n corresponding to a predetermined unit time t; and the count value of the first count means is set to the unit value. A second counting means for repeatedly performing an operation of counting the number of times of the second signal until reaching a count value n, and counting a number of times the count value of the first counting means reaches the unit count value n The count value is indicated by a predetermined multiple of the unit time. And a third counting means for counting until a correction unit count value N corresponding to a predetermined correction unit time T is reached, wherein the control means updates the value of the clock data of the clock LSI in seconds. At the same time, an initialization process for clearing the count values of the first counting means, the second counting means, and the third counting means and starting the operation; Each time a numerical value reaches the unit count value t,
A unit time right / wrong determination process for determining whether the count value of the first counting means is correct or not based on the count value m of the second counting means at that time, and determining that the count value of the first counting means is correct. If it is determined, the counting operation of the third counting means is continued, and if the count value of the first counting means is determined to be incorrect, the correction unit time measurement is shifted to the initialization processing. And performing a correction process of correcting the clocking operation of the timepiece LSI based on the correction unit time T when the count value of the third counting means reaches the correction unit count value N. Characteristic correction circuit for clock LSI.
JP17707996A 1996-06-17 1996-06-17 Clock LSI correction circuit Expired - Fee Related JP3421508B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17707996A JP3421508B2 (en) 1996-06-17 1996-06-17 Clock LSI correction circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17707996A JP3421508B2 (en) 1996-06-17 1996-06-17 Clock LSI correction circuit

Publications (2)

Publication Number Publication Date
JPH102974A JPH102974A (en) 1998-01-06
JP3421508B2 true JP3421508B2 (en) 2003-06-30

Family

ID=16024767

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17707996A Expired - Fee Related JP3421508B2 (en) 1996-06-17 1996-06-17 Clock LSI correction circuit

Country Status (1)

Country Link
JP (1) JP3421508B2 (en)

Also Published As

Publication number Publication date
JPH102974A (en) 1998-01-06

Similar Documents

Publication Publication Date Title
US10725497B2 (en) Clocking device, electronic apparatus, and vehicle
CN107817871B (en) Frequency offset correction accuracy for real-time clocks
US4866713A (en) Operational function checking method and device for microprocessors
JP3930773B2 (en) Frequency correction circuit
JP3421508B2 (en) Clock LSI correction circuit
JP3286283B2 (en) Radio clock
JP2006292579A (en) Measuring system
US5546363A (en) Clock apparatus for forming time information for use in computer system
JPS641038A (en) Error correction control system for control memory
JP6958296B2 (en) Timekeeping devices, electronic devices and mobiles
JPS5819587A (en) Clock for computer
US5168478A (en) Time standard assembly with upset protection and recovery means
JP2896004B2 (en) Calendar iC correction method
JP3294004B2 (en) Dual clock system for information equipment
JP3175962B2 (en) Calendar device
JP4230808B2 (en) Time synchronization method and communication system
US6237105B1 (en) Signal processor with intelligent feedback to ensure functionality of microprocessor and state machine based programmable pulse generators in the presence of clock and power supply disturbances
JP2003270369A (en) Time correction method and time correction device for real time clock
JPS62189520A (en) Clock count system for microcomputer
JPS63180119A (en) Method for initializing microcomputer
JP3123856B2 (en) Memory backup control circuit
JPS62214418A (en) Time correcting system for timepiece incorporated in processor
SU1372275A1 (en) Electronic self-monitoring clock
JPH0481239B2 (en)
JPS594677B2 (en) electronic clock

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080418

Year of fee payment: 5

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080418

Year of fee payment: 5

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090418

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090418

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100418

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110418

Year of fee payment: 8

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110418

Year of fee payment: 8

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120418

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130418

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130418

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140418

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees