JP5556579B2 - Electronic device and clock correction method - Google Patents

Electronic device and clock correction method Download PDF

Info

Publication number
JP5556579B2
JP5556579B2 JP2010236028A JP2010236028A JP5556579B2 JP 5556579 B2 JP5556579 B2 JP 5556579B2 JP 2010236028 A JP2010236028 A JP 2010236028A JP 2010236028 A JP2010236028 A JP 2010236028A JP 5556579 B2 JP5556579 B2 JP 5556579B2
Authority
JP
Japan
Prior art keywords
frequency
clock signal
clock
setting
change amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2010236028A
Other languages
Japanese (ja)
Other versions
JP2012088979A (en
Inventor
尚登 遠田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2010236028A priority Critical patent/JP5556579B2/en
Publication of JP2012088979A publication Critical patent/JP2012088979A/en
Application granted granted Critical
Publication of JP5556579B2 publication Critical patent/JP5556579B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

この発明は、RC発振器によりクロック信号を生成する電子機器ならびにこのクロック信号の周波数を補正するクロック補正方法に関する。   The present invention relates to an electronic device that generates a clock signal using an RC oscillator and a clock correction method that corrects the frequency of the clock signal.

RC発振器は、水晶発振器やセラミック発振器などと比較して、クロック信号を生成するのに消費電力が少なく、部品コストも低くできるという利点がある。一方、発振周波数の精度が比較的に低く、また、温度等に起因して発振周波数が比較的に大きく変化するという欠点がある。   The RC oscillator has advantages in that it consumes less power to generate a clock signal and can reduce the component cost compared to a crystal oscillator, a ceramic oscillator, or the like. On the other hand, there are drawbacks that the accuracy of the oscillation frequency is relatively low and the oscillation frequency changes relatively greatly due to temperature and the like.

そのため、RC発振器によりクロック信号を生成するシステムにおいては、クロック信号の周波数が大きくずれないように、クロック周波数の補正処理を定期的に行うようにするのが一般的である。このような補正処理により、例えば、正確なタイマーを必要とする場合、あるいは、周辺機器とのデータ通信でクロック信号に同期した信号処理を行うような場合に、クロック周波数のズレによりタイマー誤差が大きくなったり、或いは、通信エラーが発生したりするのを回避できる。   Therefore, in a system in which a clock signal is generated by an RC oscillator, it is common to periodically perform a clock frequency correction process so that the clock signal frequency does not greatly deviate. By such correction processing, for example, when an accurate timer is required, or when signal processing synchronized with a clock signal is performed in data communication with a peripheral device, a timer error is increased due to a shift in clock frequency. Or occurrence of a communication error can be avoided.

RC発振器によるクロック信号の周波数の補正方法としては、例えば、次のような方法が一般的である。先ず、RC発振器にその抵抗や容量を切り替え可能なトリミング回路を設けておく。そして、定期的な補正処理の際、正確な周波数の信号を基準にしてクロック信号の周波数を計測しながら、トリミング回路の設定を初段目から全段階にわたって切り替える。そして、全ての設定状態で周波数の計測を行ったら、最終的にクロック信号の周波数が規定値に一番近くなる設定にトリミング回路を切り替える。これにより、クロック信号の周波数が補正される。   As a method for correcting the frequency of the clock signal by the RC oscillator, for example, the following method is generally used. First, the RC oscillator is provided with a trimming circuit capable of switching its resistance and capacitance. Then, during the periodic correction processing, the setting of the trimming circuit is switched from the first stage to all stages while measuring the frequency of the clock signal with reference to the accurate frequency signal. When the frequency is measured in all setting states, the trimming circuit is finally switched to a setting in which the frequency of the clock signal is closest to the specified value. Thereby, the frequency of the clock signal is corrected.

また、本発明に関連する従来技術として、特許文献1には、RC発振器の出力を分周してクロック信号を生成するとともに、水晶発振器の出力に基づいてRC発振器の発振信号の周期を計測し、この計測値に応じた分周比で上記の分周を行うようにすることで、クロック信号の周波数を補正する技術が開示されている。   Further, as a prior art related to the present invention, Patent Document 1 divides the output of the RC oscillator to generate a clock signal, and measures the period of the oscillation signal of the RC oscillator based on the output of the crystal oscillator. A technique for correcting the frequency of the clock signal by performing the above-described frequency division at a frequency division ratio corresponding to the measured value is disclosed.

また、特許文献2には、RC発振器のクロック信号の周波数を水晶発振器のクロックを基準に計測しておき、RC発振器のクロック信号に基づくタイマーの精度をソフトウェアにより補正する技術が開示されている。   Patent Document 2 discloses a technique for measuring the frequency of the clock signal of the RC oscillator based on the clock of the crystal oscillator and correcting the accuracy of the timer based on the clock signal of the RC oscillator by software.

特開2006−229607号公報JP 2006-229607 A 特開平10−049251号公報Japanese Patent Laid-Open No. 10-049251

しかしながら、上記従来のクロック信号の周波数の補正方法では、補正処理の際、トリミング回路の設定が初段目から全段階にわたって切り替えられるため、クロック信号の周波数が大きく変動する。また、クロック信号の周波数が規定値から大きく外れる期間が生じる。さらに、補正処理の開始時と終了時にクロック信号の周波数が急激に変化するという課題が生じる。   However, in the above-described conventional method for correcting the frequency of the clock signal, the setting of the trimming circuit is switched from the first stage to all stages during the correction process, so that the frequency of the clock signal varies greatly. In addition, a period in which the frequency of the clock signal deviates significantly from the specified value occurs. Furthermore, there arises a problem that the frequency of the clock signal changes abruptly at the start and end of the correction process.

クロック信号の周波数が上記のように変化すると、例えば、周辺機器との間で通信エラーが生じたり、表示データの出力が一時的に中断して表示画面にちらつきが生じるといった不都合が生じることがある。   If the frequency of the clock signal changes as described above, for example, a communication error may occur with a peripheral device, or display data output may be temporarily interrupted, causing a display screen to flicker. .

この発明の目的は、RC発振器によりクロック信号を生成するシステムにおいて、クロック信号の周波数を大きく変動させずに補正して規定の範囲に保つことのできる電子機器およびクロック補正方法を提供することにある。   An object of the present invention is to provide an electronic device and a clock correction method capable of correcting and maintaining a clock signal frequency within a specified range in a system in which a clock signal is generated by an RC oscillator. .

上記目的を達成するため、請求項1記載の発明は、
RC回路の時定数を利用してクロック信号を生成するRC発振器と、
少なくとも前記RC回路の抵抗値または容量値の設定を切り替えて前記クロック信号の周波数を複数段階に変更可能な周波数変更手段と、
前記クロック信号よりも高精度な一定周波数のタイミング信号を生成するタイミング信号生成手段と、
前記タイミング信号に基づいて前記クロック信号の周波数のズレ量を計測するズレ量計測手段と、
前記周波数変更手段の設定を同一時期に複数通りに切り替えながら各切替状態で前記ズレ量計測手段により前記ズレ量を計測させて、前記周波数変更手段による前記周波数の複数段階の変更量に関する値をそれぞれ表わしたデータである周波数変更量データを作成する周波数変更量データ作成手段と、
前記周波数変更量データ作成手段により作成された前記周波数変更量データを記憶する記憶手段と、
前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正するクロック補正制御手段と、
を備え、
前記クロック補正制御手段は、
前記周波数変更量データに基づき、前記クロック信号の周波数を補正前の周波数から規定の周波数へ次第に近づいていくように、前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正することを特徴としている。
In order to achieve the above object, the invention according to claim 1
An RC oscillator that generates a clock signal using the time constant of the RC circuit;
A frequency changing means capable of changing the frequency of the clock signal in a plurality of stages by switching the setting of at least the resistance value or the capacitance value of the RC circuit;
Timing signal generating means for generating a timing signal having a constant frequency with higher accuracy than the clock signal;
A deviation amount measuring means for measuring a deviation amount of the frequency of the clock signal based on the timing signal;
While switching the setting of the frequency changing means in a plurality of ways at the same time, the deviation amount measuring means measures the deviation amount in each switching state, and values relating to the frequency changing amount of the frequency by the frequency changing means are respectively determined. Frequency change amount data creating means for creating frequency change amount data that is represented data;
Storage means for storing the frequency change amount data created by the frequency change amount data creating means ;
Clock correction control means for correcting the frequency of the clock signal by switching the setting of the frequency changing means;
With
The clock correction control means includes
Based on the frequency change amount data, the setting of the frequency changing unit is switched to correct the frequency of the clock signal so that the frequency of the clock signal gradually approaches the specified frequency from the frequency before correction. It is said.

請求項記載の発明は、請求項記載の電子機器において、
前記周波数変更量データ作成手段は、
当該電子機器の起動時に前記周波数変更量データを作成することを特徴としている。
The invention according to claim 2 is the electronic device according to claim 1 ,
The frequency change amount data creating means includes:
The frequency change amount data is created when the electronic device is activated.

請求項記載の発明は、請求項又はに記載の電子機器において、
前記クロック補正制御手段は、
前記ズレ量計測手段の計測結果に基づいて前記クロック信号の周波数が所定量以上ずれたと判別された場合に前記クロック信号の周波数の補正処理を開始し、
前記ズレ量計測手段の計測結果に基づいて前記クロック信号の周波数が規定値に近づいたことを判別することを特徴としている。
The invention according to claim 3 is the electronic device according to claim 1 or 2 ,
The clock correction control means includes
When it is determined that the frequency of the clock signal has shifted by a predetermined amount or more based on the measurement result of the deviation amount measuring means, the correction processing of the frequency of the clock signal is started.
It is characterized in that it is determined that the frequency of the clock signal has approached a specified value based on the measurement result of the deviation amount measuring means.

請求項記載の発明は、請求項1又は2に記載の電子機器において、
前記クロック補正制御手段は、
前記周波数変更手段の設定を、直前の設定状態から前記周波数を一番少ないシフト量で
ズレを減らす方向にシフトさせる次の設定状態に逐次切り替えていくことで、前記クロッ
ク信号の周波数を補正することを特徴としている。
The invention according to claim 4 is the electronic device according to claim 1 or 2 ,
The clock correction control means includes
The frequency of the clock signal is corrected by sequentially switching the setting of the frequency changing means from the immediately previous setting state to the next setting state in which the frequency is shifted in the direction of reducing the shift with the smallest shift amount. It is characterized by.

請求項記載の発明は、
RC回路の時定数を利用してクロック信号を生成するRC発振器と、少なくとも前記RC回路の抵抗値または容量値の設定を切り替えて前記クロック信号の周波数を複数段階に変更可能な周波数変更手段と、前記周波数変更手段による前記周波数の複数段階の変更量をそれぞれ表わした周波数変更量データを記憶する記憶手段と、を備えた電子機器で前記クロック信号の周波数を補正するクロック補正方法であって、
前記電子機器には、前記クロック信号よりも高精度な一定周波数のタイミング信号を生成するタイミング信号生成手段が設けられ、
前記タイミング信号に基づいて前記クロック信号の周波数のズレ量を計測するズレ量計測ステップと、
前記周波数変更手段の設定を同一時期に複数通りに切り替えながら各切替状態で前記ズレ量計測ステップにより前記ズレ量を計測させて前記周波数変更量データを作成する周波数変更量データ作成ステップと、
前記周波数変更量データ作成ステップで作成された前記周波数変更量データを前記記憶手段に記憶させるデータ記憶ステップと、
前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正するクロック補正制御ステップと、
を含み、
当該クロック補正制御ステップは、
前記データ記憶ステップにより前記記憶手段に記憶された前記周波数変更量データに基づき、前記クロック信号の周波数を補正前の周波数から規定の周波数へ次第に近づいていくように、前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正することを特徴としている。
The invention according to claim 5
An RC oscillator that generates a clock signal using a time constant of the RC circuit, and a frequency changing unit that can change the setting of the resistance value or the capacitance value of the RC circuit and change the frequency of the clock signal in a plurality of stages. Storage means for storing frequency change amount data each representing a change amount in a plurality of stages of the frequency by the frequency change means, and a clock correction method for correcting the frequency of the clock signal in an electronic device comprising:
The electronic device is provided with timing signal generation means for generating a timing signal having a constant frequency with higher accuracy than the clock signal,
A deviation amount measuring step of measuring a deviation amount of the frequency of the clock signal based on the timing signal;
A frequency change amount data creation step of creating the frequency change amount data by measuring the shift amount by the shift amount measurement step in each switching state while switching the setting of the frequency changing means in a plurality of ways at the same time,
A data storage step of storing the frequency change amount data created in the frequency change amount data creation step in the storage means;
A clock correction control step of switching the setting of the frequency changing means to correct the frequency of the clock signal ;
Including
The clock correction control step includes
Based on the frequency change amount data stored in the storage means by the data storage step , the setting of the frequency change means is switched so that the frequency of the clock signal gradually approaches the specified frequency from the frequency before correction. The frequency of the clock signal is corrected.

本発明に従うと、RC発振器により生成されたクロック信号の周波数を補正する際、クロック信号の周波数が補正前の周波数から徐々に規定の周波数に近づくように変更されて補正される。そのため、周波数が大きく変動したり急激に変動したりすることがなく、このような変動に起因して生じる不具合を回避できるという効果がある。   According to the present invention, when the frequency of the clock signal generated by the RC oscillator is corrected, the frequency of the clock signal is changed and corrected so as to gradually approach a specified frequency from the frequency before correction. Therefore, there is an effect that the frequency does not fluctuate greatly or fluctuates, and problems caused by such fluctuations can be avoided.

本発明の実施形態の電子機器の全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the electronic device of embodiment of this invention. RC発振ブロックの一例を示す回路構成図である。It is a circuit block diagram which shows an example of RC oscillation block. クロック信号の周波数の計測方法を説明するタイミングチャートである。It is a timing chart explaining the measuring method of the frequency of a clock signal. トリミングテーブルの一例を示すデータチャートである。It is a data chart which shows an example of a trimming table. 複数の設定状態のクロック信号の周波数と温度との関係を示すグラフである。It is a graph which shows the relationship between the frequency of the clock signal of a some setting state, and temperature. CPUにより実行されるクロック周波数制御処理の制御手順を示すフローチャートである。It is a flowchart which shows the control procedure of the clock frequency control process performed by CPU.

以下、本発明の実施の形態を図面に基づいて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明の実施形態の電子機器1の全体構成を示すブロック図である。   FIG. 1 is a block diagram showing an overall configuration of an electronic apparatus 1 according to an embodiment of the present invention.

この実施形態の電子機器1は、特に制限されるものではないが、GPS(全地球測位システム)による測位機能を有するデジタルカメラである。この電子機器1は、図1に示すように、レンズを介して得られる被写体像の撮像を行う撮像素子2と、複数の操作ボタンを有し外部から操作指令を入力する入力装置3と、撮影画像やその他の種々の画像表示を行う表示装置4と、GPS衛星の送信信号を受信して復調を行うGPSモジュール5と、CPU(中央演算処理装置)11を内蔵したLSI(大規模集積回路)からなるコントローラ10と、CPU11が実行する制御プログラムや制御データが格納されたプログラムROM(Read Only Memory)6と、CPU11に作業用のメモリ空間を提供するRAM(Random Access Memory)7と、撮影画像などのデータを記憶するフラッシュメモリなどの外部記憶装置8等を備えている。   The electronic device 1 of this embodiment is a digital camera having a positioning function by GPS (Global Positioning System), although not particularly limited. As shown in FIG. 1, the electronic apparatus 1 includes an image sensor 2 that captures a subject image obtained through a lens, an input device 3 that has a plurality of operation buttons and inputs an operation command from the outside, An LSI (Large Scale Integrated Circuit) incorporating a display device 4 for displaying images and other various images, a GPS module 5 for receiving and demodulating a GPS satellite transmission signal, and a CPU (Central Processing Unit) 11 A controller 10, a program ROM (Read Only Memory) 6 storing a control program and control data executed by the CPU 11, a RAM (Random Access Memory) 7 that provides a working memory space to the CPU 11, and a captured image And an external storage device 8 such as a flash memory for storing the data.

また、コントローラ10には、機器の全体的な制御を行うCPU11と、撮像素子2の制御や撮像信号の信号処理等を行う撮像コントローラ12と、入力装置3からの信号の入力および表示装置4への表示データの出力を行う入出力コントローラ13と、GPSモジュール5とデータ通信を行うためのシリアルコントローラ14と、実時間の計時を行うタイミング信号生成手段としてのRTC(Real Time Clock)ブロック15と、コントローラ10のシステムクロックとなるクロック信号を生成するRC発振ブロック16と、クロック信号の周波数を測定するズレ量計測手段としての周波数測定カウンタ17と、コントローラ10の制御データが格納される記憶手段としてのEEPROM(電気的消去型プログラマブルROM)18と、プログラムROM6やRAM7に対してデータの読み書きを行うメモリコントローラ19と、外部記憶装置8に対してデータの読み書きを行う外部記憶コントローラ20等が設けられている。また、コントローラ10にはRTCブロック15に高精度の一定周期の信号を供給するための水晶振動子9が外付けされている。   Further, the controller 10 includes a CPU 11 that performs overall control of the device, an imaging controller 12 that performs control of the image sensor 2, signal processing of the imaging signal, and the like, and input of signals from the input device 3 and the display device 4. An input / output controller 13 for outputting display data, a serial controller 14 for data communication with the GPS module 5, an RTC (Real Time Clock) block 15 as a timing signal generating means for measuring real time, An RC oscillation block 16 that generates a clock signal to be a system clock of the controller 10, a frequency measurement counter 17 as a deviation amount measuring unit that measures the frequency of the clock signal, and a storage unit that stores control data of the controller 10 EEPROM (electrically erasable programmable ROM) 18 and program A memory controller 19 for reading and writing data to the ROM6 and RAM 7, the external storage controller 20 and the like are provided for reading and writing data to the external storage device 8. In addition, the controller 10 is externally attached with a crystal resonator 9 for supplying a signal with a constant period to the RTC block 15 with high accuracy.

RC発振ブロック16は、図1の点線で示すように、コントローラ10の各部(CPU11、撮像コントローラ12、入出力コントローラ13、シリアルコントローラ14,EEPROM18、メモリコントローラ19、外部記憶コントローラ20)に動作クロックとなるクロック信号を供給している。また、コントローラ10の各部(撮像コントローラ12、入出力コントローラ13、シリアルコントローラ14、RTCブロック15、RC発振ブロック16、周波数測定カウンタ17、EEPROM18、メモリコントローラ19、外部記憶コントローラ20)は、CPU11と図示略のバスを介して接続されている。   As shown by a dotted line in FIG. 1, the RC oscillation block 16 supplies an operation clock to each part of the controller 10 (CPU 11, imaging controller 12, input / output controller 13, serial controller 14, EEPROM 18, memory controller 19, external storage controller 20). A clock signal is supplied. Further, each part of the controller 10 (the imaging controller 12, the input / output controller 13, the serial controller 14, the RTC block 15, the RC oscillation block 16, the frequency measurement counter 17, the EEPROM 18, the memory controller 19, and the external storage controller 20) is illustrated as the CPU 11. They are connected via an abbreviated bus.

シリアルコントローラ14は、例えばUART(Universal Asynchronous Receiver Transmitter)によりデータ通信を行うものであり、パラレル信号とシリアル信号の変換や各種のエラーチェックをクロック信号に同期させて行っているため、クロック信号の周波数が大きく変動すると通信エラーが生じる場合がある。   The serial controller 14 performs data communication using, for example, a UART (Universal Asynchronous Receiver Transmitter), and performs parallel signal / serial signal conversion and various error checks in synchronization with the clock signal. If the value fluctuates greatly, a communication error may occur.

プログラムROM6には、カメラ機能や測位機能を実現するためのメイン制御処理のプログラムに加えて、RC発振ブロック16のクロック信号の周波数を調整するためのクロック周波数制御処理のプログラムが格納されている。   The program ROM 6 stores a program for a clock frequency control process for adjusting the frequency of the clock signal of the RC oscillation block 16 in addition to a main control process program for realizing a camera function and a positioning function.

RTCブロック15は、高精度で且つ温度変化に対する変動が少ない水晶振動子9の発振信号を分周して例えば正確な1/512秒のタイミング信号を生成するものである。そして、この1/512秒のタイミング信号をカウントして現在時刻の計時を行う。また、RTCブロック15のタイミング信号は、クロック信号の周波数の計測用に周波数測定カウンタ17にも供給されている。   The RTC block 15 divides the oscillation signal of the crystal unit 9 with high accuracy and little fluctuation with respect to temperature change to generate, for example, an accurate 1/512 second timing signal. Then, the timing signal of 1/512 seconds is counted to measure the current time. The timing signal of the RTC block 15 is also supplied to the frequency measurement counter 17 for measuring the frequency of the clock signal.

図2には、RC発振ブロック16の一例を表わした回路構成図を示す。   FIG. 2 is a circuit configuration diagram illustrating an example of the RC oscillation block 16.

RC発振ブロック16は、クロック信号を生成するRC発振器およびクロック信号の周波数を複数段階で変更可能な周波数変更手段を含むもので、図2に示すように、信号発振用の遅延時間を設けるため抵抗R0〜R29および電気容量C0〜C29と、各組の抵抗および容量(RC回路)を用いて信号を発振させる第0〜第29RC発振回路161と、これら第0〜第29RC発振回路161の何れか1個の出力をクロック信号として選択的に出力するセレクタ162等から構成される。   The RC oscillation block 16 includes an RC oscillator that generates a clock signal and frequency changing means that can change the frequency of the clock signal in a plurality of stages. As shown in FIG. 2, a resistor for providing a delay time for signal oscillation is provided. Any one of R0 to R29, electric capacitances C0 to C29, 0th to 29th RC oscillation circuits 161 for oscillating signals using each set of resistors and capacitors (RC circuits), and any of these 0th to 29th RC oscillation circuits 161 It includes a selector 162 that selectively outputs one output as a clock signal.

抵抗R0〜R29および電気容量C0〜C29は、各組の時定数が少しずつ異なるように形成されており、それにより第0〜第29RC発振回路161の発振信号の周波数が少しずつ異なるようになっている。例えば、第0〜第29RC発振回路161の発振周波数の上限値と下限値とが10パーセント程度異なるように設計されている。   The resistors R0 to R29 and the electric capacitances C0 to C29 are formed so that the time constants of the respective sets are slightly different, whereby the frequencies of the oscillation signals of the 0th to 29th RC oscillation circuits 161 are slightly different. ing. For example, the upper limit value and the lower limit value of the oscillation frequency of the 0th to 29th RC oscillation circuits 161 are designed to be different by about 10%.

セレクタ162は、CPU11からトリミング値設定信号が出力されて、このトリミング値設定信号に応じて第0〜第29RC発振回路161の出力のうち1つをクロック信号として出力する。   The selector 162 outputs a trimming value setting signal from the CPU 11 and outputs one of outputs of the 0th to 29th RC oscillation circuits 161 as a clock signal in accordance with the trimming value setting signal.

なお、RC発振ブロック16は、上記のような構成に限られない。例えば、遅延時間を設けるための抵抗および電気容量と、この抵抗および電気容量に接続されて信号を発振させる1つのRC発振回路と、上記抵抗の抵抗値を複数段階に切り替えるトリミング回路とから構成することもできる。また、上記のトリミング回路は、抵抗の代わりに上記電気容量の容量値を複数段階に切り替えるように構成しても良い。   Note that the RC oscillation block 16 is not limited to the above configuration. For example, a resistor and an electric capacitor for providing a delay time, one RC oscillation circuit connected to the resistor and the electric capacitor to oscillate a signal, and a trimming circuit that switches the resistance value of the resistor in a plurality of stages are included. You can also. Further, the trimming circuit may be configured to switch the capacitance value of the capacitance in a plurality of stages instead of the resistor.

図3には、クロック信号の周波数計測方法を説明するタイミングチャートを示す。   FIG. 3 shows a timing chart for explaining a clock signal frequency measuring method.

周波数測定カウンタ17は、CPU11から測定指令を受けた場合に、図3に示すように、RTCブロック15のタイミンク信号の入力時点(例えばタイミング信号の立下りタイミング)から次のタイミング信号の入力時点まで、RC発振ブロック16のクロック信号を計数し、このカウント値をCPU11に供給するように構成されている。   When receiving a measurement command from the CPU 11, the frequency measurement counter 17, as shown in FIG. 3, from the input timing of the timing signal of the RTC block 15 (for example, the falling timing of the timing signal) to the input timing of the next timing signal. The clock signal of the RC oscillation block 16 is counted and this count value is supplied to the CPU 11.

図4には、EEPROM18に記憶されるトリミングテーブル18aを表わしたデータチャートを示す。   FIG. 4 shows a data chart representing the trimming table 18 a stored in the EEPROM 18.

EEPROM18には、RC発振ブロック16のトリミング値と、クロック信号の周波数に関するデータとが対応づけられたトリミングテーブル18aが記憶される。ここで、トリミング値とは、セレクタ162の選択状態を示す値で、例えばトリミング値「0」は第0RC発振回路161の出力が選択されている状態を示し、トリミング値「N」は第NRC発振回路161の出力が選択されている状態を示す。   The EEPROM 18 stores a trimming table 18a in which trimming values of the RC oscillation block 16 are associated with data relating to the frequency of the clock signal. Here, the trimming value is a value indicating the selection state of the selector 162. For example, the trimming value “0” indicates a state in which the output of the 0th RC oscillation circuit 161 is selected, and the trimming value “N” indicates the NRC oscillation. The state in which the output of the circuit 161 is selected is shown.

トリミングテーブル18aには、例えば、各トリミング値に対応させて、該当するトリミング値の設定状態で出力されるクロック信号について、周波数測定カウンタ17により計測されたクロック信号のカウント値(1/512秒間に出力されたクロック信号の個数)と、規定周波数のクロック信号に対する上記カウント値のズレ量を百分率で表わした値とがそれぞれ登録されるようになっている。これらカウント値とズレ量のデータにより周波数変更量データが構成される。   In the trimming table 18a, for example, the clock signal output in the setting state of the corresponding trimming value corresponding to each trimming value, the count value of the clock signal measured by the frequency measurement counter 17 (in 1/512 second). The number of output clock signals) and a value representing the deviation amount of the count value with respect to the clock signal of the specified frequency as a percentage are registered. The frequency change amount data is composed of the count value and the deviation amount data.

