JP2010081337A - Cr oscillation clock-incorporated microcomputer - Google Patents

Cr oscillation clock-incorporated microcomputer Download PDF

Info

Publication number
JP2010081337A
JP2010081337A JP2008248019A JP2008248019A JP2010081337A JP 2010081337 A JP2010081337 A JP 2010081337A JP 2008248019 A JP2008248019 A JP 2008248019A JP 2008248019 A JP2008248019 A JP 2008248019A JP 2010081337 A JP2010081337 A JP 2010081337A
Authority
JP
Japan
Prior art keywords
oscillation
circuit
count number
output
determination
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
Application number
JP2008248019A
Other languages
Japanese (ja)
Inventor
Katsuaki Nishie
桂亮 西江
Masaya Hirota
雅也 廣田
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 JP2008248019A priority Critical patent/JP2010081337A/en
Publication of JP2010081337A publication Critical patent/JP2010081337A/en
Pending legal-status Critical Current

Links

Landscapes

  • Inductance-Capacitance Distribution Constants And Capacitance-Resistance Oscillators (AREA)
  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a CR oscillation clock-incorporated microcomputer capable of determining whether or not period adjustment of a CR oscillation clock has been completed. <P>SOLUTION: A determination circuit determines whether or not a value indicated by an external oscillation pulse counter is settled between a value indicated by a lower limit count number setting register and a value indicated by an upper limit count number setting register (S170). If it is determined that the value is settled therebetween (S170:Yes), the determination circuit performs counting-up by adding "1" to a value stored in a correction completion counter (S180). An output circuit judges thereafter whether or not a count number of the correction completion counter is equal to or more than a value stored in a correction completed count number setting register (S190). If it is judged that the value is equal to or more than the stored value (S190:Yes), the output circuit inputs to a correction completion register "1" (information indicating the period adjustment has been completed) (S200). Then, these steps are repeated. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

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

精密な外部発振パルスに基づいて発振周期を自動調整するCR発振クロックを内蔵するマイクロコンピュータが既に知られている(特許文献1)。
特開2001−111389号公報
A microcomputer incorporating a CR oscillation clock that automatically adjusts the oscillation period based on a precise external oscillation pulse is already known (Patent Document 1).
JP 2001-111389 A

先述した技術の課題は、周期調整が完了したかを判定できないことである。以下、詳述する。マイクロコンピュータの停止中は、外部発振パルスも停止することがある。この場合はCR発振クロックの自動調整ができない。そうすると、マイクロコンピュータの起動直後は発振周期が大きくずれていることがあるので、周期調整が完了してからCR発振クロックを時間制御に用いる必要がある。   The problem with the technology described above is that it cannot be determined whether the cycle adjustment has been completed. Details will be described below. While the microcomputer is stopped, the external oscillation pulse may also stop. In this case, the CR oscillation clock cannot be automatically adjusted. In this case, the oscillation cycle may be greatly shifted immediately after the microcomputer is started up. Therefore, it is necessary to use the CR oscillation clock for time control after the cycle adjustment is completed.

しかし先述した技術では、周期調整が完了しているのかが判定できなかったので、例えば、起動からの一定時間を確保し、周期調整が十分にできていると推測される状態になるまで待つ、という方法を採っていた。従って、必要以上に待つことになる場合も往々にしてあった。   However, in the technique described above, it was not possible to determine whether the cycle adjustment was completed.For example, a certain time from the start is ensured, and the process waits until it is assumed that the cycle adjustment is sufficiently performed. The method was taken. Therefore, there was often a case of waiting longer than necessary.

なお、本明細書等で「周期調整が完了」という意味は、周期調整が十分に達成された状態(ある範囲に収まる等の予め定められた条件を満たした状態)であることを指す。つまり「周期調整を終える」という意味ではなく、「周期調整が完了」後に、理想値に近付けるために更に周期調整を続けても構わない。   In this specification and the like, the meaning of “period adjustment is complete” means that the period adjustment is sufficiently achieved (a condition that satisfies a predetermined condition such as being within a certain range). That is, it does not mean “end the cycle adjustment”, and after the “cycle adjustment is completed”, the cycle adjustment may be further continued to approach the ideal value.

本発明は先述した課題に鑑み、CR発振クロックの周期調整が完了したかを判定できるCR発振クロック内蔵マイクロコンピュータの提供を目的とする。   In view of the above-described problems, an object of the present invention is to provide a microcomputer with a built-in CR oscillation clock that can determine whether the cycle adjustment of the CR oscillation clock has been completed.

先述した課題を解決するために発明された請求項1のCR発振クロック内蔵マイクロコンピュータは、CR発振クロックを内蔵し、CR発振クロックからの発振出力に基づいて時間制御を行うCR発振クロック内蔵マイクロコンピュータである。   The microcomputer with built-in CR oscillation clock according to claim 1 invented in order to solve the above-mentioned problem, has a built-in CR oscillation clock and performs time control based on an oscillation output from the CR oscillation clock. It is.

