JP2006030136A - Real-time clock circuit, semiconductor integrated circuit, and watt-hour meter device - Google Patents
Real-time clock circuit, semiconductor integrated circuit, and watt-hour meter device Download PDFInfo
- Publication number
- JP2006030136A JP2006030136A JP2004213283A JP2004213283A JP2006030136A JP 2006030136 A JP2006030136 A JP 2006030136A JP 2004213283 A JP2004213283 A JP 2004213283A JP 2004213283 A JP2004213283 A JP 2004213283A JP 2006030136 A JP2006030136 A JP 2006030136A
- Authority
- JP
- Japan
- Prior art keywords
- clock signal
- circuit
- data
- counter
- bus
- 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.)
- Pending
Links
Images
Landscapes
- Electric Clocks (AREA)
Abstract
Description
本発明は、時刻計時に使用されるクロック信号を発生するリアルタイムクロック回路及びこれを内蔵した半導体集積回路並びに該半導体集積回路を搭載した電力量計装置に関する。 The present invention relates to a real-time clock circuit for generating a clock signal used for timekeeping, a semiconductor integrated circuit incorporating the clock signal, and a watt-hour meter device mounting the semiconductor integrated circuit.
リアルタイムクロック回路で発生されるクロック信号をカウンタ等で計数することで時刻計時が行われる。従来の簡単なリアルタイムクロック回路では、32.768KHzで発振する水晶振動子を用いた発振回路が用いられる。この発振回路で発生されるクロック信号は分周器で16分周され、これが1秒のパルス信号として用いられる。さらに、この1秒のパルス信号が、分用カウンタ及び時間用カウンタで順次カウントされることで時計を構成することができる。 Time counting is performed by counting a clock signal generated by the real-time clock circuit with a counter or the like. In a conventional simple real-time clock circuit, an oscillation circuit using a crystal resonator that oscillates at 32.768 KHz is used. The clock signal generated by this oscillation circuit is divided by 16 by a frequency divider, and this is used as a 1-second pulse signal. Further, the 1-second pulse signal is sequentially counted by the minute counter and the time counter, whereby a timepiece can be configured.
しかし、水晶振動子はもともと個体誤差(ばらつき)を持っている。また、発振回路で使用される負荷容量コンデンサの誤差、さらには使用環境温度などによっても発振周波数は少なからず変動する。このように、幾つもの要因が絡み合っているために、水晶振動子を用いた発振回路では、予め発振誤差を予測することは非常に困難である。例えば、32.768KHzの水晶振動子を用いて1秒をカウントする際に、1クロック分の誤差が生じたとすると、その水晶振動子の特性は(1/32768)=30.5ppmの誤差を持つ。この誤差は1日当りでは約2.63秒((1/32768)×60×60×24)の誤差となり、1カ月(31日)当りでは約81.53秒の誤差となる。このようなばらつき誤差は、製品にリアルタイムクロック回路を組み込んだ後でも時刻の再調整が頻繁にできるシステムならば問題となることは少ない。しかし、時刻調整がなかなか行えない場合には、時間が経過する程、時計の誤差が拡大する。 However, crystal resonators originally have individual errors (variations). In addition, the oscillation frequency fluctuates not a little depending on the error of the load capacitor used in the oscillation circuit, and also on the usage environment temperature. Thus, since several factors are intertwined, it is very difficult to predict an oscillation error in advance in an oscillation circuit using a crystal resonator. For example, if an error of one clock occurs when counting one second using a 32.768 kHz crystal unit, the characteristic of the crystal unit has an error of (1/32768) = 30.5 ppm. This error is approximately 2.63 seconds ((1/32768) × 60 × 60 × 24) per day, and approximately 81.53 seconds per month (31 days). Such a variation error is less likely to be a problem in a system in which the time can be readjusted even after a real-time clock circuit is incorporated into the product. However, if the time cannot be adjusted easily, the time error increases as time elapses.
リアルタイムクロック回路を組み込んだ製品の一例として電力量計装置がある。この電力量計装置では、使用電力量に基づいて電力料金が自動的に計算される。深夜電力料金は昼間の電力料金よりも安価に設定される場合があり、そのような場合には時間帯に応じて単位電力量当りの価格を変更して電力料金を計算する必要がある。その際、時間帯を判断するためには、時刻を正確に計時する必要がある。しかし、時刻調整が行えない場合には、時間が経過する程、時計の誤差が拡大し、電力料金が正確に計算できなくなる。 One example of a product incorporating a real-time clock circuit is a watt-hour meter device. In this watt-hour meter device, a power charge is automatically calculated based on the amount of power used. In some cases, the midnight power charge is set at a lower price than the daytime power charge. In such a case, it is necessary to change the price per unit power amount according to the time zone and calculate the power charge. At that time, in order to determine the time zone, it is necessary to measure the time accurately. However, if the time cannot be adjusted, the time error increases as time elapses, making it impossible to calculate the power rate accurately.
なお、特許文献1には、外部から基準クロックを電子機器に入力し、この基準クロックを使って計時した所定の測定時間の間、水晶振動子の発振クロックをカウントし、基準クロックを使って計時した測定時間の間、誤差補正機能付きリアルタイムクロック回路のクロック出力をカウントし、測定結果のカウント値と既知の調整目標カウント値との差分をとることで補正値を算出し、算出した補正値を誤差補正機能付きリアルタイムクロック回路に設定するようにしたリアルタイムクロックの時刻補正方法及び装置が記載されている。
本発明は上記のような事情を考慮してなされたものであり、その目的は、発振回路で発生されるクロック信号にばらつきが生じても、正確な計時を行うためのクロック信号を生成できるリアルタイムクロック回路を提供することにある。 The present invention has been made in consideration of the above-described circumstances, and an object of the present invention is to provide a real-time signal that can generate a clock signal for accurate time measurement even if the clock signal generated in the oscillation circuit varies. It is to provide a clock circuit.
また、本発明の目的は、発振回路で発生されるクロック信号にばらつきが生じても、正確な計時を行うためのクロック信号を生成できるリアルタイムクロック回路を内蔵した半導体集積回路を提供することにある。 Another object of the present invention is to provide a semiconductor integrated circuit having a built-in real-time clock circuit that can generate a clock signal for performing accurate timing even if the clock signal generated by the oscillation circuit varies. .
さらに、本発明の目的は、クロック信号を計数して時刻の計時を行うリアルタイムクロック回路を内蔵し、時間帯に応じて異なる複数の課金情報の中から計時時刻の時間帯に応じた課金情報を選択し、この課金情報と使用電力量とに応じて使用電力料金を算出する半導体集積回路を搭載した電力量計装置において、発振回路で発生されるクロック信号にばらつきが生じても正確な計時を行うためのクロック信号を生成でき、もって時間帯に応じた電力料金を正確に算出できる電力量計装置を提供することにある。 Furthermore, an object of the present invention is to incorporate a real-time clock circuit that counts clock signals and counts the time, and from among a plurality of charging information that varies depending on the time zone, charging information corresponding to the time zone of the timing time is provided. In the watt-hour meter device equipped with the semiconductor integrated circuit that selects and calculates the power usage fee according to the billing information and the power usage amount, even if the clock signal generated in the oscillation circuit varies, it is possible to accurately measure the time. It is an object of the present invention to provide a watt-hour meter device that can generate a clock signal to be performed and can accurately calculate a power charge according to a time zone.
本発明のリアルタイムクロック回路は、基準クロック信号を分周してウインドウパルスを生成する分周器と、第1の周期を有する第1のクロック信号を発生する第1の発振回路と、前記第1の周期よりも長い第2の周期を有する第2のクロック信号を発生する第2の発振回路と、前記第1及び第2のクロック信号のいずれか一方のクロック信号を選択して出力する第1の選択回路と、前記第1の選択回路で選択されたクロック信号と前記ウインドウパルスとの論理積をとる第1の論理積回路と、前記第1の選択回路で選択されたクロック信号及び前記第1の論理積回路の出力のいずれか一方を選択して出力する第2の選択回路と、前記第2の選択回路の出力をカウントする第1のカウンタと、所定のデータが格納されるレジスタと、前記第1のカウンタのカウントデータを前記レジスタに格納されたデータと比較して時刻計時用のクロック信号を生成する比較器と、前記時刻計時用のクロック信号及び前記第2のクロック信号との論理積をとる第2の論理積回路と、前記第2の論理積回路の出力をカウントする第2のカウンタとを具備し、前記レジスタには、前記第1のカウンタのカウントデータもしくはこのカウントデータを一定数で除算したデータ、または前記第2のカウンタのカウントデータもしくはこのカウントデータを一定数で除算したデータが格納されることを特徴とする。 The real-time clock circuit according to the present invention includes a frequency divider that divides a reference clock signal to generate a window pulse, a first oscillation circuit that generates a first clock signal having a first period, and the first A second oscillation circuit that generates a second clock signal having a second period longer than the first period, and a first clock signal that selects and outputs one of the first and second clock signals. Selection circuit, a first AND circuit that takes a logical product of the clock signal selected by the first selection circuit and the window pulse, the clock signal selected by the first selection circuit, and the first A second selection circuit that selects and outputs one of the outputs of the AND circuit, a first counter that counts the output of the second selection circuit, and a register that stores predetermined data The first A comparator that generates a clock signal for timekeeping by comparing the count data of the counter with the data stored in the register, and a logical product of the clock signal for timekeeping and the second clock signal. 2 and a second counter that counts the output of the second AND circuit, and the register divides the count data of the first counter or the count data by a fixed number. Or the count data of the second counter or the data obtained by dividing the count data by a fixed number is stored.
本発明のリアルタイムクロック回路は、基準クロック信号を分周してウインドウパルスを生成し、このウインドウパルスの生成期間に、発振回路で発生されるクロック信号をカウントし、そのカウント数に応じたデータをレジスタに格納し、前記クロック信号を再度、カウントし、比較器によりこのカウントデータを前記レジスタに格納されているデータと比較して時刻計時用のクロック信号を生成することを特徴とする。 The real-time clock circuit of the present invention generates a window pulse by dividing the reference clock signal, counts the clock signal generated by the oscillation circuit during the generation period of the window pulse, and outputs data corresponding to the count number. The clock signal is stored in a register, the clock signal is counted again, and the count data is compared with the data stored in the register by a comparator to generate a clock signal for time measurement.
本発明のリアルタイムクロック回路は、基準クロック信号を分周してウインドウパルスを生成し、このウインドウパルスの生成期間に、第1の発振回路で発生される第1の周期を有する第1のクロック信号をカウントしてそのカウント数に応じたデータをレジスタに格納し、前記第1のクロック信号を再度、カウントし、比較器によりこのカウントデータを前記レジスタに格納されているデータと比較して第1の時刻計時用のクロック信号を生成し、前記第1の時刻計時用のクロック信号をウインドウパルスとして用いて、このウインドウパルスの生成期間に、第2の発振回路で発生される前記第1の周期よりも長い第2の周期を有する第2のクロック信号をカウントしてそのカウント数に応じたデータを前記レジスタに再度、格納し、前記第2のクロック信号を再度、カウントし、前記比較器によりこのカウントデータを前記レジスタに格納されているデータと比較して第2の時刻計時用のクロック信号を生成することを特徴とする。 The real-time clock circuit of the present invention divides the reference clock signal to generate a window pulse, and a first clock signal having a first period generated by the first oscillation circuit during the generation period of the window pulse. And the data corresponding to the counted number is stored in the register, the first clock signal is counted again, and the comparator compares this count data with the data stored in the register to obtain the first Of the first clock generated by the second oscillation circuit during the generation period of the window pulse using the first clock signal for the clock as a window pulse. A second clock signal having a longer second period is counted, and data corresponding to the counted number is stored again in the register, and The second clock signal again, counted, by the comparator and generates a clock signal of the second time timekeeping compared with the data stored the count data in the register.
本発明の半導体集積回路は、外部端子から入力される基準クロック信号を分周してウインドウパルスを生成する分周器と、制御用データを生成する中央演算処理装置と、前記中央演算処理装置に接続され、前記中央演算処理装置で生成された制御データを伝達するバスと、外部端子を介して水晶振動子が接続され、第1の周期を有する第1のクロック信号を発生する第1の発振回路と、外部端子を介して水晶振動子が接続され、前記第1の周期よりも長い第2の周期を有する第2のクロック信号を発生する第2の発振回路と、前記バスに接続され、前記バス上の制御用データに応じて、第1及び第2のクロック信号のいずれか一方のクロック信号を選択して出力する第1の選択回路と、前記第1の選択回路で選択されたクロック信号と前記ウインドウパルスとの論理積をとる第1の論理積回路と、前記バスに接続され、前記バス上の制御用データに応じて、前記第1の選択回路で選択されたクロック信号及び前記第1の論理積回路の出力のいずれか一方を選択して出力する第2の選択回路と、前記バスに接続され、前記第2の選択回路の出力をカウントする第1のカウンタと、前記バスに接続され、前記バス上のデータが格納されるレジスタと、前記第1のカウンタのカウントデータを前記レジスタに格納されたデータと比較して時刻計時用のクロック信号を生成する比較器と、前記比較器で生成されたクロック信号及び前記第2のクロック信号との論理積をとる第2の論理積回路と、前記バスに接続され、前記第2の論理積回路の出力をカウントする第2のカウンタとを具備したリアルタイムクロック回路を内蔵し、前記レジスタには、前記第1のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算された後のデータ、または前記第2のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算されたデータが格納されることを特徴とする。 A semiconductor integrated circuit according to the present invention includes a frequency divider that divides a reference clock signal input from an external terminal to generate a window pulse, a central processing unit that generates control data, and the central processing unit A first oscillator for generating a first clock signal having a first period, connected to a bus for transmitting control data generated by the central processing unit, and a crystal resonator via an external terminal A crystal oscillator connected via an external terminal, a second oscillation circuit for generating a second clock signal having a second period longer than the first period, and the bus, A first selection circuit that selects and outputs one of the first and second clock signals according to the control data on the bus, and a clock selected by the first selection circuit Signal and the above A first logical product circuit that performs a logical product with a window pulse, and a clock signal connected to the bus and selected by the first selection circuit according to control data on the bus, and the first logical circuit A second selection circuit that selects and outputs one of the outputs of the product circuit; a first counter that is connected to the bus and counts an output of the second selection circuit; and is connected to the bus; A register for storing data on the bus, a comparator for comparing the count data of the first counter with the data stored in the register and generating a clock signal for time measurement, and generated by the comparator A second logical product circuit that performs a logical product of the clock signal and the second clock signal, and a second counter that is connected to the bus and counts the output of the second logical product circuit. did It has an internal time clock circuit, and the register has the count data of the first counter or the data after the count data is divided by a fixed number by the central processing unit, or the count of the second counter Data or data obtained by dividing the count data by a predetermined number by the central processing unit is stored.
本発明の電力量計装置は、商用交流電源に接続され、使用電力量に応じた周波数を有するパルス信号を生成する電力量測定部と、前記パルス信号をカウントして使用電力量を算出すると共に、時刻計時用のクロック信号を生成し、このクロック信号を計数して時刻の計時を行うリアルタイムクロック回路を内蔵し、時間帯に応じて異なる複数の課金情報の中から計時時刻の時間帯に応じた課金情報を選択し、この課金情報と前記算出された使用電力量とに応じて使用電力料金を算出する半導体集積回路とを具備し、前記半導体集積回路は、外部端子から入力される基準クロック信号を分周してウインドウパルスを生成する分周器と、制御用データを生成する中央演算処理装置と、前記中央演算処理装置に接続され、前記中央演算処理装置で生成された制御データを伝達するバスと、外部端子を介して水晶振動子が接続され、第1の周期を有する第1のクロック信号を発生する第1の発振回路と、外部端子を介して水晶振動子が接続され、前記第1の周期よりも長い第2の周期を有する第2のクロック信号を発生する第2の発振回路と、前記バスに接続され、前記バス上の制御用データに応じて、第1及び第2のクロック信号のいずれか一方のクロック信号を選択して出力する第1の選択回路と、前記第1の選択回路で選択されたクロック信号と前記ウインドウパルスとの論理積をとる第1の論理積回路と、前記バスに接続され、前記バス上の制御用データに応じて、前記第1の選択回路で選択されたクロック信号及び前記第1の論理積回路の出力のいずれか一方を選択して出力する第2の選択回路と、前記バスに接続され、前記第2の選択回路の出力をカウントする第1のカウンタと、前記バスに接続され、前記バス上のデータが格納されるレジスタと、前記第1のカウンタのカウントデータを前記レジスタに格納されたデータと比較して時刻計時用のクロック信号を生成する比較器と、前記比較器で生成されたクロック信号及び前記第2のクロック信号との論理積をとる第2の論理積回路と、前記バスに接続され、前記第2の論理積回路の出力をカウントする第2のカウンタとを有し、前記レジスタには、前記第1のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算された後のデータ、または前記第2のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算されたデータが格納されることを特徴とする。 The watt-hour meter device of the present invention is connected to a commercial AC power source, generates a pulse signal having a frequency corresponding to the amount of power used, and calculates the amount of power used by counting the pulse signal. Built-in real-time clock circuit that generates a clock signal for timekeeping and counts the clock signal to count the time, and responds to the time zone of the time from among multiple billing information that varies depending on the time zone And a semiconductor integrated circuit that calculates a usage power charge according to the charging information and the calculated power consumption. The semiconductor integrated circuit includes a reference clock input from an external terminal. A frequency divider that divides a signal to generate a window pulse, a central processing unit that generates control data, and a central processing unit that is connected to the central processing unit and is generated by the central processing unit A crystal oscillator is connected to the bus for transmitting the control data, a crystal oscillator via an external terminal, and generates a first clock signal having a first period, and the crystal oscillation via the external terminal A second oscillation circuit for generating a second clock signal having a second period longer than the first period, and a child connected to the bus, in accordance with control data on the bus A first selection circuit that selects and outputs one of the first and second clock signals, and a logical product of the clock signal selected by the first selection circuit and the window pulse. A first logical product circuit that is connected to the bus and selected by the first selection circuit in accordance with control data on the bus and an output of the first logical product circuit Select one of them and output Two selection circuits, a first counter connected to the bus and counting the output of the second selection circuit, a register connected to the bus and storing data on the bus, and the first A logical product of a comparator that compares the count data of the counter with the data stored in the register to generate a clock signal for timekeeping, and the clock signal generated by the comparator and the second clock signal And a second counter that is connected to the bus and counts the output of the second AND circuit, and the register includes count data of the first counter. Alternatively, the data after the count data is divided by a fixed number by the central processing unit, or the count data of the second counter or the count data is the intermediate data Data divided by a fixed number by the central processing unit is stored.
本発明のリアルタイムクロック回路によれば、発振回路で発生されるクロック信号にばらつきが生じても、正確な計時を行うためのクロック信号を生成することができる。 According to the real-time clock circuit of the present invention, it is possible to generate a clock signal for performing accurate timing even if the clock signal generated in the oscillation circuit varies.
また、本発明のリアルタイムクロック回路を内蔵した半導体集積回路では、発振回路で発生されるクロック信号にばらつきが生じても、正確な計時を行うためのクロック信号を生成することができる。 In the semiconductor integrated circuit incorporating the real-time clock circuit of the present invention, a clock signal for accurate time measurement can be generated even if the clock signal generated by the oscillation circuit varies.
さらに、本発明の電力量計装置では、発振回路で発生されるクロック信号にばらつきが生じても正確な計時を行うためのクロック信号を生成でき、もって時間帯に応じて電力料金を正確に算出することができる。 Furthermore, in the watt-hour meter device of the present invention, it is possible to generate a clock signal for accurate time measurement even if the clock signal generated in the oscillation circuit varies, and thus accurately calculate the power rate according to the time zone. can do.
以下、図面を参照して本発明を実施の形態により説明する。図1は本発明に係る半導体集積回路からリアルタイムクロック回路に関連した回路部分のみを抽出して示す回路図である。外部端子11には、予め校正された数Hzから数十Hzの基準クロック信号CLKrefが半導体集積回路の外部から供給される。外部端子11には分周器12が接続されている。分周器12は、基準クロック信号CLKrefを分周し、所定期間のウインドウパルスPw1を生成する。このウインドウパルスPw1は第1のANDゲート回路(第1の論理積回路)13の一方の入力端子に供給される。
The present invention will be described below with reference to the drawings. FIG. 1 is a circuit diagram showing only a circuit portion related to a real-time clock circuit extracted from a semiconductor integrated circuit according to the present invention. The
一対の外部端子14a、14b間には、発振用の水晶振動子15が接続される。また、この一対の各外部端子14a、14bと接地電位ノードとの間には、負荷容量コンデンサ16がそれぞれ接続されている。半導体集積回路の内部では、上記一対の外部端子14a、14b間に、発振用の反転回路17と帰還用の抵抗素子18とが並列に接続されている。そして、これら水晶振動子15、負荷容量コンデンサ16、反転回路17及び抵抗素子18により第1の発振回路19が構成される。この第1の発振回路19は、発振周波数が例えば数MHzとなるように水晶振動子15の固有振動数が選択される。
An
さらに、一対の外部端子20a、20b間には、発振用の水晶振動子21が接続される。また、この一対の各外部端子20a、20bと接地電位ノードとの間には、負荷容量コンデンサ22がそれぞれ接続されている。半導体集積回路の内部では、上記一対の外部端子20a、20b間に、発振用の反転回路23と帰還用の抵抗素子24とが並列に接続されている。そして、これら水晶振動子21、負荷容量コンデンサ22、反転回路23及び抵抗素子24により第2の発振回路25が構成される。この第2の発振回路25は、発振周波数が例えば数KHzとなるように水晶振動子21の固有振動数が選択される。
Further, an
第1及び第2の発振回路19、25内に設けられた発振用の反転回路17、23はそれぞれ制御信号に応じて動作が制御され、これらの制御信号により第1及び第2の発振回路19、25の発振動作の可否が選択される。発振動作時に、第1の発振回路19は第1の周期を持つ第1のクロック信号CLK1を発生し、第2の発振回路25は第1の周期よりも長い第2の周期を持つ第2のクロック信号CLK2を発生する。つまり、第2のクロック信号CLK2は第1のクロック信号CLK1よりも低い周波数を持ち、第1の発振回路19は高速で発振し、第2の発振回路25は低速で発振する。
The operations of the inverting
第1及び第2の発振回路19、25で発生される第1のクロック信号CLK1及び第2のクロック信号CLK2は共に第1の選択回路26に供給される。第1の選択回路26は、CPU27に接続されたバス28上を伝達される制御データに応じて、第1のクロック信号CLK1及び第2のクロック信号CLK2のいずれか一方のクロック信号を選択して出力する。第1の選択回路26で選択されたクロック信号は、第1のANDゲート回路13の他方の入力端子に供給される。
Both the first clock signal CLK 1 and the second clock signal CLK 2 generated by the first and
また、第1の選択回路26で選択されたクロック信号及び第1のANDゲート回路13の出力は共に第2の選択回路29に供給される。第2の選択回路29は、上記バス28上を伝達される制御データに応じて、第1の選択回路26で選択されたクロック信号及び第1のANDゲート回路13の出力のいずれか一方を選択して出力する。第2の選択回路29で選択された信号は、第1のカウンタ(カウンタ1)30に供給される。第1のカウンタ30は、第2の選択回路29から選択出力される信号をカウントする。第1のカウンタ30のカウントデータはバス28を介してCPU27に送られる。CPU27は、第1のカウンタ30のカウントデータをそのまま、もしくはこのカウントデータを一定数で除算したデータを不揮発性記憶装置、例えばE2PROM等に記憶させると共に、そのデータをバス28を介してレジスタ31に送り、格納させる。
The clock signal selected by the
第1のカウンタ30のカウントデータ及びレジスタ31に格納されたデータは比較器32で比較され、時刻計時用のクロック信号CLK3が生成される。比較器32で生成された時刻計時用のクロック信号CLK3は、図示しない計時用の分周器に送られて時刻計時が行われると共に、さらに分周器33によって分周された後、第2のANDゲート回路(第2の論理積回路)34の一方の入力端子に供給される。この第2のANDゲート回路34の他方の入力端子には、第2の発振回路25で発生される第2のクロック信号CLK2が供給される。第2のANDゲート回路34の出力は第2のカウンタ(カウンタ2)35に供給される。第2のカウンタ35は第2のANDゲート回路34の出力をカウントする。第2のカウンタ34のカウントデータは、バス28を介してCPU27に送られる。CPU27は、第2のカウンタ34のカウントデータをそのまま、もしくはこのカウントデータを一定数で除算したデータを不揮発性記憶装置、例えば先のE2PROM等に記憶させると共に、そのデータをバス28を介してレジスタ31に送り、格納させる。
The count data of the
なお、第1及び第2の発振回路19、25で発生される第1のクロック信号CLK1及び第2のクロック信号CLK2は、CPU27が処理動作を行う際に同期信号として使用される。高速で発振する第1の発振回路19は、CPU27が大きな処理能力を必要とする際に動作し、低速で発振する第2の発振回路25は、CPU27がそれ程大きな処理能力を必要としない場合や、半導体集積回路に供給される電源が遮断され、電池によるバックアップ動作が行われる場合等に動作するように、前記制御信号によって制御される。
Note that the first clock signal CLK1 and the second clock signal CLK2 generated by the first and
上記構成でなる半導体集積回路において、第1、第2の発振回路19、25で発生される第1、第2のクロック信号CLK1、CLK2は、時刻計時用のクロック信号CLK3を生成するために使用される。前述したように水晶振動子はもともと個体誤差を持っており、負荷容量コンデンサの誤差、さらには使用環境温度などによって、発振回路の発振周波数が変動する。従って、第1、第2のクロック信号CLK1、CLK2を使用して生成される時刻計時用のクロック信号CLK3にもばらつきが生じる。そこで、半導体集積回路の工場出荷時に、図1に示されるリアルタイムクロック回路内の水晶振動子の精度測定及び補正が行われる。
In the semiconductor integrated circuit having the above configuration, the first and second clock signals CLK1 and CLK2 generated by the first and
この精度測定及び補正は、以下のようにして行われる。まず、半導体集積回路が動作状態にされ、予め校正された数〜数十Hzの正確な基準クロック信号CLKrefが外部端子11から入力される。この際、第1、第2の発振回路19、25は動作させる。基準クロック信号CLKrefが入力される際、第1の選択回路26が第1の発振回路19で発生されるクロック信号CLK1を選択し、第2の選択回路29が第1のANDゲート回路13の出力を選択するように、第1、第2の選択回路26、29がCPU27の処理により切り換え制御される。このときの図1の回路の接続状態を図2に抽出して示す。外部端子11から入力される基準クロック信号CLKrefが分周器12で分周されることにより、例えば1秒の期間を有するウインドウパルスPw1が生成され、第1のANDゲート回路13の一方の入力端子に入力される。一方、第1の発振回路19で発生される第1のクロック信号CLK1が、第1の選択回路26を介して、第1のANDゲート回路13の他方の入力端子に入力される。そして、ウインドウパルスPw1が成立している期間に、第1のANDゲート回路13から第1のクロック信号CLK1が出力され、第1のカウンタ30によりカウントされる。これにより、正確な1秒の期間に発生する第1のクロック信号CLK1のクロック数が測定される。この測定が終了した後は、外部から入力される基準クロック信号CLKrefは切り離すことができ、その後はCPU27による処理が行われる。
This accuracy measurement and correction is performed as follows. First, the semiconductor integrated circuit is set in an operating state, and an accurate reference clock signal CLKref calibrated in advance of several to several tens Hz is input from the
第1のカウンタ30のカウントデータは、CPU27の転送命令等により、バス28を介してCPU27に読み込まれ、カウントデータがそのまま、もしくはこのカウントデータが一定数で除算されたデータが不揮発性記憶装置に記憶されると共に、そのデータが再びバス28を介してレジスタ31に転送され、格納される。なお、ウインドウパルスPw1の成立期間が上記のように1秒である場合には、カウンタ30のカウントデータがそのままレジスタ31に転送されて格納される。しかし、分周器12の分周数を増加させるなどして、ウインドウパルスPw1の成立期間が1秒以上に設定されている場合には、CPU27に読み出されたカウンタ30のカウントデータが、CPU27の演算命令などで、ウインドウパルスPw1の成立期間に対応した秒数である一定数で除算されて1秒の期間のデータに変換され、この変換後のデータが不揮発性記憶装置に記憶されると共にレジスタ31に格納される。
The count data of the
この後、第2の選択回路29が第1の選択回路26の出力を選択するように、第2の選択回路29がCPU27の処理により切り換え制御される。第1の選択回路26の選択動作は変化しない。このときの図1の回路の接続状態を図3に抽出して示す。このとき、レジスタ31には、正確な1秒の期間に発生する第1のクロック信号CLK1のクロック数に対応したデータが格納されている。そして、第1の発振回路19で発生される第1のクロック信号CLK1が第1のカウンタ30によりカウントされ、そのカウントデータが比較器32によりレジスタ31に格納されているデータと比較される。これにより、比較器32では、誤差の少ない周期が1秒のクロック信号CLK3が生成される。このクロック信号CLK3を分周することによって、精度の高い時計を実現できる。
Thereafter, the
このように、外部から入力される正確な基準クロック信号CLKrefを用いて秒単位(例えば1秒)のウインドウパルスPw1を生成し、このウインドウパルスPw1が成立している期間、高い発振周波数(MHz以上)を持つ第1のクロック信号CLK1のカウント数をカウンタ30で測定すると、第1のクロック信号CLK1を用いて1秒を計時するために必要なクロック数を求めることができる。この際の測定最小単位はカウンタ30の1クロック分となるため、測定時に最大で第1のクロック信号CLK1の半クロック分の分解能誤差が発生する。また、ウインドウパルスPw1の立ち上がり及び立ち下がり時に、それぞれ1クロック分、合わせて最大2クロック分の測定誤差が生じる。ただし、これは外部から入力される正確な基準クロック信号CLKrefを分周する分周器12の分周数を増加させて、例えば16秒などのようにウインドウパルスPw1の成立期間を長くして、カウンタ30による測定時間を長くすると、全体の誤差に対して測定誤差の割合を小さくできる。
In this way, a window pulse Pw1 in units of seconds (for example, 1 second) is generated using an accurate reference clock signal CLKref input from the outside, and a high oscillation frequency (MHz or higher) during the period in which the window pulse Pw1 is established. When the count number of the first clock signal CLK1 having () is measured by the
全体の誤差は、カウンタ30の分解能に基づく分解能誤差と、測定誤差との和で表わされ、第1のクロック信号CLK1の周波数をf1(Hz)、測定時間をt1(s)とすると、分解能誤差は(1/f1×2)、測定誤差は(2/f1×t1)となり、全体の誤差は(1/f1×2)+(2/f1×t1)(ppm)となる。仮に第1の発振回路19を1MHzで動作させたときに実際の発振周波数が1000010Hzだった場合、補正を行わないときの第1のクロック信号CLK1は10ppmの誤差を持つことになる。これに対し、カウンタ30における測定時間を16秒にすると、比較器32で生成されるクロックCLK3の誤差は0.625ppmに減少する。
The total error is expressed as the sum of the resolution error based on the resolution of the
次に、比較器32で生成されたクロックCLK3が分周器33で分周されることにより、例えば1秒の期間を有するウインドウパルスPw2が生成され、第2のANDゲート回路34の一方の入力端子に入力される。一方、第2の発振回路25で発生される第2のクロック信号CLK2が第2のANDゲート回路34の他方の入力端子に入力される。このときの図1の回路の接続状態を図4に抽出して示す。ウインドウパルスPw2が成立している期間に、第2のANDゲート回路34から第2のクロック信号CLK2が出力され、第2のカウンタ35によりカウントされる。これにより、正確な1秒の期間に発生する第2のクロック信号CLK2のクロック数が測定される。
Next, the clock CLK3 generated by the
第2のカウンタ35のカウントデータは、CPU27の転送命令等により、バス28を介してCPU27に読み込まれ、カウントデータがそのまま、もしくはこのカウントデータが一定数で除算されたデータが不揮発性記憶装置に記憶されると共に、そのデータが再びバス28を介してレジスタ31に転送され、格納される。なお、ウインドウパルスPw2の成立期間が上記のように1秒である場合には、カウンタ35のカウントデータがそのままレジスタ31に格納される。しかし、分周器33の分周数を増加させるなどして、ウインドウパルスPw2の成立期間が1秒以上である場合には、CPU27に読み出されたカウンタ35のカウントデータは、CPU27の演算命令などで、ウインドウパルスPw2の成立期間に対応した秒数である一定数で除算されて1秒の期間のデータに変換され、この変換後のデータがレジスタ31に格納される。
The count data of the
この後、第1の選択回路26が第1の発振回路25で発生されるクロック信号CLK2を選択するように、第1の選択回路26がCPU27の処理により切り換え制御される。第2の選択回路29の選択動作は変化しない。このときの図1の回路の接続状態を図5に抽出して示す。このとき、レジスタ31には、正確な1秒の期間に発生する第2のクロック信号CLK2のクロック数に応じたデータが格納されている。そして、第2の発振回路25で発生される第2のクロック信号CLK2が第1のカウンタ30によりカウントされ、そのカウントデータが比較器32によりレジスタ31に格納されているデータと比較されることにより、比較器32からは誤差の少ない周期が1秒のクロック信号CLK3が生成される。このクロック信号CLK3を分周することによって、精度の高い時計を実現できる。
Thereafter, the
ところで、図1に示すようなリアルタイムクロック回路を内蔵した半導体集積回路を実際の製品に組み込んで計時動作を行わせる場合に、安定して電源電圧が供給されるときは、図3に示すように、第1の発振回路19が動作し、第1の発振回路19で発生される第1のクロック信号CLK1が第1の選択回路26及び第2の選択回路29を介して第1のカウンタ30に供給され、第1のカウンタ30で第1のクロック信号CLK1がカウントされる。そして、第1のカウンタ30のカウントデータがレジスタ31に格納されているデータと比較される。このとき、レジスタ31には、外部から入力される正確な基準クロック信号CLKrefを用いて生成される秒単位のウインドウパルスPw1が成立している期間に、第1のクロック信号CLK1がカウンタ30でカウントされた後のデータが格納されている。なお、この期間、第2の発振回路25の動作は、制御信号より停止されている。
By the way, when a semiconductor integrated circuit having a built-in real-time clock circuit as shown in FIG. 1 is incorporated in an actual product to perform a timing operation, when a power supply voltage is stably supplied, as shown in FIG. The
従って、安定して電源電圧が供給されるときは、高速で発振する第1の発振回路19で発生される第1のクロック信号CLK1を用いて、誤差の少ない周期が1秒のクロック信号CLK3が生成される。
Therefore, when the power supply voltage is stably supplied, the first clock signal CLK1 generated by the
一方、半導体集積回路に供給されている電源電圧が遮断し、電池によるバックアップ動作が行われる場合は、図5に示すように、第2の発振回路25が動作し、第2の発振回路25で発生される第2のクロック信号CLK2が第1の選択回路26及び第2の選択回路29を介して第1のカウンタ30に供給され、第1のカウンタ30で第2のクロック信号CLK2がカウントされる。そして、第1のカウンタ30のカウントデータがレジスタ31に格納されているデータと比較される。このとき、レジスタ31には、図4に示すように、クロック信号CLK3を用いて生成される秒単位のウインドウパルスPw2が成立している期間に、第2のクロック信号CLK2が第2のカウンタ35でカウントされた後のデータが格納されている。なお、この期間、第1の発振回路19の動作は、制御信号より停止されている。
On the other hand, when the power supply voltage supplied to the semiconductor integrated circuit is cut off and a backup operation by a battery is performed, the
従って、電池によるバックアップ動作が行われる場合は、低速で発振する第2の発振回路25で発生される第2のクロック信号CLK2を用いて、誤差の少ない周期が1秒のクロック信号CLK3が生成される。
Therefore, when the backup operation by the battery is performed, the second clock signal CLK2 generated by the
さらに、電源電圧が復帰した後は、図3に示すように、第1の発振回路19が動作し、第1の発振回路19で発生される第1のクロック信号CLK1が第1の選択回路26及び第2の選択回路29を介して第1のカウンタ30に供給され、カウントデータがレジスタ31に格納されているデータと比較されることで、誤差の少ない周期が1秒のクロック信号CLK3が生成される。このとき、レジスタ31には、外部から入力される正確な基準クロック信号CLKrefを用いて生成される秒単位のウインドウパルスPw1が成立している期間に、第1のクロック信号CLK1がカウンタ30でカウントされた後のデータが格納される。
Further, after the power supply voltage is restored, as shown in FIG. 3, the
このように、上記実施の形態の半導体集積回路によれば、工場出荷時に、外部端子11から、予め校正された正確な基準クロック信号CLKrefを入力して、リアルタイムクロック回路内の水晶振動子の精度測定及び補正を行うことにより、その後、実際の製品に組み込んだ後は内部の発振回路を動作させて誤差の少ない周期が1秒のクロック信号CLK3を生成することができる。しかも、安定して電源電圧が供給されている場合や、電源電圧が遮断して電池によるバックアップ動作が行われる場合でも、誤差の少ない周期が1秒のクロック信号CLK3を生成することができる。もちろん、電源電圧の遮断後に電源電圧が復帰した後でも、外部から基準クロック信号CLKrefを入力することなく、誤差の少ない周期が1秒のクロック信号CLK3を生成することができる。
As described above, according to the semiconductor integrated circuit of the above-described embodiment, the accurate reference clock signal CLKref calibrated in advance is input from the
図6は、本発明に係るリアルタイムクロック回路を内蔵した半導体集積回路の応用例を示すブロック図である。本応用例は、図1に示す半導体集積回路を、深夜電力料金と昼間電力料金とが異なる商用交流電源の使用電力量に基づいて電力料金を自動的に計算する電力量計装置に適用したものである。 FIG. 6 is a block diagram showing an application example of a semiconductor integrated circuit incorporating a real-time clock circuit according to the present invention. In this application example, the semiconductor integrated circuit shown in FIG. 1 is applied to a watt-hour meter device that automatically calculates a power charge based on the amount of power used by a commercial AC power supply with a different midnight power charge and daytime power charge. It is.
図6において、50は図1に示すような構成を有するリアルタイムクロック回路を内蔵した半導体集積回路である。この半導体集積回路50において、外部端子CIN1及びCOUT1は図1中の外部端子14a、14bに相当し、両外部端子CIN1及びCOUT1に先の第1の発振回路19を構成する水晶振動子15及び負荷容量コンデンサ16が接続される。同様に、外部端子CIN2及びCOUT2は図1中の外部端子20a、20bに相当し、両外部端子CIN2及びCOUT2に先の第2の発振回路25を構成する水晶振動子21及び負荷容量コンデンサ22が接続される。
In FIG. 6,
また、この半導体集積回路50では、図1中に示すように、第1、第2の発振回路19、25で発生される第1、第2のクロック信号CLK1、CLK2を第1のカウンタ30でカウントし、さらに比較器32においてレジスタ31に格納されているデータと比較されることで生成される1秒の周期を有するクロック信号CLK3を分周して、秒、分、時からなる時刻を計時する時刻計時機能を有する。
In the semiconductor integrated
図6において、60は200Vまたは100Vの商用交流電源の使用電力量を測定する電力量測定部である。この電力量測定部60は、例えばΔΣAD変換用半導体集積回路(ΔΣAD変換IC)を有し、商用交流電源の交流パルス(電圧/電流)を測定し、数Hzないし数KHzのデジタルパルス信号に変換して出力する。変換されたパルス信号の周波数は使用電力量に比例する。つまり、周波数が高い程、電力を多く使用していることになる。このパルス信号は、使用電力量表示部70に設けられた機械式の表示器71のステップモータに駆動パルスとして供給されることで、使用した累積電力量が数値表示される。使用電力量表示部70は、上記機械式の表示器71の他に例えば液晶表示器(LCD)からなるフロントパネル(Front Panel)72を有する。フロントパネル72では、半導体集積回路50から出力される種々の表示情報に基づいて表示がなされる。
In FIG. 6,
また、電力量測定部60から出力されるデジタルパルス信号は、フォトカプラ(Photo coupler)61を介して、半導体集積回路50の電力測定入力用の外部端子(I/O)に供給される。
The digital pulse signal output from the power
80は、商用交流電源から直流電圧を発生する電源回路(Regulator)である。この電源回路80で発生される直流電圧は、ダイオード81を介して半導体集積回路50の電源電圧供給用の外部端子(VDD)に供給されると共に、半導体集積回路50の電源電圧検出用の外部端子(I/O)に供給される。また、電源遮断時のバックアップ用の電池82が、ダイオード83を介して半導体集積回路50の電源電圧供給用の外部端子(VDD)に接続されている。
A power supply circuit (Regulator) 80 generates a DC voltage from a commercial AC power supply. The DC voltage generated by the
半導体集積回路50では、電源回路80で直流電圧が発生されている時にこれが検出され、先の第1の発振回路19(図1中に図示)で発生される第1のクロック信号CLK1がカウンタ30(図1中に図示)でカウントされ、比較器32(図1中に図示)で比較されることで1秒の周期を持つパルス信号CLK3が生成され、さらにパルス信号CLK3が分周されることで時刻が計時される。
In the semiconductor integrated
一方、半導体集積回路50では、電力測定入力用の外部端子(I/O)に供給されるデジタルパルス信号がカウントされることで使用電力量が測定され、この測定された使用電力量と、時間帯に応じて異なる複数の課金情報の中から計時時刻の時間帯に応じた課金情報を選択し、この課金情報と算出された使用電力量とに応じて使用電力料金が計算される。計算された電力料金は、課金情報として不揮発性記憶装置、例えばE2PROM90に格納される。なお、図1中のCPU27は、第1のカウンタ30のカウントデータ、もしくはこのカウントデータを一定数で除算したデータをこのE2PROM90に格納してもよい。
On the other hand, in the semiconductor integrated
また、半導体集積回路50には、主に赤外線LED(発光ダイオード)及び赤外線受光素子を接続するための外部端子(UART/SIO)が設けられている。そして、この外部端子に接続された赤外線LED及び赤外線受光素子を介して、検針用の外部端末との間で光による情報の授受が行われ、E2PROM90に格納されている月単位の課金情報が検針用の外部端末に供給され、単価変更及び機能変更のための情報が半導体集積回路50に供給される。単価変更及び機能変更の際に、入力情報に基づいて半導体集積回路50で表示用情報が生成され、この表示用情報がフロントパネル72に供給されることで、単価変更及び機能変更の際の情報がフロントパネル72で表示されるようにしてもよい。
The semiconductor integrated
一方、交流電源が遮断され、電源回路80で直流電圧が発生されなくなり、半導体集積回路50でこの状態で検出されると、先の第1の発振回路19に代わって第2の発振回路25が動作状態にされ、この第2の発振回路25で発生される第2のクロック信号CLK2がカウンタ30でカウントされ、比較器32で比較されることで1秒の周期を持つパルス信号CLK3が生成され、さらにパルス信号CLK3が分周されることで時刻が計時される。すなわち、図1に示すようなリアルタイムクロック回路を内蔵した半導体集積回路50では、常に安定して現在時刻を計時することができるので、交流電源が遮断した後でも、ほぼ正確に時刻の計時が行われ、その後、交流電源が復帰しても、時間帯に応じた単位電力量当りの価格に基づいて正確に電力料金を計算することができる。
On the other hand, when the AC power supply is cut off and no DC voltage is generated in the
なお、この発明は上記実施の形態に限定されるものではなく種々の変形が可能であることはいうまでもない。例えば、図1に示す半導体集積回路では、比較器32で生成されるクロック信号CLK3を分周器33によりカウントして1秒の期間を有するウインドウパルスPw2を生成する場合を説明したが、これはクロック信号CLK3そのものが1秒の期間を有するクロック信号である場合には分周器33を省略し、クロック信号CLK3そのものをウインドウパルスPw2として第2のANDゲート回路34に供給するようにしてもよい。
Needless to say, the present invention is not limited to the above-described embodiment, and various modifications are possible. For example, in the semiconductor integrated circuit shown in FIG. 1, the case where the clock signal CLK3 generated by the
11、14a、14b、20a、20b…外部端子、12…分周器、13…第1のANDゲート回路、15、21…水晶振動子、19…第1の発振回路、25…第2の発振回路、26…第1の選択回路、27…CPU、28…バス、29…第2の選択回路、30…第1のカウンタ、31…レジスタ、32…比較器、33…分周器、34…第2のANDゲート回路、35…第2のカウンタ、50…半導体集積回路、60…電力量測定部、61…フォトカプラ、70…使用電力量表示部、71…表示器、72…フロントパネル、80…電源回路、81…ダイオード、82…バックアップ用の電池、83…ダイオード、90…E2PROM。
DESCRIPTION OF
Claims (5)
第1の周期を有する第1のクロック信号を発生する第1の発振回路と、
前記第1の周期よりも長い第2の周期を有する第2のクロック信号を発生する第2の発振回路と、
前記第1及び第2のクロック信号のいずれか一方のクロック信号を選択して出力する第1の選択回路と、
前記第1の選択回路で選択されたクロック信号と前記ウインドウパルスとの論理積をとる第1の論理積回路と、
前記第1の選択回路で選択されたクロック信号及び前記第1の論理積回路の出力のいずれか一方を選択して出力する第2の選択回路と、
前記第2の選択回路の出力をカウントする第1のカウンタと、
所定のデータが格納されるレジスタと、
前記第1のカウンタのカウントデータを前記レジスタに格納されたデータと比較して時刻計時用のクロック信号を生成する比較器と、
前記時刻計時用のクロック信号及び前記第2のクロック信号との論理積をとる第2の論理積回路と、
前記第2の論理積回路の出力をカウントする第2のカウンタとを具備し、
前記レジスタには、前記第1のカウンタのカウントデータもしくはこのカウントデータを一定数で除算したデータ、または前記第2のカウンタのカウントデータもしくはこのカウントデータを一定数で除算したデータが格納されることを特徴とするリアルタイムクロック回路。 A frequency divider that divides the reference clock signal to generate a window pulse;
A first oscillation circuit for generating a first clock signal having a first period;
A second oscillation circuit for generating a second clock signal having a second period longer than the first period;
A first selection circuit that selects and outputs one of the first and second clock signals;
A first AND circuit that takes a logical product of the clock signal selected by the first selection circuit and the window pulse;
A second selection circuit that selects and outputs either the clock signal selected by the first selection circuit or the output of the first AND circuit;
A first counter that counts the output of the second selection circuit;
A register for storing predetermined data; and
A comparator that compares the count data of the first counter with the data stored in the register to generate a clock signal for timekeeping;
A second AND circuit that takes a logical product of the clock signal for timekeeping and the second clock signal;
A second counter that counts the output of the second AND circuit;
The register stores the count data of the first counter or data obtained by dividing the count data by a certain number, or the count data of the second counter or data obtained by dividing the count data by a certain number. A real-time clock circuit.
前記クロック信号を再度、カウントし、比較器によりこのカウントデータを前記レジスタに格納されているデータと比較して時刻計時用のクロック信号を生成することを特徴とするリアルタイムクロック回路。 The reference clock signal is divided to generate a window pulse, and the clock signal generated by the oscillation circuit is counted during the generation period of the window pulse, and data corresponding to the count number is stored in the register.
A real-time clock circuit which counts the clock signal again and compares the count data with data stored in the register by a comparator to generate a clock signal for time measurement.
前記第1のクロック信号を再度、カウントし、比較器によりこのカウントデータを前記レジスタに格納されているデータと比較して第1の時刻計時用のクロック信号を生成し、
前記第1の時刻計時用のクロック信号をウインドウパルスとして用いて、このウインドウパルスの生成期間に、第2の発振回路で発生される前記第1の周期よりも長い第2の周期を有する第2のクロック信号をカウントしてそのカウント数に応じたデータを前記レジスタに再度、格納し、
前記第2のクロック信号を再度、カウントし、前記比較器によりこのカウントデータを前記レジスタに格納されているデータと比較して第2の時刻計時用のクロック信号を生成することを特徴とするリアルタイムクロック回路。 The reference clock signal is divided to generate a window pulse. During the window pulse generation period, the first clock signal having the first period generated by the first oscillation circuit is counted to obtain the count number. The corresponding data is stored in the register,
The first clock signal is counted again, and the count data is compared with the data stored in the register by a comparator to generate a clock signal for the first clock.
The second clock having the second period longer than the first period generated by the second oscillation circuit is generated in the generation period of the window pulse by using the first clock signal for timekeeping as the window pulse. The clock signal is counted and the data corresponding to the count number is stored again in the register,
The second clock signal is counted again, and the count data is compared with the data stored in the register by the comparator to generate a second clock signal for time measurement. Clock circuit.
制御用データを生成する中央演算処理装置と、
前記中央演算処理装置に接続され、前記中央演算処理装置で生成された制御データを伝達するバスと、
外部端子を介して水晶振動子が接続され、第1の周期を有する第1のクロック信号を発生する第1の発振回路と、
外部端子を介して水晶振動子が接続され、前記第1の周期よりも長い第2の周期を有する第2のクロック信号を発生する第2の発振回路と、
前記バスに接続され、前記バス上の制御用データに応じて、第1及び第2のクロック信号のいずれか一方のクロック信号を選択して出力する第1の選択回路と、
前記第1の選択回路で選択されたクロック信号と前記ウインドウパルスとの論理積をとる第1の論理積回路と、
前記バスに接続され、前記バス上の制御用データに応じて、前記第1の選択回路で選択されたクロック信号及び前記第1の論理積回路の出力のいずれか一方を選択して出力する第2の選択回路と、
前記バスに接続され、前記第2の選択回路の出力をカウントする第1のカウンタと、
前記バスに接続され、前記バス上のデータが格納されるレジスタと、
前記第1のカウンタのカウントデータを前記レジスタに格納されたデータと比較して時刻計時用のクロック信号を生成する比較器と、
前記比較器で生成されたクロック信号及び前記第2のクロック信号との論理積をとる第2の論理積回路と、
前記バスに接続され、前記第2の論理積回路の出力をカウントする第2のカウンタとを具備したリアルタイムクロック回路を内蔵し、
前記レジスタには、前記第1のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算された後のデータ、または前記第2のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算されたデータが格納されることを特徴とする半導体集積回路。 A frequency divider that divides a reference clock signal input from an external terminal to generate a window pulse;
A central processing unit for generating control data;
A bus connected to the central processing unit for transmitting control data generated by the central processing unit;
A first oscillation circuit that is connected to a crystal resonator via an external terminal and generates a first clock signal having a first period;
A second oscillation circuit that is connected to a crystal resonator via an external terminal and generates a second clock signal having a second period longer than the first period;
A first selection circuit that is connected to the bus and selects and outputs one of the first and second clock signals according to the control data on the bus;
A first AND circuit that takes a logical product of the clock signal selected by the first selection circuit and the window pulse;
A first signal that is connected to the bus and that selects and outputs either the clock signal selected by the first selection circuit or the output of the first AND circuit according to the control data on the bus; Two selection circuits;
A first counter connected to the bus and counting an output of the second selection circuit;
A register connected to the bus for storing data on the bus;
A comparator that compares the count data of the first counter with the data stored in the register to generate a clock signal for timekeeping;
A second AND circuit that takes a logical product of the clock signal generated by the comparator and the second clock signal;
A real-time clock circuit that is connected to the bus and includes a second counter that counts the output of the second AND circuit;
In the register, the count data of the first counter or the data after the count data is divided by a fixed number by the central processing unit, or the count data of the second counter or the count data is the central data A semiconductor integrated circuit in which data divided by a predetermined number by an arithmetic processing unit is stored.
前記パルス信号をカウントして使用電力量を算出すると共に、時刻計時用のクロック信号を生成し、このクロック信号を計数して時刻の計時を行うリアルタイムクロック回路を内蔵し、時間帯に応じて異なる複数の課金情報の中から計時時刻の時間帯に応じた課金情報を選択し、この課金情報と前記算出された使用電力量とに応じて使用電力料金を算出する半導体集積回路とを具備し、
前記半導体集積回路は、
外部端子から入力される基準クロック信号を分周してウインドウパルスを生成する分周器と、
制御用データを生成する中央演算処理装置と、
前記中央演算処理装置に接続され、前記中央演算処理装置で生成された制御データを伝達するバスと、
外部端子を介して水晶振動子が接続され、第1の周期を有する第1のクロック信号を発生する第1の発振回路と、
外部端子を介して水晶振動子が接続され、前記第1の周期よりも長い第2の周期を有する第2のクロック信号を発生する第2の発振回路と、
前記バスに接続され、前記バス上の制御用データに応じて、第1及び第2のクロック信号のいずれか一方のクロック信号を選択して出力する第1の選択回路と、
前記第1の選択回路で選択されたクロック信号と前記ウインドウパルスとの論理積をとる第1の論理積回路と、
前記バスに接続され、前記バス上の制御用データに応じて、前記第1の選択回路で選択されたクロック信号及び前記第1の論理積回路の出力のいずれか一方を選択して出力する第2の選択回路と、
前記バスに接続され、前記第2の選択回路の出力をカウントする第1のカウンタと、
前記バスに接続され、前記バス上のデータが格納されるレジスタと、
前記第1のカウンタのカウントデータを前記レジスタに格納されたデータと比較して時刻計時用のクロック信号を生成する比較器と、
前記比較器で生成されたクロック信号及び前記第2のクロック信号との論理積をとる第2の論理積回路と、
前記バスに接続され、前記第2の論理積回路の出力をカウントする第2のカウンタとを有し、
前記レジスタには、前記第1のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算された後のデータ、または前記第2のカウンタのカウントデータもしくはこのカウントデータが前記中央演算処理装置によって一定数で除算されたデータが格納されることを特徴とする電力量計装置。 An electric energy measuring unit that is connected to a commercial AC power source and generates a pulse signal having a frequency according to the used electric energy;
The power consumption is calculated by counting the pulse signal, and a clock signal for timekeeping is generated, and a real-time clock circuit that counts the clock signal and counts the time is built in, and varies depending on the time zone A semiconductor integrated circuit that selects billing information according to the time zone of the clocking time from a plurality of billing information, and calculates a power consumption fee according to the billing information and the calculated power consumption amount,
The semiconductor integrated circuit is:
A frequency divider that divides a reference clock signal input from an external terminal to generate a window pulse;
A central processing unit for generating control data;
A bus connected to the central processing unit for transmitting control data generated by the central processing unit;
A first oscillation circuit that is connected to a crystal resonator via an external terminal and generates a first clock signal having a first period;
A second oscillation circuit that is connected to a crystal resonator via an external terminal and generates a second clock signal having a second period longer than the first period;
A first selection circuit that is connected to the bus and selects and outputs one of the first and second clock signals according to the control data on the bus;
A first AND circuit that takes a logical product of the clock signal selected by the first selection circuit and the window pulse;
A first signal that is connected to the bus and that selects and outputs either the clock signal selected by the first selection circuit or the output of the first AND circuit according to the control data on the bus; Two selection circuits;
A first counter connected to the bus and counting an output of the second selection circuit;
A register connected to the bus for storing data on the bus;
A comparator that compares the count data of the first counter with the data stored in the register to generate a clock signal for timekeeping;
A second AND circuit that takes a logical product of the clock signal generated by the comparator and the second clock signal;
A second counter connected to the bus and counting the output of the second AND circuit;
In the register, the count data of the first counter or the data after the count data is divided by a fixed number by the central processing unit, or the count data of the second counter or the count data is the central data A watt-hour meter device storing data divided by a fixed number by an arithmetic processing unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004213283A JP2006030136A (en) | 2004-07-21 | 2004-07-21 | Real-time clock circuit, semiconductor integrated circuit, and watt-hour meter device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004213283A JP2006030136A (en) | 2004-07-21 | 2004-07-21 | Real-time clock circuit, semiconductor integrated circuit, and watt-hour meter device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006030136A true JP2006030136A (en) | 2006-02-02 |
Family
ID=35896659
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004213283A Pending JP2006030136A (en) | 2004-07-21 | 2004-07-21 | Real-time clock circuit, semiconductor integrated circuit, and watt-hour meter device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006030136A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111181552A (en) * | 2020-01-08 | 2020-05-19 | 电子科技大学 | Bidirectional frequency synchronous oscillator circuit |
US20220035398A1 (en) * | 2020-07-29 | 2022-02-03 | Seiko Epson Corporation | Circuit Device And Real-Time Clock Device |
-
2004
- 2004-07-21 JP JP2004213283A patent/JP2006030136A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111181552A (en) * | 2020-01-08 | 2020-05-19 | 电子科技大学 | Bidirectional frequency synchronous oscillator circuit |
US20220035398A1 (en) * | 2020-07-29 | 2022-02-03 | Seiko Epson Corporation | Circuit Device And Real-Time Clock Device |
US11836001B2 (en) * | 2020-07-29 | 2023-12-05 | Seiko Epson Corporation | Circuit device and real-time clock device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101128780B (en) | Clock signal output apparatus and control method of same, and electric apparatus and control method of same | |
US4399510A (en) | System for monitoring utility usage | |
US8823434B2 (en) | Clock correction circuit and clock correction method | |
CN103809658A (en) | Semiconductor device and clock correction method | |
JP6282723B2 (en) | High-precision timekeeping method for quartz electronic watches | |
US4987363A (en) | Electric energy meter with power outage recovery circuit | |
CN105573106A (en) | Smart meter RTC timing precision correction circuit and method thereof | |
CN103226376A (en) | High-precision real-time clock chip | |
JP2007078405A (en) | Timing program of software timepiece | |
US8901983B1 (en) | Temperature compensated timing signal generator | |
JP5477488B2 (en) | Real-time clock and data recording method for real-time clock | |
WO2000041041A1 (en) | Electronic apparatus and method of controlling electronic apparatus | |
JP2013167597A (en) | Real time clock | |
JP2009055178A (en) | Integrated circuit device | |
KR100421298B1 (en) | Electrical Energy Meter Oscillator Compensation | |
JP2006030136A (en) | Real-time clock circuit, semiconductor integrated circuit, and watt-hour meter device | |
JP2002261591A (en) | Accurate time delay system and method using innacurate oscillator | |
US8896359B1 (en) | Temperature compensated timing signal generator | |
JPH0347718B2 (en) | ||
JPS6015905B2 (en) | electronic clock | |
JP7392576B2 (en) | Real-time clock circuit, real-time clock module, electronic equipment and real-time clock circuit correction method | |
CN106444966A (en) | Device and method for adjusting real time clock (RTC) | |
JP5037755B2 (en) | Temperature change measuring apparatus and method | |
JP2005257494A (en) | Timepiece accuracy correction control device and watt-hour meter | |
JP2013003033A (en) | Battery life estimation apparatus |