図5には、RC発振ブロック16から出力される複数の設定状態のクロック信号の周波数と温度の関係を表わしたグラフを示す。   FIG. 5 is a graph showing the relationship between the frequency and temperature of a plurality of set state clock signals output from the RC oscillation block 16.

RC発振ブロック16から出力されるクロック信号の周波数は、図5に示すように、温度一定の条件でトリミング値を切り替えることで複数段階に変化する。また、トリミング値を一定としたまま温度が変化すると、温度変化に伴って周波数も変化する。また、温度変化に対する周波数変化の割合は、トリミング値によらずにほぼ一定となる。従って、クロック信号の周波数が高い方から低い方へ変化する順に複数のトリミング値を並べた場合に、温度が低いときと温度が高いときとで、このトリミング値の順番はほぼ変化しないようになっている。このような特性により、例えば或る温度においてこの順番を計測しておけば、その後に温度が変化しても、クロック信号の周波数を順に変化させるトリミング値の順番を判別できるようになっている。   As shown in FIG. 5, the frequency of the clock signal output from the RC oscillation block 16 changes in a plurality of stages by switching the trimming value under a constant temperature condition. If the temperature changes with the trimming value kept constant, the frequency also changes with the temperature change. Further, the ratio of the frequency change to the temperature change is substantially constant regardless of the trimming value. Therefore, when a plurality of trimming values are arranged in the order in which the frequency of the clock signal changes from higher to lower, the order of the trimming values hardly changes between when the temperature is low and when the temperature is high. ing. With such characteristics, for example, if this order is measured at a certain temperature, the order of trimming values for sequentially changing the frequency of the clock signal can be determined even if the temperature subsequently changes.