そして、CR発振クロックは、CR発振回路と、エッジ検出回路と、外部発振パルスカウンタと、判定手段とを備える。
CR発振回路は、発振出力の周期調整が可能になっている。エッジ検出回路は、CR発振回路からの発振出力のエッジを検出すると、エッジ検出信号を出力する。外部発振パルスカウンタは、CR発振回路からの発振出力よりも周期が精密な外部発振パルスを受信して、当該外部発振パルスを計数する。判定手段は、エッジ検出信号が出力される間隔と外部発振パルスカウンタの計数とに基づいて、発振出力の周期調整が完了したかを判定する。
The CR oscillation clock includes a CR oscillation circuit, an edge detection circuit, an external oscillation pulse counter, and a determination unit.
The CR oscillation circuit can adjust the period of the oscillation output. The edge detection circuit outputs an edge detection signal when detecting an edge of the oscillation output from the CR oscillation circuit. The external oscillation pulse counter receives an external oscillation pulse whose cycle is more precise than the oscillation output from the CR oscillation circuit, and counts the external oscillation pulse. The determination means determines whether the cycle adjustment of the oscillation output is completed based on the interval at which the edge detection signal is output and the count of the external oscillation pulse counter.

請求項1のCR発振クロック内蔵マイクロコンピュータによれば、CR発振クロックの周期調整が完了したかを判定できる。
請求項2のCR発振クロック内蔵マイクロコンピュータは、情報を記憶する完了記憶手段を備える。そして、判定手段は、CR発振クロックの周期調整が完了したかについての判定結果を完了記憶手段に記憶させる。
According to the CR oscillation clock built-in microcomputer of the first aspect, it can be determined whether or not the cycle adjustment of the CR oscillation clock is completed.
According to a second aspect of the present invention, there is provided a microcomputer with a built-in CR oscillation clock comprising completion storage means for storing information. Then, the determination unit stores the determination result as to whether the period adjustment of the CR oscillation clock is completed in the completion storage unit.

請求項2のCR発振クロック内蔵マイクロコンピュータによれば、周期調整が完了したかを示す情報を、マイコンに備えられたCPUが記憶手段から好きな時に取得すれば良いので、マイクロコンピュータの動作を簡潔にできる。   According to the microcomputer with a built-in CR oscillation clock according to claim 2, information indicating whether or not the cycle adjustment has been completed can be obtained from the memory means at any time by the CPU provided in the microcomputer, so that the operation of the microcomputer is simplified. Can be.

請求項3のCR発振クロック内蔵マイクロコンピュータの判定手段は、判定回路と、成功記憶手段と、出力回路とを備える。
判定回路は、エッジ検出信号を受け取るたびに、一つ前のエッジ検出信号を受け取ってから今回のエッジ検出信号を受け取るまでの間において外部発振パルスカウンタによって計数されたパルス数が所定範囲に収まっている適正状態なのかを判定する。
According to a third aspect of the present invention, the determination means of the microcomputer with built-in CR oscillation clock includes a determination circuit, a success storage means, and an output circuit.
Every time an edge detection signal is received, the determination circuit keeps the number of pulses counted by the external oscillation pulse counter within a predetermined range from the reception of the previous edge detection signal to the reception of the current edge detection signal. It is determined whether it is in an appropriate state.

成功記憶手段は、適正状態であると判定回路によって判定された回数を成功回数として記憶する。出力回路は、成功記憶手段に記憶された成功回数が所定回数以上になると、発振出力の周期調整が完了したことを完了記憶手段に記憶させる。   The success storage means stores the number of times determined by the determination circuit as being in an appropriate state as the number of successes. When the number of successes stored in the success storage unit exceeds a predetermined number, the output circuit causes the completion storage unit to store the completion of the oscillation output cycle adjustment.

また、判定回路は、適正状態でないと判定すると、発振出力の周期調整が完了していないことを完了記憶手段に記憶させる。
請求項3のCR発振クロック内蔵マイクロコンピュータによれば、判定手段の動作が分担されるので、個々の回路等を簡潔に構成できる。
If the determination circuit determines that the state is not appropriate, the determination storage unit stores that the period adjustment of the oscillation output is not completed.
According to the microcomputer with a built-in CR oscillation clock according to the third aspect, since the operation of the judging means is shared, individual circuits and the like can be configured simply.

また、周期調整が実質的には完了していない不安定な状態において、偶発的に調整が完了したと判定されることを防ぐことができる。なぜなら、一回だけでなく所定回数、適正状態であると判定されて初めて、調整が完了したということを完了記憶手段に記憶させるからである。   In addition, it is possible to prevent an accidental determination that the adjustment has been completed in an unstable state in which the cycle adjustment is not substantially completed. This is because the completion storage means stores the fact that the adjustment is completed only after it is determined that the state is appropriate not only once but a predetermined number of times.

請求項4のCR発振クロック内蔵マイクロコンピュータが備える判定回路は、適正状態でないと判定すると、成功記憶手段に記憶された成功回数を減らす。
請求項4のCR発振クロック内蔵マイクロコンピュータによれば、周期調整完了の判定基準を調整できる。つまり、適正状態になったり、ならなかったりする場合等に、周期調整完了という判定への至り易さを調整できる。なお、「減らす」には一律に0にすることも含まれる。また、成功回数が零の場合には、成功回数が減らされることはない。
If the determination circuit provided in the microcomputer with built-in CR oscillation clock according to the fourth aspect determines that the state is not appropriate, the number of successes stored in the success storage means is reduced.
According to the microcomputer with a built-in CR oscillation clock according to the fourth aspect of the present invention, it is possible to adjust the criterion for completion of the cycle adjustment. That is, it is possible to adjust the ease of reaching the determination that the cycle adjustment is completed when the state is appropriate or not. Note that “reducing” includes uniformly setting to zero. When the number of successes is zero, the number of successes is not reduced.

