JP2008180612A - Timer circuit and program - Google Patents
Timer circuit and program Download PDFInfo
- Publication number
- JP2008180612A JP2008180612A JP2007014483A JP2007014483A JP2008180612A JP 2008180612 A JP2008180612 A JP 2008180612A JP 2007014483 A JP2007014483 A JP 2007014483A JP 2007014483 A JP2007014483 A JP 2007014483A JP 2008180612 A JP2008180612 A JP 2008180612A
- Authority
- JP
- Japan
- Prior art keywords
- counter
- count
- millisecond
- output
- circuit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は携帯装置のタイマ回路及びプログラムに関する。 The present invention relates to a timer circuit and a program for a portable device.
携帯電話等の各種携帯装置では種々の時間監視のためのタイマ回路を備えており,正確な時間を維持すると共に消費電力を軽減することが望まれている。なお,タイマ回路は処理装置(CPUとメモリ)とは別の回路(ハードウェア)的に設けられる場合もあるが,メモリの特定領域をタイマ領域として使用し,タイマ領域から読出した内容を共通の演算回路(処理装置)により計数してタイマ領域に格納する方法により実現する場合もある。 Various portable devices such as mobile phones are provided with timer circuits for various time monitoring, and it is desired to maintain accurate time and reduce power consumption. Note that the timer circuit may be provided as a circuit (hardware) separate from the processing device (CPU and memory). However, a specific area of the memory is used as the timer area, and the contents read from the timer area are shared. There may be a case where it is realized by a method of counting by an arithmetic circuit (processing device) and storing in the timer area.
図5は従来例1の構成を示す図であり,携帯電話で使用するタイマ回路の例である。図中,80は水晶発振子であり消費電力を低減するために32.768KHzの発振周波数を持つものを使用する場合が多い。81は10msec カウンタ,82は携帯電話の制御処理を行うCPU,83はCPU82に対して一定時間毎に時計表示またはアラームの出力を発生する時計回路である。
FIG. 5 is a diagram showing a configuration of the conventional example 1, which is an example of a timer circuit used in a mobile phone. In the figure,
図5の構成では,水晶発振子80の出力をカウンタ81でカウントし,10msecの内部で発生する信号をCPU82から与えられた設定値(n)だけカウントした時にCPU82に対して出力を発生し,時計回路83は1秒や1分毎の割り込み信号を発生する。
In the configuration of FIG. 5, the output of the
水晶発振子の32.768KHzの出力をカウントして1msecタイマを構成するには,33回カウントすることになるが,そのタイマの出力には0.7%の誤差が生じてしまう。例えば,カウンタ81を1秒(1000msec)のタイマとして使用して計時すると,0.7%の誤差は7msecに達し,1分を計時した場合には誤差が420msecになってしまい,他の正確な時計回路を用いたタイマとの誤差が大きくなる。
To configure the 1 msec timer by counting the 32.768 KHz output of the crystal oscillator, the count is 33 times. However, an error of 0.7% occurs in the output of the timer. For example, if the
具体的には,携帯電話において動画再生をするアプリケーションを実行する例の場合には,動画と音声とがずれてしまうなどさまざまな不都合が発生する。 Specifically, in the example of executing an application for playing back a moving image on a mobile phone, various inconveniences such as a shift between the moving image and sound occur.
なお,図5のカウンタ81は,誤差を低減するために10msecタイマとして使用しており,32.768KHzのクロックを327回カウントすることで10msecの経過を計測することができるが,それでも0.02msecの誤差が発生してしまうため,タイマを使うそれぞれの機能毎の処理で誤差を吸収する処理を行う必要がある。
Note that the
精度が要求されるタイマの場合,8〜10MHzの高周波の水晶発振子を使用してカウンタ回路で構成しているが,周波数が高いと消費電流が多くなるために携帯電話機等の電池を使用する機器では,常時使用することができないという問題があった。また,高周波の発振子を使用してもわずかだが誤差が発生して,その誤差が累積することにより長時間経過すると大きな誤差となる。その対策として,タイマを構成するカウンタのプリセットデータを周期動作で変更してタイマの計数値を可変にすることで,計時精度を向上させる方法が提案されている(特許文献1参照)。 In the case of a timer that requires accuracy, it is configured with a counter circuit using a high-frequency crystal oscillator of 8 to 10 MHz. However, since the current consumption increases when the frequency is high, a battery such as a mobile phone is used. There was a problem that the device could not be used at all times. Even if a high-frequency oscillator is used, a slight error occurs, and the error accumulates, resulting in a large error after a long time. As a countermeasure, there has been proposed a method for improving the timing accuracy by changing the preset data of the counter constituting the timer by a periodic operation to make the count value of the timer variable (see Patent Document 1).
図6は従来例2の構成であり,上記特許文献1の構成を含むものである。図中,80,82,83は上記図5と同じであり,80は32KHz(正確には32.768KHz)の水晶発振子,82はCPU,83は時計回路である。85は8MHzの水晶発振子,86は1msecの出力を発生する8ビットの2進カウンタ,87は2進カウンタからのキャリー信号(最上位桁からの桁上がり信号)の発生により2進カウンタにプリセットする可変の2進データを発生するプリセットデータ切り替え回路である。この回路の中の85〜87からなる構成が上記特許文献1により提案されたものであり,プリセットデータ切り替え回路87は2進カウンタ86からのキャリー信号をカウントして一定数をカウントする補助カウンタ870と2進カウンタ86に毎周期毎にプリセットされるプリセットデータ作成回路871を備える。2進カウンタ86からキャリー信号が発生するとプリセットデータ切り替え回路87の補助カウンタ870がカウントを行うと共に,キャリー信号が更新起動信号となってプリセットデータ作成回路871に設定されたデータと補助カウンタ870のカウント値(その一部ビット)とを2進カウンタ86にプリセット値として設定する。これにより,2進カウンタ86の更新周期がプリセット値を変えることにより計時精度を向上させる。
上記従来例2の構成(図6)によっても,32KHzで動作する時計回路83と水晶発振子80の発振精度と,8MHzの水晶発振子85とカウンタ86の発振精度との差により,誤差が発生するという問題を解決することができない。また,温度,電圧変動により時計用の水晶発振子80とカウンタ用の高周波数の水晶振動子85との影響度の差による誤差の累積を避けることはできない。そのため,精度や温度・電圧変動による誤差は,アプリケーション毎に補正処理を行う等の対策が必要であった。
Even in the configuration of the conventional example 2 (FIG. 6), an error occurs due to the difference between the oscillation accuracy of the
また,従来例2の構成では高い周波数(8MHz)の水晶発振子を使用しているため,消費電力が多く,電池を使用する携帯電話機等の携帯装置に適用することに問題がある。 Further, since the configuration of Conventional Example 2 uses a high-frequency (8 MHz) crystal oscillator, it consumes a lot of power and has a problem in application to a portable device such as a cellular phone using a battery.
本発明は低周波数(32KHz)の水晶発振子を使用しても長時間の計時を行っても誤差の累積を防ぐことができる携帯装置のタイマ回路及びプログラムを提供することを目的とする。 An object of the present invention is to provide a timer circuit and a program for a portable device that can prevent accumulation of errors regardless of whether a low-frequency (32 KHz) crystal oscillator is used or time is measured for a long time.
図1は本発明の原理構成を示す図である。図中,1は低周波数(32.768KHz)の水晶発振子,2は水晶発振子1からのクロックを「32」または「33」の2つの容量(数値)の何れか一方の数値だけカウントしてほぼ1ミリ秒毎に出力を発生する第1のカウンタ,20は第1のカウンタ2のカウント数を前記2つの数値の何れにするかを切替えて発生する切替回路,3は第1のカウンタ2から発生するほぼ1ミリ秒毎の信号をカウントして「m」(m=125(ミリ秒),250(ミリ秒),375(ミリ秒),500(ミリ秒)…等の複数の中の一つの値が選択される)毎に出力を発生する第2のカウンタ,30は誤差調整のために第2のカウンタ3のカウント値が「m」の値に達するまでの分散した多数の設定値との一致を検出すると前記切替回路20に対して切替えを指示する調整判別回路,30aは設定値保持部,4は第2のカウンタ3の出力が入力される携帯電話等の処理機能を実行する処理装置,5は水晶発振子1により駆動されて,1秒や1分毎等の一定周期で処理装置4に対して割込み信号を発生する時計回路である。
FIG. 1 is a diagram showing a principle configuration of the present invention. In the figure, 1 is a low-frequency (32.768 KHz) crystal oscillator, 2 is a clock from the
水晶発振子1から出力された低周波数(32.768KHz)のクロック信号は第1のカウンタ2においてカウントされ,切替回路20においてその時の切替え状態に対応して設定されたカウント数に達すると出力を発生して第2のカウンタ3に供給する。第1のカウンタ2のカウント容量は調整判別回路30からの判定出力により切替えられる切替回路20の出力により「32」または「33」の何れかの容量に切替えられる。この例では,通常は「33」のカウント容量であり,調整判別回路30からの判定出力により切替回路20は「32」のカウント容量に切替える。調整判別回路30には第2のカウンタ3のカウント値が常時入力される一方,第2のカウンタ3のカウント値の1〜mの間に発生する数値の中の分散した多数の数値が設定された設定値保持部30aの何れか一つの数値と,第2のカウンタ3のカウント値が一致すると,一致を検出する毎に切替え信号を発生し,切替回路20はカウント数「32」をカウントするよう切替えられる。設定値保持部30aに保持するカウント値としては,m=125の場合は「5」,「9」,「14」,「18」,「22」,「26」,「30」,「35」,「39」,「44」,「48」,「52」,……,「120」,「125」であり,m=250の場合は,「5」,「9」,「14」,……,「120」,「125」,「130」,「134」,「139」……,「250」の数値であり,m=375の場合,「5」,「9」,……,「125」,「130」,「134」,……,「250」,「255」,「259」,……「375」の数値が設定される。
The low-frequency (32.768 KHz) clock signal output from the
これにより,m=125の場合は第2のカウンタ3は,1から125のカウント値をカウントするうちの上記の各カウントをした時点で切替え信号を通知して,切替回路20は切替え信号を受ける毎に第1のカウンタ2を「32」のカウント容量に切替える。
As a result, when m = 125, the
水晶発振子1の周波数誤差による計時誤差は最大月差±15秒とすると,1分間の誤差は最大±347.2マイクロ秒となる。この誤差を調節するために,時計回路で1分間を計時するために,通常であれば毎秒32768カウントする所を数秒に1回,+1して32769カウントしたり,逆に−1して32767カウントして調整する機能を備えるのが一般である。それに合わせて,1msを計時する場合に,32回カウントを行うところを33回カウントしたり,33回カウントするところを32回カウントに変更することにより,32.768KHz水晶発振子の周波数誤差を調節し,時計誤差を吸収して正しい時計計数を行うことも可能である。
If the time error due to the frequency error of the
第2のカウンタ3の出力は直接処理装置4に入力する場合や,図示されないカウンタでカウントされて1秒毎や1分毎に処理装置4に入力され,それら入力信号は,水晶発振子1のクロックに基づいて時計回路5から1秒,1分等の一定時間毎にCPU等の処理装置4へ供給される割込み信号に対する時間差を縮小することができる。また,第2のカウンタ(ミリ秒の出力のカウンタ)3はカウント容量がm(ミリ秒)であるが,その出力を図示省略されたカウンタでカウントすることにより,例えば,1秒カウンタを構成することができる。その場合には第1のカウンタ2を「32」に切替える時点を,+125だけでなく,+250,+375,・・・+875となる。
The output of the
第2のカウンタ3は,「m」のカウント毎に出力を発生し,その出力を図示省略された他のカウンタでカウント(または処理装置4内のカウント動作によるカウント)する毎に例えば,10秒や,1分という一定時間周期で処理装置4に出力を発生するが,第2のカウンタ3には長い時間周期で誤差が累積する。そのような長い時間周期で生じる誤差を調整する必要がある場合,処理装置4から一定時間長毎に第2のカウンタ3に対して指示信号4aを出力する。これを受けた第2のカウンタ3はそのカウント容量を「125」ではなく,+1(126)または−1(124)の値に設定する。これにより第2のカウンタ3から発生する出力が一定の長い時間周期内で補正することができる。
The
本発明により第1のカウンタのカウント容量を分散したミリ秒単位で切替えることにより最大でも1ミリ秒について,1ms−1/32768 ×32ms=0.0234msの誤差による時間計測が可能となり,且つ,連続測定したり,長時間の計時を行っても誤差の累積を防ぐことが可能となる。また,ある程度長い時間周期(10秒とか,1分等)毎に第2のカウンタ3のカウント容量を1だけ加減することで誤差の累積を防ぐことができる。
By switching the count capacity of the first counter in units of distributed milliseconds according to the present invention, it is possible to measure time with an error of 1 ms – 1/32768 × 32 ms = 0.0234 ms for a maximum of 1 millisecond and continuous measurement. It is possible to prevent errors from accumulating even when measuring for a long time. Further, accumulation of errors can be prevented by adding or subtracting the count capacity of the
本発明を携帯電話機等の携帯装置の制御装置を構成するコンピュータ(CPU及び記憶装置を含む)を使用した実施例の構成を説明する。図2はCPU及び記憶装置の特定領域を使用した実施例の構成を示す。図中,6はプログラムのメモリを含むCPU,60は水晶発振子,7はタイマ用の複数の領域(レジスタ)を含むメモリ,70〜72はメモリ7内に設けられた領域であり,70は水晶発振子(32.768KHz)の出力を設定された数値(「32」または「33」)のカウントを行う1ミリ秒カウンタ(図1の第1のカウンタ2に対応)の領域,71は1ミリ秒カウンタ70が設定された数値(「32」または「33」)をカウントしたことを検出する毎にカウントアップを行うmミリ秒カウンタ(図1の第2のカウンタ3に対応)の領域,72はmミリ秒×nの周期毎にmミリ秒カウンタ71の値を+1または−1する調整を行うための周期n(例えばn=80の場合,80×125ミリ秒=10秒の周期となる)をカウントするための誤差調整カウンタの領域,73はカウンタの領域70のカウント値を通常の「33」ではなく「32」に変更する指示を発生するための分散されたカウント値(mミリ秒カウンタの値)が多数設定された設定部の領域である。
The configuration of an embodiment in which the present invention uses a computer (including a CPU and a storage device) constituting a control device for a portable device such as a cellular phone will be described. FIG. 2 shows a configuration of an embodiment using specific areas of the CPU and the storage device. In the figure, 6 is a CPU including a program memory, 60 is a crystal oscillator, 7 is a memory including a plurality of areas (registers) for timers, 70 to 72 are areas provided in the
なお,設定部73には,1ミリ秒カウンタ70を「32回」に設定するためのmミリ秒カウンタ71のカウント値として,m=125の場合は「5」,「9」,「14」,「18」,「22」,「26」,………,「125」の各数値が設定される。また,mミリ秒カウンタ71のmは125だけでなく,m=250,375,500,725,……という値を設定することができ,その場合には設定部73には,「5」,「9」,……,「125」だけでなく,カウンタ71のカウント値を越えない範囲で,「125+5=129」,「125+9=134」,…「125+125=250」,……等の各数値を設定することができる。
Note that the setting
図3,図4は実施例のフローチャート(その1),(その2)である。なお,このフローチャートは,図2に示すmミリ秒カウンタ71は125ミリ秒カウンタとして使用した例であり,125ミリ秒カウンタ71として説明する。この場合,設定部73には上記したように125を越えない分散した複数の値である「5」,「9」,「14」,………,「125」が設定される。 3 and 4 are flowcharts (part 1) and (part 2) of the embodiment. This flowchart is an example in which the m millisecond counter 71 shown in FIG. 2 is used as a 125 millisecond counter, and will be described as a 125 millisecond counter 71. In this case, as described above, “5”, “9”, “14”,..., “125”, which are a plurality of dispersed values not exceeding 125 as described above, are set.
動作を開始すると,誤調整カウンタ(図2の72)を0回に設定し(図3のS1),1ミリ秒カウンタ(図2の70)の回数(カウント容量)を33回に設定し(図3のS2),125ミリ秒カウンタ(図2の71)を0に設定する(同S3)。次に1ミリ秒カウンタ70のカウンタ回数は「32」であるか判別する(図3のS4)。この判定は,1/32768秒毎に実行され,その時の1ミリ秒カウンタ70に対して設定されたカウント値が,「32回」か「33回」の何れであるかを判定する(図3のS4)。この設定は後述するステップS11またはS12で行われ,判定に応じて1ミリ秒カウンタ70を32回カウントするよう動作させるか(図3のS5),33回カウントするよう動作させる(同S6)。
When the operation is started, the misadjustment counter (72 in FIG. 2) is set to 0 (S1 in FIG. 3), and the number of 1 millisecond counters (70 in FIG. 2) (count capacity) is set to 33 ( The S2) and 125 millisecond counter (71 in FIG. 2) is set to 0 (S3 in FIG. 3). Next, it is determined whether the number of counters of the 1
この後,1ミリ秒カウンタ70が上記で判定した設定回数(「32」または「33」)にカウントアップしたか判別し(図3のS7),設定回数にカウントアップしないとステップS4に戻り,設定回数にカウントアップした場合は125ミリ秒カウンタ71をカウントアップする(同S8)。次にカウンタ調整はあるか判別する(図3のS9)。このカウンタ調整は,125ミリ秒カウンタ71に対して予め設定された一定時間長に対して発生する誤差を調整する必要があるかの判定を行うもので,誤差調整の有無はCPU(図2の6)からの指示の有無により決まる。調整有りである場合は125ミリ秒×mの中のmの数値(例えば,m=80の場合は125ミリ秒×80=10秒に一回の調整)を設定した領域を設け,調整無しの場合は数値が設定されないようにしておく。誤差調整が有ると判定されると,図4の処理に移行する(後述する)。
Thereafter, it is determined whether or not the 1-
125ミリ秒カウンタの調整がない場合は,現在の125ミリ秒カウンタの値が1ミリ秒の補正を行うべき設定部(図2の73)の数値の一つに該当(一致)するカウントアップであるか判別する(図3のS10)。設定部の数値の一つと一致した場合は,1ミリ秒カウンタ70を32回カウントに設定し(図3のS11),一致しないと33回カウントに設定する(同S12)。この後,125ミリ秒カウンタが125に達したか判別し(図3のS13),達した場合は125ミリ秒カウンタに0を設定し(同S14),カウンタ調整があるか判別する(図3のS15)。この判別は上記ステップS9と同様であり,調整有りの場合は誤差調整カウンタ(図2の72)のカウントアップを行い(図3のS16),カウンタ調整がない時及び誤差調整カウントアップが行われた後,タイムアップか判別する(同S17)。この場合のタイムアップは,予め1秒とか,1分といった計測すべきタイムが予め決められている場合に,その決められた時間に達したかを判別する。達しない場合はステップS4に戻り,達した場合はタイムアップ処理を実行する(同S18)。タイムアップ処理は決められた時間に達した時に実行するよう決められた処理(割り込みや,出力等)を実行するものである。
If the 125 millisecond counter is not adjusted, the current 125 millisecond counter value corresponds to one of the numerical values of the setting unit (73 in FIG. 2) to be corrected by 1 millisecond. It is determined whether it is present (S10 in FIG. 3). If it matches one of the numerical values in the setting section, the 1
図4はカウンタ調整有りの場合のフローチャートであり,上記図3のステップS9でイエスと判定された場合に実行される。最初に誤差調整カウンタ=設定値になったか判別する(図4のS19)。例えば,設定値m=80の場合は誤差調整カウンタ(図2の72)が「80」になったか判別し,「80」になった場合は「+1カウント」か「−1カウント」かを判別する(図4のS20)。この場合,「+1」か「−1」にするかは,予め当該タイマ回路の特性に応じて予め設定されており,その設定を判別することにより決められる。+1カウントを実行した場合は,125ミリ秒カウンタ71が「125」になったか判別し(図4のS21),125にならない場合は図3のステップS10に移行し,「125」になった場合は,1ミリ秒カウンタ70を「33」カウントに設定して(同S22),ステップS25に移行する。
FIG. 4 is a flowchart in the case of counter adjustment, and is executed when it is determined as YES in step S9 of FIG. First, it is determined whether the error adjustment counter is equal to the set value (S19 in FIG. 4). For example, when the set value m = 80, it is determined whether the error adjustment counter (72 in FIG. 2) is “80”, and when it is “80”, it is determined whether it is “+1 count” or “−1 count”. (S20 in FIG. 4). In this case, whether “+1” or “−1” is set in advance according to the characteristics of the timer circuit, and is determined by determining the setting. When the +1 count is executed, it is determined whether the 125 millisecond counter 71 has become “125” (S21 in FIG. 4). If not 125, the process proceeds to step S10 in FIG. Sets the 1
ステップS20で「−1」カウントと判定されて「−1」を実行した時125ミリ秒カウンタ71が「124」になったか判定し(図4のS23),「124」であると判定されると1ミリ秒カウンタ70を「32」カウントに設定し(同S24),次に誤差調整カウンタ(図2の72)に0を設定し(同S25),上記図3のステップS13に移行する。上記ステップS19で,誤差調整カウンタ=設定値ではないと判定された場合及び,ステップS23において125ミリ秒カウンタ71が「124」でないと判定された場合は,図3のステップS10に移行する。
When it is determined that the count is “−1” in step S20 and “−1” is executed, it is determined whether the 125 millisecond counter 71 has become “124” (S23 in FIG. 4), and is determined to be “124”. The 1-
水晶発振子の周波数誤差による計時誤差は最大月差±15秒とすると,1分間の誤差は最大±347μ秒となる。この誤差を調節するために,計時回路で1分間を計時するために,通常であれば毎秒32768カウントするところを,数秒に1回,+して32768カウントしたり,逆に−1して32767カウントして調整する機能が一般に行われる。それに合わせて,1ミリ秒を計時する場合に,32回カウントを行うところを33回カウントしたり,33回カウントするところを32回カウントに変更することにより,32.768KHz水晶発振子の周波数誤差を調節し,時計誤差を吸収して正しい時計計数を行うことも可能である。
If the time error due to the frequency error of the crystal oscillator is a maximum monthly difference of ± 15 seconds, the error per minute is a maximum of ± 347 μs. In order to adjust this error, in order to measure one minute by the time measuring circuit, the normal count of 32768 is performed once every few seconds, and is incremented once every several seconds to +32768, or vice versa. The function of counting and adjusting is generally performed. Correspondingly, when counting 1 millisecond, the frequency error of the 32.768 KHz crystal oscillator is changed by counting the number of
(付記1) 低周波数の水晶発振子の出力をカウントしてほぼ1ミリ秒毎の出力を発生する第1のカウンタと,前記第1のカウンタの出力を所定数(m)カウントしてmミリ秒毎の出力を発生する第2のカウンタと,前記第2のカウンタの出力を処理装置に供給するタイマ回路において,前記第1のカウンタは「32」または「33」の2つのカウント容量の一方でカウントするよう切替える切替回路と,前記第2のカウンタのカウント値が前記第2カウンタのカウント容量(m)以下の分散した複数の予め設定した値と一致するか判別して一致すると前記切替回路に切替指示を発生する調整判別回路とを設け,前記調整判別回路からの切替指示により前記第1のカウンタのカウント容量を切替えることにより,時計回路との誤差を補正した信号を前記第2のカウンタから出力することを特徴とする携帯装置用のタイマ回路。 (Supplementary Note 1) A first counter that counts the output of a low-frequency crystal oscillator and generates an output every 1 millisecond, and counts a predetermined number (m) of the output of the first counter to m millimeter In a second counter that generates an output per second and a timer circuit that supplies the output of the second counter to the processing device, the first counter is one of two count capacities of “32” or “33”. A switching circuit that switches to count at the same time, and the switching circuit that determines if the count value of the second counter matches a plurality of dispersed preset values that are less than or equal to the count capacity (m) of the second counter. And an adjustment discriminating circuit for generating a switching instruction, and an error from the clock circuit is corrected by switching the count capacity of the first counter according to the switching instruction from the adjustment discriminating circuit. A timer circuit for a portable device, wherein the output from said second counter to issue.
(付記2) 付記1において,前記処理装置は予め設定された一定時間長毎に前記第2のカウンタのカウント容量を1だけアップまたはダウンさせる指示信号を発生し,前記第2のカウンタは前記指示信号によりカウント容量を変更することを特徴とする携帯装置用のタイマ回路。
(Supplementary note 2) In
(付記3) 付記1において,前記第2のカウンタの出力を予め設定した回数だけカウントする別のカウンタを設け,前記別のカウンタの出力を前記処理装置に供給し,前記処理装置は前記別のカウンタの出力に基づいて一定周期毎に前記第2のカウンタのカウント値を調整する指示を発生することを特徴とする携帯装置用のタイマ回路。
(Supplementary Note 3) In
(付記4) 携帯装置の制御を行うコンピュータを,低周波数の水晶発振子の出力の発生に応じてメモリ内の1ミリ秒カウンタ領域の数値をカウントアップする手段と,前記1ミリ秒カウンタが「32」または「33」の2つのカウント容量の何れに設定されているか判別し,前記カウントアップした値が前記判別したカウント容量に達したか判別して,達した場合は前記メモリ内のmミリ秒カウンタ領域の数値をカウントアップする手段と,前記mミリ秒カウンタ領域の数値をカウントアップした時に,前記メモリ内の設定領域に予め設定された分散した多数の値と一致するか判別し,一致すると前記1ミリ秒カウンタ領域のカウント容量を「32」に設定し,一致しないと「33」に設定して前記mミリ秒カウンタ領域の数値がカウント容量に達したか判定する手段と,前記mミリ秒カウンタ領域の数値がカウント容量に達すると,タイムアップ処理を行う手段と,して機能させることを特徴とするプログラム。 (Supplementary Note 4) A computer that controls the portable device is configured to count a value in a 1 millisecond counter area in the memory in response to generation of an output of a low-frequency crystal oscillator, and the 1 millisecond counter It is determined which of the two count capacities “32” or “33” is set, and whether the counted-up value has reached the determined count capacity is determined. A means for counting up the numerical value in the second counter area, and when counting up the numerical value in the m millisecond counter area, it is determined whether or not it matches a number of dispersed values preset in the setting area in the memory. Then, the count capacity of the 1 millisecond counter area is set to “32”, and if it does not match, it is set to “33” and the numerical value of the m millisecond counter area is counted. Means for determining has been reached on the amount, the the value of m millisecond counter area reaches the count capacity, program characterized thereby and means for performing a time-up process, to function.
(付記5) 付記4において,前記mミリ秒カウンタ領域の数値がカウント容量に達したか判定する手段を,カウント容量に達したことを検出すると前記メモリ内に備えた誤差調整カウンタ領域の数値をカウントアップする手段として機能させ,前記mミリ秒カウンタ領域の数値をカウントアップする手段を,更に前記誤差調整カウンタ領域の数値が予め設定された設定値に達したことを検出すると,前記mミリ秒カウンタ領域の数値を1だけアップまたはダウンさせて,前記誤差調整カウンタ領域の数値を0にする手段として機能させる,ことを特徴とするプログラム。 (Supplementary note 5) In the supplementary note 4, when the means for determining whether the numerical value in the m millisecond counter area has reached the count capacity is detected, the numerical value in the error adjustment counter area provided in the memory is detected. A function for counting up, and a means for counting up the numerical value of the m millisecond counter area, and further detecting that the numerical value of the error adjustment counter area has reached a preset value; A program for increasing or decreasing a value in a counter area by 1 to function as means for setting a value in an error adjustment counter area to 0.
1 低周波数(32.768KHz)の水晶発振子
2 第1のカウンタ
20 切替回路
3 第2のカウンタ
30 調整判別回路
30a 設定値保持部
4 処理装置
5 時計回路
DESCRIPTION OF
Claims (3)
前記第1のカウンタは「32」または「33」の2つのカウント容量の一方でカウントするよう切替える切替回路と,
前記第2のカウンタのカウント値が前記第2カウンタのカウント容量(m)以下の分散した複数の予め設定した値と一致するか判別して一致すると前記切替回路に切替指示を発生する調整判別回路とを設け,
前記調整判別回路からの切替指示により前記第1のカウンタのカウント容量を切替えることにより,時計回路との誤差を補正した信号を前記第2のカウンタから出力することを特徴とする携帯装置用のタイマ回路。 A first counter that counts the output of a low-frequency crystal oscillator and generates an output every 1 millisecond, and outputs every m milliseconds by counting a predetermined number (m) of the output of the first counter And a timer circuit for supplying the output of the second counter to the processing device,
The first counter is a switching circuit for switching to count one of the two count capacities of “32” or “33”;
An adjustment discriminating circuit for discriminating whether or not the count value of the second counter coincides with a plurality of dispersed preset values less than or equal to the count capacity (m) of the second counter and generating a switching instruction to the switching circuit And
A timer for a portable device, wherein a signal corrected for an error with respect to a clock circuit is output from the second counter by switching a count capacity of the first counter according to a switching instruction from the adjustment determination circuit. circuit.
前記処理装置は予め設定された一定時間長毎に前記第2のカウンタのカウント容量を1だけアップまたはダウンさせる指示信号を発生し,
前記第2のカウンタは前記指示信号によりカウント容量を変更することを特徴とする携帯装置用のタイマ回路。 In claim 1,
The processing device generates an instruction signal for increasing or decreasing the count capacity of the second counter by 1 every predetermined time length,
The timer circuit for a portable device, wherein the second counter changes a count capacity according to the instruction signal.
低周波数の水晶発振子の出力の発生に応じてメモリ内の1ミリ秒カウンタ領域の数値をカウントアップする手段と,
前記1ミリ秒カウンタが「32」または「33」の2つのカウント容量の何れに設定されているか判別し,前記カウントアップした値が前記判別したカウント容量に達したか判別して,達した場合は前記メモリ内のmミリ秒カウンタ領域の数値をカウントアップする手段と,
前記mミリ秒カウンタ領域の数値をカウントップした時に,前記メモリ内の設定領域に予め設定された分散した多数の値と一致するか判別し,一致すると前記1ミリ秒カウンタ領域のカウント容量を「32」に設定し,一致しないと「33」に設定して前記mミリ秒カウンタ領域の数値がカウント容量に達したか判定する手段と,
前記mミリ秒カウンタ領域の数値がカウント容量に達すると,タイムアップ処理を行う手段と,
して機能させることを特徴とするプログラム。 A computer that controls the mobile device,
Means for counting up the value of the 1 millisecond counter area in the memory in response to the generation of the output of the low frequency crystal oscillator;
When determining whether the 1 millisecond counter is set to two count capacities of “32” or “33”, determining whether the counted up value has reached the determined count capacities, and reaching Means for counting up the numerical value of the m millisecond counter area in the memory;
When the numerical value in the m millisecond counter area is counted up, it is determined whether or not it matches a large number of dispersed values preset in the setting area in the memory. Means for setting whether the numerical value in the m millisecond counter area has reached the count capacity,
Means for performing time-up processing when the numerical value of the m millisecond counter area reaches the count capacity;
A program characterized by making it function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007014483A JP2008180612A (en) | 2007-01-25 | 2007-01-25 | Timer circuit and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007014483A JP2008180612A (en) | 2007-01-25 | 2007-01-25 | Timer circuit and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008180612A true JP2008180612A (en) | 2008-08-07 |
Family
ID=39724621
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007014483A Pending JP2008180612A (en) | 2007-01-25 | 2007-01-25 | Timer circuit and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008180612A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010117214A (en) * | 2008-11-12 | 2010-05-27 | Shimadzu Corp | Detector for chromatograph and method for adjusting the same |
JP2013170853A (en) * | 2012-02-17 | 2013-09-02 | Citizen Holdings Co Ltd | Electronic clock |
JP2016091479A (en) * | 2014-11-11 | 2016-05-23 | 株式会社明電舎 | Counter unit |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS53164A (en) * | 1976-06-24 | 1978-01-05 | Casio Comput Co Ltd | Electronic clock |
JPS53116761U (en) * | 1977-02-22 | 1978-09-16 | ||
JPS5589789A (en) * | 1978-12-28 | 1980-07-07 | Seiko Instr & Electronics Ltd | Electronic watch |
-
2007
- 2007-01-25 JP JP2007014483A patent/JP2008180612A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS53164A (en) * | 1976-06-24 | 1978-01-05 | Casio Comput Co Ltd | Electronic clock |
JPS53116761U (en) * | 1977-02-22 | 1978-09-16 | ||
JPS5589789A (en) * | 1978-12-28 | 1980-07-07 | Seiko Instr & Electronics Ltd | Electronic watch |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010117214A (en) * | 2008-11-12 | 2010-05-27 | Shimadzu Corp | Detector for chromatograph and method for adjusting the same |
US8281639B2 (en) | 2008-11-12 | 2012-10-09 | Shimadzu Corporation | Method for adjusting the detector of a chromatograph |
JP2013170853A (en) * | 2012-02-17 | 2013-09-02 | Citizen Holdings Co Ltd | Electronic clock |
JP2016091479A (en) * | 2014-11-11 | 2016-05-23 | 株式会社明電舎 | Counter unit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0683443B1 (en) | Time correction of an electronic clock | |
RU2579716C2 (en) | Correction of low-accuracy clock generator | |
US20080114565A1 (en) | Pedometer | |
WO2002098023A1 (en) | Timing control device and timing control method | |
JP2008180612A (en) | Timer circuit and program | |
WO2006106917A1 (en) | Timer circuit, mobile communication terminal using the same, and electronic device using the same | |
US11385600B2 (en) | Timer measurement device, electronic timepiece, timer measurement method, and non-transitory computer readable storage medium storing program | |
JP2004288087A (en) | Information processor | |
JP2000315121A (en) | Rtc circuit | |
JP2002228778A (en) | Real-time clock and clocking circuit | |
JP2005011194A (en) | Radio data collecting device | |
KR101128613B1 (en) | Quick Start Crystal oscillator and calibration method thereof | |
JP2002311173A (en) | Electronic clock, method and program for correcting time error of the same | |
JP6102618B2 (en) | Periodic noise elimination A / D converter | |
US5712832A (en) | Electronic clock and time setting method | |
JP2006053008A (en) | Timepiece and timepiece error adjustment method | |
JP2016184366A (en) | Timer correction device, timer correction method, and timer correction program | |
JP3990331B2 (en) | Time correction control circuit, time correction control method, and time correction control program | |
JPH11183660A (en) | Portable information processing device with built-in watch | |
JP4501823B2 (en) | Interrupt signal control device, interrupt signal control method, and interrupt signal control program | |
JPH0587958A (en) | Multifunction electronic timekeeper | |
JP2002091610A (en) | Electronic equipment | |
KR950015036B1 (en) | Automatic time control method | |
JPH0611664Y2 (en) | Electronics | |
JPH064481A (en) | Electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20091016 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110829 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110906 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20120403 |