次に、上記構成の電子機器1において、クロック信号の周波数を調整する制御処理について説明する。   Next, a control process for adjusting the frequency of the clock signal in the electronic apparatus 1 having the above configuration will be described.

図6には、CPU11により実行されるクロック周波数制御処理のフローチャートを示す。   FIG. 6 shows a flowchart of the clock frequency control process executed by the CPU 11.

このクロック周波数制御処理は、システム起動時に開始され、その後、カメラ機能や測位機能を実現するメイン制御処理と並行してシステムが終了するまで実行されるものである。   This clock frequency control process is started when the system is started, and is then executed in parallel with the main control process for realizing the camera function and the positioning function until the system is terminated.

システムが起動して、このクロック周波数制御処理が開始されると、先ず、CPU11は、全トリミング値の設定状態におけるクロック信号の周波数の計測を行って、トリミングテーブル18aのカウント値とズレ量のデータを生成・記憶させる処理を行う(ステップS1)。   When the system is started and this clock frequency control process is started, first, the CPU 11 measures the frequency of the clock signal in the setting state of all trimming values, and the count value and deviation data of the trimming table 18a. Is generated and stored (step S1).

詳細には、周波数測定カウンタ17に測定指令を出力してクロック信号の計数処理を行わせるとともに、カウント値が得られるごとにRC発振ブロック16のトリミング値の設定を切り替えることで、全てのトリミング値に対応するカウント値を取得する。そして、このカウント値をトリミングテーブル18aに記憶させる。さらに、各トリミング値のカウント値が、規定周波数に対応するカウント値からどれだけずれているか百分率で計算し、算出された値をトリミングテーブル18aのズレ量のデータとして記憶させる。このようなステップS1の処理により、図4に示したようなトリミングテーブル18aが生成・記憶される。   More specifically, all the trimming values are obtained by outputting a measurement command to the frequency measurement counter 17 to perform the clock signal counting process and switching the setting of the trimming value of the RC oscillation block 16 every time the count value is obtained. Get the count value corresponding to. Then, this count value is stored in the trimming table 18a. Further, how much the count value of each trimming value deviates from the count value corresponding to the specified frequency is calculated as a percentage, and the calculated value is stored as data of the deviation amount of the trimming table 18a. By such processing in step S1, the trimming table 18a as shown in FIG. 4 is generated and stored.

