JP2009032142A - Real time clock - Google Patents
Real time clock Download PDFInfo
- Publication number
- JP2009032142A JP2009032142A JP2007197025A JP2007197025A JP2009032142A JP 2009032142 A JP2009032142 A JP 2009032142A JP 2007197025 A JP2007197025 A JP 2007197025A JP 2007197025 A JP2007197025 A JP 2007197025A JP 2009032142 A JP2009032142 A JP 2009032142A
- Authority
- JP
- Japan
- Prior art keywords
- clock
- signal
- real
- time clock
- watchdog timer
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、リアルタイムクロックに係り、特にリアルタイムクロックを搭載したシステムの動作を監視する機能を有するリアルタイムクロックに関する。 The present invention relates to a real-time clock, and more particularly to a real-time clock having a function of monitoring the operation of a system equipped with a real-time clock.
システムの動作を監視する機能を有する回路として、ウォッチドッグタイマが知られている。近年では、多くのシステムにウォッチドッグタイマが備えられるようになっている。このようなシステムにおけるウォッチドッグタイマの役割の一例としては、CPUの動作の監視である。ウォッチドッグタイマには少なくとも、監視時間の制限値を定めるタイマが備えられ、外部から入力されるクロック信号をカウントすることで前記タイマで定めるカウント値を加算、あるいは減算する。そして、内蔵されたタイマが0または所定の値になるまでの間、CPUの動作を監視し、CPUからの出力信号を検出した時点でタイマをリセットするという動作を繰り返す。そして、タイマが0または所定の値となった場合には、CPUに対して割り込み信号やリセット信号を出力し、CPUの暴走を防止する。 A watchdog timer is known as a circuit having a function of monitoring the operation of the system. In recent years, many systems have been equipped with a watchdog timer. An example of the role of the watchdog timer in such a system is to monitor the operation of the CPU. The watchdog timer is provided with at least a timer that determines a limit value of the monitoring time, and counts a clock signal input from the outside is added or subtracted from the count value determined by the timer. The operation of the CPU is monitored until the built-in timer reaches 0 or a predetermined value, and the operation of resetting the timer is detected when an output signal from the CPU is detected. When the timer reaches 0 or a predetermined value, an interrupt signal or a reset signal is output to the CPU to prevent the CPU from running away.
このような機能を有するウォッチドッグタイマについては、特許文献1に開示されている。
近年、上記のようなシステムを含む電子機器に対しては、小型薄型化、高集積化が求められており、特にモバイル機器に対してはその傾向が著しい。こうした事情を考慮して上記システムを見直すと、CPUには独自の動作を制御するためのクロック源(例えばリアルタイムクロック)が接続されており、ウォッチドッグタイマにも独自にクロック源が備えられるという傾向にある。このため、1つのシステムを構成するために複数のクロック源を備えることとなり、スペース的、電力的なロスが大きい。 In recent years, electronic devices including the above-described systems are required to be small and thin and highly integrated, and this tendency is particularly remarkable for mobile devices. If the above system is reviewed in consideration of such circumstances, the CPU is connected to a clock source (for example, a real-time clock) for controlling an original operation, and the watchdog timer has its own clock source. It is in. For this reason, a plurality of clock sources are provided in order to configure one system, resulting in a large space and power loss.
そこで本発明では、上記のようなスペース的、電力的なロスを減らしつつ、システムの監視、クロック源の双方として機能することが可能なリアルタイムクロックを提供することを目的とする。 Therefore, an object of the present invention is to provide a real-time clock that can function as both a system monitor and a clock source while reducing the above-described space and power losses.
本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の形態又は適用例として実現することができる。 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 forms or application examples.
[適用例1]クロック信号を出力する発振回路と、複数の分周回路を備え、前記クロック信号を分周し互いに周期の異なる複数の分周信号を生成する分周部と、カウンタを備えたウォッチドックタイマ回路であって、複数の前記分周信号のいずれか1つに基づいて前記カウンタのカウンタ値をカウントアップまたはカウントダウンし、前記カウンタ値がオーバーフローまたはアンダーフローした場合、割り込み信号を外部へ出力するウォッチドッグタイマ回路と、前記複数の分周信号のいずれか1つに基づいて時計データを生成する内部時計と、を備えたことを特徴とするリアルタイムクロック。
このような構成とすることにより、システムのクロック減を1つとした上で、システムの監視機能を持たせることができ、スペース的、電力的なロスを減らすことができる。
Application Example 1 An oscillation circuit that outputs a clock signal, a plurality of frequency dividers, a frequency divider that divides the clock signal and generates a plurality of frequency-divided signals having different periods, and a counter A watchdog timer circuit, which counts up or counts down a counter value based on any one of a plurality of the divided signals, and when the counter value overflows or underflows, sends an interrupt signal to the outside A real-time clock comprising: a watchdog timer circuit for outputting; and an internal clock for generating clock data based on any one of the plurality of divided signals.
With such a configuration, it is possible to provide a system monitoring function after reducing the number of clocks of the system to one, and it is possible to reduce space and power loss.
[適用例2]適用例1に記載のリアルタイムクロックであって、複数の前記分周信号のう
ちいずれかを選択して出力するクロック選択部を設け、前記ウォッチドッグタイマ回路に対して前記クロック選択部の出力信号を入力する構成としたことを特徴とするリアルタイムクロック。
このような構成とすることにより、複数のクロック源を持つ事なく、ウォッチドッグタイマ回路に対して周期の異なる複数種類のクロック信号を選択的に入力することが可能となる。このため、ウォッチドッグタイマ回路のタイムアウトまでの時間管理等を任意かつ高精度に定めることが可能となる。
Application Example 2 The real-time clock according to Application Example 1, wherein a clock selection unit that selects and outputs any one of the plurality of divided signals is provided, and the clock selection is performed for the watchdog timer circuit. A real-time clock characterized by being configured to input the output signal of the unit.
With such a configuration, it is possible to selectively input a plurality of types of clock signals having different periods to the watchdog timer circuit without having a plurality of clock sources. For this reason, it is possible to arbitrarily and accurately determine the time management until timeout of the watchdog timer circuit.
[適用例3]適用例2に記載のリアルタイムクロックであって、前記クロック選択部には、外部から入力されるクロック選択信号に基づいて当該クロック選択部により信号を取り出す分周回路を選択するための選択信号を出力するレジスタ設定部を接続したことを特徴とするリアルタイムクロック。
このような構成とすることにより、ウォッチドッグタイマ回路のタイムアウトまでの時間等の設定を、リアルタイムクロックにおける外部端子への電気信号の入力のみで行うことが可能となる。
Application Example 3 In the real-time clock according to Application Example 2, the clock selection unit selects a frequency dividing circuit that extracts a signal from the clock selection unit based on a clock selection signal input from the outside. A real-time clock characterized by connecting a register setting unit that outputs a selection signal.
With such a configuration, it is possible to set the time until the timeout of the watchdog timer circuit and the like only by inputting an electric signal to the external terminal in the real-time clock.
[適用例4]適用例1ないし3のいずれかに記載のリアルタイムクロックであって、メイン電源端子およびバックアップ電源をさらに備えたことを特徴とするリアルタイムクロック。
このような構成とすることにより、電力の供給経路が2系統となり、発振回路からの信号の取り出しを、より確実に行うことが可能となる。
Application Example 4 A real-time clock according to any one of Application Examples 1 to 3, further comprising a main power supply terminal and a backup power supply.
With such a configuration, there are two power supply paths, and it is possible to more reliably extract signals from the oscillation circuit.
以下、本発明のリアルタイムクロックに係る実施の形態について、図面を参照しつつ詳細に説明する。
まず、図1を参照して本発明のリアルタイムクロックに係る第1の実施形態について説明する。本実施形態に係るリアルタイムクロック10は、発振回路12、分周部20、内部時計24、およびウォッチドッグタイマ回路28を基本として構成される。
Hereinafter, embodiments of the present invention relating to a real-time clock will be described in detail with reference to the drawings.
First, a first embodiment according to the real-time clock of the present invention will be described with reference to FIG. The real-
前記発振回路12には、リアルタイムクロック10の外部端子である電源入力端子(メイン電源端子)18が接続されている。また、当該発振回路12は圧電振動子14と発振回路16から構成されている。圧電振動子14は、発振回路16を介して電源入力端子18から入力される電気信号に基づいて一定周期(例えば約32kHz)で振動し、これを発振回路16へと出力する。圧電振動子14の構成は特に限定するものでは無いが、例として挙げた32kHzの振動を励起する場合には、水晶により構成された音叉型圧電振動片を用いたものとすると良い。水晶により構成された圧電振動片を採用することにより、周波数温度特性を良好に保つことが可能となるからである。そして発振回路16は、圧電振動子14から出力された信号を増幅し、詳細を後述する分周部20へ出力する。なお、発振回路12には、図示しない二次電池等(バックアップ電源)が接続されており、電源入力端子18からの電気信号の入力が無い場合でも発振することが可能に構成されている。
A power input terminal (main power terminal) 18 that is an external terminal of the real-
前記分周部20は、前記発振回路12の出力側に接続されており、複数の1/2分周回路22を備えている。当該分周回路22は、多段に接続されており、源振クロック(32kHz)を段階的に1/2に分周し、1Hzの1秒信号を生成することができる。それぞれの分周回路22により分周された個々の信号のそれぞれを、分周信号と呼ぶことができる。
The
分周部20には前述した発振回路12の他に、計時手段としての内部時計24とウォッチドッグタイマ回路28が接続されており、分周部20にて生成された1秒信号は、詳細
を後述するウォッチドッグタイマ回路28と前記内部時計24との双方に出力される。内部時計24では、入力された1秒信号に基づいて年、月、日、時、分、秒のカウントを行って時計データを生成し、図示しないCPUを有するシステム内部のクロック源としての役割を果たす。このため、内部時計24には、リアルタイムクロック10の外部端子としての時計データ出力端子26が接続されている。
In addition to the
前記ウォッチドッグタイマ回路28は、カウンタ値を備えたカウンタ30と、ポストスケーラ32を有する。前記カウンタ30は、分周部20から出力された1秒信号をカウントし、カウンタ値を予め定められたクロック数だけカウントアップ、あるいはカウントダウンする。(以下、本実施形態ではカウントダウンする場合の例を挙げることとする)カウンタ値がアンダーフローした際(カウントアップする場合にはオーバーフロー)にシステムのCPUに対してプログラムの停止やリセットを行うための割り込み信号、リセット信号を出力する。また、カウンタ30は、カウンタ値がアンダーフローする前にCPUからの動作信号が入力された場合にはカウンタ値がリセットされる。前記ポストスケーラ32は、カウンタ30のアンダーフロー時間を延長する際に用いる。このような構成のウォッチドッグタイマ回路28には、カウンタ30に対して、CPUの動作信号を入力するための動作信号入力端子34が接続されている。また、ポストスケーラ32に対して、リセット信号(割り込み信号)を出力するためのリセット信号出力端子36が接続されている。
The
次に、上記のような構成のアルタイムクロック10の動作について説明する。本実施形態に係るリアルタイムクロック10では、電源入力端子18からの電気信号を受けて発振回路12が所定周波数の信号を出力する。発振回路12から出力された信号は分周部20に入力されて1秒信号が生成される。分周部20により生成された1秒信号は、内部時計24に出力されるとともに、ウォッチドッグタイマ回路28に出力される。
Next, the operation of the
内部時計24に入力された1秒信号は、内部の計時レジスタ(不図示)にてカウントされ、年、月、日、時、分、秒といった時計データを構成する。内部時計24により構成された時計データは、時計データ出力端子26より外部に出力されることとなる。
The 1-second signal input to the
一方、ウォッチドッグタイマ回路28に入力された1秒信号は、カウンタ30に入力される(図2:S10)。カウンタ30に1秒信号が入力されると、予め定められたカウンタ値のカウントダウンが開始される(S20)。
On the other hand, the 1-second signal input to the
ウォッチドッグタイマ回路28では、カウンタ30によるカウントダウンの最中、CPUからの動作信号の入力の有無を判定し、これをフィードバックすることとなる(S30)。この時、ウォッチドッグカウンタ回路28のカウンタ30に対して動作信号が入力されると(Yesの場合)、カウンタ30のリセットがなされ、再度カウンタ30のカウントダウンが開始される(S40)。
In the
一方、S30において動作信号の入力が確認できない場合(Noの場合)、カウンタ値がアンダーフローしていないか、すなわちカウンタ値が「0」になっていないかを確認する(S50)。ここで、カウンタ値がアンダーフローしていた場合(Yesの場合)、CPUや動作プログラムが暴走していると判断し、CPUに対してリセット信号を出力する(S60)。これに対し、S50にてカウンタ値がアンダーフローしていない場合(Noの場合)、再度カウンタ値を減算するために、S20の前段へと戻る。 On the other hand, when the input of the operation signal cannot be confirmed in S30 (in the case of No), it is confirmed whether the counter value is underflowed, that is, whether the counter value is “0” (S50). Here, when the counter value is underflowing (in the case of Yes), it is determined that the CPU and the operation program are out of control, and a reset signal is output to the CPU (S60). On the other hand, when the counter value does not underflow in S50 (in the case of No), the process returns to the previous stage of S20 in order to subtract the counter value again.
このような構成のリアルタイムクロック10によれば、リアルタイムクロック10内にウォッチドッグタイマ回路28を備え、時計データを生成する内部時計24とクロック源を共有する構成としたため、従来2つ必要であった発振器を1つとすることができ、シス
テムを含む電子機器を構成する場合におけるスペース面、電力面に優位性を出すことができる。また、リアルタイムクロック10に対してウォッチドッグタイマ回路28を設ける構成としたため、発振回路12の発振は図示しないバックアップ電源からの電力供給を受けることによっても行うことができる。このため、CPUを含む電子機器のシステムが待機中であったとしても、リセット信号等の出力が可能となる。
According to the real-
次に、図3を参照して本実施形態のリアルタイムクロックに係る第2の実施形態について説明する。なお、本実施形態に係るリアルタイムクロックの殆どの構成は、上述した第1の実施形態に係るリアルタイムクロック10と同様である。したがってその機能を同一とする箇所には、図1に示す符号に100を足した符号を付して詳細な説明は省略することとする。
Next, a second embodiment according to the real-time clock of this embodiment will be described with reference to FIG. Note that most of the configuration of the real-time clock according to the present embodiment is the same as that of the real-
本実施形態に係るリアルタイムクロック110は、分周部120とウォッチドッグタイマ回路128との間に、クロック選択回路140を設けた点にある。
The real-
分周部120における各分周回路122ではそれぞれ、段階的な1/2分周信号が生成されている。このため、これらの周期の異なる分周信号をクロック信号としてクロック選択回路140に出力するようにするのである。なお当然に、クロック選択回路140に対して出力するクロック信号として、1秒信号を出力することも可能である。
In each
前記クロック選択回路140は、クロック選択部142と内部レジスタ設定部144とから構成されている。クロック選択部142は、内部レジスタ設定部144から出力される切替え信号に基づいてスイッチングを行い、接続された分周回路122から出力されるクロック信号をウォッチドッグタイマ回路128へ出力する切替え接続部である。また、内部レジスタ設定部144には、分周部120に備えられた複数の分周回路122のそれぞれに対応したアドレスと、当該アドレスに対応した分周回路122への切替え信号を出力するためのクロック選択信号が記録されている。そして、リアルタイムクロック110の外部端子であるクロック選択信号入力端子146から入力されるクロック選択信号に対応した分周回路122への切替え信号を、クロック選択部142へと出力する。
The
このような構成のリアルタイムクロック110によれば、ウォッチドッグタイマ回路128のタイムアウトまでの時間管理、割り込み信号等の出力時間を任意のタイミングで高精度に調整することが可能となる。このため、複数のクロック発振源を持たずに個別なシステム、電子機器の動作状況に応じた最適な監視タイミングの設定が可能となる。
According to the real-
10………リアルタイムクロック、12………発振器、14………圧電振動子、16………発振回路、20………分周部、22………分周回路、24………内部時計、28………ウォッチドッグタイマ回路、30………カウンタ、32………ポストスケーラ。
10 ......... Real time clock, 12 ......... Oscillator, 14 ......... Piezoelectric vibrator, 16 ......... Oscillator circuit, 20 ......... Division part, 22 ......... Division circuit, 24 .........
Claims (4)
複数の分周回路を備え、前記クロック信号を分周し互いに周期の異なる複数の分周信号を生成する分周部と、
カウンタを備えたウォッチドックタイマ回路であって、複数の前記分周信号のいずれか1つに基づいて前記カウンタのカウンタ値をカウントアップまたはカウントダウンし、前記カウンタ値がオーバーフローまたはアンダーフローした場合、割り込み信号を外部へ出力するウォッチドッグタイマ回路と、
前記複数の分周信号のいずれか1つに基づいて時計データを生成する内部時計と、
を備えたことを特徴とするリアルタイムクロック。 An oscillation circuit that outputs a clock signal;
A frequency divider that divides the clock signal and generates a plurality of frequency-divided signals having different periods from each other;
A watchdog timer circuit having a counter, which counts up or counts down a counter value based on any one of a plurality of the divided signals, and interrupts when the counter value overflows or underflows A watchdog timer circuit for outputting a signal to the outside;
An internal clock that generates clock data based on any one of the plurality of divided signals;
Real-time clock characterized by comprising.
複数の前記分周信号のうちいずれかを選択して出力するクロック選択部を設け、
前記ウォッチドッグタイマ回路に対して前記クロック選択部の出力信号を入力する構成としたことを特徴とするリアルタイムクロック。 The real-time clock according to claim 1,
A clock selection unit that selects and outputs any one of the plurality of the divided signals is provided,
A real-time clock characterized in that an output signal of the clock selector is input to the watchdog timer circuit.
前記クロック選択部には、外部から入力されるクロック選択信号に基づいて当該クロック選択部により信号を取り出す分周回路を選択するための選択信号を出力するレジスタ設定部を接続したことを特徴とするリアルタイムクロック。 The real-time clock according to claim 2,
The clock selection unit is connected to a register setting unit that outputs a selection signal for selecting a frequency dividing circuit for extracting a signal from the clock selection unit based on a clock selection signal input from the outside. Real time clock.
メイン電源端子およびバックアップ電源をさらに備えたことを特徴とするリアルタイムクロック。 The real-time clock according to any one of claims 1 to 3,
A real-time clock characterized by further comprising a main power supply terminal and a backup power supply.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007197025A JP2009032142A (en) | 2007-07-30 | 2007-07-30 | Real time clock |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007197025A JP2009032142A (en) | 2007-07-30 | 2007-07-30 | Real time clock |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009032142A true JP2009032142A (en) | 2009-02-12 |
Family
ID=40402559
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007197025A Withdrawn JP2009032142A (en) | 2007-07-30 | 2007-07-30 | Real time clock |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009032142A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9552329B2 (en) | 2014-06-09 | 2017-01-24 | Rohm Co., Ltd. | Correction arithmetic circuit and a signal processor |
US20210288629A1 (en) * | 2020-03-16 | 2021-09-16 | Seiko Epson Corporation | Real-Time Clock Device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08335179A (en) * | 1995-06-06 | 1996-12-17 | Sharp Corp | One-chip microcomputer |
JP2006190260A (en) * | 2004-12-07 | 2006-07-20 | Seiko Epson Corp | Real time clock device |
-
2007
- 2007-07-30 JP JP2007197025A patent/JP2009032142A/en not_active Withdrawn
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08335179A (en) * | 1995-06-06 | 1996-12-17 | Sharp Corp | One-chip microcomputer |
JP2006190260A (en) * | 2004-12-07 | 2006-07-20 | Seiko Epson Corp | Real time clock device |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9552329B2 (en) | 2014-06-09 | 2017-01-24 | Rohm Co., Ltd. | Correction arithmetic circuit and a signal processor |
US10002110B2 (en) | 2014-06-09 | 2018-06-19 | Rohm Co., Ltd. | Correction arithmetic circuit and a signal processor |
US20210288629A1 (en) * | 2020-03-16 | 2021-09-16 | Seiko Epson Corporation | Real-Time Clock Device |
CN113411052A (en) * | 2020-03-16 | 2021-09-17 | 精工爱普生株式会社 | Real-time clock device |
US11811389B2 (en) | 2020-03-16 | 2023-11-07 | Seiko Epson Corporation | Real-time clock device |
CN113411052B (en) * | 2020-03-16 | 2024-01-05 | 精工爱普生株式会社 | Real-time clock device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9501088B2 (en) | Clock generator, communication device and sequential clock gating circuit | |
US9134752B2 (en) | Time measurement device, micro-controller and method of measuring time | |
JP2017118371A5 (en) | Timing signal generating apparatus and electronic device | |
US6670839B2 (en) | Clock monitoring apparatus | |
JP2006197564A (en) | Signal selector circuit and real-time clock device | |
JP2009032142A (en) | Real time clock | |
JP2000174615A (en) | Method and device for automatically correcting internal clock frequency of integrated circuit | |
TWI638517B (en) | Mitigation of long wake-up delay of a crystal oscillator | |
CN106557019B (en) | Timing device and timing method and electronic equipment | |
JP2012047705A (en) | Time correction device and control method | |
JP2014062812A (en) | Temperature sensor and temperature compensation oscillator | |
JPH10283774A (en) | Clock-built-in-type semiconductor integrated circuit device | |
JP2004272403A (en) | Process input/output device and monitor control system using the same | |
JP2006048284A (en) | Programmable controller device and method for synchronizing with option module | |
JP2008180612A (en) | Timer circuit and program | |
JP2007147484A (en) | Time correction system | |
JP5678226B1 (en) | Digital circuit system and block unit | |
JP5835245B2 (en) | Time supply device, time supply method and program | |
JP2007064867A (en) | Real-time clock unit | |
JP2006190260A (en) | Real time clock device | |
JP2007207185A (en) | Semiconductor integrated circuit | |
JP6274638B2 (en) | Frequency adjustment circuit and frequency adjustment method | |
JP2006201856A (en) | Semiconductor integrated circuit | |
JP2007155655A (en) | Control method for real-time clock and real time clock | |
JPS5870336A (en) | Oscillating device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100726 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20110729 |
|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20110729 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110819 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110907 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20111004 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20111115 |