[構成]
図1は、CR発振クロック1の概略構成を示すブロック図である。CR発振クロック1は、マイクロコンピュータ(以下「マイコン」と言う)に内蔵される。つまり、CR発振クロック1は、CR発振クロック内蔵マイコンの集積回路の一部に集積されて一体に形成されている。そして、CR発振クロック1は、以下に説明する構成によって、このマイコンにクロック機能を提供する。また、CR発振クロック1を内蔵したマイコン及び後述する水晶振動子は、節電のためのスリープ機能を持つ。
[Constitution]
FIG. 1 is a block diagram showing a schematic configuration of the CR oscillation clock 1. The CR oscillation clock 1 is built in a microcomputer (hereinafter referred to as “microcomputer”). That is, the CR oscillation clock 1 is integrated and formed integrally with a part of an integrated circuit of the CR oscillation clock built-in microcomputer. The CR oscillation clock 1 provides a clock function to the microcomputer with the configuration described below. Further, the microcomputer incorporating the CR oscillation clock 1 and a crystal resonator described later have a sleep function for power saving.

CR発振クロック1は、CR発振回路10、エッジ検出回路20、外部発振パルスカウンタ30、カウント数設定レジスタ40、判定回路50、抵抗値調整回路60、カウント数上限設定レジスタ70、カウント数下限設定レジスタ75、補正完了カウンタ80、出力回路85、補正完了カウント数設定レジスタ90、及び補正完了レジスタ95を備える。   The CR oscillation clock 1 includes a CR oscillation circuit 10, an edge detection circuit 20, an external oscillation pulse counter 30, a count number setting register 40, a determination circuit 50, a resistance value adjustment circuit 60, a count number upper limit setting register 70, and a count number lower limit setting register. 75, a correction completion counter 80, an output circuit 85, a correction completion count number setting register 90, and a correction completion register 95.

CR発振回路10は、ラダー抵抗を持ち、CRを用いた発振回路である。このラダー抵抗は、抵抗値調整回路60からの後述する制御信号により抵抗値が調整される可変抵抗器である。なお、ラダー抵抗の抵抗値が小さくなると発振出力の周期は短くなり、抵抗値が大きくなると発振出力の周期は長くなる。このようにして、CR発振回路10は、発振出力の周期調整が可能になっている。   The CR oscillation circuit 10 has a ladder resistor and is an oscillation circuit using CR. The ladder resistor is a variable resistor whose resistance value is adjusted by a control signal described later from the resistance value adjusting circuit 60. Note that when the resistance value of the ladder resistor is reduced, the cycle of the oscillation output is shortened, and when the resistance value is increased, the cycle of the oscillation output is lengthened. In this way, the CR oscillation circuit 10 can adjust the period of the oscillation output.

エッジ検出回路20は、CR発振回路10からの発振出力のエッジを検出して検出信号を出力する検出回路である。
外部発振パルスカウンタ30は、水晶振動子から外部発振パルスを受信して、その外部発振パルスを計数するデジタルカウンタである。なお、水晶振動子は、CR発振回路10の発振よりも周期が短く、精密である(狂いにくい)。なお、後述する構成によって、CR発振回路10からの発振出力のエッジが検出される度に、カウント数が零に戻されるようになっている。つまり、カウント数は、零に戻される直前において、CR発振回路10の発振出力の一周期に計数されたものになる。
The edge detection circuit 20 is a detection circuit that detects an edge of the oscillation output from the CR oscillation circuit 10 and outputs a detection signal.
The external oscillation pulse counter 30 is a digital counter that receives an external oscillation pulse from a crystal resonator and counts the external oscillation pulse. Note that the crystal resonator has a shorter period and is more precise (not likely to go wrong) than the oscillation of the CR oscillation circuit 10. Note that the count number is reset to zero each time an edge of the oscillation output from the CR oscillation circuit 10 is detected by the configuration described later. That is, the count number is counted in one cycle of the oscillation output of the CR oscillation circuit 10 immediately before returning to zero.

カウント数設定レジスタ40は、CR発振回路10の発振出力の一周期に相当すべき外部発振パルスの適正なカウント数が格納されるレジスタである。
カウント数上限設定レジスタ70及びカウント数下限設定レジスタ75は、許容できる外部発振パルスのカウント数の上下限値が格納されるレジスタである。「許容できる」とは、カウント数設定レジスタ40に格納された値とは誤差があるものの、時間制御に使用できる状態に対応する、という意味である。また「エッジ検出直後において、両レジスタに格納された値の間に外部発振パルスのカウント数が収まっている」状態を「適正状態」と呼ぶことにする。適正状態にあることが、周期調整完了の必要条件である。
The count number setting register 40 is a register that stores an appropriate count number of external oscillation pulses that should correspond to one cycle of the oscillation output of the CR oscillation circuit 10.
The count number upper limit setting register 70 and the count number lower limit setting register 75 are registers for storing the upper and lower limit values of the allowable number of external oscillation pulses. “Acceptable” means that the value stored in the count number setting register 40 corresponds to a state that can be used for time control although there is an error. Also, a state where “the number of counts of external oscillation pulses is within the values stored in both registers immediately after edge detection” will be referred to as a “proper state”. An appropriate condition is a necessary condition for completing the cycle adjustment.