続いて、CPU11は、トリミングテーブル18aを参照してズレ量の絶対値が一番小さいトリミング値を検索し、RC発振ブロック16の設定(セレクタ162の設定)をこのトリミング値の設定状態に切り替える(ステップS2)。この切り替えにより、クロック信号が規定の周波数に一番近いものに切り替えられる。   Subsequently, the CPU 11 refers to the trimming table 18a to search for the trimming value having the smallest absolute value of the deviation amount, and switches the setting of the RC oscillation block 16 (setting of the selector 162) to the setting state of this trimming value ( Step S2). By this switching, the clock signal is switched to the one closest to the specified frequency.

その後、CPU11は、クロック周波数のズレを確認する規定時間をタイマーにセットして、規定時間の経過までこのプログラム処理を待機状態とさせる(ステップS3)。   Thereafter, the CPU 11 sets a specified time for confirming the deviation of the clock frequency in the timer, and keeps this program processing in a standby state until the specified time elapses (step S3).

規定時間が経過したら、CPU11は、周波数測定カウンタ17に測定指令を出力して、現在設定されているトリミング値でのクロック信号の計数処理を行わせ、計数結果のカウント値と規定のカウント値とを比較してそのズレ量を算出する(ステップS4)。そして、このズレ量が所定のしきい値未満であるか判別し(ステップS5)、ズレ量がしきい値未満であれば、まだ、トリミング値の切り替えは不要であるとして、ステップS3に戻って、再び、規定時間の待機状態とする。   When the specified time has elapsed, the CPU 11 outputs a measurement command to the frequency measurement counter 17 to cause the clock signal to be counted with the currently set trimming value, and the count value of the count result and the specified count value And the amount of deviation is calculated (step S4). Then, it is determined whether or not the amount of deviation is less than a predetermined threshold value (step S5). Then, the standby state is again set for the specified time.

