JP2001111389A - Microcomputer incorporating cr oscillation clock - Google Patents

Microcomputer incorporating cr oscillation clock

Info

Publication number
JP2001111389A
JP2001111389A JP33759799A JP33759799A JP2001111389A JP 2001111389 A JP2001111389 A JP 2001111389A JP 33759799 A JP33759799 A JP 33759799A JP 33759799 A JP33759799 A JP 33759799A JP 2001111389 A JP2001111389 A JP 2001111389A
Authority
JP
Japan
Prior art keywords
oscillation
circuit
count number
clock
pulse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP33759799A
Other languages
Japanese (ja)
Other versions
JP3584821B2 (en
Inventor
Kunitaka Egawa
邦隆 江川
Yoichi Fujita
洋一 藤田
Keisuke Matsuda
啓資 松田
Hiroshi Fujii
裕志 藤井
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.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP33759799A priority Critical patent/JP3584821B2/en
Publication of JP2001111389A publication Critical patent/JP2001111389A/en
Application granted granted Critical
Publication of JP3584821B2 publication Critical patent/JP3584821B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a microcomputer incorporating a CR oscillation clock with further precise clock precision without any cost increase. SOLUTION: This microcomputer incorporating a CR oscillation clock is provided with a CR oscillation clock for automatically adjusting an oscillation cycle based on a precise outside oscillation pulse. This CR oscillation clock is provided with a CR oscillation circuit 1 having a ladder resistance 11, an edge detecting circuit 2 for detecting the edge of the oscillation output, an outside oscillation pulse counter 3, a count number setting register 4, a comparing and adjusting means 5 for comparing the numerical values of the counter 3 with those of the register 4, and for properly adjusting the ladder resistance 11, and a resistance adjusting circuit 6. In this CR oscillation clock, the oscillation cycle is automatically adjusted based on the precise outside oscillation pulse so that the clock precision of the CR oscillation clock can be accurately held. Also, the CR oscillation clock is formed as one part of an integrated circuit so that there is no cost increase.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロコンピュ
ータの技術分野に属し、より詳しくはCR発振クロック
を内蔵したマイクロコンピュータの技術分野に属する。
The present invention belongs to the technical field of microcomputers, and more particularly to the technical field of microcomputers having a built-in CR oscillation clock.

【0002】[0002]

【従来の技術】従来から、スリープ機能やPWM制御等
の時間制御に使用する目的で、安価なCR発振クロック
を内蔵したマイクロコンピュータは普及していた。この
ようなCR発振クロック内蔵マイクロコンピュータを調
整工数がない安価な通常の工程によって製造すると、C
R発振クロックの時間精度に数十%もの誤差が発生して
しまう。
2. Description of the Related Art Conventionally, microcomputers having a built-in inexpensive CR oscillation clock for the purpose of time control such as a sleep function and PWM control have been widely used. When such a microcomputer with a built-in CR oscillation clock is manufactured by an inexpensive ordinary process without adjustment man-hours, C
An error of several tens% occurs in the time accuracy of the R oscillation clock.

【0003】そこで、従来技術としては、CR発振クロ
ックに調整抵抗を内蔵させ、この調整抵抗にレーザート
リミング処理を施すことにより、CR発振クロックの誤
差を数%に抑えたCR発振クロック内蔵マイクロコンピ
ュータがある。
Therefore, as a conventional technique, a microcomputer with a built-in CR oscillation clock in which an error in the CR oscillation clock is suppressed to several percent by incorporating an adjustment resistor in the CR oscillation clock and performing laser trimming processing on the adjustment resistor. is there.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、従来技
術のCR発振クロック内蔵マイクロコンピュータでは、
レーザートリミングを行うにあたり、薄膜を形成する工
程とレーザートリミングを行う工程とが必要になり、工
数が増える分だけコストアップが生じるという不都合が
あった。一方、前述のようにレーザートリミングを行わ
ない通常の工程によって製造されたCR発振クロック内
蔵マイクロコンピュータには、数十%もの誤差があるの
で、同マイクロコンピュータの時間制御を行うには、い
ささか誤差が大きすぎる。それゆえ、従来では相反する
要求ではあるが、安価でありながらより計時精度が高い
CR発振クロックをもったマイクロコンピュータが必要
とされている。
However, in the prior art microcomputer with a built-in CR oscillation clock,
In performing laser trimming, a step of forming a thin film and a step of performing laser trimming are required, and there has been a disadvantage that the cost is increased by the number of steps. On the other hand, a microcomputer with a built-in CR oscillation clock manufactured by a normal process without laser trimming as described above has an error of several tens of percent. Too big. Therefore, a microcomputer having a CR oscillation clock which is inexpensive and has higher timekeeping accuracy, which is a conflicting demand in the past, is required.

【0005】そこで本発明は、ほとんどコストアップを
生じないで、より精密な計時精度をもつCR発振クロッ
クを内蔵したマイクロコンピュータを提供することを解
決すべき課題とする。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a microcomputer having a built-in CR oscillation clock having more accurate timekeeping with little increase in cost.

【0006】[0006]

【課題を解決するための手段】前記課題を解決するため
に、発明者らは以下の手段を発明した。
In order to solve the above problems, the inventors have invented the following means.

【0007】(第1手段)本発明の第1手段は、請求項
1記載のCR発振クロック内蔵マイクロコンピュータで
ある。
(First Means) A first means of the present invention is a microcomputer with a built-in CR oscillation clock according to the first aspect.

【0008】すなわち、本手段のマイクロコンピュータ
に内蔵されたCR発振クロックは、CR発振回路、エッ
ジ検出回路、外部発振パルスカウンタ、カウント数設定
レジスタ、比較調整手段および抵抗調整回路をもつ。こ
れらの構成要素のうちいくつかは、互いに一体不可分に
構成されていてもかまわない。
That is, the CR oscillation clock built in the microcomputer of this means has a CR oscillation circuit, an edge detection circuit, an external oscillation pulse counter, a count setting register, a comparison adjustment means, and a resistance adjustment circuit. Some of these components may be integrally formed with each other.

【0009】ここで、CR発振回路は、後述の抵抗調整
回路からの制御信号により抵抗値が可変な可変抵抗器を
もつ発振回路であり、エッジ検出回路は、CR発振回路
からの発振出力のエッジを検出して検出信号を生成する
検出回路である。また、外部発振パルスカウンタは、C
R発振回路からの発振出力よりも周期が精密な外部発振
パルスを受信してその外部発振パルスを計数するデジタ
ルカウンタである。一方、カウント数設定レジスタは、
CR発振回路からの発振出力の一周期に相当すべき外部
発振パルスの適正なカウント数が格納されるレジスタで
ある。さらに、比較調整手段は、エッジ検出回路からエ
ッジ検出信号を受け取ると、外部発振パルスカウンタに
よる外部発振パルスのカウント数とカウント数設定レジ
スタに格納されたカウント数とを比較し、両カウント数
の差に基づいてCR発振回路の発振周期を調整するため
の調整信号を生成する手段である。そして、抵抗調整回
路は、比較調整手段からの調整信号に基づいて制御信号
を生成し、この制御信号をもって可変抵抗器の抵抗値を
調整する回路である。
Here, the CR oscillation circuit is an oscillation circuit having a variable resistor whose resistance value is variable by a control signal from a resistance adjustment circuit described later, and the edge detection circuit is an edge of an oscillation output from the CR oscillation circuit. Is a detection circuit that generates a detection signal by detecting The external oscillation pulse counter is C
This is a digital counter that receives an external oscillation pulse whose cycle is more precise than the oscillation output from the R oscillation circuit and counts the external oscillation pulse. On the other hand, the count number setting register
This register stores an appropriate count number of an external oscillation pulse corresponding to one cycle of the oscillation output from the CR oscillation circuit. Further, when receiving the edge detection signal from the edge detection circuit, the comparing and adjusting means compares the count number of the external oscillation pulse by the external oscillation pulse counter with the count number stored in the count number setting register, and determines the difference between the two count numbers. Means for generating an adjustment signal for adjusting the oscillation cycle of the CR oscillation circuit based on the The resistance adjustment circuit is a circuit that generates a control signal based on an adjustment signal from the comparison adjustment unit and adjusts the resistance value of the variable resistor using the control signal.

【0010】それゆえ本手段では、CR発振回路の一周
期が経ち、CR発振回路からの発振出力のパルスのエッ
ジがエッジ検出回路によって検出されると、エッジ検出
回路から検出信号が比較調整手段に送られる。すると、
比較調整手段は、前回の検出信号から積算された外部発
振パルスの積算値と、カウント数設定レジスタに設定さ
れているカウント数とを読み出して両者を比較する。こ
こで、カウント数設定レジスタに設定されているカウン
ト数は、CR発振回路からの発振出力の一周期に相当す
べき外部発振パルスの適正な積算値である。そこで、比
較調整手段は、精密な周期をもつ外部発振パルスがCR
発振回路の一周期のうちにいくつ積算されたかをもっ
て、CR発振回路からの発振出力の一周期が適正な設定
値よりもどの程度大きいかあるいは小さいかを判定する
ことができる。その判定結果に基づいて、比較調整手段
は、CR発振回路の発振周期を調整するための調整信号
を生成し、この調整信号に基づいて、抵抗調整回路は、
制御信号を生成して可変抵抗器の抵抗値を調整する。
Therefore, in this means, when one cycle of the CR oscillation circuit passes and the edge of the pulse of the oscillation output from the CR oscillation circuit is detected by the edge detection circuit, the detection signal is sent from the edge detection circuit to the comparison adjustment means. Sent. Then
The comparing and adjusting means reads out the integrated value of the external oscillation pulse integrated from the previous detection signal and the count number set in the count number setting register and compares them. Here, the count number set in the count number setting register is a proper integrated value of the external oscillation pulse which should correspond to one cycle of the oscillation output from the CR oscillation circuit. Therefore, the comparison and adjustment means uses an external oscillation pulse having a precise cycle
It is possible to determine how much one cycle of the oscillation output from the CR oscillation circuit is larger or smaller than an appropriate set value, based on how many times it is integrated in one cycle of the oscillation circuit. Based on the determination result, the comparing and adjusting means generates an adjustment signal for adjusting the oscillation cycle of the CR oscillation circuit, and based on the adjustment signal, the resistance adjustment circuit
A control signal is generated to adjust the resistance value of the variable resistor.

【0011】その結果、CR発振回路の発振周期は、カ
ウント数設定レジスタに設定されたカウント数を基準に
外部発振パルスに基づいて調整されるので、精密な発振
周期をもつ外部発振パルスに準ずる精度をもつようにな
る。それゆえ、CR発振クロックを内蔵し、CR発振ク
ロックからの発振出力に基づいて時間制御を行うマイク
ロコンピュータは、かなり精密な時間精度をもって各種
時間制御を行うことができるようになる。なお、このよ
うなCR発振クロックは、マイクロコンピュータの集積
回路の一部として形成されうるので、本手段の製造に
は、通常のCR発振クロックをもつマイクロコンピュー
タに比べて1〜2円程度のコストアップしか生じない。
As a result, the oscillation cycle of the CR oscillation circuit is adjusted based on the external oscillation pulse with reference to the count number set in the count number setting register, so that the accuracy is equivalent to that of the external oscillation pulse having a precise oscillation cycle. It comes to have. Therefore, a microcomputer that incorporates a CR oscillation clock and performs time control based on the oscillation output from the CR oscillation clock can perform various time controls with fairly precise time accuracy. Since such a CR oscillation clock can be formed as a part of an integrated circuit of a microcomputer, the production of this means costs about 1 to 2 yen compared to a microcomputer having a normal CR oscillation clock. Only happens up.

【0012】したがって本手段によれば、ほとんどコス
トアップを生じないで、より精密な計時精度をもつCR
発振クロックを内蔵したマイクロコンピュータを提供す
ることができるという効果がある。その結果、本手段の
マイクロコンピュータには、かなり精密な時間精度をも
って各種時間制御を行うことができるようになるという
効果がある。
Therefore, according to this means, a CR having a more precise timekeeping accuracy can be obtained with almost no increase in cost.
There is an effect that a microcomputer having a built-in oscillation clock can be provided. As a result, the microcomputer according to the present invention has an effect that various time controls can be performed with considerably precise time accuracy.

【0013】(第2手段)本発明の第2手段は、請求項
2記載のCR発振クロック内蔵マイクロコンピュータで
ある。すなわち本手段は、カウント数設定レジスタに格
納されるべきカウント数を適正に制限するカウント数制
限手段をさらに有する。ここで、カウント数制限手段
は、カウント数設定レジスタに格納されるべきカウント
数に適正な上限値および下限値から定まる適正範囲を設
け、この適正範囲から外れた値にカウント数設定レジス
タのカウント数が指定された場合には、カウント数を適
正な既定値に強制的に設定する機能を持つ。
(Second Means) A second means of the present invention is a microcomputer with a built-in CR oscillation clock according to the second aspect. That is, the present means further includes count number limiting means for appropriately limiting the count number to be stored in the count number setting register. Here, the count number limiting means sets an appropriate range determined from an appropriate upper limit value and an appropriate lower limit value for the count number to be stored in the count number setting register, and sets the count value of the count number setting register to a value outside the appropriate range. If is specified, it has a function to forcibly set the count number to an appropriate default value.

【0014】本手段では、何らかの不具合などに起因し
て仮にカウント数設定レジスタに不適正なカウント数が
書き込まれようとした場合にも、カウント数制限手段の
作用により、カウント数設定レジスタには適正な規定値
が書き込まれる。その結果、CR発振回路の制御は適正
範囲で行われるようになり、CR発振回路が発振不能に
なったり、CR発振回路の発振周期が不安定になったり
する不具合は、回避される。
In this means, even if an incorrect count number is written into the count number setting register due to some trouble or the like, the count number setting means operates the correct count number register. Is written. As a result, the control of the CR oscillation circuit is performed within an appropriate range, and the problem that the CR oscillation circuit becomes unable to oscillate or the oscillation cycle of the CR oscillation circuit becomes unstable is avoided.

【0015】ここで、カウント数制限手段は、マイクロ
コンピュータの集積回路の一部として形成されうるの
で、本手段は、ほとんどコストアップなしに実施するこ
とができる。
Here, since the count limiting means can be formed as a part of the integrated circuit of the microcomputer, the present means can be implemented with almost no increase in cost.

【0016】したがって本手段によれば、前述の第1手
段の効果に加えて、安定したCR発振回路の発振作用が
保証されるという効果がある。
Therefore, according to this means, in addition to the effect of the first means, there is an effect that a stable oscillating action of the CR oscillation circuit is guaranteed.

【0017】[0017]

【発明の実施の形態】本発明のCR発振クロック内蔵マ
イクロコンピュータの実施の形態については、当業者に
実施可能な理解が得られるよう、以下の実施例で明確か
つ十分に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of a microcomputer having a built-in CR oscillation clock according to the present invention will be clearly and fully described in the following embodiments so that those skilled in the art can understand the present invention.

【0018】[実施例1] (実施例1の構成)本発明の実施例1としてのCR発振
クロック内蔵マイクロコンピュータは、図1に示す構成
のCR発振クロックを内蔵したマイクロコンピュータで
ある。ここで、このCR発振クロックは、CR発振回路
1、エッジ検出回路2、外部発振パルスカウンタ3、カ
ウント数設定レジスタ4、比較調整手段5および抵抗調
整回路6をもつ。
Embodiment 1 (Configuration of Embodiment 1) A microcomputer with a built-in CR oscillation clock as Embodiment 1 of the present invention is a microcomputer with a built-in CR oscillation clock having the configuration shown in FIG. Here, this CR oscillation clock has a CR oscillation circuit 1, an edge detection circuit 2, an external oscillation pulse counter 3, a count setting register 4, a comparison adjustment means 5, and a resistance adjustment circuit 6.

【0019】CR発振回路1は、後述の抵抗調整回路6
からの制御信号により抵抗値が可変な可変抵抗器として
のラダー抵抗11をもつ発振回路である。すなわち、C
R発振回路1は、ラダー抵抗11、コンデンサ12、イ
ンバータ(否定ゲート)13およびバッファ14からな
る発振回路である。ここで、インバータ13およびバッ
ファ14は、それぞれ前記マイクロコンピュータと同じ
チップ上に形成されている。
The CR oscillation circuit 1 includes a resistance adjustment circuit 6 described later.
This is an oscillation circuit having a ladder resistor 11 as a variable resistor whose resistance value can be changed by a control signal from the control circuit. That is, C
The R oscillation circuit 1 is an oscillation circuit including a ladder resistor 11, a capacitor 12, an inverter (negative gate) 13, and a buffer 14. Here, the inverter 13 and the buffer 14 are respectively formed on the same chip as the microcomputer.

【0020】エッジ検出回路2は、CR発振回路1から
の発振出力のエッジを検出して検出信号を生成する検出
回路である。
The edge detection circuit 2 is a detection circuit that detects an edge of the oscillation output from the CR oscillation circuit 1 and generates a detection signal.

【0021】また、外部発振パルスカウンタ3は、CR
発振回路1からの発振出力よりも周期が精密な水晶振動
子からの外部発振パルスを受信して、その外部発振パル
スを計数するデジタルカウンタである。
The external oscillation pulse counter 3 has a CR
It is a digital counter that receives an external oscillation pulse from a crystal oscillator whose cycle is more precise than the oscillation output from the oscillation circuit 1 and counts the external oscillation pulse.

【0022】一方、カウント数設定レジスタ4は、CR
発振回路1からの発振出力の一周期に相当すべき外部発
振パルスの適正なカウント数が格納されるレジスタであ
る。すなわち、カウント数設定レジスタ4に設定される
カウント数には、外部発振パルスがそのカウント数だけ
発生する時間にCR発振回路1の発振周期が調整される
べき数値が設定される。
On the other hand, the count number setting register 4 stores the CR
This register stores an appropriate count number of an external oscillation pulse which should correspond to one cycle of the oscillation output from the oscillation circuit 1. That is, the count number set in the count number setting register 4 is set to a value by which the oscillation cycle of the CR oscillation circuit 1 should be adjusted during the time when the external oscillation pulse is generated by the count number.

【0023】さらに、比較調整手段5は、エッジ検出回
路2からエッジ検出信号を受け取ると、外部発振パルス
カウンタ3による外部発振パルスのカウント数とカウン
ト数設定レジスタ4に格納されたカウント数とを比較
し、両カウント数の差に基づいてCR発振回路1の発振
周期を調整するための調整信号を生成するデジタル演算
手段である。
Further, upon receiving the edge detection signal from the edge detection circuit 2, the comparison adjustment means 5 compares the count number of the external oscillation pulse by the external oscillation pulse counter 3 with the count number stored in the count number setting register 4. The digital operation means generates an adjustment signal for adjusting the oscillation cycle of the CR oscillation circuit 1 based on the difference between the two count numbers.

【0024】そして、抵抗調整回路6は、比較調整手段
5からの調整信号に基づいて制御信号を生成し、この制
御信号をもってCR発振回路1の可変抵抗器としてのラ
ダー抵抗11の抵抗値を調整する回路である。
The resistance adjustment circuit 6 generates a control signal based on the adjustment signal from the comparison adjustment means 5, and adjusts the resistance value of the ladder resistor 11 as a variable resistor of the CR oscillation circuit 1 using the control signal. Circuit.

【0025】以上の各構成要素1〜6は、本実施例のC
R発振クロック内蔵マイクロコンピュータの集積回路の
一部に集積されて一体に形成されており、同マイクロコ
ンピュータにCR発振クロック機能を提供する。
The above components 1 to 6 correspond to C of this embodiment.
It is integrated and formed integrally with a part of the integrated circuit of the microcomputer with the built-in R oscillation clock, and provides the microcomputer with a CR oscillation clock function.

【0026】なお、前述の外部発振パルスは、発振周期
が精密な水晶発振回路から提供されるものとし、同水晶
発振回路および本実施例のCR発振クロック内蔵マイク
ロコンピュータは、節電のためにスリープ機能を持つも
のとする。
The above-mentioned external oscillation pulse is provided from a crystal oscillation circuit whose oscillation cycle is precise, and the crystal oscillation circuit and the microcomputer with a built-in CR oscillation clock of this embodiment are provided with a sleep function to save power. Have

【0027】(実施例1の作用効果)本実施例のCR発
振クロック内蔵マイクロコンピュータは、以上のように
構成されているので、以下のような作用効果を発揮す
る。
(Operation and Effect of First Embodiment) The microcomputer with a built-in CR oscillation clock of this embodiment has the above-described configuration, and thus exhibits the following operation and effect.

【0028】先ず、前述の水晶発振回路および本ワンチ
ップ・マイクロコンピュータがスリープ状態になく通常
に機能している状態では、次のようにしてCR発振回路
1の発振周期の調整が行われる。
First, in a state where the above-described crystal oscillation circuit and the present one-chip microcomputer are functioning normally without being in the sleep state, the oscillation cycle of the CR oscillation circuit 1 is adjusted as follows.

【0029】すなわち、CR発振回路1の一周期が経
ち、CR発振回路からの発振出力のパルスのエッジがエ
ッジ検出回路2によって検出されると、エッジ検出回路
2から検出信号が比較調整手段5に送られる。すると、
比較調整手段5は、外部発振パルスカウンタ3で積算さ
れている前回の検出信号から積算された外部発振パルス
のカウント数と、カウント数設定レジスタ4に設定され
ているカウント数とを読み出して両者を比較する。ここ
で、カウント数設定レジスタ4に設定されているカウン
ト数は、CR発振回路1からの発振出力の一周期に相当
すべき外部発振パルスの適正な積算値である。そこで、
比較調整手段5は、精密な周期をもつ外部発振パルスが
CR発振回路1の一周期のうちにいくつ積算されたかを
もって、CR発振回路1からの発振出力の一周期が適正
な設定値よりもどの程度大きいかあるいは小さいかを判
定することができる。その判定結果に基づいて、比較調
整手段5は、CR発振回路1の発振周期を調整するため
の調整信号を生成し、この調整信号に基づいて、抵抗調
整回路6は、制御信号を生成してラダー抵抗11の抵抗
値を調整する。
That is, when one cycle of the CR oscillation circuit 1 has passed and the edge of the pulse of the oscillation output from the CR oscillation circuit is detected by the edge detection circuit 2, the detection signal is sent from the edge detection circuit 2 to the comparison / adjustment means 5. Sent. Then
The comparing and adjusting means 5 reads the count number of the external oscillation pulse integrated from the previous detection signal integrated by the external oscillation pulse counter 3 and the count number set in the count number setting register 4 and reads both. Compare. Here, the count number set in the count number setting register 4 is a proper integrated value of the external oscillation pulse which should correspond to one cycle of the oscillation output from the CR oscillation circuit 1. Therefore,
The comparison and adjustment means 5 determines which one cycle of the oscillation output from the CR oscillation circuit 1 is greater than the appropriate set value, based on how many external oscillation pulses having a precise cycle are accumulated in one cycle of the CR oscillation circuit 1. It can be determined whether the degree is large or small. Based on the determination result, the comparison and adjustment means 5 generates an adjustment signal for adjusting the oscillation cycle of the CR oscillation circuit 1, and based on the adjustment signal, the resistance adjustment circuit 6 generates a control signal. The resistance value of the ladder resistor 11 is adjusted.

【0030】以上の作用を、図2に示すフローチャート
を参照しつつ、これから順を追って説明する。
The above operation will be described step by step with reference to the flowchart shown in FIG.

【0031】本実施例のCR発振クロック内蔵マイクロ
コンピュータが起動されると、同図に示すロジックがス
タートし、処理ステップS1で、外部発振パルスカウン
タ3に初期発振の計数に適正な初期値が代入される。併
せて処理ステップS2で、カウント数設定レジスタ4に
適正なカウント数が登録され、外部発振パルス計数の準
備が整うと、処理ステップS3で、CR発振回路1から
のパルス発振が始まる。そして、処理ステップS4で
は、エッジ検出回路2によりCR発振回路1からのパル
スの立ち上がりエッジの検出が行われ、判断ステップS
5でエッジ検出の有無が判定される。すると、立ち上が
りエッジが検出されるまでは、処理ステップS4および
判断ステップS5からなるループがごく短周期で繰り返
され、立ち上がりエッジが検出されたとたんに、ロジッ
クは次の判断ステップS6に進む。
When the microcomputer with a built-in CR oscillation clock of this embodiment is started, the logic shown in the figure starts, and in a processing step S1, an appropriate initial value is substituted into the external oscillation pulse counter 3 for counting the initial oscillation. Is done. At the same time, in processing step S2, when an appropriate count number is registered in the count number setting register 4 and preparation for external oscillation pulse counting is completed, pulse oscillation from the CR oscillation circuit 1 starts in processing step S3. In the processing step S4, the rising edge of the pulse from the CR oscillation circuit 1 is detected by the edge detection circuit 2, and the judgment step S4 is performed.
At 5, the presence or absence of edge detection is determined. Then, the loop including the processing step S4 and the determination step S5 is repeated in a very short cycle until a rising edge is detected, and as soon as a rising edge is detected, the logic proceeds to the next determination step S6.

【0032】判断ステップS6では、CR発振回路1か
らのパルスの立ち上がりエッジが検出されるまでに短周
期の外部発振パルスがいくつ計数されたかを示すカウン
ト数が外部発振パルスカウンタ3から読み出され、カウ
ント数設定レジスタ4に登録されているカウント数と大
小の比較判定が行われる。そして、カウント数設定レジ
スタ4の設定値に比べて外部発振パルスカウンタ3の積
算値が小さかった場合には、ロジックは処理ステップS
7に進み、比較調整手段5および抵抗調整回路6の作用
によってCR発振回路1のラダー抵抗11の抵抗値が増
やされ、CR発振回路1の発信周期は遅められる。逆
に、カウント数設定レジスタ4の設定値に比べて外部発
振パルスカウンタ3の積算値が大きかった場合には、ロ
ジックは処理ステップS8に進み、比較調整手段5およ
び抵抗調整回路6の作用によってCR発振回路1のラダ
ー抵抗11の抵抗値が減らされ、CR発振回路1の発信
周期は速められる。どちらの場合でもない場合、すなわ
ちカウント数設定レジスタ4の設定値と外部発振パルス
カウンタ3の積算値とが互いに等しかった場合には、ラ
ダー抵抗11の調整は行われない。
In the determination step S6, the count number indicating how many short-period external oscillation pulses have been counted until the rising edge of the pulse from the CR oscillation circuit 1 is detected is read out from the external oscillation pulse counter 3. The comparison between the count number registered in the count number setting register 4 and the magnitude is performed. If the integrated value of the external oscillation pulse counter 3 is smaller than the set value of the count number setting register 4, the logic proceeds to the processing step S
7, the resistance value of the ladder resistor 11 of the CR oscillation circuit 1 is increased by the operation of the comparison adjustment means 5 and the resistance adjustment circuit 6, and the transmission cycle of the CR oscillation circuit 1 is delayed. Conversely, if the integrated value of the external oscillation pulse counter 3 is larger than the value set in the count number setting register 4, the logic proceeds to the processing step S 8, and the operation of the comparison adjusting means 5 and the resistance adjusting circuit 6 causes the CR to operate. The resistance value of the ladder resistor 11 of the oscillation circuit 1 is reduced, and the transmission cycle of the CR oscillation circuit 1 is accelerated. In either case, that is, when the set value of the count number setting register 4 and the integrated value of the external oscillation pulse counter 3 are equal to each other, the ladder resistor 11 is not adjusted.

【0033】そして、いずれの場合も、ロジックは次の
処理ステップS9に進む。処理ステップS9では、外部
発振パルスカウンタ3で積算されているカウント数がゼ
ロクリヤされ、ロジックは処理ステップS4に戻って、
ステップS4〜S9のループが繰り返される。
Then, in any case, the logic proceeds to the next processing step S9. In processing step S9, the count number accumulated by the external oscillation pulse counter 3 is cleared to zero, and the logic returns to processing step S4,
The loop of steps S4 to S9 is repeated.

【0034】同ループを繰り返すうちに、外部発振パル
スカウンタ3の積算値は、カウント数設定レジスタ4の
設定値にだんだん近づき、ついにはほぼ同じか全く同一
になる。その結果、CR発振回路1の発振周期は、カウ
ント数設定レジスタ4に設定されたカウント数を基準に
外部発振パルスに基づいて調整されるので、精密な発振
周期をもつ外部発振パルスに準ずる精度をもつようにな
る。
As the loop is repeated, the integrated value of the external oscillation pulse counter 3 gradually approaches the set value of the count number setting register 4 and finally becomes almost the same or exactly the same. As a result, the oscillation cycle of the CR oscillation circuit 1 is adjusted based on the external oscillation pulse based on the count number set in the count number setting register 4, so that the accuracy according to the external oscillation pulse having a precise oscillation cycle is improved. I will have it.

【0035】次に、本実施例ではCR発振回路1がこの
ようにして精密に調整されるに至るので、前述の水晶発
振回路と本実施例のマイクロコンピュータがCR発振回
路1を残して節電のためスリープ状態に入っても、スリ
ープ期間は精密に制御される。その結果、精密なスリー
プ期間の設定が要求される使用目的にも、本実施例のC
R発振クロック内蔵マイクロコンピュータは使用できる
ようになる。
Next, in this embodiment, since the CR oscillation circuit 1 is precisely adjusted in this manner, the above-described crystal oscillation circuit and the microcomputer of this embodiment save the CR oscillation circuit 1 to save power. Therefore, even in the sleep state, the sleep period is precisely controlled. As a result, the use purpose for which the setting of the precise sleep period is required is also reduced to C in this embodiment.
The microcomputer with the R oscillation clock can be used.

【0036】以上のように、本実施例のCR発振クロッ
ク内蔵マイクロコンピュータ、すなわちCR発振クロッ
クを内蔵しCR発振クロックからの発振出力に基づいて
時間制御を行うマイクロコンピュータは、かなり精密な
時間精度をもって各種時間制御を行うことができるよう
になる。そして、温度変化によってCR発振回路1のラ
ダー抵抗11およびコンデンサ12の電気特性に影響が
出ても、同影響は即座に修正されるので、温度変化によ
ってCR発振回路1の発振周期が変動することも防止さ
れている。
As described above, the microcomputer with a built-in CR oscillation clock of the present embodiment, that is, the microcomputer with a built-in CR oscillation clock and performing time control based on the oscillation output from the CR oscillation clock, has a very precise time accuracy. Various time controls can be performed. Then, even if the electrical characteristics of the ladder resistor 11 and the capacitor 12 of the CR oscillation circuit 1 are affected by the temperature change, the influence is immediately corrected, so that the oscillation cycle of the CR oscillation circuit 1 fluctuates due to the temperature change. Has also been prevented.

【0037】なお、このようなCR発振クロック(1〜
6)は、前述のようにマイクロコンピュータの集積回路
の一部として形成されている。それゆえ、本実施例のC
R発振クロック内蔵マイクロコンピュータの製造には、
通常のCR発振クロックをもつマイクロコンピュータに
比べて1〜2円程度のごくわずかなコストアップしか生
じない。
Note that such CR oscillation clocks (1 to
6) is formed as a part of the microcomputer integrated circuit as described above. Therefore, C of the present embodiment
To manufacture microcomputers with built-in R oscillation clock,
Compared with a microcomputer having a normal CR oscillation clock, the cost is only slightly increased by about 1 to 2 yen.

【0038】以上詳述したように、本実施例のCR発振
クロック内蔵マイクロコンピュータによれば、ほとんど
コストアップを生じないで、温度変化等の影響を受ける
ことなく内蔵CR発振クロックの計時精度をより精密に
することができるという効果がある。その結果、スリー
プ期間の制御など内蔵CR発振クロックに基づいた時間
制御がかなり精密に保証されるようになる。それゆえ、
本実施例のCR発振クロック内蔵マイクロコンピュータ
は、よほど精密なCR発振クロック時間制御が要求され
る用途にも適合するようになるという効果がある。
As described in detail above, according to the microcomputer with a built-in CR oscillation clock of the present embodiment, the cost accuracy is hardly increased, and the timing accuracy of the built-in CR oscillation clock can be improved without being affected by a temperature change or the like. There is an effect that precision can be achieved. As a result, the time control based on the built-in CR oscillation clock, such as the control of the sleep period, is assured fairly accurately. therefore,
The microcomputer with a built-in CR oscillation clock according to the present embodiment has an effect that it can be adapted to applications that require very precise CR oscillation clock time control.

【0039】(実施例1の変形態様1)本実施例の変形
態様1として、カウント数設定レジスタ4に格納される
べきカウント数を適正に制限するカウント数制限手段
(図略)をさらに有するCR発振クロック内蔵マイクロ
コンピュータの実施が可能である。ここで、カウント数
制限手段は、カウント数設定レジスタ4に格納されるべ
きカウント数に適正な上限値および下限値から定まる適
正範囲を設け、この適正範囲から外れた値にカウント数
設定レジスタのカウント数が指定された場合には、カウ
ント数を適正な既定値に強制的に設定する機能を持つ。
(Modification 1 of Embodiment 1) As Modification 1 of the present embodiment, a CR that further includes count number limiting means (not shown) for appropriately limiting the count number to be stored in the count number setting register 4 is provided. A microcomputer with a built-in oscillation clock can be implemented. Here, the count number limiting means sets an appropriate range defined by an appropriate upper limit value and an appropriate lower limit value for the count number to be stored in the count number setting register 4, and sets the count of the count number setting register to a value outside the appropriate range. When a number is specified, it has a function to force the count to an appropriate default value.

【0040】本変形態様では、何らかの不具合などに起
因して仮にカウント数設定レジスタ4に不適正なカウン
ト数が書き込まれようとした場合にも、カウント数制限
手段の作用により、カウント数設定レジスタ4には許容
できる範囲の規定値が書き込まれる。その結果、CR発
振回路1の制御は適正範囲で行われるようになり、CR
発振回路1が発振不能になったり、CR発振回路1の発
振周期が不安定になったりする不具合は、回避される。
In this modified embodiment, even if an improper count value is to be written into the count value setting register 4 due to some trouble or the like, the operation of the count value setting means 4 causes the count value setting register 4 to operate. Is written with a prescribed value in an allowable range. As a result, the control of the CR oscillation circuit 1 is performed within an appropriate range,
The disadvantage that the oscillation circuit 1 becomes unable to oscillate or the oscillation cycle of the CR oscillation circuit 1 becomes unstable is avoided.

【0041】ここで、カウント数制限手段もまたマイク
ロコンピュータの集積回路の一部として形成されうるの
で、本変形態様は、ほとんどコストアップなしに実施す
ることができる。
Here, since the count number limiting means can also be formed as a part of the integrated circuit of the microcomputer, this modification can be implemented with almost no increase in cost.

【0042】したがって本変形態様によれば、前述の実
施例1の効果に加えて、CR発振回路1の発振周期を変
更可能としても、必ず安定したCR発振回路1の発振作
用が保証されるという効果がある。
Therefore, according to this modification, in addition to the effect of the first embodiment, even if the oscillation cycle of the CR oscillation circuit 1 can be changed, the stable oscillation operation of the CR oscillation circuit 1 is always guaranteed. effective.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 実施例1におけるCR発振クロックの構成を
示すブロック図
FIG. 1 is a block diagram illustrating a configuration of a CR oscillation clock according to a first embodiment.

【図2】 実施例1におけるCR発振クロックの作用を
示すフローチャート
FIG. 2 is a flowchart illustrating an operation of a CR oscillation clock in the first embodiment.

【符号の説明】[Explanation of symbols]

1:CR発振回路 11:ラダー抵抗(可変抵抗器として) 12:コン
デンサ 13:インバータ(否定ゲート) 14:バッファ 2:エッジ検出回路 3:外部発振パルスカウンタ 4:カウント数設定レジスタ 5:比較調整手段
6:抵抗調整回路
1: CR oscillation circuit 11: Ladder resistance (as a variable resistor) 12: Capacitor 13: Inverter (negative gate) 14: Buffer 2: Edge detection circuit 3: External oscillation pulse counter 4: Count number setting register 5: Comparison adjustment means
6: Resistance adjustment circuit

フロントページの続き (72)発明者 松田 啓資 愛知県刈谷市昭和町1丁目1番地 株式会 社デンソー内 (72)発明者 藤井 裕志 愛知県刈谷市昭和町1丁目1番地 株式会 社デンソー内 Fターム(参考) 5J043 AA22 EE01 Continued on the front page (72) Inventor Keisuke Matsuda 1-1-1, Showa-cho, Kariya-shi, Aichi Prefecture Inside Denso Corporation (72) Inventor Hiroshi Fujii 1-1-1, Showa-cho, Kariya-shi, Aichi Prefecture F Inside Denso Corporation Term (reference) 5J043 AA22 EE01

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】CR発振クロックを内蔵し、該CR発振ク
ロックからの発振出力に基づいて時間制御を行うマイク
ロコンピュータであって、 前記CR発振クロックは、 制御信号により抵抗値が可変な可変抵抗器をもつCR発
振回路と、 該CR発振回路からの前記発振出力のエッジを検出する
エッジ検出回路と、 該CR発振回路からの該発振出力よりも周期が精密な外
部発振パルスを受信して該外部発振パルスを計数する外
部発振パルスカウンタと、 該CR発振回路からの該発振出力の一周期に相当すべき
該外部発振パルスの適正なカウント数が格納されるカウ
ント数設定レジスタと、 該エッジ検出回路からエッジ検出信号を受け取ると、該
外部発振パルスカウンタによる該外部発振パルスのカウ
ント数と該カウント数設定レジスタに格納された該カウ
ント数とを比較し、両該カウント数の差に基づいて該C
R発振回路の発振周期を調整するための調整信号を生成
する比較調整手段と、 該調整信号に基づいて該制御信号を生成し、もって該可
変抵抗器の該抵抗値を調整する抵抗調整回路とを有する
ことを特徴とする、 CR発振クロック内蔵マイクロコンピュータ。
1. A microcomputer having a built-in CR oscillation clock and performing time control based on an oscillation output from the CR oscillation clock, wherein the CR oscillation clock is a variable resistor having a variable resistance value according to a control signal. A CR oscillation circuit having an edge detection circuit for detecting an edge of the oscillation output from the CR oscillation circuit; receiving an external oscillation pulse whose cycle is more precise than the oscillation output from the CR oscillation circuit; An external oscillation pulse counter for counting an oscillation pulse; a count number setting register for storing an appropriate count number of the external oscillation pulse corresponding to one cycle of the oscillation output from the CR oscillation circuit; When the edge detection signal is received from the external oscillation pulse counter, the external oscillation pulse count is stored in the count number setting register and the count number of the external oscillation pulse. It was compared with the count number, the C on the basis of the difference between the said count
Comparison adjustment means for generating an adjustment signal for adjusting the oscillation cycle of the R oscillation circuit; a resistance adjustment circuit for generating the control signal based on the adjustment signal and thereby adjusting the resistance value of the variable resistor; A microcomputer with a built-in CR oscillation clock.
【請求項2】前記カウント数設定レジスタに格納される
べき前記カウント数に適正な上限値および下限値から定
まる適正範囲を設け、該適正範囲から外れた値に該カウ
ント数が指定された場合には、該カウント数を適正な既
定値に強制的に設定するカウント数制限手段をさらに有
する、 請求項1記載のCR発振クロック内蔵マイクロコンピュ
ータ。
2. An apparatus according to claim 1, wherein said count number to be stored in said count number setting register is provided with an appropriate range defined by an appropriate upper limit value and an appropriate lower limit value. 2. The microcomputer with a built-in CR oscillation clock according to claim 1, further comprising a count number limiter for forcibly setting the count number to an appropriate predetermined value.
JP33759799A 1999-08-05 1999-11-29 Microcomputer with built-in CR oscillation clock Expired - Lifetime JP3584821B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33759799A JP3584821B2 (en) 1999-08-05 1999-11-29 Microcomputer with built-in CR oscillation clock

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP11-222001 1999-08-05
JP22200199 1999-08-05
JP33759799A JP3584821B2 (en) 1999-08-05 1999-11-29 Microcomputer with built-in CR oscillation clock

Publications (2)

Publication Number Publication Date
JP2001111389A true JP2001111389A (en) 2001-04-20
JP3584821B2 JP3584821B2 (en) 2004-11-04

Family

ID=26524622

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33759799A Expired - Lifetime JP3584821B2 (en) 1999-08-05 1999-11-29 Microcomputer with built-in CR oscillation clock

Country Status (1)

Country Link
JP (1) JP3584821B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007094931A (en) * 2005-09-30 2007-04-12 Nec Electronics Corp Correction clock generation circuit and usb device equipped with the same
US7216250B2 (en) 2002-12-27 2007-05-08 Denso Corporation Clock control circuit for correcting frequency of second clock signal based on first clock signal and monitoring oscillation state of first clock signal based on second clock signal
JP2010081337A (en) * 2008-09-26 2010-04-08 Denso Corp Cr oscillation clock-incorporated microcomputer
JP2013179469A (en) * 2012-02-28 2013-09-09 Lapis Semiconductor Co Ltd Oscillation frequency adjustment circuit, semiconductor device, electronic apparatus, and oscillation frequency adjustment method
CN107256065A (en) * 2017-07-14 2017-10-17 佛山华芯微特科技有限公司 The processing system and method for a kind of real-time clock

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7216250B2 (en) 2002-12-27 2007-05-08 Denso Corporation Clock control circuit for correcting frequency of second clock signal based on first clock signal and monitoring oscillation state of first clock signal based on second clock signal
JP2007094931A (en) * 2005-09-30 2007-04-12 Nec Electronics Corp Correction clock generation circuit and usb device equipped with the same
JP2010081337A (en) * 2008-09-26 2010-04-08 Denso Corp Cr oscillation clock-incorporated microcomputer
JP2013179469A (en) * 2012-02-28 2013-09-09 Lapis Semiconductor Co Ltd Oscillation frequency adjustment circuit, semiconductor device, electronic apparatus, and oscillation frequency adjustment method
CN107256065A (en) * 2017-07-14 2017-10-17 佛山华芯微特科技有限公司 The processing system and method for a kind of real-time clock
CN107256065B (en) * 2017-07-14 2023-12-22 广东华芯微特集成电路有限公司 Real-time clock processing system and method

Also Published As

Publication number Publication date
JP3584821B2 (en) 2004-11-04

Similar Documents

Publication Publication Date Title
KR101651263B1 (en) Automatic synchronization of an internal oscillator to an external frequency reference
EP2369438B1 (en) Calibration method of a real time clock signal
US6084441A (en) Apparatus for and method of processing data
CN110262210B (en) Crystal oscillator time keeping method based on counter
US4159622A (en) Electronic timepiece having a main oscillator circuitry and secondary oscillator circuitry
JP2001111389A (en) Microcomputer incorporating cr oscillation clock
JPH0575445A (en) Device and method for correcting fluctuation of oscillation frequency of cpu
JP2011197910A (en) Clock control circuit and microcomputer
JPH0631731B2 (en) Clock device with temperature compensation function
JP6585977B2 (en) Semiconductor device and oscillation circuit control method
CN114050790A (en) High-precision automatic calibration method and device for RC oscillator
JPH04165716A (en) Frequency control circuit
JP2006229607A (en) Semiconductor device and method of correcting oscillation frequency
EP2333954B1 (en) Clock recovery in a battery powered device
US20240146242A1 (en) Method and apparatus for oscillator frequency calibration
JP2002311173A (en) Electronic clock, method and program for correcting time error of the same
JPH104347A (en) Oscillation circuit
JP2003270369A (en) Time correction method and time correction device for real time clock
JP3092199B2 (en) Timer
JPS59225323A (en) Electronic thermometer
JPH1125831A (en) Timer with temperature-compasating function and temperature regulator
JPS6010457B2 (en) Microprocessor controlled PLL
JP3020533B2 (en) Crystal oscillator frequency adjustment device
JPH08179849A (en) Clock output circuit
JPH0438039A (en) Signal interruption detection circuit

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040301

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040713

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040726

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 3584821

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100813

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110813

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120813

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130813

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term