JP2010085124A - Time correction device - Google Patents

Time correction device Download PDF

Info

Publication number
JP2010085124A
JP2010085124A JP2008251742A JP2008251742A JP2010085124A JP 2010085124 A JP2010085124 A JP 2010085124A JP 2008251742 A JP2008251742 A JP 2008251742A JP 2008251742 A JP2008251742 A JP 2008251742A JP 2010085124 A JP2010085124 A JP 2010085124A
Authority
JP
Japan
Prior art keywords
time
clock
correction
timer
time correction
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.)
Withdrawn
Application number
JP2008251742A
Other languages
Japanese (ja)
Inventor
Koichi Eguchi
巧一 江口
Keitoku Konno
敬徳 今野
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP2008251742A priority Critical patent/JP2010085124A/en
Publication of JP2010085124A publication Critical patent/JP2010085124A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Electric Clocks (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a built-in timepiece which does not place a heavy burden on a CPU and can keep accurate time without variationss caused by ambient temperature. <P>SOLUTION: The time correction device for performing time correction for a time display device which writes a time measured by a real time clock 3 into a timepiece means 5 within an OS 2 and displays its output on an externally connected monitor 4. The time correction device includes a power management timer 7 which operates independently of a main CPU and a time correction means 8 which calculates a correction value with respect to a real time of the timepiece means 5 using a clock generated by the power management timer 7 and inputs the correction value into the real time clock 3 at regular intervals. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、パーソナルコンピュータなどの情報処理装置に使用される内蔵時計の時刻誤差を補正する時刻補正装置に関する。   The present invention relates to a time correction device that corrects a time error of a built-in clock used in an information processing device such as a personal computer.

従来、パーソナルコンピュータなどの情報処理装置に使用される内蔵時計は、水晶発振器で発振した基本発振周波数を分周器で分周し、分周したクロック信号を用いてパーソナルコンピュータの内蔵時計としている。   Conventionally, a built-in timepiece used in an information processing apparatus such as a personal computer divides a basic oscillation frequency oscillated by a crystal oscillator by a frequency divider and uses the divided clock signal as a built-in timepiece of the personal computer.

以下はマイクロコンピュータではあるが、これに内蔵される時計の時刻補正装置について説明する。図7は従来のマイクロコンピュータの内蔵時計の時刻補正装置を示すブロック図である。まず水晶発振器51からの発振周波数を分周器52で分周する。基準カウント部54では、前記分周器52からタイマ53へ出力される信号のクロック周期で、単位時間を除算することにより基準カウント数を求める。タイマ割込みカウント部55では、前記クロック周期で、タイマ53に設定されたタイマ割込み時間を除算することにより、割込みカウント数を求め、これをタイマ割込み発生毎にこの割込みカウント数を順次加算して、加算割込みカウント数を求める。   Although the following is a microcomputer, a time correction device for a clock incorporated in the microcomputer will be described. FIG. 7 is a block diagram showing a time correction device for a built-in clock of a conventional microcomputer. First, the oscillation frequency from the crystal oscillator 51 is divided by the frequency divider 52. The reference count unit 54 obtains the reference count number by dividing the unit time by the clock period of the signal output from the frequency divider 52 to the timer 53. The timer interrupt count unit 55 obtains an interrupt count number by dividing the timer interrupt time set in the timer 53 by the clock cycle, and sequentially adds this interrupt count number every time a timer interrupt occurs. Find the added interrupt count.

誤差補正部56では、前記加算割込みカウント数が前記基準カウント数を超えた場合に、前記加算割込みカウント数から前記基準カウント数を減算し、余剰カウント数を次回のタイマ割込み発生時における加算割込みカウント数の初期値とする。これにより、水晶発振器51で発振した発振周波数を分周器52で分周した際に発生する時刻誤差を補正する(特開平10‐20052号公報(特許文献1)参照)。   The error correction unit 56 subtracts the reference count number from the addition interrupt count number when the addition interrupt count number exceeds the reference count number, and calculates the surplus count number at the next timer interrupt occurrence. The initial value of the number. As a result, a time error generated when the oscillation frequency oscillated by the crystal oscillator 51 is divided by the frequency divider 52 is corrected (see Japanese Patent Laid-Open No. 10-20052 (Patent Document 1)).

次に、パーソナルコンピュータの内蔵時計について説明する。図8は従来のパーソナルコンピュータの内蔵時計の構成図を示すブロック図である。パーソナルコンピュータ61の内部にはオペレーティングシステム62と、リアルタイムクロック63を搭載している。パーソナルコンピュータ61は、前記リアルタイムクロック63で計数した時刻を前記オペレーティングシステム62内部の時計手段65に書込む。そして、時計手段65の出力は、パーソナルコンピュータ61に接続されたモニタ64に送られ、時計表示手段66に表示される。   Next, a built-in clock of the personal computer will be described. FIG. 8 is a block diagram showing the configuration of a built-in clock of a conventional personal computer. An operating system 62 and a real time clock 63 are mounted inside the personal computer 61. The personal computer 61 writes the time counted by the real time clock 63 into the clock means 65 inside the operating system 62. The output of the clock means 65 is sent to the monitor 64 connected to the personal computer 61 and displayed on the clock display means 66.

リアルタイムクロック63は水晶振動子のクロックを以って時刻を計数する。リアルタイムクロック63はパーソナルコンピュータ61の電源とは直接接続されておらず、ボタン型電池などでパーソナルコンピュータ61とは別個で給電する手段を有しているため、パーソナルコンピュータ61の電源がOFFの状態でも時刻計数の処理を続ける。
特開平10‐20052号公報
The real-time clock 63 counts the time with the crystal oscillator clock. Since the real-time clock 63 is not directly connected to the power source of the personal computer 61 and has means for supplying power separately from the personal computer 61 with a button-type battery or the like, even when the power source of the personal computer 61 is OFF. Continue time counting.
Japanese Patent Laid-Open No. 10-20052

しかしながら、図7に示す従来の時刻補正装置では、時刻補正の際にタイマ割込みを発生させることになる。よって、他の処理などで一時的にCPUに高い負荷が掛かっている場合、タイマ割込みを頻繁に発生させるため、CPUに更に高い負荷を掛けることになるという問題があった。   However, in the conventional time correction device shown in FIG. 7, a timer interrupt is generated when the time is corrected. Therefore, when a high load is temporarily applied to the CPU due to other processing or the like, there is a problem that a higher load is applied to the CPU because timer interrupts are frequently generated.

一方、図8に示す従来のパーソナルコンピュータ61の内蔵時計65に関しては、リアルタイムクロック63は前述の如くボタン型電池などパーソナルコンピュータ61とは別個の給電手段を有している。しかしながら、リアルタイムクロック63のクロック精度は、周囲の気温等により大きくばらつきが出るため、常時正確な時刻を刻めないという欠点があった。   On the other hand, with respect to the built-in clock 65 of the conventional personal computer 61 shown in FIG. 8, the real-time clock 63 has power supply means separate from the personal computer 61 such as a button type battery as described above. However, the clock accuracy of the real-time clock 63 varies greatly depending on the ambient temperature and the like, so that there is a drawback in that the accurate time cannot always be recorded.

本発明が解決しようとする課題はCPUに高い負荷を発生することがない時刻補正装置を提供するとともに、周囲温度によりばらつきのない正確な時刻を刻むことができる内蔵時計を有する時刻補正装置を提供することにある。   The problem to be solved by the present invention is to provide a time correction device that does not generate a high load on the CPU, and also provides a time correction device having a built-in clock that can keep accurate time without variation depending on the ambient temperature. There is to do.

上記課題を解決するために本発明は、リアルタイムクロックで計数した時刻をオペレーティングシステム内部の時計手段に書込み、前記時計手段の出力を外部に接続されたモニタに表示する時刻表示装置の時刻補正を行なう時刻補正装置において、メインCPUとは独立して動作するタイマを設け、前記タイマが発生するクロックを用いて、実時間との補正値を算出し、前記補正値を前記リアルタイムクロックに定期的に入力する時刻補正手段を有することを特徴とする時刻補正装置である。 In order to solve the above-mentioned problems, the present invention corrects the time of a time display device that writes the time counted by the real-time clock to the clock means in the operating system and displays the output of the clock means on an externally connected monitor. In the time correction device, a timer that operates independently of the main CPU is provided, a correction value with respect to real time is calculated using a clock generated by the timer, and the correction value is periodically input to the real-time clock. It is a time correction apparatus characterized by having a time correction means.

本発明の時刻補正装置によれば、CPUに高い負荷を発生することがない時刻補正装置を得るとともに、周囲温度によりばらつきのない正確な時刻を刻むことができる内蔵時計を有する時刻補正装置を提供することができる。 According to the time correction apparatus of the present invention, it is possible to obtain a time correction apparatus that does not generate a high load on the CPU and has a built-in clock that can record an accurate time that does not vary depending on the ambient temperature. can do.

(第1の実施の形態)
以下、第1の実施の形態を図面に従って説明する。図1は第1の実施の形態を示す構成図である。1はパーソナルコンピュータ(以下PCという)であり、内部にはオペレーティングシステム(以下OSという)2と、リアルタイムクロック(以下RTCという)3を搭載している。PC1は、前記RTC3で計数した時刻を前記OS2内部の時計手段5に書込む。そして、時計手段5の出力は、PC1に接続されたモニタ4に送られ、モニタ4の時計表示手段6に表示される。
(First embodiment)
Hereinafter, a first embodiment will be described with reference to the drawings. FIG. 1 is a block diagram showing the first embodiment. Reference numeral 1 denotes a personal computer (hereinafter referred to as a PC), and an operating system (hereinafter referred to as an OS) 2 and a real time clock (hereinafter referred to as an RTC) 3 are mounted therein. The PC 1 writes the time counted by the RTC 3 into the clock means 5 inside the OS 2. The output of the clock means 5 is sent to the monitor 4 connected to the PC 1 and displayed on the clock display means 6 of the monitor 4.

RTC3は水晶振動子のクロックを以って時刻を計数する。RTC3はPC1の図示しない電源とは直接接続されておらず、ボタン型電池などの図示しない給電手段を有しているため、PC1の電源がOFFの状態でも時刻計数の処理を続ける。   The RTC 3 counts the time with the crystal oscillator clock. Since the RTC 3 is not directly connected to a power source (not shown) of the PC 1 and has a power supply means (not shown) such as a button-type battery, the time counting process is continued even when the power of the PC 1 is OFF.

パワーマネージメントタイマ(以下PMタイマという)7はクロックデバイスである。時刻補正手段8は、前記PC1の図示しない格納手段に格納されたプログラムによって動作し、PMタイマ7のクロックをカウントし、時刻の補正値を前記RTC3に書込む機能を有する。これにより実時刻との誤差を非常に小さくすることが可能となる。前記PMタイマ7はほとんどのACPI(Advanced Configuration and Power Interface)ベースのマザーボードに搭載されているクロックデバイスであり、主に電源の管理に用いられる。PMタイマ7は図示しないメインCPUとは独立して動作し、周囲温度によりばらつきの少ない正確な時刻を刻むことができる。   A power management timer (hereinafter referred to as PM timer) 7 is a clock device. The time correction means 8 is operated by a program stored in a storage means (not shown) of the PC 1 and has a function of counting the clock of the PM timer 7 and writing a time correction value into the RTC 3. As a result, the error from the actual time can be made extremely small. The PM timer 7 is a clock device mounted on most ACPI (Advanced Configuration and Power Interface) based motherboards, and is mainly used for power management. The PM timer 7 operates independently of a main CPU (not shown), and can accurately time with little variation depending on the ambient temperature.

図2は第1の実施の形態の動作を示すフローチャートである。なお、第1の実施の形態における時刻補正回数は1日に1度として説明する。PC1の電源投入後、時刻補正手段8はPC1のPMタイマ7の周波数(固定)を参照し、24時間分のクロック数(理論値)を算出する(S101)。時刻補正手段8はOS2の時計手段5の現在時刻を取得する(S102)。時刻補正手段8は、取得した現在時刻に基づきPMタイマ7の1時間分の実クロック数を計数する(S103)。24回分(即ち24時間分)のPMタイマ7の実クロック数を計数したかどうかを判断する。NOである場合は、引き続き1時間分のPMタイマ7の実クロック数を計数する。YESである場合は次に進む(S104)。   FIG. 2 is a flowchart showing the operation of the first embodiment. Note that the time correction count in the first embodiment will be described once per day. After powering on the PC 1, the time correction means 8 refers to the frequency (fixed) of the PM timer 7 of the PC 1 and calculates the number of clocks (theoretical value) for 24 hours (S101). The time correction unit 8 acquires the current time of the clock unit 5 of the OS 2 (S102). The time correction means 8 counts the actual number of clocks for one hour of the PM timer 7 based on the acquired current time (S103). It is determined whether the number of real clocks of the PM timer 7 for 24 times (that is, 24 hours) has been counted. If NO, the actual number of clocks of the PM timer 7 for one hour is counted continuously. If yes, the process proceeds to the next (S104).

更に、時刻補正手段8は24回計数した実クロック数を総和し、24時間分の実クロック数を算出する(S105)。前記ステップ101で求めたPMタイマ7の24時間分のクロック数(理論値)と、ステップ105で求めた24時間分の実クロック数を比較し、実時刻についての理論値に対する補正値を算出する(S106)。ステップ106で求めた補正値をRTC3に反映させる。前記補正値の算出方法は、例えば、前記クロック数(理論値)と、実クロック数の差を算出し、その差を補正値とする。これにより1日分の動作は終了し、以降は、PC1の電源がONになっている間は図2の動作を継続する。   Further, the time correction means 8 sums up the actual clock numbers counted 24 times, and calculates the actual clock numbers for 24 hours (S105). The number of clocks (theoretical value) for 24 hours of the PM timer 7 obtained in step 101 is compared with the actual number of clocks for 24 hours obtained in step 105, and a correction value for the theoretical value for the actual time is calculated. (S106). The correction value obtained in step 106 is reflected on the RTC 3. For example, the correction value is calculated by calculating the difference between the number of clocks (theoretical value) and the actual number of clocks and using the difference as the correction value. Thereby, the operation for one day is completed, and thereafter, the operation of FIG. 2 is continued while the power of the PC 1 is turned on.

以上のように、第1の実施の形態によれば、メインCPUとは独立して動作するPMタイマ7のクロックを用いて、実時刻についての理論値に対する補正値を算出し、補正値をRTC3に定期的(即ち24時間分)に反映させることで、安定した時刻を刻むことが可能となる。本発明を実際に実施した例としては、OSはWindowsXP SP2(Windowsは登録商標)、HP製のdc5300にて、本発明適用前は1ケ月あたり実時刻より1分遅れていたが、適用後は1ケ月あたり3秒の遅れで抑えることに成功している。   As described above, according to the first embodiment, the correction value for the theoretical value for the real time is calculated using the clock of the PM timer 7 that operates independently of the main CPU, and the correction value is set to RTC3. By reflecting them periodically (ie, for 24 hours), a stable time can be recorded. As an example of actual implementation of the present invention, the OS is Windows XP SP2 (Windows is a registered trademark), and HP's dc5300 is 1 minute behind the actual time per month before the present invention is applied. Succeeded in suppressing with a delay of 3 seconds per month.

(第2の実施の形態)
次に、第2の実施の形態について説明する。前記第1の実施の形態では、時刻補正手段8が補正値を算出して前記RTC3に反映させていたが、第2の実施の形態では、時刻補正手段18は、PMタイマ17のクロック数から経過時間を算出し、前記時計手段15の現在時刻にこの経過時間加えて、表示時刻とする。
(Second Embodiment)
Next, a second embodiment will be described. In the first embodiment, the time correction unit 8 calculates the correction value and reflects it in the RTC 3. However, in the second embodiment, the time correction unit 18 determines the number of clocks of the PM timer 17. The elapsed time is calculated, and this elapsed time is added to the current time of the clock means 15 to obtain the display time.

図3は第2の実施の形態を示す構成図である。同図(a)はPC11の電源OFF時の構成を示し、同図(b)はPC11の電源ON時の構成を示す。PC11の内部にはOS12とRTC13を搭載している。同図(a)に示すように、PC11は、PC11の電源OFF時、RTC13で計数した時刻をOS12内部の時計手段15に書込む。   FIG. 3 is a block diagram showing the second embodiment. FIG. 4A shows the configuration when the PC 11 is turned off, and FIG. 4B shows the configuration when the PC 11 is turned on. An OS 12 and an RTC 13 are installed inside the PC 11. As shown in FIG. 5A, the PC 11 writes the time counted by the RTC 13 into the clock means 15 in the OS 12 when the PC 11 is turned off.

RTC13は水晶振動子のクロックを以って時刻を計数する。RTC13はPC11の図示しない電源とは直接接続されておらず、ボタン型電池などの図示しない給電手段を有しているため、PC11の電源OFF時でも時刻計数の処理を続ける。RTC13のクロックは、PC11の電源がOFFの時のみ、時刻計数に使用する。   The RTC 13 counts the time with the crystal oscillator clock. Since the RTC 13 is not directly connected to a power source (not shown) of the PC 11 and has a power supply means (not shown) such as a button-type battery, the time counting process is continued even when the power of the PC 11 is turned off. The clock of the RTC 13 is used for time counting only when the power of the PC 11 is OFF.

同図(b)において、PMタイマ17はクロックデバイスである。時刻補正手段18は、前記PC11の図示しない格納手段に格納されたプログラムによって動作し、PMタイマ17のクロックをカウントし、補正した時刻をモニタ14の時計表示手段16に書込む機能を有する。これにより実時刻との誤差を非常に小さくすることが可能となる。前記PMタイマ17は図示しないメインCPUとは独立して動作し、周囲温度によりばらつきの少ない正確な時刻を刻むことができる。   In FIG. 2B, the PM timer 17 is a clock device. The time correction means 18 is operated by a program stored in a storage means (not shown) of the PC 11 and has a function of counting the clock of the PM timer 17 and writing the corrected time on the clock display means 16 of the monitor 14. As a result, the error from the actual time can be made extremely small. The PM timer 17 operates independently of a main CPU (not shown), and can accurately time with little variation depending on the ambient temperature.

PC11の電源がONの際、時刻補正手段18は、初回のみOS12の時計手段15から現在時刻(以下開始時刻という)を取得する。更に、PC11の電源がONの間、時刻補正手段18は、PMタイマ17のクロック数から経過時間を算出し、前記開始時刻に経過時間を加えて表示時刻とする。   When the PC 11 is powered on, the time correction unit 18 acquires the current time (hereinafter referred to as start time) from the clock unit 15 of the OS 12 only for the first time. Further, while the PC 11 is turned on, the time correction means 18 calculates the elapsed time from the number of clocks of the PM timer 17 and adds the elapsed time to the start time to obtain the display time.

図4は第2の実施の形態の動作を示すフローチャートである。まず、PC11の電源がONであるかを判断する。ONであればステップ202へ、OFFであればステップ208へ進む(S201)。次に、時刻補正手段18は、PC11のOS12内の時計手段15の前記開始時刻を取得する。ただし、PC11の電源ONの際、OS12の起動時に一度だけ実施する(S202)。更に、時刻補正手段18は、PMタイマ17の実クロック数を取得し、計数する(S203)。時刻補正手段18は、計数した実クロック数をもとに、前記開始時刻の取得後、経過した時間を算出する(S204)。   FIG. 4 is a flowchart showing the operation of the second embodiment. First, it is determined whether the power of the PC 11 is ON. If it is ON, the process proceeds to step 202, and if it is OFF, the process proceeds to step 208 (S201). Next, the time correction unit 18 acquires the start time of the clock unit 15 in the OS 12 of the PC 11. However, when the PC 11 is turned on, it is executed only once when the OS 12 is started (S202). Further, the time correction means 18 acquires the actual clock number of the PM timer 17 and counts it (S203). The time correction means 18 calculates the elapsed time after obtaining the start time based on the counted number of actual clocks (S204).

次に、時刻補正手段18は、ステップ202で取得した前記開始時刻にステップ204で算出した経過時間分を加える(S205)。更に、時刻補正手段18は、時計表示手段16に出力し(S205)、時計表示手段16はこれを表示する。   Next, the time correction means 18 adds the elapsed time calculated in step 204 to the start time acquired in step 202 (S205). Further, the time correction means 18 outputs to the clock display means 16 (S205), and the clock display means 16 displays this.

最後に、PC11の電源がOFFとなったかを判断する。ONであれば再度ステップ203に戻り、ステップ203からステップ206の処理を繰り返す。OFFであれば再度PC11の電源がONになるまで、時刻補正手段18の処理は休止となる。ステップ201において、PC11の電源OFFの場合、通常のRTC13による時刻の計数処理を行なう(S208)。PC11の電源がONになり次第、時刻補正手段18の処理を開始する(S209)。   Finally, it is determined whether the PC 11 is turned off. If it is ON, the process returns to step 203 again, and the processing from step 203 to step 206 is repeated. If it is OFF, the processing of the time correction means 18 is suspended until the power of the PC 11 is turned ON again. In step 201, when the power of the PC 11 is OFF, the time counting process is performed by the normal RTC 13 (S208). As soon as the PC 11 is turned on, processing of the time correction means 18 is started (S209).

以上のように、第2の実施の形態によれば、PC11の電源がONのとき、PMタイマ17のクロックを用いて時刻を計数し、随時反映させることで、RTC13の時刻精度の影響を受けずに時刻の精度を向上させることができる。   As described above, according to the second embodiment, when the power of the PC 11 is turned on, the time is counted using the clock of the PM timer 17 and reflected at any time, so that the time accuracy of the RTC 13 is affected. Time accuracy can be improved.

(第3の実施の形態)
次に、第3の実施の形態について説明する。前記第2の実施の形態は、電源OFF時にRTC13のクロックを前記時計手段15へ加えていたが、第3の実施の形態では、電源OFFの際に、今まで正確に時刻を計数していた時刻補正手段18の現在時刻を一回のみ前記時計手段15に加えるものである。これにより、PMタイマ17によって得られた時刻を時計手段15が引継ぐことができ、正確な時刻を継続して得られることができる。
(Third embodiment)
Next, a third embodiment will be described. In the second embodiment, the clock of the RTC 13 is added to the clock means 15 when the power is turned off. In the third embodiment, the time is accurately counted so far when the power is turned off. The current time of the time correction means 18 is added to the clock means 15 only once. Thereby, the clock means 15 can take over the time obtained by the PM timer 17, and the accurate time can be obtained continuously.

図5は第3の実施の形態を示す構成図である。同図はPC11の電源OFF時の構成を示す。構成は前記第2の実施の形態と同じである。PC11の内部にはOS12とRTC13を搭載している。同図に示すように、PC11は、PC11の電源OFF時、RTC13で計数した時刻をOS12内部の時計手段15に書込む。   FIG. 5 is a block diagram showing the third embodiment. The figure shows the configuration when the PC 11 is powered off. The configuration is the same as in the second embodiment. An OS 12 and an RTC 13 are installed inside the PC 11. As shown in the figure, the PC 11 writes the time counted by the RTC 13 in the clock means 15 in the OS 12 when the PC 11 is turned off.

RTC13は水晶振動子のクロックを以って時刻を計数する。RTC13はPC11の図示しない電源とは直接接続されておらず、ボタン型電池などの図示しない給電手段を有しているため、PC11の電源OFF時でも時刻計数の処理を続ける。RTC13のクロックは、PC11の電源がOFFの時のみ、時刻計数に使用する。   The RTC 13 counts the time with the crystal oscillator clock. Since the RTC 13 is not directly connected to a power source (not shown) of the PC 11 and has a power supply means (not shown) such as a button-type battery, the time counting process is continued even when the power of the PC 11 is turned off. The clock of the RTC 13 is used for time counting only when the power of the PC 11 is OFF.

同図において、PMタイマ17はクロックデバイスである。時刻補正手段18は、前記PC11の図示しない格納手段に格納されたプログラムによって動作し、PMタイマ17のクロックをカウントし、補正した時刻をモニタ14の時計表示手段16に書込む機能を有する。これにより実時刻との誤差を非常に小さくすることが可能となる。前記PMタイマ17は図示しないメインCPUとは独立して動作し、周囲温度によりばらつきの少ない正確な時刻を刻むことができる。   In the figure, a PM timer 17 is a clock device. The time correction means 18 is operated by a program stored in a storage means (not shown) of the PC 11 and has a function of counting the clock of the PM timer 17 and writing the corrected time on the clock display means 16 of the monitor 14. As a result, the error from the actual time can be made extremely small. The PM timer 17 operates independently of a main CPU (not shown), and can accurately time with little variation depending on the ambient temperature.

PC11の電源がONの際、時刻補正手段18は、初回のみOS12の時計手段15から現在時刻(以下開始時刻という)を取得する。更に、PC11の電源がONの間、時刻補正手段18は、PMタイマ17のクロック数から経過時間を算出し、前記開始時刻に経過時間を加えて表示時刻とする。更に前記時刻補正手段18は、PC11の電源がOFFになると、一回のみOS12の時計手段15へ現在時刻(以下終了時刻という)を加える。   When the PC 11 is powered on, the time correction unit 18 acquires the current time (hereinafter referred to as start time) from the clock unit 15 of the OS 12 only for the first time. Further, while the PC 11 is turned on, the time correction means 18 calculates the elapsed time from the number of clocks of the PM timer 17 and adds the elapsed time to the start time to obtain the display time. Further, the time correction means 18 adds the current time (hereinafter referred to as end time) to the clock means 15 of the OS 12 only once when the power of the PC 11 is turned off.

図6は第3の実施の形態の動作を示すフローチャートである。まず、PC11の電源がONであるかを判断する。ONであればステップ202へ、OFFであればステップ301へ進む(S201)。次に、時刻補正手段18は、PC11のOS12内の時計手段15の前記開始時刻を取得する。ただし、PC11の電源ONの際、OS12の起動時に一回だけ実施する(S202)。更に、時刻補正手段18は、PMタイマ17の実クロック数を取得し、計数する(S203)。時刻補正手段18は、計数した実クロック数をもとに、前記開始時刻の取得後、経過した時間を算出する(S204)。   FIG. 6 is a flowchart showing the operation of the third embodiment. First, it is determined whether the power of the PC 11 is ON. If it is ON, the process proceeds to step 202, and if it is OFF, the process proceeds to step 301 (S201). Next, the time correction unit 18 acquires the start time of the clock unit 15 in the OS 12 of the PC 11. However, when the PC 11 is turned on, it is executed only once when the OS 12 is activated (S202). Further, the time correction means 18 acquires the actual clock number of the PM timer 17 and counts it (S203). The time correction means 18 calculates the elapsed time after obtaining the start time based on the counted number of actual clocks (S204).

次に、時刻補正手段18は、ステップ202で取得した前記開始時刻にステップ204で算出した経過時間分を加える(S205)。更に、時刻補正手段18は、時計表示手段16に出力し(S205)、時計表示手段16はこれを表示する。   Next, the time correction means 18 adds the elapsed time calculated in step 204 to the start time acquired in step 202 (S205). Further, the time correction means 18 outputs to the clock display means 16 (S205), and the clock display means 16 displays this.

最後に、PC11の電源がOFFとなったかを判断する。ONであれば再度ステップ203に戻り、ステップ203からステップ206の処理を繰り返す。OFFであれば再度PC11の電源がONになるまで、時刻補正手段18の処理は休止となる。   Finally, it is determined whether the PC 11 is turned off. If it is ON, the process returns to step 203 again, and the processing from step 203 to step 206 is repeated. If it is OFF, the processing of the time correction means 18 is suspended until the power of the PC 11 is turned ON again.

ステップ201において、PC11の電源OFFになった際、時刻補正手段18は一回だけ終了時刻を前記時計手段15へ送る(S301)。これにより、時計手段15は正確な時刻を得ることができる。その後、通常のRTC13による時刻の計数処理を行なう(S302)。PC11の電源がONになった際(303)、時刻補正手段18は、前記時計手段15の前記開始時刻を一回だけ取得する (S202)。   In step 201, when the PC 11 is turned off, the time correction means 18 sends the end time to the clock means 15 only once (S301). Thereby, the clock means 15 can obtain an accurate time. Thereafter, the time counting process by the normal RTC 13 is performed (S302). When the power of the PC 11 is turned on (303), the time correction means 18 acquires the start time of the clock means 15 only once (S202).

以上のように、第3の実施の形態によれば、PC11の電源がONのとき、PMタイマ17のクロックを用いて時刻を計数し、随時反映させることで、RTC13の時刻精度の影響を受けずに時刻の精度を向上させることができる。更に、PC11の電源がONのときに算出した現在時刻(終了時刻)を電源OFFの際に時計手段15へ継続して反映するようにしたので、再度電源ONした際、時計手段15から取得する開始時刻は正確な時刻となる。従って、電源ON時、前記時刻補正手段18により得られる時刻は、より精度を向上させることができる。   As described above, according to the third embodiment, when the power of the PC 11 is turned on, the time is counted using the clock of the PM timer 17 and reflected at any time, so that the time accuracy of the RTC 13 is affected. Time accuracy can be improved. Further, since the current time (end time) calculated when the power of the PC 11 is turned on is continuously reflected in the clock means 15 when the power is turned off, it is acquired from the clock means 15 when the power is turned on again. The start time is an accurate time. Therefore, when the power is turned on, the accuracy of the time obtained by the time correction means 18 can be improved.

第1の実施の形態を示す構成図である。It is a block diagram which shows 1st Embodiment. 第1の実施の形態の動作を示すフローチャートである。It is a flowchart which shows operation | movement of 1st Embodiment. 第2の実施の形態を示す構成図である。It is a block diagram which shows 2nd Embodiment. 第2の実施の形態の動作を示すフローチャートである。It is a flowchart which shows operation | movement of 2nd Embodiment. 第2の実施の形態を示す構成図である。It is a block diagram which shows 2nd Embodiment. 第2の実施の形態の動作を示すフローチャートである。It is a flowchart which shows operation | movement of 2nd Embodiment. 従来のマイクロコンピュータの内蔵時計の時刻補正装置を示すブロック図である。It is a block diagram which shows the time correction apparatus of the built-in timepiece of the conventional microcomputer. 従来のパーソナルコンピュータの内蔵時計の構成図を示す。The block diagram of the built-in timepiece of the conventional personal computer is shown.

符号の説明Explanation of symbols

1 PC
2 OS
3 RTC
4 モニタ
5 時計手段
6 時計表示手段
7 PMタイマ
8 時刻補正手段
1 PC
2 OS
3 RTC
4 Monitor 5 Clock means 6 Clock display means 7 PM timer 8 Time correction means

Claims (6)

リアルタイムクロックで計数した時刻をオペレーティングシステム内部の時計手段に書込み、前記時計手段の出力を外部に接続されたモニタに表示する時刻表示装置の時刻補正を行なう時刻補正装置において、
メインCPUとは独立して動作するタイマを設け、
前記タイマが発生するクロックを用いて、実時間との補正値を算出し、前記補正値を前記リアルタイムクロックに定期的に入力する時刻補正手段を有することを特徴とする時刻補正装置。
In a time correction device that performs time correction of a time display device that writes a time counted by a real-time clock to a clock means inside the operating system and displays an output of the clock means on an externally connected monitor.
A timer that operates independently from the main CPU is provided.
A time correction apparatus comprising time correction means for calculating a correction value with respect to real time using a clock generated by the timer and periodically inputting the correction value to the real time clock.
前記時刻補正手段は、
前記タイマのクロックから算出する一定時間分の理論値のクロック数と、
前記時計手段から取得した前記実時間に基づき、前記タイマのクロックから算出する前記一定時間分の実クロック数とから、前記補正値を算出することを特徴とする請求項1記載の時刻補正装置。
The time correction means includes
The theoretical number of clocks for a certain time calculated from the clock of the timer,
2. The time correction apparatus according to claim 1, wherein the correction value is calculated from the number of real clocks for the predetermined time calculated from the clock of the timer based on the real time acquired from the clock means.
リアルタイムクロックで計数した時刻をオペレーティングシステム内部の時計手段に書込み、外部に接続されたモニタに時刻を表示する時刻表示装置の時刻補正を行なう時刻補正装置において、
メインCPUとは独立して動作するタイマを設け、
前記時計手段から取得する現在時刻と、前記タイマが発生するクロックを用いて算出する経過時間とから新たな時刻を算出し、前記モニタに時刻表示する時刻補正手段を有することを特徴とする時刻補正装置。
In a time correction device that performs time correction of a time display device that writes a time counted by a real-time clock to a clock means inside the operating system and displays the time on an externally connected monitor,
A timer that operates independently from the main CPU is provided.
Time correction comprising: time correction means for calculating a new time from the current time acquired from the clock means and the elapsed time calculated using the clock generated by the timer and displaying the time on the monitor apparatus.
前記時計手段は、本体の電源OFF時に前記リアルタイムクロックから時刻を書込まれることを特徴とする請求項3記載の時刻補正装置。 4. The time correction apparatus according to claim 3, wherein the clock means writes the time from the real time clock when the power of the main body is turned off. 前記時刻補正手段は、本体の電源ONの際、前記時計手段から現在時刻を取得することを特徴とする請求項3又は4記載の時刻補正装置。   5. The time correction apparatus according to claim 3, wherein the time correction means acquires the current time from the clock means when the power of the main body is turned on. 前記時刻補正手段は、本体の電源OFFの際、前記時計手段へ現在時刻を送ることを特徴とする請求項3乃至5いずれか一記載の時刻補正装置。


6. The time correction apparatus according to claim 3, wherein the time correction unit sends the current time to the clock unit when the power of the main body is turned off.


JP2008251742A 2008-09-29 2008-09-29 Time correction device Withdrawn JP2010085124A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008251742A JP2010085124A (en) 2008-09-29 2008-09-29 Time correction device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008251742A JP2010085124A (en) 2008-09-29 2008-09-29 Time correction device

Publications (1)

Publication Number Publication Date
JP2010085124A true JP2010085124A (en) 2010-04-15

Family

ID=42249240

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008251742A Withdrawn JP2010085124A (en) 2008-09-29 2008-09-29 Time correction device

Country Status (1)

Country Link
JP (1) JP2010085124A (en)

Similar Documents

Publication Publication Date Title
JP6327183B2 (en) Radio wave receiver, radio wave clock, signal acquisition method and program
JP6435762B2 (en) Electronic device, program, and date / time information acquisition method
US20120265461A1 (en) Electronic device and system time setting method thereof
EP2369438A1 (en) Calibration method of a real time clock signal
RU2579716C2 (en) Correction of low-accuracy clock generator
JP6282723B2 (en) High-precision timekeeping method for quartz electronic watches
US20060190752A1 (en) Compensating software time in processor having sleep mode
JP2021131395A (en) Electronic display device and display control method
CN109643267B (en) Techniques for low power and high accuracy time stamping
EP2894439A1 (en) Electronic device and program
US10816357B2 (en) Display device, electronic timepiece, display method, and computer-readable recording medium
JP6888575B2 (en) Electronic clock and information acquisition method
JP2011113173A (en) Real-time clock device, information processor and electronic apparatus
US11385600B2 (en) Timer measurement device, electronic timepiece, timer measurement method, and non-transitory computer readable storage medium storing program
JP2010085124A (en) Time correction device
CN108519735B (en) Electronic timepiece, display control method, and recording medium
JP2017020852A (en) Embedded device
JP2003270371A (en) Clock device in computer system
JP6493574B2 (en) Radio wave receiver, radio wave clock, signal acquisition method and program
JP7006090B2 (en) Satellite radio wave receiver, electronic clock, date and time information acquisition control method and program
JP5937928B2 (en) Electronic clock
JP6741058B2 (en) Electronic device, program, and acquisition method of date and time information
JPH07225264A (en) Electronic watt-hour meter
JP2013061258A (en) Analog electronic clock
JP7416142B2 (en) Electronic clock, reception operation control method and program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20111206