一方、ステップS5の判別処理でズレ量が所定のしきい値以上と判別されれば、“NO”側に移行して、先ず、トリミング値の変更をN回(例えば30回)行ったか確認する(ステップS6)。そして、未だであれば、次に、ステップS4で算出されたズレを修正する方向にクロック周波数をシフトさせ、且つ、クロック周波数を一番小さくシフトさせるトリミング値をトリミングテーブル18aの中から検索する(ステップS7)。   On the other hand, if it is determined in step S5 that the amount of deviation is greater than or equal to the predetermined threshold value, the process proceeds to “NO”, and first, it is confirmed whether the trimming value has been changed N times (for example, 30 times). (Step S6). If not, the trimming value that shifts the clock frequency in the direction of correcting the deviation calculated in step S4 and shifts the clock frequency to the smallest is searched from the trimming table 18a ( Step S7).

例えば、ステップS4の計測時点で設定されているトリミング値が「14」であり、計測処理の結果、クロック信号のカウント値は「15430」で、規定値「15625」より小さかったとする。この場合、このズレを修正する方向(カウント値を大きくする方向)で、且つ、その変化量が一番小さくなるトリミング値を検索する。図4のトリミングテーブル18aであれば、トリミング値「12」が、カウント値を大きくする方向にシフトさせ、且つ、ズレ量の差異が“−0.70%−(−1.00%)=0.30%”とカウント値を一番小さくシフトさせる設定状態として抽出される。   For example, it is assumed that the trimming value set at the time of measurement in step S4 is “14”, and the count value of the clock signal is “15430” as a result of the measurement process, and is smaller than the specified value “15625”. In this case, a trimming value is searched for in the direction of correcting this deviation (in the direction of increasing the count value) and having the smallest change amount. In the case of the trimming table 18a of FIG. 4, the trimming value “12” is shifted in the direction of increasing the count value, and the difference in deviation amount is “−0.70% − (− 1.00%) = 0. .30% "is extracted as a setting state for shifting the count value to the smallest.

上記のように検索を行ったら、RC発振ブロック16の設定を検索結果のトリミング値の設定状態に変更する(ステップS8)。そして、ステップS4に戻り、ステップS4からの処理を再び繰り返す。ここで、設定変更後のクロック信号に対しても、ステップS5,S6の判別処理で“NO”の判別が行われれば、ステップS4〜S8の処理が繰り返し実行され、このステップS4〜S8の繰り返し処理により、クロック信号の周波数が規定の周波数に徐々に近づくようにシフトしていくことになる。   When the search is performed as described above, the setting of the RC oscillation block 16 is changed to the trimming value setting state of the search result (step S8). And it returns to step S4 and repeats the process from step S4 again. If “NO” is determined in the determination processing in steps S5 and S6 for the clock signal after the setting change, the processing in steps S4 to S8 is repeatedly executed, and the steps S4 to S8 are repeated. By the processing, the frequency of the clock signal is shifted so as to gradually approach the specified frequency.

そして、上記ステップS4〜S8の繰り返し処理により、クロック信号の周波数が規定周波数に近い値までシフトされると、ステップS5の判別処理でクロック信号の周波数のズレがしきい値未満と判別される。すなわち、このときの設定状態によりクロック周波数の補正完了となる。従って、その後、ステップS3に戻って、再び、規定時間の待機状態とする。   Then, when the frequency of the clock signal is shifted to a value close to the specified frequency by repeating the above steps S4 to S8, the discrepancy in the frequency of the clock signal is determined to be less than the threshold value in the determination processing of step S5. That is, the correction of the clock frequency is completed according to the setting state at this time. Therefore, after that, the process returns to step S3 and again enters a standby state for a specified time.

一方、RC発振ブロック16の複数の設定状態の一部に、クロック周波数の変更間隔がやや広くなる部分が生じ、この広い変更間隔の中間あたりに規定周波数があるような場合には、クロック信号の周波数が規定周波数に一番近づいたときでも、ステップS5の判別処理でカウント値のズレ量がしきい値未満と判別されない場合が生じえる。また、ステップS4〜S8の繰り返し処理中に、温度等の環境が激しく変化することで、クロック信号の周波数が規定周波数に近づいていかない場合も生じえる。   On the other hand, in some of the plurality of setting states of the RC oscillation block 16, there is a portion where the clock frequency change interval becomes slightly wide, and when there is a prescribed frequency around the middle of the wide change interval, Even when the frequency is closest to the specified frequency, there may be a case where the discrepancy amount of the count value is not determined to be less than the threshold value in the determination process in step S5. In addition, there may be a case where the frequency of the clock signal does not approach the specified frequency due to a drastic change in the environment such as temperature during the repeated processing of steps S4 to S8.

この場合には、ステップS4〜S8のループ処理がN回繰り返されることで、ステップS6の判別処理で“YES”の判別が行われて、このループ処理を抜ける。この場合、トリミング値をN回変更した中で、規定のカウント値からのズレ量が一番小さかったトリミング値を抽出して、RC発振ブロック16の設定をこのトリミング値の設定状態に切り替える(ステップS9)。温度等の環境が激しく変化しているのでなければ、このときの設定状態によりクロック周波数は規定値に最も近い設定となりクロック周波数の補正完了となる。従って、その後、ステップS3に戻って、再び、規定時間の待機状態とする。   In this case, the loop process of steps S4 to S8 is repeated N times, so that “YES” is determined in the determination process of step S6, and the loop process is exited. In this case, the trimming value having the smallest deviation from the specified count value is extracted while the trimming value is changed N times, and the setting of the RC oscillation block 16 is switched to the setting state of the trimming value (step S9). If the environment such as temperature does not change drastically, the clock frequency is set closest to the specified value according to the setting state at this time, and the correction of the clock frequency is completed. Therefore, after that, the process returns to step S3 and again enters a standby state for a specified time.