判定回路50は、エッジ検出回路20からエッジ検出信号を受け取ると、CR発振回路10の発振周期を調整するための調整信号を生成する。調整信号は、外部発振パルスカウンタ30によるカウント数とカウント数設定レジスタ40に格納されたカウント数との差に基づいて生成される。   When receiving the edge detection signal from the edge detection circuit 20, the determination circuit 50 generates an adjustment signal for adjusting the oscillation cycle of the CR oscillation circuit 10. The adjustment signal is generated based on the difference between the count number by the external oscillation pulse counter 30 and the count number stored in the count number setting register 40.

抵抗値調整回路60は、判定回路50からの調整信号に基づいて制御信号を生成する。この制御信号によってCR発振回路10のラダー抵抗の抵抗値が調整され、ひいては発振出力の周期が調整される。   The resistance value adjustment circuit 60 generates a control signal based on the adjustment signal from the determination circuit 50. The resistance value of the ladder resistor of the CR oscillation circuit 10 is adjusted by this control signal, and consequently the cycle of the oscillation output is adjusted.

また、判定回路50は、エッジ検出回路20からエッジ検出信号を受け取ると、適正状態なのかを判定すると共に、その判定結果に基づいて、補正完了カウンタ80及び補正完了レジスタ95に格納される値を操作する。   When the determination circuit 50 receives the edge detection signal from the edge detection circuit 20, the determination circuit 50 determines whether or not the state is appropriate, and the values stored in the correction completion counter 80 and the correction completion register 95 are determined based on the determination result. Manipulate.

補正完了カウンタ80は、適正状態であると判定された回数をカウントするデジタルカウンタである。ただし、判定回路50は、適正状態にないと判定すると、補正完了カウンタ80のカウント数を零にする。   The correction completion counter 80 is a digital counter that counts the number of times determined to be in an appropriate state. However, if the determination circuit 50 determines that it is not in the proper state, it sets the count number of the correction completion counter 80 to zero.

補正完了カウント数設定レジスタ90は、周期調整完了の十分条件として、適正状態と判定されるべき回数が格納されるレジスタである。つまり、補正完了カウンタ80がカウントした回数が、補正完了カウント数設定レジスタ90に格納された回数以上になると、周期調整が完了したということになる。   The correction completion count number setting register 90 is a register that stores the number of times to be determined as an appropriate state as a sufficient condition for completing the cycle adjustment. That is, when the number of times counted by the correction completion counter 80 is equal to or greater than the number stored in the correction completion count number setting register 90, the cycle adjustment is completed.

出力回路85は、補正完了カウンタ80に格納されたカウント数が変化する度に動作するようになっている。その動作とは、外部発振パルスカウンタ30に格納されたカウント数を零にすることである。さらに別の動作として、補正完了カウンタ80のカウント数が補正完了カウント数設定レジスタ90に格納された値以上のときには、補正完了レジスタ95に「1」を格納する。   The output circuit 85 operates every time the count number stored in the correction completion counter 80 changes. The operation is to set the count number stored in the external oscillation pulse counter 30 to zero. As another operation, when the count number of the correction completion counter 80 is equal to or greater than the value stored in the correction completion count number setting register 90, “1” is stored in the correction completion register 95.

一方、判定回路50は、適正状態にないと判定すると、補正完了レジスタ95に「0」を格納する。
補正完了レジスタ95に「1」が格納されていれば周期調整は完了、「0」が格納されていれば周期調整は完了でないと、マイコンに備えられたCPUは判断するようになっている。
[作用]
図2は、上記構成による作用をフローチャートに表したものである。以下このフローチャートに沿って説明する。
On the other hand, if the determination circuit 50 determines that it is not in the proper state, it stores “0” in the correction completion register 95.
If “1” is stored in the correction completion register 95, the cycle adjustment is completed, and if “0” is stored, the CPU provided in the microcomputer determines that the cycle adjustment is not completed.
[Action]
FIG. 2 is a flowchart showing the operation of the above configuration. The following description will be made along this flowchart.

CR発振クロック内蔵マイコンが起動されると、まず、マイコンが備えるCPUが、外部発振パルスカウンタ30、補正完了カウンタ80、及び補正完了レジスタ95に格納される値を零にする(S110)。なお、CPUが各レジスタに格納される値を変更する場合、アドレスバス98とデータバス99を介して実行する。具体的には、CPUは、アドレスバス98によって各レジスタにアクセスすると共に、アクセスしたレジスタにデータバス99を通じて値を入力する。   When the CR oscillation clock built-in microcomputer is activated, first, the CPU included in the microcomputer sets the values stored in the external oscillation pulse counter 30, the correction completion counter 80, and the correction completion register 95 to zero (S110). When the CPU changes the value stored in each register, it is executed via the address bus 98 and the data bus 99. Specifically, the CPU accesses each register through the address bus 98 and inputs a value to the accessed register through the data bus 99.

次に、マイコンが備えるCPUが、カウント数設定レジスタ40、カウント数上限設定レジスタ70、カウント数下限設定レジスタ75、及び補正完了カウント数設定レジスタ90に、それぞれ初期設定値を代入する(S120)。   Next, the CPU provided in the microcomputer substitutes initial setting values in the count number setting register 40, the count number upper limit setting register 70, the count number lower limit setting register 75, and the correction completion count number setting register 90, respectively (S120).

そして、判定回路50は、エッジ検出回路20から検出信号を受信したかを判定する(S130)。エッジ検出回路20から検出信号を受信していないと判定すると(S130でNo)、判定回路50は再びS130の判定をする。従って「エッジ検出回路20から検出信号を受信した」と判定するまで待機するような状態になる。   Then, the determination circuit 50 determines whether a detection signal is received from the edge detection circuit 20 (S130). If it is determined that the detection signal is not received from the edge detection circuit 20 (No in S130), the determination circuit 50 determines S130 again. Therefore, the process waits until it is determined that “a detection signal has been received from the edge detection circuit 20”.

エッジ検出回路20から検出信号を受信したと判定すると(S130でYes)、外部発振パルスカウンタ30が示すカウント数と、カウント数設定レジスタ40に格納された値とのどちらが大きいかを判定する(S140)。   If it is determined that the detection signal has been received from the edge detection circuit 20 (Yes in S130), it is determined which of the count number indicated by the external oscillation pulse counter 30 and the value stored in the count number setting register 40 is larger (S140). ).

カウント数設定レジスタ40に格納された値の方が大きいと判定回路50が判定すると(S140でカウント数設定レジスタ)、判定回路50は、両値の差に基づいて生成した調整信号を抵抗値調整回路60に送る。そして、調整信号を受けた抵抗値調整回路60は、その調整信号に基づいて制御信号をCR発振回路10に送る。そうすると、ラダー抵抗の抵抗値が大きくなる(S150)。その結果、発振周期は長くなる。   When the determination circuit 50 determines that the value stored in the count number setting register 40 is larger (the count number setting register in S140), the determination circuit 50 adjusts the resistance value adjustment signal generated based on the difference between the two values. Send to circuit 60. Then, the resistance value adjustment circuit 60 that has received the adjustment signal sends a control signal to the CR oscillation circuit 10 based on the adjustment signal. Then, the resistance value of the ladder resistor is increased (S150). As a result, the oscillation period becomes longer.

一方、外部発振パルスカウンタ30が示すカウント数の方が大きいと判定回路50が判定すると(S140で外部発振パルスカウンタ)、判定回路50は、両値の差に基づいて生成した調整信号を抵抗値調整回路60に送る。そして、調整信号を受けた抵抗値調整回路60が、その調整信号に基づいて制御信号をCR発振回路10に送る。そうすると、ラダー抵抗の抵抗値が小さくなる(S160)。その結果、発振周期は短くなる。   On the other hand, when the determination circuit 50 determines that the count number indicated by the external oscillation pulse counter 30 is larger (the external oscillation pulse counter in S140), the determination circuit 50 uses the resistance value to generate the adjustment signal generated based on the difference between the two values. This is sent to the adjustment circuit 60. Then, the resistance value adjustment circuit 60 that has received the adjustment signal sends a control signal to the CR oscillation circuit 10 based on the adjustment signal. Then, the resistance value of the ladder resistor is reduced (S160). As a result, the oscillation cycle is shortened.

また、両者が等しいと判定回路50が判定すると(S140で等しい)、判定回路50は、調整信号を生成しない。
さらに、判定回路50は、カウント数下限設定レジスタ75が示す値とカウント数上限設定レジスタ70が示す値との間に、外部発振パルスカウンタ30が示す値が収まっているかを判定する(S170)。
If the determination circuit 50 determines that both are equal (equal to S140), the determination circuit 50 does not generate an adjustment signal.
Further, the determination circuit 50 determines whether the value indicated by the external oscillation pulse counter 30 falls between the value indicated by the count number lower limit setting register 75 and the value indicated by the count number upper limit setting register 70 (S170).

カウント数下限設定レジスタ75が示す値とカウント数上限設定レジスタ70が示す値との間に、外部発振パルスカウンタ30が示す値が収まっている(適正状態)と判定すると(S170でYes)、判定回路50は、補正完了カウンタ80に格納されている値に1を足してカウントアップする(S180)。   If it is determined that the value indicated by the external oscillation pulse counter 30 falls between the value indicated by the count number lower limit setting register 75 and the value indicated by the count number upper limit setting register 70 (appropriate state) (Yes in S170), the determination The circuit 50 counts up by adding 1 to the value stored in the correction completion counter 80 (S180).

次に、出力回路85が、補正完了カウンタ80のカウント数が補正完了カウント数設定レジスタ90に格納された値以上であるかを判断する(S190)。補正完了カウンタ80のカウント数が、補正完了カウント数設定レジスタ90に格納された値以上である(周期調整完了)と判断すると(S190でYes)、出力回路85は、補正完了レジスタ95に「1」を格納し(S200)、S210に進む。   Next, the output circuit 85 determines whether or not the count number of the correction completion counter 80 is equal to or greater than the value stored in the correction completion count number setting register 90 (S190). When it is determined that the count number of the correction completion counter 80 is equal to or greater than the value stored in the correction completion count number setting register 90 (period adjustment completion) (Yes in S190), the output circuit 85 sets “1” in the correction completion register 95. Is stored (S200), and the process proceeds to S210.

一方、補正完了カウンタ80のカウント数が、補正完了カウント数設定レジスタ90に格納された値未満であると判断すると(S190でNo)、出力回路85は、補正完了レジスタ95に何も入力せずにS210に進む。   On the other hand, when it is determined that the count number of the correction completion counter 80 is less than the value stored in the correction completion count number setting register 90 (No in S190), the output circuit 85 inputs nothing to the correction completion register 95. The process proceeds to S210.

そして、出力回路85は、外部発振パルスカウンタ30のカウント数を零にする(S210)。その後、S130に戻る。
一方、カウント数下限設定レジスタ75が示す値とカウント数上限設定レジスタ70が示す値との間に、外部発振パルスカウンタ30が示す値が収まっていない(適正状態でない)と判定すると(S170でNo)、判定回路50は、補正完了カウンタ80のカウント数を零にする(S220)。さらに、判定回路50は、補正完了レジスタ95に「0」を格納する(S230)。その後S210に進む。
[効果]
CR発振クロック1によれば、マイコンが備えるCPUは、補正完了レジスタ95に記憶されている値が0なのか1なのかを調べさえすれば、CR発振の周期調整が完了したかが分かる。
Then, the output circuit 85 sets the count number of the external oscillation pulse counter 30 to zero (S210). Thereafter, the process returns to S130.
On the other hand, if it is determined that the value indicated by the external oscillation pulse counter 30 does not fall between the value indicated by the count number lower limit setting register 75 and the value indicated by the count number upper limit setting register 70 (not in an appropriate state) (No in S170). The determination circuit 50 sets the count number of the correction completion counter 80 to zero (S220). Further, the determination circuit 50 stores “0” in the correction completion register 95 (S230). Thereafter, the process proceeds to S210.
[effect]
According to the CR oscillation clock 1, the CPU provided in the microcomputer knows whether the CR oscillation cycle adjustment has been completed by simply checking whether the value stored in the correction completion register 95 is 0 or 1.

従って、周期調整が完了になり次第、時間制御が直ぐに実行できることになる。さらに、起動から一定時間、待機するという処理を実行しなくても済むようになる。また、副次的な効果として、暗電流の低減も期待できる。
[その他]
特許請求の範囲との対応関係を述べる。ただし、名称が同じものは省く。完了記憶手段は補正完了レジスタ95、成功記憶手段は補正完了カウンタ80に相当する。
Therefore, as soon as the cycle adjustment is completed, the time control can be executed immediately. Furthermore, it is not necessary to execute a process of waiting for a certain time from the start. In addition, as a secondary effect, a reduction in dark current can be expected.
[Others]
The correspondence with the claims will be described. However, items with the same name are omitted. The completion storage means corresponds to the correction completion register 95, and the success storage means corresponds to the correction completion counter 80.

また、S220において、判定回路50が補正完了カウンタ80に零を格納する替わりに、所定数(例えば1)を減らすようにしてもよい。
また、適正状態と周期調整完了状態とを一致させるという設計思想であれば、適正状態にあると判定回路50が判定したときに、判定回路50が補正完了レジスタ95に1を入力すれば良い。そうすれば、補正完了カウンタ80、出力回路85、及び補正完了カウント数設定レジスタ90が不要になる。
In S220, instead of the determination circuit 50 storing zero in the correction completion counter 80, a predetermined number (for example, 1) may be reduced.
Further, if the design philosophy is to match the appropriate state with the cycle adjustment completion state, the determination circuit 50 may input 1 to the correction completion register 95 when the determination circuit 50 determines that it is in the appropriate state. Then, the correction completion counter 80, the output circuit 85, and the correction completion count number setting register 90 are not necessary.

なお、補正完了カウンタ80、出力回路85、及び補正完了カウント数設定レジスタ90を備えていても、補正完了カウント数設定レジスタ90に1が格納されていれば、適正状態と周期調整完了状態とが一致することになる。   Even if the correction completion counter 80, the output circuit 85, and the correction completion count number setting register 90 are provided, if 1 is stored in the correction completion count number setting register 90, an appropriate state and a cycle adjustment completion state are obtained. Will match.

また、補正完了レジスタ95を省いて、CPUに直接、周期調整が完了したかを示す情報を入力してもよい。
また、S210(外部発振パルスカウンタ30のゼロクリア)は、判定回路50が主体となってもよい。
Alternatively, the correction completion register 95 may be omitted, and information indicating whether the cycle adjustment has been completed may be input directly to the CPU.
In S210 (zero clear of the external oscillation pulse counter 30), the determination circuit 50 may be the main component.

また、出願時の任意の請求項に、CR発振の周期調整のための構成を追加してもよい。そのためには、以下の各発明特定事項を追加することになる。それは「前記CR発振回路からの前記発振出力の一周期に相当すべき前記外部発振パルスの適正なカウント数が格納されるカウント数設定レジスタと、前記エッジ検出回路からエッジ検出信号を受け取ると、前記カウント数設定レジスタに格納された前記カウント数と一つ前の前記エッジ検出信号を受け取ってから今回の前記エッジ検出信号を受け取るまでの間において前記外部発振パルスカウンタによって計数されたパルス数とを比較し、両前記カウント数の差に基づいて前記CR発振回路の発振周期を調整するための調整信号を生成する比較調整手段と、前記調整信号に基づいて制御信号を生成し、当該制御信号によって前記CR発振回路の発振出力の周期を調整する抵抗調整回路と」である。   Further, a configuration for adjusting the period of CR oscillation may be added to any claim at the time of filing. For that purpose, the following invention specific matters are added. It is “a count number setting register that stores an appropriate count number of the external oscillation pulse that should correspond to one cycle of the oscillation output from the CR oscillation circuit, and an edge detection signal received from the edge detection circuit, The count number stored in the count number setting register is compared with the number of pulses counted by the external oscillation pulse counter from when the previous edge detection signal is received until the current edge detection signal is received. And a comparison adjustment means for generating an adjustment signal for adjusting the oscillation period of the CR oscillation circuit based on the difference between the two count numbers, a control signal is generated based on the adjustment signal, and the control signal generates the control signal. A resistance adjustment circuit that adjusts the period of the oscillation output of the CR oscillation circuit.

CR発振クロックの概略構成を示すブロック図。The block diagram which shows schematic structure of CR oscillation clock. CR発振クロックの作用を表したフローチャート。The flowchart showing the effect | action of CR oscillation clock.

符号の説明Explanation of symbols

1…CR発振クロック、10…CR発振回路、20…エッジ検出回路、30…外部発振パルスカウンタ、40…カウント数設定レジスタ、50…判定回路、60…抵抗値調整回路、70…カウント数上限設定レジスタ、75…カウント数下限設定レジスタ、80…補正完了カウンタ、85…出力回路、90…補正完了カウント数設定レジスタ、95…補正完了レジスタ、98…アドレスバス、99…データバス DESCRIPTION OF SYMBOLS 1 ... CR oscillation clock, 10 ... CR oscillation circuit, 20 ... Edge detection circuit, 30 ... External oscillation pulse counter, 40 ... Count number setting register, 50 ... Determination circuit, 60 ... Resistance value adjustment circuit, 70 ... Count number upper limit setting Register 75: Count number lower limit setting register 80 ... Correction completion counter 85 ... Output circuit 90 ... Correction completion count number setting register 95 ... Correction completion register 98 ... Address bus 99 ... Data bus

Claims (4)

CR発振クロックを内蔵し、前記CR発振クロックからの発振出力に基づいて時間制御を行うCR発振クロック内蔵マイクロコンピュータであって、
前記CR発振クロックは、
前記発振出力の周期調整が可能なCR発振回路と、
前記CR発振回路からの前記発振出力のエッジを検出すると、エッジ検出信号を出力するエッジ検出回路と、
前記CR発振回路からの前記発振出力よりも周期が精密な外部発振パルスを受信して、当該外部発振パルスを計数する外部発振パルスカウンタと、
前記エッジ検出信号が出力される間隔と前記外部発振パルスカウンタの計数とに基づいて、前記発振出力の周期調整が完了したかを判定する判定手段とを備える
ことを特徴とするCR発振クロック内蔵マイクロコンピュータ。
A CR oscillation clock built-in microcomputer that incorporates a CR oscillation clock and performs time control based on the oscillation output from the CR oscillation clock,
The CR oscillation clock is
A CR oscillation circuit capable of adjusting the period of the oscillation output;
An edge detection circuit that outputs an edge detection signal when detecting an edge of the oscillation output from the CR oscillation circuit;
An external oscillation pulse counter that receives an external oscillation pulse whose cycle is more precise than the oscillation output from the CR oscillation circuit, and counts the external oscillation pulse;
And a determination means for determining whether or not the period adjustment of the oscillation output is completed based on an interval at which the edge detection signal is output and a count of the external oscillation pulse counter. Computer.
情報を記憶する完了記憶手段を備え、
前記判定手段は、前記判定結果を前記完了記憶手段に記憶させる
ことを特徴とする請求項1に記載のCR発振クロック内蔵マイクロコンピュータ。
Completion storage means for storing information is provided,
The microcomputer with built-in CR oscillation clock according to claim 1, wherein the determination unit stores the determination result in the completion storage unit.
前記判定手段は、
前記エッジ検出信号を受け取るたびに、一つ前の前記エッジ検出信号を受け取ってから今回の前記エッジ検出信号を受け取るまでの間において前記外部発振パルスカウンタによって計数されたパルス数が所定範囲に収まっている適正状態なのかを判定する判定回路と、
前記適正状態であると前記判定回路によって判定された回数を成功回数として記憶する成功記憶手段と、
前記成功記憶手段に記憶された成功回数が所定回数以上になると、前記発振出力の周期調整が完了したことを前記完了記憶手段に記憶させる出力回路とを備え、
前記判定回路は、前記適正状態でないと判定すると、前記発振出力の周期調整が完了していないことを前記完了記憶手段に記憶させる
ことを特徴とする請求項2に記載のCR発振クロック内蔵マイクロコンピュータ。
The determination means includes
Each time the edge detection signal is received, the number of pulses counted by the external oscillation pulse counter is within a predetermined range between the time when the previous edge detection signal is received and the time when the current edge detection signal is received. A determination circuit for determining whether the current state is appropriate;
Success storage means for storing the number of times determined by the determination circuit as the appropriate state as the number of successes;
An output circuit for storing in the completion storage means that the cycle adjustment of the oscillation output is completed when the number of successes stored in the success storage means is a predetermined number or more;
3. The microcomputer with built-in CR oscillation clock according to claim 2, wherein if the determination circuit determines that the state is not in an appropriate state, the completion storage unit stores that the period adjustment of the oscillation output is not completed. .
前記判定回路は、前記適正状態でないと判定すると、前記成功記憶手段に記憶された成功回数を減らす
ことを特徴とする請求項3に記載のCR発振クロック内蔵マイクロコンピュータ。
4. The microcomputer with built-in CR oscillation clock according to claim 3, wherein the determination circuit reduces the number of successes stored in the success storage means when determining that the state is not the proper state.
JP2008248019A 2008-09-26 2008-09-26 Cr oscillation clock-incorporated microcomputer Pending JP2010081337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008248019A JP2010081337A (en) 2008-09-26 2008-09-26 Cr oscillation clock-incorporated microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008248019A JP2010081337A (en) 2008-09-26 2008-09-26 Cr oscillation clock-incorporated microcomputer

Publications (1)

Publication Number Publication Date
JP2010081337A true JP2010081337A (en) 2010-04-08

Family

ID=42211263

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008248019A Pending JP2010081337A (en) 2008-09-26 2008-09-26 Cr oscillation clock-incorporated microcomputer

Country Status (1)

Country Link
JP (1) JP2010081337A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05259848A (en) * 1992-03-11 1993-10-08 Nec Corp Clock generator
JPH05313781A (en) * 1992-05-07 1993-11-26 Matsushita Electric Ind Co Ltd Microcomputer
JPH09222934A (en) * 1996-02-16 1997-08-26 Canon Inc Electronic equipment and camera
JPH10229327A (en) * 1997-02-17 1998-08-25 Sanyo Electric Co Ltd Frequency adjustment device for oscillation circuit
JP2001111389A (en) * 1999-08-05 2001-04-20 Denso Corp Microcomputer incorporating cr oscillation clock

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05259848A (en) * 1992-03-11 1993-10-08 Nec Corp Clock generator
JPH05313781A (en) * 1992-05-07 1993-11-26 Matsushita Electric Ind Co Ltd Microcomputer
JPH09222934A (en) * 1996-02-16 1997-08-26 Canon Inc Electronic equipment and camera
JPH10229327A (en) * 1997-02-17 1998-08-25 Sanyo Electric Co Ltd Frequency adjustment device for oscillation circuit
JP2001111389A (en) * 1999-08-05 2001-04-20 Denso Corp Microcomputer incorporating cr oscillation clock

Similar Documents

Publication Publication Date Title
CN108694974B (en) Semiconductor device and timing calibration method
TWI463800B (en) Debounce apparatus and method thereof
US20070252626A1 (en) All-digital power-on reset device
JP5734057B2 (en) Microcontroller and control method thereof
CN116820828B (en) Method and device for setting correctable error threshold, electronic equipment and storage medium
JP2010081337A (en) Cr oscillation clock-incorporated microcomputer
US20100299557A1 (en) Providing tuning limits for operational parameters in data processing apparatus
US8957795B2 (en) Analog-to-digital conversion device
JP6585977B2 (en) Semiconductor device and oscillation circuit control method
EP2658162A1 (en) Data reception circuit, information processing device, data reception program and data reception method
JP3584821B2 (en) Microcomputer with built-in CR oscillation clock
JP6402798B2 (en) Control device for vehicle power window device
EP2333954B1 (en) Clock recovery in a battery powered device
US8042020B2 (en) Data error correction circuit, integrated circuit for data error correction, and method of performing data error correction
US10069839B2 (en) Determine approximate current time on a client using secure protocol metadata
JP5456705B2 (en) Image forming apparatus
TW201917735A (en) Semiconductor device and automatic adjustment method of access cycles of flash memory thereof
JP3072168B2 (en) Memory operation arbitration circuit
JP2014181019A (en) Vehicle equipment control unit
JP2005267580A (en) Method for checking abnormality in synchronous serial communication
JP4967400B2 (en) Clock divider
JP2507972B2 (en) Line quality monitoring device
JP5652367B2 (en) Microcomputer
JP2001273199A (en) Serial interface
JP2008217661A (en) Jog dial input determination method and portable device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110809

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121002

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130702

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20131112