上記のクロック周波数制御処理のうち、ステップS4〜S9の処理によりクロック補正制御手段が構成され、ステップS1の処理により周波数変更量データ作成手段が構成される。   Among the above clock frequency control processes, the clock correction control means is configured by the processes of steps S4 to S9, and the frequency change amount data generating means is configured by the process of step S1.

以上のように、この実施形態の電子機器1によれば、クロック周波数を補正する際、補正前の周波数から規定周波数に徐々に近づいていくように、RC発振ブロック16のトリミング値が切り替えられていく。従って、トリミング値を初段目から全段階にわたって切り替えて最適な設定を見つける方式と比較して、クロック周波数のトータルの変動量を小さくでき、また、クロック周波数の急激な変化も生じない。従って、クロック周波数の補正処理中に、シリアルコントローラ14を介して通信処理を行っていてもクロック周波数の大きな変動に起因した通信エラーの発生を回避でき、この通信処理を停止させる必要も生じない。また、表示画面のちらつきなどクロック周波数の急激な変化に起因した不具合も回避できる。   As described above, according to the electronic apparatus 1 of this embodiment, when the clock frequency is corrected, the trimming value of the RC oscillation block 16 is switched so as to gradually approach the specified frequency from the frequency before correction. Go. Therefore, compared with a method of finding the optimum setting by switching the trimming value from the first stage to all stages, the total amount of fluctuation of the clock frequency can be reduced, and a sudden change of the clock frequency does not occur. Therefore, even if communication processing is performed via the serial controller 14 during clock frequency correction processing, it is possible to avoid the occurrence of communication errors due to large fluctuations in the clock frequency, and it is not necessary to stop this communication processing. In addition, problems caused by sudden changes in the clock frequency, such as display screen flickering, can be avoided.

また、上記実施形態の電子機器1によれば、クロック周波数を補正する際、トリミングテーブル18aのデータに基づき、切替前の設定状態から、周波数のズレを修正する方向に、且つ、周波数を最も小さくシフトさせる次の設定状態に逐次切り替えていくようになっている。従って、補正処理の際に、確実に、クロック周波数を規定周波数に徐々に近づけるように変化させることができる。   Further, according to the electronic device 1 of the above embodiment, when correcting the clock frequency, the frequency is minimized in the direction of correcting the frequency deviation from the setting state before switching based on the data of the trimming table 18a. The next setting state to be shifted is sequentially switched. Therefore, in the correction process, the clock frequency can be reliably changed so as to gradually approach the specified frequency.

また、この実施形態の電子機器1によれば、同一時期にRC発振ブロック16を複数の設定状態に切り替えつつ、各設定状態でクロック信号の計数処理を行って、トリミングテーブル18aを作成するようになっている。従って、RC発振ブロック16で切り替えられる複数の抵抗R0〜R29の抵抗値ならびに複数の電気容量C0〜C29の容量値に製造バラツキや設計値からの誤差が生じていても、RC発振ブロック16の実際の周波数の変更量を反映したトリミングテーブル18aを作成することができる。そして、このトリミングテーブル18aを使用することで、上記のようなクロック周波数の補正処理を正常に実現することができる。   Further, according to the electronic apparatus 1 of this embodiment, the RC oscillation block 16 is switched to a plurality of setting states at the same time, and the clock signal is counted in each setting state to create the trimming table 18a. It has become. Therefore, even if there is a manufacturing variation or an error from the design value in the resistance values of the plurality of resistors R0 to R29 switched by the RC oscillation block 16 and the capacitance values of the plurality of electric capacitors C0 to C29, the RC oscillation block 16 is actually used. The trimming table 18a reflecting the amount of frequency change can be created. By using this trimming table 18a, the above clock frequency correction processing can be normally realized.

また、この実施形態の電子機器1によれば、機器の起動時にトリミングテーブル18aを作成するようになっているので、通信処理を中断させる必要もなく、また、表示画面のちらつきが生じることになっても、このちらつきが目立たない期間に、トリミングテーブル18aを作成することができる。   Further, according to the electronic device 1 of this embodiment, since the trimming table 18a is created when the device is activated, there is no need to interrupt the communication process and the display screen flickers. However, the trimming table 18a can be created in a period in which this flicker is not noticeable.

また、この実施形態の電子機器1によれば、RTCブロック15のタイミング信号に基づいてクロック周波数のズレ量を計測するとともに、このズレ量が所定のしきい値以上となった場合に、クロック周波数の補正処理に移行するようになっている。また、クロック周波数の補正処理では、RC発振ブロック16のトリミング値が切り替えられた後にクロック周波数のズレ量が計測されて、この計測結果に基づいてクロック周波数のズレが解消されたか確認されるようになっている。従って、不必要なときにクロック周波数の補正処理が実行されることを回避でき、また、クロック周波数を確実に規定値に近い値に修正することができる。   Further, according to the electronic apparatus 1 of this embodiment, the amount of clock frequency deviation is measured based on the timing signal of the RTC block 15, and the clock frequency when the amount of deviation exceeds a predetermined threshold value. Shift to the correction process. In the clock frequency correction processing, the clock frequency deviation amount is measured after the trimming value of the RC oscillation block 16 is switched, and it is confirmed whether the clock frequency deviation has been eliminated based on the measurement result. It has become. Therefore, it is possible to avoid the correction process of the clock frequency when it is unnecessary, and to reliably correct the clock frequency to a value close to the specified value.

なお、本発明は、上記実施の形態に限られるものではなく、様々な変更が可能である。例えば、上記実施形態では、周波数変更量データとしてトリミングテーブル18aのカウント値のデータやズレ量のデータを採用した例を示したが、このように各設定状態でのクロック信号の周波数やその変更量を直接的又は間接的に表わすデータに制限されず、例えば、周波数の変更量の大きさの順番を表わすデータとしても良い。変更量の大きさの順番が分かることで、現在の設定状態からズレを修正する方向に且つクロック周波数を一番少なくシフトする設定状態を検索することが可能となる。   The present invention is not limited to the above-described embodiment, and various modifications can be made. For example, in the above embodiment, the count value data and the shift amount data of the trimming table 18a are used as the frequency change amount data. However, the frequency of the clock signal in each setting state and the change amount are as described above. Is not limited to data directly or indirectly representing, for example, may be data representing the order of the magnitude of frequency change. By knowing the order of the magnitudes of the change amounts, it is possible to search for a setting state in which the shift is corrected from the current setting state in the direction of correcting the deviation and the clock frequency is minimized.

また、上記実施形態では、トリミングテーブル18aを電子機器1の起動時に毎回作成するようにしているが、電子機器1のリセット時に作成・記憶させるようにしたり、或いは、工場出荷前の設定工程において作成・記憶させるようにしても良い。   In the above embodiment, the trimming table 18a is created every time the electronic device 1 is started. However, the trimming table 18a is created and stored when the electronic device 1 is reset, or created in a setting process before factory shipment. -You may make it memorize.

また、上記実施形態では、トリミング値を切り替えてクロック周波数を補正する際に、クロック周波数を一番少なくシフトする設定状態に1段ずつ切り替えていくように構成しているが、RC発振ブロック16のトリミング値の切替段数を多く設けて、2段ずつや3段ずつ切り替えてもクロック周波数の変化が急激な変化とならない場合には、2段ずつや3段ずつ切り替えるようにしても良い。このような構成では、例えば、クロック周波数が大きくずれているときには、多段ずつ切り替え、クロック周波数が規定値に近づいてきたら1段ずつ切り替えて、規定値に近づけるといった切替制御も採用できる。   In the above embodiment, when the trimming value is switched to correct the clock frequency, the clock frequency is shifted to the setting state in which the clock frequency is shifted to the lowest level. A large number of trimming value switching stages may be provided, and if the clock frequency does not change suddenly even when switching every two or three stages, switching may be performed every two or three stages. In such a configuration, for example, it is possible to adopt switching control such that when the clock frequency is largely deviated, switching is performed in multiple stages, and when the clock frequency approaches the specified value, the switching is performed one stage at a time to approach the specified value.

また、上記実施形態では、規定時間の経過ごとに、クロック周波数のズレ量を計測して補正処理を行うか否か判別するようにしているが、例えば、温度センサを設けて、温度が一定量変化した場合に、クロック周波数のズレ量を計測して補正処理を行うか否か判別したり、或いは、この判別を省いて温度が一定量変化した場合にクロック周波数の補正処理を実行するようにしても良い。   Further, in the above embodiment, every time the specified time elapses, the amount of clock frequency deviation is measured to determine whether or not correction processing is performed. For example, a temperature sensor is provided, and the temperature is constant. If there is a change, measure whether or not the correction process is performed by measuring the amount of deviation of the clock frequency, or omit this determination and execute the correction process of the clock frequency when the temperature changes by a certain amount. May be.

また、上記実施形態では、クロック周波数の補正処理においてトリミング値を切り替えるごとに、クロック周波数のズレ量を計測して、ズレ量がしきい値未満になったか確認しているが、初回に計測したズレ量と、トリミングテーブル18aのズレ量のデータとから、未だ、クロック周波数が規定値に近づいていないと判別できる場合にはクロック周波数のズレ量の計測を省くようにしても良い。   In the above embodiment, every time the trimming value is switched in the clock frequency correction process, the amount of deviation of the clock frequency is measured to check whether the amount of deviation is less than the threshold value. If it can be determined from the deviation amount and the deviation amount data in the trimming table 18a that the clock frequency has not yet approached the specified value, the measurement of the deviation amount of the clock frequency may be omitted.

また、上記実施形態では、クロック周波数のズレ量がしきい値未満となった場合に補正完了とするか、或いは、トリミング値をN回切り替えてズレ量がしきい値未満とならなかった場合に一番ズレ量が小さかったトリミング値の設定状態にして補正完了としているが、例えば、トリミング値を逐次切り替えていってクロック周波数のズレ量の方向が正から負へ或いは負から正へ切り換わったときに、この設定状態で補正完了とするようにしても良い。   In the above embodiment, the correction is completed when the amount of deviation of the clock frequency is less than the threshold value, or when the amount of deviation is not less than the threshold value by switching the trimming value N times. The correction is completed with the trimming value setting state with the smallest deviation amount, but for example, the trimming value was sequentially switched and the direction of the clock frequency deviation amount was switched from positive to negative or from negative to positive. Sometimes, correction may be completed in this setting state.

また、上記実施形態では、高精度のタイミング信号として、水晶振動子による発振信号を適用した例を示したが、例えば、セラミック振動子による発振信号など、適宜な精度のタイミング信号が得られれば、どのような手段を用いても良い。また、例えばトリミングテーブル18aなどの周波数変更量データはコントローラ10内に記憶させるのではなく、RAM7や外部記憶装置8に記憶させるようにしても良い。その他、実施形態で示した細部構成および細部方法は、発明の趣旨を逸脱しない範囲で適宜変更可能である。   In the above-described embodiment, an example in which an oscillation signal by a crystal oscillator is applied as a highly accurate timing signal has been described.For example, if an appropriate timing signal such as an oscillation signal by a ceramic oscillator is obtained, Any means may be used. Further, for example, frequency change amount data such as the trimming table 18 a may be stored in the RAM 7 or the external storage device 8 instead of being stored in the controller 10. In addition, the detailed configuration and the detailed method shown in the embodiments can be appropriately changed without departing from the spirit of the invention.

1 電子機器
4 表示装置
5 GPSモジュール
6 プログラムROM
7 RAM
8 外部記憶装置
9 水晶振動子
10 コントローラ
11 CPU
12 撮像コントローラ
13 入出力コントローラ
14 シリアルコントローラ
15 RTCブロック
16 RC発振ブロック
17 周波数測定カウンタ
18 EEPROM
18a トリミングテーブル
19 メモリコントローラ
20 外部記憶コントローラ
R0〜R29 抵抗
C0〜C29 電気容量
161 第0〜第29RC発振回路
162 セレクタ
1 Electronic device 4 Display device 5 GPS module 6 Program ROM
7 RAM
8 External storage device 9 Crystal resonator 10 Controller 11 CPU
12 Imaging Controller 13 Input / Output Controller 14 Serial Controller 15 RTC Block 16 RC Oscillation Block 17 Frequency Measurement Counter 18 EEPROM
18a Trimming table 19 Memory controller 20 External storage controller R0 to R29 Resistor C0 to C29 Electric capacity 161 0th to 29th RC oscillation circuit 162 Selector

Claims (5)

RC回路の時定数を利用してクロック信号を生成するRC発振器と、
少なくとも前記RC回路の抵抗値または容量値の設定を切り替えて前記クロック信号の周波数を複数段階に変更可能な周波数変更手段と、
前記クロック信号よりも高精度な一定周波数のタイミング信号を生成するタイミング信号生成手段と、
前記タイミング信号に基づいて前記クロック信号の周波数のズレ量を計測するズレ量計測手段と、
前記周波数変更手段の設定を同一時期に複数通りに切り替えながら各切替状態で前記ズレ量計測手段により前記ズレ量を計測させて、前記周波数変更手段による前記周波数の複数段階の変更量に関する値をそれぞれ表わしたデータである周波数変更量データを作成する周波数変更量データ作成手段と、
前記周波数変更量データ作成手段により作成された前記周波数変更量データを記憶する記憶手段と、
前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正するクロック補正制御手段と、
を備え、
前記クロック補正制御手段は、
前記周波数変更量データに基づき、前記クロック信号の周波数を補正前の周波数から規定の周波数へ次第に近づいていくように、前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正することを特徴とする電子機器。
An RC oscillator that generates a clock signal using the time constant of the RC circuit;
A frequency changing means capable of changing the frequency of the clock signal in a plurality of stages by switching the setting of at least the resistance value or the capacitance value of the RC circuit;
Timing signal generating means for generating a timing signal having a constant frequency with higher accuracy than the clock signal;
A deviation amount measuring means for measuring a deviation amount of the frequency of the clock signal based on the timing signal;
While switching the setting of the frequency changing means in a plurality of ways at the same time, the deviation amount measuring means measures the deviation amount in each switching state, and values relating to the frequency changing amount of the frequency by the frequency changing means are respectively determined. Frequency change amount data creating means for creating frequency change amount data that is represented data;
Storage means for storing the frequency change amount data created by the frequency change amount data creating means ;
Clock correction control means for correcting the frequency of the clock signal by switching the setting of the frequency changing means;
With
The clock correction control means includes
Based on the frequency change amount data, the setting of the frequency changing unit is switched to correct the frequency of the clock signal so that the frequency of the clock signal gradually approaches the specified frequency from the frequency before correction. Electronic equipment.
前記周波数変更量データ作成手段は、
当該電子機器の起動時に前記周波数変更量データを作成することを特徴とする請求項記載の電子機器。
The frequency change amount data creating means includes:
The electronic apparatus according to claim 1, wherein the generating the frequency change amount data at the start of the electronic device.
前記クロック補正制御手段は、
前記ズレ量計測手段の計測結果に基づいて前記クロック信号の周波数が所定量以上ずれたと判別された場合に前記クロック信号の周波数の補正処理を開始し、
前記ズレ量計測手段の計測結果に基づいて前記クロック信号の周波数が規定値に近づいたことを判別することを特徴とする請求項又はに記載の電子機器。
The clock correction control means includes
When it is determined that the frequency of the clock signal has shifted by a predetermined amount or more based on the measurement result of the deviation amount measuring means, the correction processing of the frequency of the clock signal is started.
The electronic device according to claim 1 or 2, characterized in that determining that the frequency of the clock signal based on a measurement result of the displacement amount measuring means is close to the specified value.
前記クロック補正制御手段は、
前記周波数変更手段の設定を、直前の設定状態から前記周波数を一番少ないシフト量でズレを減らす方向にシフトさせる次の設定状態に逐次切り替えていくことで、前記クロック信号の周波数を補正することを特徴とする請求項1又は2に記載の電子機器。
The clock correction control means includes
The frequency of the clock signal is corrected by sequentially switching the setting of the frequency changing means from the immediately previous setting state to the next setting state in which the frequency is shifted in the direction of reducing the shift with the smallest shift amount. the electronic device according to claim 1 or 2, characterized in.
RC回路の時定数を利用してクロック信号を生成するRC発振器と、少なくとも前記RC回路の抵抗値または容量値の設定を切り替えて前記クロック信号の周波数を複数段階に変更可能な周波数変更手段と、前記周波数変更手段による前記周波数の複数段階の変更量をそれぞれ表わした周波数変更量データを記憶する記憶手段と、を備えた電子機器で前記クロック信号の周波数を補正するクロック補正方法であって、
前記電子機器には、前記クロック信号よりも高精度な一定周波数のタイミング信号を生成するタイミング信号生成手段が設けられ、
前記タイミング信号に基づいて前記クロック信号の周波数のズレ量を計測するズレ量計測ステップと、
前記周波数変更手段の設定を同一時期に複数通りに切り替えながら各切替状態で前記ズレ量計測ステップにより前記ズレ量を計測させて前記周波数変更量データを作成する周波数変更量データ作成ステップと、
前記周波数変更量データ作成ステップで作成された前記周波数変更量データを前記記憶手段に記憶させるデータ記憶ステップと、
前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正するクロック補正制御ステップと、
を含み、
当該クロック補正制御ステップは、
前記データ記憶ステップにより前記記憶手段に記憶された前記周波数変更量データに基づき、前記クロック信号の周波数を補正前の周波数から規定の周波数へ次第に近づいていくように、前記周波数変更手段の設定を切り替えて前記クロック信号の周波数を補正することを特徴とするクロック補正方法。
An RC oscillator that generates a clock signal using a time constant of the RC circuit, and a frequency changing unit that can change the setting of the resistance value or the capacitance value of the RC circuit and change the frequency of the clock signal in a plurality of stages. Storage means for storing frequency change amount data each representing a change amount in a plurality of stages of the frequency by the frequency change means, and a clock correction method for correcting the frequency of the clock signal in an electronic device comprising:
The electronic device is provided with timing signal generation means for generating a timing signal having a constant frequency with higher accuracy than the clock signal,
A deviation amount measuring step of measuring a deviation amount of the frequency of the clock signal based on the timing signal;
A frequency change amount data creation step of creating the frequency change amount data by measuring the shift amount by the shift amount measurement step in each switching state while switching the setting of the frequency changing means in a plurality of ways at the same time,
A data storage step of storing the frequency change amount data created in the frequency change amount data creation step in the storage means;
A clock correction control step of switching the setting of the frequency changing means to correct the frequency of the clock signal ;
Including
The clock correction control step includes
Based on the frequency change amount data stored in the storage means by the data storage step , the setting of the frequency change means is switched so that the frequency of the clock signal gradually approaches the specified frequency from the frequency before correction. And correcting the frequency of the clock signal.
JP2010236028A 2010-10-21 2010-10-21 Electronic device and clock correction method Expired - Fee Related JP5556579B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010236028A JP5556579B2 (en) 2010-10-21 2010-10-21 Electronic device and clock correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010236028A JP5556579B2 (en) 2010-10-21 2010-10-21 Electronic device and clock correction method

Publications (2)

Publication Number Publication Date
JP2012088979A JP2012088979A (en) 2012-05-10
JP5556579B2 true JP5556579B2 (en) 2014-07-23

Family

ID=46260525

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010236028A Expired - Fee Related JP5556579B2 (en) 2010-10-21 2010-10-21 Electronic device and clock correction method

Country Status (1)

Country Link
JP (1) JP5556579B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6371189B2 (en) * 2014-10-08 2018-08-08 ローム株式会社 Clock signal generation circuit
KR102410912B1 (en) * 2015-10-28 2022-06-20 삼성전자주식회사 Contactless communication devices, electronic systems having the same, and method of operating contactless communication devices
WO2018154876A1 (en) * 2017-02-24 2018-08-30 ソニーセミコンダクタソリューションズ株式会社 Clocking circuit, electronic apparatus, and clocking circuit control method
CN110233620B (en) * 2019-06-05 2023-09-22 长沙景美集成电路设计有限公司 Self-correction algorithm applied to clock system of USB slave device
JP7422066B2 (en) 2020-12-28 2024-01-25 ルネサスエレクトロニクス株式会社 semiconductor equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08139593A (en) * 1994-11-15 1996-05-31 Nec Corp Oscillation circuit
JPH10229327A (en) * 1997-02-17 1998-08-25 Sanyo Electric Co Ltd Frequency adjustment device for oscillation circuit
JP2006042214A (en) * 2004-07-29 2006-02-09 Nec Electronics Corp Semiconductor device and ic tag

Also Published As

Publication number Publication date
JP2012088979A (en) 2012-05-10

Similar Documents

Publication Publication Date Title
KR100687230B1 (en) Real time clock apparatus and the real time compensating method thereof
JP5556579B2 (en) Electronic device and clock correction method
US8823434B2 (en) Clock correction circuit and clock correction method
JP2001339244A (en) Temperature compensation type oscillator and its manufacturing method, and integrated circuit for temperature compensation type oscillation
US10416706B2 (en) Calibration unit for calibrating an oscillator, oscillator arrangement and method for calibrating an oscillator
JP2011182154A (en) Oscillation circuit and frequency-correcting oscillation circuit
JP2006309479A (en) Clock correction circuit, clock correction method, and microcontroller
JP2007078405A (en) Timing program of software timepiece
JP2009038432A (en) Temperature compensated oscillation circuit, real time clock device, and electronic apparatus
JPH1049251A (en) Microcontroller and its control method
CN113031428A (en) Real-time clock device and electronic apparatus
JP2017123628A (en) Circuit device, oscillator, electronic apparatus, and movable body
JP5291564B2 (en) Oscillator
JP5590174B2 (en) Temperature compensated oscillation circuit, real-time clock device and electronic equipment
CN115061515A (en) Temperature compensation method, circuit, chip and electronic equipment
JP5673044B2 (en) Temperature compensated piezoelectric oscillator, frequency correction system, frequency drift correction method
CN115951756A (en) Clock signal calibration device and method, electronic device, and storage medium
EP2153524A1 (en) Electronic device and method of correcting clock signal deviations in an electronic device
JP2006303764A (en) Temperature compensation method of temperature compensation oscillation circuit, temperature compensation oscillation circuit, piezoelectric device, and electronic apparatus
JP4036114B2 (en) Clock generation circuit
JP2011035487A (en) Oscillator device
JP2017033055A (en) Electronic control device, actuator, and sensor
CN117348686B (en) Clock signal temperature drift correction method, circuit, chip and electronic equipment
JP2016184366A (en) Timer correction device, timer correction method, and timer correction program
JP2006284192A (en) Thermometer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130903

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140219

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140225

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140307

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: 20140507

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140520

R150 Certificate of patent or registration of utility model

Ref document number: 5556579

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees