JP2005331329A - Method for correcting time - Google Patents

Method for correcting time Download PDF

Info

Publication number
JP2005331329A
JP2005331329A JP2004149146A JP2004149146A JP2005331329A JP 2005331329 A JP2005331329 A JP 2005331329A JP 2004149146 A JP2004149146 A JP 2004149146A JP 2004149146 A JP2004149146 A JP 2004149146A JP 2005331329 A JP2005331329 A JP 2005331329A
Authority
JP
Japan
Prior art keywords
time
time data
data
address
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2004149146A
Other languages
Japanese (ja)
Other versions
JP4464738B2 (en
Inventor
Naohisa Ikeda
直久 池田
Masanori Sugimoto
雅則 杉本
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.)
Yazaki Corp
Original Assignee
Yazaki Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yazaki Corp filed Critical Yazaki Corp
Priority to JP2004149146A priority Critical patent/JP4464738B2/en
Publication of JP2005331329A publication Critical patent/JP2005331329A/en
Application granted granted Critical
Publication of JP4464738B2 publication Critical patent/JP4464738B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Electric Clocks (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method for correcting time which enables one to correct time instant with a little labor. <P>SOLUTION: In an apparatus provided with a CPU1 having a time operation function of a time-piece and an indicator 3 to which time data calculated with the time operation function is supplied from the CPU1 and indicating time, the time data is stored in a non-volatile memory 4 at every specific time unit. When a source voltage is lowered below a function guarantee voltage and the CPU1 is reset, the time data immediately before the reset which is stored in the non-volatile memory 4 are read out and indicated with the indicator 3. Simultaneously, the start time is calculated from the read-out time data, so as to correct the time indicated after the reset. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、時刻修正方法に関し、特に、時計の時刻演算機能を有するCPUと、該CPUから時刻演算機能で演算された時刻データが供給されて時刻を表示する表示器とを備えた機器における時刻修正方法に関する。   The present invention relates to a time correction method, and in particular, a time in a device including a CPU having a time calculation function of a clock and a display that displays time by supplying time data calculated by the time calculation function from the CPU. Regarding the correction method.

従来、車載メータ等の機器における時計表示機能は、図15に示すように、リアルタイム時計の時刻演算機能を有するCPU1より、LCD(液晶ディスプレイ)等からなる表示器3に時刻データを供給して時刻を表示させている。CPU1への電源は、バッテリ(+B)より安定化電源回路2で5V等の電源電圧に安定化させて供給している。供給される電源電圧の異常時、たとえば、電源電圧がCPU1の動作保証電圧以下に低下した時、CPU1の機能障害が発生しないように、安定化電源回路2に備えられたウォッチドッグタイマ5等にて供給電源を監視する機能により、CPU1にリセットをかけていた。   Conventionally, as shown in FIG. 15, a clock display function in a device such as an in-vehicle meter is supplied with time data from a CPU 1 having a time calculation function of a real-time clock to a display 3 such as an LCD (liquid crystal display). Is displayed. The power to the CPU 1 is supplied from the battery (+ B) after being stabilized to a power supply voltage such as 5 V by the stabilized power circuit 2. When the power supply voltage to be supplied is abnormal, for example, when the power supply voltage drops below the operation guarantee voltage of the CPU 1, the watchdog timer 5 provided in the stabilized power supply circuit 2 or the like is provided so that the function failure of the CPU 1 does not occur. The CPU 1 is reset by the function of monitoring the power supply.

CPU1のリセット解除後、再び電源が供給されると、図16のフローチャートに示すように、CPU1はイニシャライズされ(ステップS41)、次いで、リアルタイム時計の時刻演算処理を再開する(ステップS42)。   When power is supplied again after resetting the CPU 1, as shown in the flowchart of FIG. 16, the CPU 1 is initialized (step S41), and then the time calculation processing of the real-time clock is resumed (step S42).

しかしながら、イニシャライズにより、表示器3で表示される時刻が「0:00」または「1:00」になるように初期化され、そこからスタートするため、数分程度のわずかな停止時間の場合にも、時計表示の時刻修正を行う際には、時および分の両方を修正しなければならず、面倒であった。   However, the initialization initializes the time displayed on the display 3 to be “0:00” or “10:00” and starts from there, so in the case of a slight stop time of about several minutes. However, when correcting the time on the clock display, both the hour and minute must be corrected, which is troublesome.

そこで本発明は、上述した従来の問題点に鑑み、わずかな労力で時刻修正が可能となる時刻修正方法を提供することを目的としている。   Accordingly, an object of the present invention is to provide a time correction method capable of correcting the time with little effort in view of the above-described conventional problems.

請求項1記載の発明の時刻修正方法は、時計の時刻演算機能を有するCPUと、該CPUから時刻演算機能で演算された時刻データが供給されて時刻を表示する表示器とを備えた機器において、前記時刻データを所定の時刻単位毎に不揮発性メモリに格納し、電源電圧が動作保証電圧以下に低下して前記CPUがリセットされたとき、前記不揮発性メモリに格納されているリセット直前の時刻データを読み出して前記表示器で表示すると共に、読み出した時刻データからスタートする時刻を演算することにより、リセット後に表示される時刻を修正することを特徴とする。   According to a first aspect of the present invention, there is provided a time correction method comprising: a CPU having a time calculation function of a clock; and a display that displays time by supplying time data calculated by the time calculation function from the CPU. The time data is stored in a non-volatile memory every predetermined time unit, and the time immediately before the reset stored in the non-volatile memory when the power supply voltage falls below the operation guarantee voltage and the CPU is reset. The data is read out and displayed on the display, and the time displayed after the reset is corrected by calculating the start time from the read time data.

請求項2記載の発明の時刻修正方法は、時計の時刻演算機能を有し、時刻演算機能で演算された時刻データを所定の時刻単位毎に内部メモリに格納するCPUと、該CPUから時刻データが供給されて時刻を表示する表示器とを備えた機器において、前記時刻データを所定の時刻単位毎に不揮発性の外部メモリに格納し、電源電圧が動作保証電圧以下に低下して前記CPUがリセットされたとき、前記内部メモリに格納されているリセット直前の時刻データの妥当性を判定し、妥当性ありの場合は、前記時刻データを前記表示器に供給して表示させると共に該時刻データからスタートする時刻を演算し、妥当性なしの場合は、前記外部メモリに格納されている時刻データを前記表示器に供給して表示させると共に該時刻データからスタートする時刻を演算することにより、リセット後に表示される時刻を修正することを特徴とする。   According to a second aspect of the present invention, there is provided a time correction method having a time calculation function of a clock, storing time data calculated by the time calculation function in an internal memory every predetermined time unit, and time data from the CPU. The time data is stored in a non-volatile external memory for each predetermined time unit, the power supply voltage drops below the guaranteed operating voltage, and the CPU When reset, the validity of the time data immediately before the reset stored in the internal memory is determined. If there is validity, the time data is supplied to the display for display and the time data is displayed. When the start time is calculated and the validity is not valid, the time data stored in the external memory is supplied to the display for display and the start is started from the time data. By calculating the time, characterized by modifying the time displayed after a reset.

請求項3記載の発明は、請求項1または2記載の時刻修正方法において、時刻データは、分単位毎に不揮発性メモリに格納されることを特徴とする。   According to a third aspect of the present invention, in the time adjustment method according to the first or second aspect, the time data is stored in a nonvolatile memory every minute unit.

請求項4記載の発明は、請求項3記載の時刻修正方法において、不揮発性メモリは、各アドレスに、複数ビットからなる時刻アドレスエリアと複数ビットからなる時刻データエリアとで構成される1ワードで表される時刻データが格納される、複数のアドレスを有する時刻データ格納エリアを有し、時刻データエリアには、分単位の時刻データが順次格納され、格納された複数の時刻データの中から、リセット直前に格納された時刻データが読み出されることを特徴とする。   According to a fourth aspect of the present invention, in the time correction method according to the third aspect, the nonvolatile memory is composed of one word composed of a time address area composed of a plurality of bits and a time data area composed of a plurality of bits in each address. The time data represented has a time data storage area having a plurality of addresses, and the time data area sequentially stores the time data in minutes, from among the plurality of stored time data, The time data stored immediately before the reset is read out.

請求項5記載の発明は、請求項4記載の時刻修正方法において、時刻データは、複数のアドレスの先頭アドレスから最終アドレスまで格納されるたびに、再び先頭アドレスから書き換えられ、時刻アドレスエリアは、時刻データが書き換えられるたびに全て0から全て1にまたは全て1から全て0に書き換えられる奇数個のビットを有することを特徴とする。   According to a fifth aspect of the present invention, in the time correction method according to the fourth aspect of the invention, the time data is rewritten from the first address every time it is stored from the first address to the last address of the plurality of addresses, and the time address area is It has an odd number of bits that are rewritten from all 0s to all 1s or from all 1s to all 0s each time the time data is rewritten.

請求項6記載の発明は、請求項5記載の時刻修正方法において、時刻データが格納された時、時刻アドレスエリアにおける奇数個のビットの多数決判定を行い、多数決判定の結果が変化したアドレスを変化点として検出し、変化点が検出された場合は、変化点として検出されたアドレスの前のアドレスに格納されている時刻データが、前記リセット直前の時刻データとして読み出され、変化点が検出されなかった場合は、先頭アドレスを変化点とみなすと共に、最終アドレスに格納されている時刻データが、前記リセット直前の時刻データとして読み出されることを特徴とする。   According to a sixth aspect of the present invention, in the time correction method according to the fifth aspect, when the time data is stored, the majority decision of the odd number of bits in the time address area is performed, and the address where the result of the majority decision is changed is changed. When the change point is detected, the time data stored at the address before the address detected as the change point is read as the time data immediately before the reset, and the change point is detected. If not, the head address is regarded as a change point, and the time data stored at the final address is read as the time data immediately before the reset.

請求項1記載の発明によれば、電源異常により時計表示がリアルタイムからずれた場合に、わずかな労力で時刻修正を行うことができる。   According to the first aspect of the present invention, when the clock display deviates from real time due to a power failure, the time can be corrected with a little effort.

請求項2記載の発明によれば、電源異常により時計表示がリアルタイムからずれた場合に、わずかな労力で時刻修正を行うことができる。また、CPUの内部メモリに格納されている時刻データが使用できない場合、不揮発性の外部メモリに格納されている時刻データを用いて時刻修正を行うことができる。また、内部メモリと外部メモリの両方に時刻データを格納することにより、電源異常でデータが破壊された時等でも、時刻表示が初期値(0:00または1:00)に戻りにくく、信頼性が向上する。   According to the second aspect of the present invention, when the clock display deviates from real time due to power supply abnormality, the time can be corrected with a little effort. If the time data stored in the internal memory of the CPU cannot be used, the time can be corrected using the time data stored in the non-volatile external memory. In addition, by storing the time data in both the internal memory and the external memory, the time display is unlikely to return to the initial value (0:00 or 1:00) even when the data is destroyed due to power failure, etc. Will improve.

請求項3記載の発明によれば、電源異常により時計が停止していた時間が1分以内ならば、異常解除後に手動で修正作業をすることなく、自動的に修正された時刻を表示することができる。また、1分以上のわずかな時間(数分等)の電源異常時でも、わずかな労力で時刻修正ができる。   According to the third aspect of the present invention, if the time during which the clock has been stopped due to a power supply abnormality is within one minute, the corrected time is automatically displayed without performing manual correction work after the abnormality is canceled. Can do. Even when the power supply is abnormal for a short time (such as several minutes) of 1 minute or more, the time can be adjusted with a little effort.

請求項4記載の発明によれば、電源異常解除後に時刻修正のために使用される時刻データを、有効に格納することができる。   According to the fourth aspect of the present invention, it is possible to effectively store time data used for time correction after the power supply abnormality is canceled.

請求項5記載の発明によれば、複数の時刻データを書き換え可能に格納することができる。   According to the invention of claim 5, a plurality of time data can be stored in a rewritable manner.

請求項6記載の発明によれば、リセット直前の時刻データを的確に読み出すことができる。   According to the sixth aspect of the invention, the time data immediately before the reset can be accurately read.

以下、本発明の実施の形態について図面を参照して説明する。図1は、本発明の最良の形態に係る時刻修正方法を実施する機器のブロック図である。ここでは、機器が車載オド/トリップメータの場合について述べる。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram of a device that implements a time correction method according to the best mode of the present invention. Here, a case where the device is an in-vehicle od / trip meter will be described.

車載オド/トリップメータは、CPU(マイクロコンピュータ)1、安定化電源回路2、表示器3および不揮発性メモリ4を有する。   The in-vehicle od / trip meter has a CPU (microcomputer) 1, a stabilized power supply circuit 2, a display 3 and a nonvolatile memory 4.

CPU1は、車両のオドメータまたはトリップメータのメータ機能とリアルタイム時計の時刻演算機能を実行する。   The CPU 1 executes a meter function of a vehicle odometer or trip meter and a time calculation function of a real-time clock.

安定化電源回路2は、バッテリ(+B)電源より供給された電圧(たとえば、12V)を5V等の安定化電圧に変換して、CPU1に電源として供給する。安定化電源回路2は、ウォッチドッグタイマ5を備えており、CPU1に供給される電源電圧を監視している。   The stabilized power supply circuit 2 converts a voltage (for example, 12V) supplied from the battery (+ B) power supply into a stabilized voltage such as 5V, and supplies it to the CPU 1 as a power supply. The stabilized power supply circuit 2 includes a watchdog timer 5 and monitors a power supply voltage supplied to the CPU 1.

表示器3は、LCD等からなり、CPU1からメータデータが供給されて、車両の総走行距離を示すオドメータ表示または車両の任意の走行距離を示すトリップメータ表示を行うメータ表示と、時刻データが供給されてリアルタイム時計の時刻表示とを行う。   The display 3 is composed of an LCD or the like. Meter data is supplied from the CPU 1, meter display for displaying an odometer indicating the total travel distance of the vehicle or a trip meter indicating any travel distance of the vehicle, and time data is supplied. The time display of the real time clock is performed.

不揮発性メモリ4は、CPU1の外部メモリとして備えられている、たとえば、総走行距離等のメータ表示のための情報を記憶しておくEEPROMからなり、その一部のアドレスが時刻修正機能に用いられる。すなわち、CPU1の時刻演算機能で生成される時刻データは、表示器3に供給されると共に不揮発性メモリ4にも供給され、不揮発性メモリ4は、複数の時刻データを所定の時刻単位毎、たとえば分単位毎に格納する。   The non-volatile memory 4 is provided as an external memory of the CPU 1, for example, an EEPROM for storing information for meter display such as the total travel distance, and a part of the address is used for the time correction function. . In other words, the time data generated by the time calculation function of the CPU 1 is supplied to the display 3 and also to the nonvolatile memory 4, and the nonvolatile memory 4 converts a plurality of time data into predetermined time units, for example, Store every minute.

上述の構成において、本発明による時刻修正方法は、次のように行われる。安定化電源回路2に備えられたウォッチドッグタイマ5は、CPU1が正常動作を行っている間は、タイマの時限値よりも短い時間間隔でCPU1から供給されるクリア信号で時限動作がクリアされるように構成されている。しかし、CPU1の動作異常時、たとえば、安定化電源回路2から供給される電源電圧がCPU1の動作保証電圧以下に低下して、CPU1の動作が異常となった場合、クリア信号が供給されないため、ウォッチドッグタイマ5の時限動作がクリアされずタイムアップして、ウォッチドッグタイマ5から異常検知信号が出力され、CPU1のリセット入力に供給される。それにより、CPU1はリセットされる。   In the above configuration, the time correction method according to the present invention is performed as follows. The watchdog timer 5 provided in the stabilized power supply circuit 2 is cleared of the timed operation by a clear signal supplied from the CPU 1 at a time interval shorter than the time limit value of the timer while the CPU 1 is operating normally. It is configured as follows. However, when the operation of the CPU 1 is abnormal, for example, when the power supply voltage supplied from the stabilized power supply circuit 2 falls below the operation guarantee voltage of the CPU 1 and the operation of the CPU 1 becomes abnormal, the clear signal is not supplied. The timed operation of the watchdog timer 5 is not cleared and the time is up, and an abnormality detection signal is output from the watchdog timer 5 and supplied to the reset input of the CPU 1. Thereby, the CPU 1 is reset.

このようなリセット動作が行われた場合、リセット解除後、再び電源がCPU1に供給されると、図2のフローチャートに示すように、CPU1はイニシャライズされる(ステップS1)。次に、CPU1は、不揮発性メモリ4に分刻みで格納されている時刻データの中からリセット直前の時刻データを読み出して表示器3に供給する(ステップS2)。それにより、表示器3には、リセット直前の時刻が表示される。次に、CPU1は、時刻演算処理を再開し(ステップS3)、読み出した時刻データからスタートする時刻を演算する。それにより、表示器3には、リセット直前の時刻からスタートする時刻が表示される。   When such a reset operation is performed, when power is supplied to the CPU 1 again after reset is released, the CPU 1 is initialized as shown in the flowchart of FIG. 2 (step S1). Next, the CPU 1 reads out the time data immediately before the reset from the time data stored in the nonvolatile memory 4 in units of minutes and supplies it to the display 3 (step S2). Thereby, the display 3 displays the time immediately before the reset. Next, the CPU 1 resumes the time calculation process (step S3), and calculates a start time from the read time data. Thereby, the display 3 displays the time starting from the time immediately before the reset.

したがって、リセット動作によりリアルタイム時計が停止していた時間が1分以内ならば、修正作業をすることなく、表示器3にリアルタイムの時刻が表示される。また、1分以上のわずかな時間(数分等)の電源異常時でも、わずかな労力で時刻修正ができる。   Therefore, if the time during which the real-time clock has been stopped by the reset operation is within one minute, the real-time time is displayed on the display unit 3 without any correction work. Even when the power supply is abnormal for a short time (such as several minutes) of 1 minute or more, the time can be adjusted with a little effort.

次に、本発明の時刻修正方法を含む時計機能について説明する。   Next, a clock function including the time correction method of the present invention will be described.

1.概略
まず、図2のフローチャートにおけるステップS3の時刻演算処理中で行われる一部のサブルーチンである図3のフローチャートで、時刻データの格納動作について説明する。CPU1が正常に動作している時、図3のフローチャートに示すように、バッテリ(+B)電源の接続時からCPU1のリアルタイム時計タイマ機能を使用し、1秒毎に割り込みを発生させ(ステップS11)、割り込みが発生したら、次に、CPU1に内蔵されているが図示しない秒カウンタ(RAM)のカウント値(RAM値)を更新する(ステップS12)。この割り込みは、CPU1がスリープモード中でも、1秒毎に発生する。更新されたRAM値は、図示しないCPU1の内部メモリ、たとえばRAMに格納される。
1. Outline First, the operation of storing time data will be described with reference to the flowchart of FIG. 3, which is a part of the subroutine performed during the time calculation process of step S3 in the flowchart of FIG. When the CPU 1 is operating normally, as shown in the flowchart of FIG. 3, an interrupt is generated every second by using the real time clock timer function of the CPU 1 from the time when the battery (+ B) power source is connected (step S11). If an interrupt occurs, the count value (RAM value) of a second counter (RAM) (not shown) that is built in the CPU 1 is updated (step S12). This interruption occurs every second even when the CPU 1 is in the sleep mode. The updated RAM value is stored in an internal memory of the CPU 1 (not shown) such as a RAM.

次に、秒カウンタ(RAM)のカウントに基づき、CPU1は、1分経過したか否かを判定し(ステップS13)、その答えがノーならば、処理をリターンし、イエスならば、ステップS14に進む。   Next, based on the count of the second counter (RAM), the CPU 1 determines whether or not 1 minute has passed (step S13). If the answer is no, the process returns. If yes, the process returns to step S14. move on.

ステップS14では、CPU1に内蔵されているが図示しない分カウンタ(RAM)のカウント値(RAM値)を更新する。すなわち、分カウンタ(RAM)のRAM値は、1分経過毎に更新される。更新されたRAM値は、上述のRAMに格納される。   In step S14, the count value (RAM value) of a counter (RAM) (not shown) that is built in the CPU 1 is updated. That is, the RAM value of the minute counter (RAM) is updated every 1 minute. The updated RAM value is stored in the above-described RAM.

次に、CPU1は、更新された書き込みアドレス(RAM)を参照し、そこに格納されている分カウンタ(RAM)のRAM値を不揮発性メモリ(以下、EEPROMとして説明する)4に書き込む(ステップS15)。基本的には、1分毎に分カウンタ(RAM)のRAM値をEEPROM4に書き込むが、正時合わせ終了時、修正モード終了時には、その都度EEPROM4に書き込む。EEPROM4に書き込み後、次回にEEPROM4に書き込むべき分カウンタ(RAM)値を格納する書き込みアドレス(RAM)を更新する(ステップS16)。   Next, the CPU 1 refers to the updated write address (RAM), and writes the RAM value of the minute counter (RAM) stored therein into the non-volatile memory (hereinafter referred to as EEPROM) 4 (step S15). ). Basically, the RAM value of the minute counter (RAM) is written into the EEPROM 4 every minute, but is written into the EEPROM 4 at the end of the correct time and at the end of the correction mode. After writing to the EEPROM 4, the write address (RAM) storing the counter value (RAM) to be written to the EEPROM 4 next time is updated (step S16).

CPU1は、車両のイグニッション(IG)オン時に、RAMに格納されている分カウンタ(RAM)値により、下記式にて現在時刻(H:M(時:分))を演算し、表示器3に表示させる。
分カウンタ(RAM)/60=H(時)
分カウンタ(RAM)%60=M(分)
なお、上記の式において、「/」、「%」は、それぞれ、除算、剰余を表す算術演算子である。
When the ignition (IG) of the vehicle is turned on, the CPU 1 calculates the current time (H: M (hour: minute)) from the minute counter (RAM) value stored in the RAM according to the following formula, Display.
Minute counter (RAM) / 60 = H (hours)
Minute counter (RAM)% 60 = M (minute)
In the above formula, “/” and “%” are arithmetic operators representing division and remainder, respectively.

2.データ構成
2.1.EEPROMのデータ構成
EEPROM4は、メータデータ格納エリアと時刻データ格納エリアを有するが、時刻データ格納エリアのデータ構成を図4に示す。図4では、EEPROM4のメモリアドレス中、たとえば91U〜101Uのアドレスが、時刻データを格納するために利用される。
2. Data structure 2.1. EEPROM Data Structure The EEPROM 4 has a meter data storage area and a time data storage area. FIG. 4 shows the data structure of the time data storage area. In FIG. 4, among the memory addresses of the EEPROM 4, for example, addresses 91U to 101U are used for storing time data.

時刻データ格納エリアは、91U〜101Uの各アドレスに、0〜10の11個のビットからなる時刻データエリアと、11〜15の5個のビットからなる時刻アドレスエリアとで構成される1ワードで表される時刻データをそれぞれ格納し、合計11ワード確保している。時刻データエリアのデータは、分データとする。すなわち、時計表示範囲が1:00〜12:59であるので、分データの範囲は、60〜779(10進数)とする。   The time data storage area is one word composed of a time data area consisting of 11 bits from 0 to 10 and a time address area consisting of 5 bits from 11 to 15 at each address of 91U to 101U. Each represented time data is stored, and a total of 11 words are secured. The data in the time data area is minute data. That is, since the clock display range is 1:00 to 12:59, the minute data range is 60 to 779 (decimal number).

時刻データエリア、時刻アドレスエリアの取り得るデータ範囲は、以下の通りとする。
時刻データエリア:0x03C〜0x30B
時刻アドレスエリア:0x00または0x1F
The possible data range of the time data area and the time address area is as follows.
Time data area: 0x03C to 0x30B
Time address area: 0x00 or 0x1F

2.2.RAMのデータ構成
リアルタイム時計機能で使用されるRAMのデータ構成は、図5に示される。分カウンタ(RAM)値は、同一時刻データが4つのアドレスに格納される。
2.2. RAM Data Structure The RAM data structure used in the real-time clock function is shown in FIG. As the minute counter (RAM) value, the same time data is stored at four addresses.

3.EEPROM読み込み
時刻データは、基本的に、RAM値が優先的に採用され、RAM値が信頼できない値で採用できない場合は、RAM値の代わりに、EEPROM4に格納されているデータ(以下、EEPROM値という)が読み込まれて採用される。すなわち、CPU1のWakeUp時に、RAM多数決判定を行い、その判定結果に基づいて、RAM値またはEEPROM値を読み込む。
3. As for the EEPROM reading time data, basically, the RAM value is preferentially adopted, and if the RAM value cannot be adopted as an unreliable value, the data stored in the EEPROM 4 instead of the RAM value (hereinafter referred to as the EEPROM value). ) Is read and adopted. That is, when the CPU 1 wakes up, a RAM majority decision is made, and a RAM value or an EEPROM value is read based on the decision result.

図6は、RAM多数決判定を説明する図である。4つのアドレスに同時に格納された4つの時刻データRAM[0]、RAM[1]、RAM[2]およびRAM[3]を、それぞれ、A,B,C,Dとすると、図6に示す判定順序の方法で多数決判定を行い、多数決結果の値を採用する。RAM配列の更新順序は、A→B→C→Dのように設定されており、更新途中でCPU1のリセットが発生した場合も、この順序を前提条件として図6の判定順序により多数決結果が決定される。   FIG. 6 is a diagram for explaining the RAM majority decision. If the four time data RAM [0], RAM [1], RAM [2] and RAM [3] stored simultaneously at the four addresses are A, B, C, and D, respectively, the determination shown in FIG. The majority decision is made by the order method, and the value of the majority decision is adopted. The update order of the RAM array is set as A → B → C → D. Even when the CPU 1 is reset during the update, the majority result is determined by the determination order of FIG. Is done.

図7は、RAMデータと採用データの関係を示す図である。すなわち、RAM値またはEEPROM値のどちらを採用データとするかは、分カウンタ(RAM)値の多数決判定結果、分カウンタの妥当性、EEPROM4の時刻アドレスエリアの多数決判定結果、EEPROM4の時刻アドレスエリアの妥当性、秒カウンタ(RAM)値の多数決判定結果、および秒カウンタの妥当性が、OKかNGかによって決定される。   FIG. 7 is a diagram showing the relationship between RAM data and adopted data. That is, whether the RAM value or the EEPROM value is adopted data depends on the majority decision result of the minute counter (RAM) value, the validity of the minute counter, the majority decision result of the time address area of the EEPROM 4, and the time address area of the EEPROM 4 The validity, the majority decision result of the second counter (RAM) value, and the validity of the second counter are determined by OK or NG.

図8は、分カウンタ、アドレスエリアおよび秒カウンタの妥当性の判定基準を示す図である。分カウンタ妥当性は、RAM値が60〜779の時OK、それ以外はNGとする。秒カウンタ妥当性は、RAM値が0〜59の時OK、それ以外はNGとする。アドレスエリア妥当性は、EEPROM値のアドレスポイント、データ共に以下の値(AND条件)であればOK、それ以外はNGとする。
アドレスポイント:91〜101、データ:0x00または0x1F
FIG. 8 is a diagram showing criteria for determining the validity of the minute counter, the address area, and the second counter. The validity of the minute counter is OK when the RAM value is 60 to 779, and NG otherwise. The validity of the second counter is OK when the RAM value is 0 to 59, and NG otherwise. The validity of the address area is OK if the address point and data of the EEPROM value are the following values (AND conditions), and NG otherwise.
Address point: 91-101, data: 0x00 or 0x1F

次に、図7に示すRAMデータと採用データの関係に基づいて、CPU1のWakeUp時に行われる処理について説明する。
(1)No.1の時
・処理なし。
(2)No.2およびNo.3の時
・秒カウンタ(RAM)をリセット(=0)する。
・時計関連レジスタの初期化を行う。
(3)No.4〜No.24において、EEPROM読み込みエラーが発生している時
・アドレスエリアをアドレス:先頭アドレス=91、データ:0x1Fに設定する。
・分カウンタ(RAM)をリセット(=60[分])する。
・秒カウンタ(RAM)をリセット(=0[秒])する。
・時計関連レジスタの初期化を行う。
(4)No.4〜No.24において、EEPROM読み込みエラーが発生していない時
・先頭アドレスから順にデータを読み込み、11〜15ビット(時刻アドレスエリア)のビット内容の多数決判定を行う。11〜15ビットは、オール0(00000)またはオール1(11111)にセットされるが、電源異常によりオール0またはオール1以外のデータ(たとえば、010011、11100等)になってしまうことがある。このような場合、多数決判定により、010011はオール0とみなされ、11100はオール1とみなされる。
・多数決判定の結果が変化したアドレスを変化点とする。変化点を検出したら、それ以降は多数決判定を行わない。
Next, processing performed when the CPU 1 performs WakeUp will be described based on the relationship between the RAM data and the adopted data shown in FIG.
(1) No. When 1, no processing.
(2) No. 2 and no. 3 Resets the hour / second counter (RAM) (= 0).
・ Initialize clock-related registers.
(3) No. 4-No. In 24, when an EEPROM read error has occurred, the address area is set to address: head address = 91, data: 0x1F.
Reset the minute counter (RAM) (= 60 [minutes]).
-Reset the second counter (RAM) (= 0 [seconds]).
・ Initialize clock-related registers.
(4) No. 4-No. At 24, when an EEPROM read error has not occurred, data is read in order from the head address, and a majority decision of the bit contents of 11 to 15 bits (time address area) is made. The 11 to 15 bits are set to all 0 (00000) or all 1 (11111), but may be data other than all 0 or all 1 (for example, 010011, 11100, etc.) due to a power failure. In such a case, according to the majority decision, 010011 is regarded as all 0 and 11100 is regarded as all 1.
・ The address where the result of majority decision is changed is taken as the change point. If a change point is detected, the majority decision is not made thereafter.

この場合の時刻データ格納エリアのEEPROM内容の例を図9に示す。図9においては、時刻アドレスエリアのビットデータは、アドレス91U〜93Uでは0x00、94U〜101Uでは0x1Fとなっているので、アドレス94Uが変化点として検出される。   An example of the EEPROM contents in the time data storage area in this case is shown in FIG. In FIG. 9, the bit data in the time address area is 0x00 for addresses 91U to 93U and 0x1F for 94U to 101U, so address 94U is detected as a change point.

・変化点を検出できない場合は、先頭アドレスを変化点とする。 • If the change point cannot be detected, the start address is taken as the change point.

この場合の時刻データ格納エリアのEEPROM内容の例を図10に示す。図10においては、時刻アドレスエリアのビットデータは、全てのアドレスで0x00となっているので、アドレス91Uが変化点となる。   An example of the EEPROM contents in the time data storage area in this case is shown in FIG. In FIG. 10, since the bit data in the time address area is 0x00 at all addresses, the address 91U becomes the changing point.

・変化点のアドレスとデータをRAMに格納する。たとえば、図9の場合は、アドレス:94U、データ:0x00をRAMに格納する。また、図10の場合は、アドレス:91U、データ:0x1FをRAMに格納する。 Store the change point address and data in RAM. For example, in the case of FIG. 9, address: 94U and data: 0x00 are stored in the RAM. In the case of FIG. 10, the address: 91U and the data: 0x1F are stored in the RAM.

・(変化点−1)アドレス(すなわち、変化点のアドレスより1つ前のアドレス)のデータを読み込みデータ(時刻データ)とする。ただし、先頭アドレスが変化点の場合は、最終アドレスのデータを読み込みデータ(時刻データ)とする。たとえば、図9の場合は、変化点のアドレスが先頭アドレス94Uであるので、その1つ前のアドレス93Uに格納されているデータが読み込み(採用)データ:74[分]となり、図10の場合は、変化点のアドレスが先頭アドレス91Uであるので、最終アドレス101Uに格納されているデータが読み込み(採用)データ:90[分]となる。 (Change point-1) The data at the address (that is, the address immediately before the change point address) is read data (time data). However, when the head address is a change point, the data of the last address is read data (time data). For example, in the case of FIG. 9, since the address of the change point is the head address 94U, the data stored in the previous address 93U is read (adopted) data: 74 [minutes], and in the case of FIG. Since the address of the change point is the start address 91U, the data stored in the final address 101U is read (adopted) data: 90 [minutes].

・読み込まれたEEPROMの時刻データの妥当性判定を行う。この妥当性の判定基準は、図8に示す分カウンタ妥当性の判定基準と同じである。
・妥当性判定結果がOKの場合は、読み込みデータを分カウンタ(RAM)に格納する。
・妥当性判定結果がNGの場合は、分カウンタ(RAM)をリセット(=60[分])する。
・秒カウンタ(RAM)をリセット(=0[秒])する。
・時計関連レジスタ初期化を行う。
-Validate the time data of the read EEPROM. The validity criterion is the same as the minute counter validity criterion shown in FIG.
When the validity determination result is OK, the read data is stored in the minute counter (RAM).
When the validity determination result is NG, the minute counter (RAM) is reset (= 60 [minutes]).
-Reset the second counter (RAM) (= 0 [seconds]).
・ Initialize clock-related registers.

以上のように処理が行われるが、変化点が2つ生じる特異な例があるので、以下に説明する。   Although the process is performed as described above, there is a unique example in which two change points are generated, which will be described below.

EEPROM4の時刻データ格納エリアに、図11(A)に示すデータが書き込まれていたとする。この場合は、WakeUp時に、EEPROM4のデータを採用する条件で、+Bオフ→オン、IGオフ→オンした時、1:30のデータが読み出され、“1:30”が表示される。   Assume that the data shown in FIG. 11A is written in the time data storage area of the EEPROM 4. In this case, at the time of WakeUp, when the data of the EEPROM 4 is adopted, + B off → on, IG off → on, 1:30 data is read and “1:30” is displayed.

その後、11分間放置し、“1:41”表示の時にEEPROMを脱着する。脱着後、2分間放置し、“1:43”表示の時にEEPROMを装着する。装着後2分間放置し、IGオン→オフ、+Bオン→オフする。この場合、図11(B)に示すように、変化点が2つ生じる。   Thereafter, it is left for 11 minutes, and the EEPROM is removed when “1:41” is displayed. After desorption, leave for 2 minutes, and install “EEPROM” when “1:43” is displayed. Leave for 2 minutes after installation, turn IG on → off, + B on → off. In this case, two change points are generated as shown in FIG.

これは、分カウンタ(RAM)値をEEPROM4に書き込む(エントリーする)際に、書き込みエラーにかかわらず、書き込みアドレスを+1するためである。   This is because when the minute counter (RAM) value is written (entry) in the EEPROM 4, the write address is incremented by 1 regardless of the write error.

そこで、再度WakeUp時に、EEPROM4のデータを採用する条件で、+Bオフ→オン、IGオフ→オンした時、始めの変化点より1:32のデータが読み出され、“1:32”が表示される。   Therefore, at the time of WakeUp again, when the data of EEPROM4 is adopted, when + B off → on, IG off → on, 1:32 data is read from the first change point and “1:32” is displayed. The

次に、上述のWakeUp時の処理を、図12および図13に示すフローチャートで説明する。   Next, the process at the time of WakeUp will be described with reference to the flowcharts shown in FIGS.

まず、分カウンタ(RAM)値の多数決結果、分カウンタ(RAM)の妥当性、アドレスエリアの多数決結果およびアドレスエリアの妥当性が、全てオーケーか否かを判定する(ステップS301)。   First, it is determined whether the majority result of the minute counter (RAM) value, the validity of the minute counter (RAM), the majority result of the address area, and the validity of the address area are all okay (step S301).

その答がイエスならば、次いで、秒カウンタ(RAM)の多数決結果または妥当性がオーケーか否かを判定する(ステップS302)。その答がノーならば、処理を終了し、イエスならば、ステップS303に進む。ステップS303では、秒カウンタ(RAM)の初期化(リセット)(=0[秒])を行う。次いで、時計関連レジスタの初期化を行い(ステップS304)、次いで処理を終了する。   If the answer is yes, then it is determined whether the majority result or validity of the second counter (RAM) is okay (step S302). If the answer is no, the process ends. If yes, the process proceeds to step S303. In step S303, the second counter (RAM) is initialized (reset) (= 0 [seconds]). Next, initialization of the clock-related registers is performed (step S304), and then the processing is terminated.

一方、ステップS301の答がノーならば、次いで、EEPROM4の読み込みエラーが発生しているか否かを判定する(ステップS305)。その答がイエスならば(すなわち、EEPROM読み込みエラーが発生している場合)、次いで、アドレスエリア(RAM)を先頭アドレス(=91U)に設定し(ステップS306)、次いで、アドレスデータ(RAM)を0x1F(すなわち、オール1)に設定する(ステップS307)。   On the other hand, if the answer to step S301 is no, it is then determined whether or not an EEPROM 4 read error has occurred (step S305). If the answer is yes (ie, if an EEPROM read error has occurred), then the address area (RAM) is set to the top address (= 91U) (step S306), and then the address data (RAM) is set. It is set to 0x1F (that is, all 1) (step S307).

次に、分カウンタ(RAM)を初期化(=60[分])し(ステップS308)、次いで、秒カウンタ(RAM)を初期化(=0[秒])し(ステップS309)、次いで、時計関連レジスタを初期化し(ステップS310)、次いで処理を終了する。   Next, the minute counter (RAM) is initialized (= 60 [minutes]) (step S308), then the second counter (RAM) is initialized (= 0 [seconds]) (step S309), then the clock The related registers are initialized (step S310), and the process is then terminated.

一方、ステップS305の答がノーならば(すなわち、EEPROM読み込みエラーが発生していない場合)、次いで、先頭アドレスから時刻データを読み込む(ステップS311)。   On the other hand, if the answer to step S305 is no (ie, no EEPROM read error has occurred), then time data is read from the head address (step S311).

次に、アドレス(i)を更新し(ステップS312)、次に、最終アドレスまで読み込みが終了したか(i>11)否かを判定する(ステップS313)。その答がノーならばステップS314に進む、イエスならばステップS318に進む。   Next, the address (i) is updated (step S312), and then it is determined whether or not reading to the last address is completed (i> 11) (step S313). If the answer is no, the process proceeds to step S314, and if yes, the process proceeds to step S318.

ステップS314で、(アドレスエリア+i)の時刻データを取得し、次いで、多数決処理を行い(ステップS315)、次いで、変化点があるか否かを判定する(ステップS316)。その答えがノーならばステップS317に進み、イエスならばステップS319に進む。ステップS317で、アドレス(i)を1だけインクリメントし(ステップS317)、次いで、ステップS313に戻る。   In step S314, time data of (address area + i) is acquired, then majority processing is performed (step S315), and then it is determined whether there is a change point (step S316). If the answer is no, the process proceeds to step S317, and if yes, the process proceeds to step S319. In step S317, the address (i) is incremented by 1 (step S317), and then the process returns to step S313.

一方、ステップS318で、先頭アドレスを変化点アドレスとし、次いで、変化点の時刻アドレスデータおよび変化点に基づき読み込むべき時刻データの取得を行う(ステップS319)。ここで、変化点に基づき読み込むべき時刻データは、変化点のアドレスの1つ前のアドレスに格納されている時刻データ、または変化点が先頭アドレスの場合は最終アドレスに格納されている時刻データである。   On the other hand, in step S318, the start address is set as the change point address, and then the time address data at the change point and the time data to be read are acquired based on the change point (step S319). Here, the time data to be read based on the change point is the time data stored at the address immediately before the change point address, or the time data stored at the last address when the change point is the start address. is there.

次に、読み込まれた時刻データの妥当性がOKか否かを判定し(ステップS320)、その答がイエスならば、次いで、読み込まれたデータを分カウンタ(RAM)に格納して(ステップS321)、ステップS323に進み、その答えがノーならば、次いで、分カウンタ(RAM)を初期化((=60[分]して(ステップS322)、ステップS323に進む。   Next, it is determined whether or not the validity of the read time data is OK (step S320). If the answer is yes, then the read data is stored in the minute counter (RAM) (step S321). ), The process proceeds to step S323, and if the answer is no, then the minute counter (RAM) is initialized (= 60 [minutes] (step S322), and the process proceeds to step S323.

ステップS323では、秒カウンタ(RAM)を初期化(=0[秒])し、次いで、時計関連レジスタを初期化し(ステップS324)、次いで処理を終了する。   In step S323, a second counter (RAM) is initialized (= 0 [second]), then a clock related register is initialized (step S324), and then the process is terminated.

4.EEPROM書き込み
・EEPROM4に書き込む(エントリーする)時には、書き込みアドレスとアドレスデータが求まっている。
・EEPROM4に書き込む(エントリーする)タイミングは、分カウンタ(RAM)の更新時とする。
・EEPROM4に書き込む(エントリーする)条件には、正時合わせ終了時、修正モード終了時、修正モード中の分カウンタ(RAM)の更新時も含む。
・EEPROM4に書き込み(エントリー)したら、書き込みエラーに関わらず書き込みアドレスを+1する。
・書き込みアドレスが最終アドレスに達したら、書き込みアドレスを先頭アドレスに移動する。その際、アドレスデータを1の補数にする。すなわち、最終アドレスデータが0x00の時は0x1F、0x1Fの時0x00をアドレスデータ(RAM)に設定する。
・書き込みエラー時でも、書き込み(EEPROMにエントリー)は行う。
4). When writing to EEPROM or writing into EEPROM 4 (entry), a write address and address data are obtained.
The timing for writing (entry) into the EEPROM 4 is when the minute counter (RAM) is updated.
The condition for writing (entry) into the EEPROM 4 includes the end of the correct time, the end of the correction mode, and the update of the minute counter (RAM) during the correction mode.
When writing (entry) to the EEPROM 4, the write address is incremented by 1 regardless of a write error.
• When the write address reaches the final address, move the write address to the top address. At this time, the address data is set to one's complement. That is, 0x1F is set as address data (RAM) when the final address data is 0x00, and 0x00 is set when 0x1F.
• Write (entry into EEPROM) even when a write error occurs.

5.正時合わせ
正時合わせは、通常時計表示時にクロックSW(図示しない)を所定時間(たとえば、0.8±0.08秒)以内に押下することにより分桁、秒データをリセットするものである。なお、リセット時、分桁が00〜29の場合、時桁への桁上げは行わず、分桁が30〜59の場合は、時桁への桁上げを行う。
5). Correct time setting Correct time setting is to reset the minute digit and second data by pressing the clock SW (not shown) within a predetermined time (for example, 0.8 ± 0.08 seconds) during normal clock display. . At the time of resetting, when the minute digit is 00 to 29, the carry to the hour digit is not performed, and when the minute digit is 30 to 59, the carry to the hour digit is performed.

次に、正時合わせ時の処理について説明する。
・正時合わせ終了時に、正時合わせ値を分カウンタ(RAM)に格納する。
・秒カウンタ(RAM)をリセット(=0[秒])する。
・時計関連レジスタ初期化を行う。
・正時合わせ値が格納された分カウンタ(RAM)値を、EEPROM4に書き込む(エントリーする)。なお、正時合わせ終了時に、正時合わせを行う前と分カウンタ(RAM)値が同一(たとえば、“2:00”表示中に正時合わせされた時)であっても、EEPROM4に書き込む(エントリーする)。
Next, processing at the time of setting the time will be described.
-At the end of the time setting, the time setting value is stored in the minute counter (RAM).
-Reset the second counter (RAM) (= 0 [seconds]).
・ Initialize clock-related registers.
The minute counter (RAM) value in which the correct time value is stored is written (entry) in the EEPROM 4. At the end of the correct time setting, even if the minute counter (RAM) value is the same as before the correct time setting (for example, when the correct time is set while “2:00” is displayed), it is written in the EEPROM 4 ( To enter).

次に、正時合わせ時の処理例をいくつか説明する。   Next, some examples of processing at the time setting will be described.

(例1)“1:29”表示中に正時合わせされた時(時桁への桁上げあり)
・“1:00”表示となり、分カウンタ(RAM)に“1:00”のデータ(=60[分])を格納する。
・分カウンタ(RAM)値(=60[分])をEEPROM4に書き込む(エントリーする)。
(Example 1) When the hour is set on the hour while “1:29” is displayed (with carry to the hour digit)
“10:00” is displayed, and data “10:00” (= 60 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 60 [minutes]) to the EEPROM 4 (entry).

(例2)“1:30”表示中に正時合わせされた時(時桁への桁上げあり)
・“2:00”表示となり、分カウンタ(RAM)に“2:00”のデータ(=120[分])を格納する。
・分カウンタ(RAM)値(=120[分])をEEPROM4に書き込む(エントリーする)。
(Example 2) When the hour is set on the hour while “1:30” is displayed (with carry to the hour digit)
“2:00” is displayed, and “2:00” data (= 120 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 120 [minutes]) to the EEPROM 4 (entry).

(例3)“2:00”表示中に正時合わせされた時(時桁への桁上げなし)
・“2:00”表示となり、分カウンタ(RAM)に“2:00”のデータ(=120[分])を格納する。
・分カウンタ(RAM)値(=120[分])をEEPROM4に書き込む(エントリーする)。
(Example 3) When the hour is set while “2:00” is displayed (no carry to the hour digit)
“2:00” is displayed, and “2:00” data (= 120 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 120 [minutes]) to the EEPROM 4 (entry).

(例4)“12:45”表示中に正時合わせされた時(時桁への桁上げあり)
・“1:00”表示となり、分カウンタ(RAM)に“1:00”のデータ(=60[分])を格納する。
・分カウンタ(RAM)値(=60[分])をEEPROM4に書き込む(エントリーする)。
(Example 4) When the hour is set on the hour while “12:45” is displayed (with carry to the hour digit)
“10:00” is displayed, and data “10:00” (= 60 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 60 [minutes]) to the EEPROM 4 (entry).

6.修正モード
修正モードでは、分桁修正および時桁修正をおこなうことができる。図14は、修正モード時のモード遷移図を示す。修正モードは、通常時計表示においてクロックSW(図示しない)を第1所定時間(たとえば、0.8±0.08秒)以上押下した時、分桁修正モードとなり、また分桁修正モードにおいて第2所定時間(たとえば、5.0±0.5秒)以上操作しなかった時、時桁修正モードになり、さらに、時桁修正モードにおいて第2所定時間(たとえば、5.0±0.5秒)以上操作しなかった時、通常時計表示に戻るものである。分桁修正モード時には、表示器3における分桁表示を点滅させ、時桁修正モード時には、表示器3における時桁表示を点滅させる。
6). Correction mode In the correction mode, minute digits and hour digits can be corrected. FIG. 14 shows a mode transition diagram in the correction mode. The correction mode is the minute digit correction mode when the clock SW (not shown) is pressed for a first predetermined time (for example, 0.8 ± 0.08 seconds) or more in the normal clock display, and the second in the minute digit correction mode. When no operation is performed for a predetermined time (for example, 5.0 ± 0.5 seconds) or more, the hour digit correction mode is set. Further, in the time digit correction mode, the second predetermined time (for example, 5.0 ± 0.5 seconds) is set. ) When no operation is performed, the normal clock display is restored. In the minute digit correction mode, the minute digit display on the display unit 3 is blinked, and in the hour digit correction mode, the hour digit display on the display unit 3 is blinked.

次に、修正モード時の処理について説明する。
・時桁修正モード終了時に、修正値を分カウンタ(RAM)に格納する。
・分桁修正モードから時桁修正モードに移行した時は、分カウンタ(RAM)を更新しない。ただし、時桁および分桁修正モード中に分カウンタ(RAM)がカウントアップされた時は、分カウンタ(RAM)を更新すると共に、EEPROM4に更新された分カウンタ(RAM)値を書き込む(エントリーする)。
・修正モード終了時には、秒カウンタ(RAM)のリセット(=0[秒])および時計関連レジスタ初期化は行わない。
・修正モード中にIG OFFされた時は、修正値は保持しない。
Next, processing in the correction mode will be described.
• When the hour digit correction mode ends, the correction value is stored in the minute counter (RAM).
-When the minute digit correction mode is changed to the hour digit correction mode, the minute counter (RAM) is not updated. However, when the minute counter (RAM) is counted up during the hour digit and minute digit correction mode, the minute counter (RAM) is updated and the updated minute counter (RAM) value is written into the EEPROM 4 (entry is entered). ).
At the end of the correction mode, the second counter (RAM) is not reset (= 0 [seconds]) and the clock-related registers are not initialized.
・ If IG is turned off during the correction mode, the correction value is not retained.

次に、修正モード時の処理例をいくつか説明する。   Next, some processing examples in the correction mode will be described.

(例1)修正モード中に分カウンタ(RAM)がカウントアップされない時(1)
・“2:00”表示中に修正モードに移行し、分桁修正モードにて“2:05”に修正する。
・時桁修正モード終了時に、分カウンタ(RAM)に“2:05”のデータ(=125[分])を格納する。
・分カウンタ(RAM)値(=125[分])をEEPROM4に書き込む(エントリーする)。
(Example 1) When the minute counter (RAM) is not counted up in the correction mode (1)
・ Change to correction mode while “2:00” is displayed, and correct to “2:05” in minute digit correction mode.
At the end of the hour digit correction mode, “2:05” data (= 125 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 125 [minutes]) to the EEPROM 4 (entry).

(例2)分桁修正モード中に分カウンタ(RAM)がカウントアップされた時
・2時5分55秒頃修正モードに移行する。
・分桁修正をしようとした時に分カウンタ(RAM)値が更新された。表示も“2:06”となる。
・修正モード中に更新された分カウンタ(RAM)値(=126[分])をEEPROM4に書き込む(エントリーする)。
・分桁修正モードにて“2:10”に修正する。
・時桁修正モード終了時に分カウンタ(RAM)に“2:10”のデータ(=130[分])を格納する。
・分カウンタ(RAM)値(=130[分])をEEPROM4に書き込む(エントリーする)。
(Example 2) When the minute counter (RAM) is counted up during the minute digit correction mode, the mode shifts to the correction mode at about 2: 5: 55.
-The minute counter (RAM) value was updated when trying to correct the minute digit. The display is also “2:06”.
The minute counter (RAM) value (= 126 [minutes]) updated during the correction mode is written (entered) into the EEPROM 4.
-Correct to "2:10" in minute digit correction mode.
When the hour digit correction mode ends, “2:10” data (= 130 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 130 [minutes]) to the EEPROM 4 (entry).

(例3)修正モードを終了し修正値をEEPROMに書き込む(エントリーする)直前に分カウンタ(RAM)値がカウントアップされた時
・“2:10”表示中に修正モードに移行し、分桁修正モードにて“2:15”に修正する。
・時桁修正モード終了時に分カウンタ(RAM)に“2:15”のデータ(=135[分])を格納する。
・分カウンタ(RAM)値(=135[分])をEEPROM4に書き込む(エントリーする)直前に分カウンタ(RAM)が更新され、分カウンタ(RAM)値は136[分]になった。
・EEPROM4には、“2:16”のデータ(=136[分])が書き込まれる(エントリーされる)。この時、“2:15”のデータ(=135[分])はEEPROM4に書き込まない(エントリーされない)。
(Example 3) When the minute counter (RAM) value is counted up just before the correction mode is finished and the correction value is written to the EEPROM (entry) ・ The mode shifts to the correction mode while “2:10” is displayed, and the minute digits Correct to “2:15” in the correction mode.
When the hour digit correction mode ends, “2:15” data (= 135 [minutes]) is stored in the minute counter (RAM).
The minute counter (RAM) was updated immediately before writing (entry) the minute counter (RAM) value (= 135 [minute]) to the EEPROM 4, and the minute counter (RAM) value became 136 [minute].
In the EEPROM 4, “2:16” data (= 136 [minutes]) is written (entered). At this time, the data “2:15” (= 135 [minutes]) is not written (not entered) in the EEPROM 4.

(例4)修正モード中に分カウンタ(RAM)がカウントアップされない時(2)
・“2:20”表示中に修正モードに移行し、修正モードにてクロックSWを操作しない、または分桁修正モードにて“2:20”に修正する。
・時桁修正モード終了時に、分カウンタ(RAM)に“2:20”のデータ(=140[分])を格納する。
・分カウンタ(RAM)値(=140[分])をEEPROM4に書き込む(エントリーする)。
(Example 4) When the minute counter (RAM) is not counted up in the correction mode (2)
・ Change to correction mode while “2:20” is displayed, do not operate clock SW in correction mode, or correct to “2:20” in minute digit correction mode.
At the end of the hour digit correction mode, “2:20” data (= 140 [minutes]) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 140 [minutes]) to the EEPROM 4 (entry).

(例5)時桁修正モード中に分カウンタ(RAM)がカウントアップされた時
・2時59分53秒頃修正モードに移行する。
・分桁修正モードでは5秒以上SWを操作せず、時桁修正モードに移行する。
・時桁修正をしようとした時に、分カウンタ(RAM)値が更新された。表示も“3:00”となる。
・修正モード中に更新された分カウンタ(RAM)値(=180[分])をEEPROM4に書き込む(エントリーする)。
・時桁修正モードにて“1:00”に修正する。
・時桁修正モード終了時に、分カウンタ(RAM)に“1:00”のデータ(=60([分])を格納する。
・分カウンタ(RAM)値(=60[分])をEEPROM4に書き込む(エントリーする)。
(Example 5) When the minute counter (RAM) is counted up in the hour digit correction mode. The mode shifts to the correction mode at around 2:59:53.
・ In minute digit correction mode, switch to the hour digit correction mode without operating the SW for more than 5 seconds.
-The minute counter (RAM) value was updated when trying to correct the hour digits. The display is also “3:00”.
The minute counter (RAM) value (= 180 [minutes]) updated during the correction mode is written (entered) into the EEPROM 4.
-Correct to "1:00" in hour digit correction mode.
At the end of the hour digit correction mode, data of “10:00” (= 60 ([minute])) is stored in the minute counter (RAM).
Write the minute counter (RAM) value (= 60 [minutes]) to the EEPROM 4 (entry).

以上のように、上述の時刻修正処理が行われた場合、リセット後に表示器3に表示された時計表示が、リアルタイムから分単位で遅れていた場合は、通常時計表示から分桁修正モードに移行させ、分桁の数字をプラスする方向に修正してリアルタイムに合わせる作業を行い、その作業終了後ほぼ10秒間待機すると、自動的に通常時計表示に戻って、リアルタイムに合った通常時計表示となる。   As described above, when the above-described time correction processing is performed, when the clock display displayed on the display device 3 after the reset is delayed in minutes from real time, the normal clock display is shifted to the minute digit correction mode. Then, the work is adjusted in the direction of adding a minute digit and adjusted in real time. After the operation is completed, when waiting for about 10 seconds, the normal clock display is automatically returned to the normal clock display that matches the real time. .

また、もし、時桁単位でもリアルタイムから遅れていた場合は、分桁修正モードから時桁修正モードに移行した時に、時桁の数字をリアルタイムに合わせる作業を行い、その作業終了後ほぼ5秒間待機すると、自動的に通常時計表示に戻って、リアルタイムに合った通常時計表示となる。   Also, if it is delayed from the real time even in the hour digit unit, when shifting from the minute digit correction mode to the hour digit correction mode, work is performed to adjust the hour digit number in real time, and waits for about 5 seconds after the work is completed. Then, the display automatically returns to the normal clock display, and the normal clock display in real time is obtained.

従来の場合は、リセット時に時計表示が0:00または1:00に初期化されてしまうため、分桁および時桁の両方を修正する必要があったが、本発明によれば、1分以内の遅れならば、修正作業をすることなく自動的に時刻修正がなされ、表示器3にリアルタイムの時刻が表示される。また、分単位の遅れならば、分桁の修正のみで済むので、運転手は、わずかな労力で時刻修正ができる。   In the conventional case, since the clock display is initialized to 0:00 or 1:00 at the time of resetting, it is necessary to correct both the minute digit and the hour digit. If there is a delay, the time is automatically corrected without any correction work, and the real-time time is displayed on the display 3. Also, if the delay is in minutes, only the minute digits need be corrected, so the driver can correct the time with little effort.

以上の通り、本発明の実施の形態について説明したが、本発明はこれに限らず、種々の変形、応用が可能である。   As described above, the embodiment of the present invention has been described. However, the present invention is not limited to this, and various modifications and applications are possible.

本発明の最良の形態に係る時刻修正方法を実施する機器のブロック図である。It is a block diagram of the apparatus which implements the time correction method which concerns on the best form of this invention. 図1の機器における電源オン時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of power-on in the apparatus of FIG. 図2のフローチャートにおけるステップS3の時刻演算処理中で行われる一部のサブルーチンである、時刻データの格納動作を示すフローチャートである。3 is a flowchart showing a time data storing operation, which is a part of a subroutine performed during the time calculation process of step S3 in the flowchart of FIG. 図1の機器のEEPROMにおける時刻データ格納エリアのデータ構成を示す図である。It is a figure which shows the data structure of the time data storage area in EEPROM of the apparatus of FIG. リアルタイム時計機能で使用されるRAMのデータ構成を示す図である。It is a figure which shows the data structure of RAM used by a real-time clock function. RAMデータの多数決判定を説明する図である。It is a figure explaining the majority decision of RAM data. RAMデータと採用データの関係を示す図である。It is a figure which shows the relationship between RAM data and adoption data. 分カウンタ、アドレスエリアおよび秒カウンタの妥当性の判定基準を示す図である。It is a figure which shows the determination criteria of the validity of a minute counter, an address area, and a second counter. 変化点の検出を説明するための時刻データ格納エリアのEEPROM内容の例を示す図である。It is a figure which shows the example of the EEPROM content of the time data storage area for demonstrating the detection of a change point. 変化点の検出を説明するための時刻データ格納エリアのEEPROM内容の例を示す図である。It is a figure which shows the example of the EEPROM content of the time data storage area for demonstrating the detection of a change point. (A)および(B)は、変化点が2つ生じる場合の変化点の検出を説明するための時刻データ格納エリアのEEPROM内容の例を示す図である。(A) And (B) is a figure which shows the example of the EEPROM content of the time data storage area for demonstrating the detection of a change point in case two change points arise. WakeUp時の処理を示すフローチャートである。It is a flowchart which shows the process at the time of WakeUp. WakeUp時の処理を示すフローチャートである。It is a flowchart which shows the process at the time of WakeUp. 修正モード時のモード遷移図を示す。The mode transition diagram at the time of correction mode is shown. 従来のリアルタイム時計表示機能を有する機器のブロック図である。It is a block diagram of the apparatus which has the conventional real-time clock display function. 図15の機器における電源オン時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of power-on in the apparatus of FIG.

符号の説明Explanation of symbols

1 CPU
2 安定化電源回路
3 表示器
4 EEPROM(不揮発性メモリ)
5 ウォッチドッグタイマ
1 CPU
2 Stabilized power supply circuit 3 Display 4 EEPROM (nonvolatile memory)
5 Watchdog timer

Claims (6)

時計の時刻演算機能を有するCPUと、該CPUから時刻演算機能で演算された時刻データが供給されて時刻を表示する表示器とを備えた機器において、
前記時刻データを所定の時刻単位毎に不揮発性メモリに格納し、電源電圧が動作保証電圧以下に低下して前記CPUがリセットされたとき、前記不揮発性メモリに格納されているリセット直前の時刻データを読み出して前記表示器で表示すると共に、読み出した時刻データからスタートする時刻を演算することにより、リセット後に表示される時刻を修正する
ことを特徴とする時刻修正方法。
In a device comprising a CPU having a time calculation function of a clock, and a display that displays time by supplying time data calculated by the time calculation function from the CPU,
The time data is stored in the nonvolatile memory every predetermined time unit, and the time data immediately before the reset is stored in the nonvolatile memory when the power supply voltage falls below the operation guarantee voltage and the CPU is reset. A time correction method characterized in that the time displayed after resetting is corrected by calculating the start time from the read time data, while reading out and displaying on the display.
時計の時刻演算機能を有し、時刻演算機能で演算された時刻データを所定の時刻単位毎に内部メモリに格納するCPUと、該CPUから時刻データが供給されて時刻を表示する表示器とを備えた機器において、
前記時刻データを所定の時刻単位毎に不揮発性の外部メモリに格納し、電源電圧が動作保証電圧以下に低下して前記CPUがリセットされたとき、前記内部メモリに格納されているリセット直前の時刻データの妥当性を判定し、妥当性ありの場合は、前記時刻データを前記表示器に供給して表示させると共に該時刻データからスタートする時刻を演算し、妥当性なしの場合は、前記外部メモリに格納されている時刻データを前記表示器に供給して表示させると共に該時刻データからスタートする時刻を演算することにより、リセット後に表示される時刻を修正する
ことを特徴とする時刻修正方法。
A CPU having a time calculation function of a clock, storing time data calculated by the time calculation function in an internal memory every predetermined time unit, and a display for displaying the time when the time data is supplied from the CPU In the equipment provided,
The time data is stored in a non-volatile external memory every predetermined time unit, and when the power supply voltage falls below the operation guarantee voltage and the CPU is reset, the time immediately before the reset stored in the internal memory The validity of the data is determined. If the data is valid, the time data is supplied to the display for display, and the time starting from the time data is calculated. A time correction method comprising: correcting the time displayed after resetting by supplying the time data stored in the display to the display and displaying the time data and calculating a time starting from the time data.
請求項1または2記載の時刻修正方法において、
時刻データは、分単位毎に不揮発性メモリに格納されることを特徴とする時刻修正方法。
The time correction method according to claim 1 or 2,
A time correction method, wherein time data is stored in a non-volatile memory every minute.
請求項3記載の時刻修正方法において、
不揮発性メモリは、各アドレスに、複数ビットからなる時刻アドレスエリアと複数ビットからなる時刻データエリアとで構成される1ワードで表される時刻データが格納される、複数のアドレスを有する時刻データ格納エリアを有し、
時刻データエリアには、分単位の時刻データが順次格納され、
格納された複数の時刻データの中から、リセット直前に格納された時刻データが読み出されることを特徴とする時刻修正方法。
The time correction method according to claim 3,
The nonvolatile memory stores time data having a plurality of addresses in which time data represented by one word composed of a time address area composed of a plurality of bits and a time data area composed of a plurality of bits is stored in each address. Has an area,
In the time data area, time data in minutes are sequentially stored,
A time correction method, wherein time data stored immediately before resetting is read out from a plurality of stored time data.
請求項4記載の時刻修正方法において、
時刻データは、複数のアドレスの先頭アドレスから最終アドレスまで格納されるたびに、再び先頭アドレスから書き換えられ、
時刻アドレスエリアは、時刻データが書き換えられるたびに全て0から全て1にまたは全て1から全て0に書き換えられる奇数個のビットを有することを特徴とする時刻修正方法。
The time correction method according to claim 4,
The time data is rewritten from the top address again every time it is stored from the top address to the last address of multiple addresses,
The time address area has an odd number of bits that are rewritten from all 0s to all 1s or all 1s to all 0s whenever time data is rewritten.
請求項5記載の時刻修正方法において、
時刻データが格納された時、時刻アドレスエリアにおける奇数個のビットの多数決判定を行い、
多数決判定の結果が変化したアドレスを変化点として検出し、
変化点が検出された場合は、変化点として検出されたアドレスの前のアドレスに格納されている時刻データが、前記リセット直前の時刻データとして読み出され、
変化点が検出されなかった場合は、先頭アドレスを変化点とみなすと共に、最終アドレスに格納されている時刻データが、前記リセット直前の時刻データとして読み出されることを特徴とする時刻修正方法。
The time correction method according to claim 5,
When the time data is stored, the majority decision of the odd number of bits in the time address area is performed,
Detect the address where the majority decision result has changed as a change point,
When the change point is detected, the time data stored in the address before the address detected as the change point is read as the time data immediately before the reset,
A time correction method characterized in that, when a change point is not detected, a head address is regarded as a change point, and time data stored in a final address is read as time data immediately before the reset.
JP2004149146A 2004-05-19 2004-05-19 Time correction method Expired - Fee Related JP4464738B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004149146A JP4464738B2 (en) 2004-05-19 2004-05-19 Time correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004149146A JP4464738B2 (en) 2004-05-19 2004-05-19 Time correction method

Publications (2)

Publication Number Publication Date
JP2005331329A true JP2005331329A (en) 2005-12-02
JP4464738B2 JP4464738B2 (en) 2010-05-19

Family

ID=35486090

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004149146A Expired - Fee Related JP4464738B2 (en) 2004-05-19 2004-05-19 Time correction method

Country Status (1)

Country Link
JP (1) JP4464738B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012514249A (en) * 2008-12-30 2012-06-21 エマニュエル コンファロニエーリ Non-volatile memory with extended operating temperature range
JP2013011525A (en) * 2011-06-29 2013-01-17 Fujitsu General Ltd Electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012514249A (en) * 2008-12-30 2012-06-21 エマニュエル コンファロニエーリ Non-volatile memory with extended operating temperature range
JP2013011525A (en) * 2011-06-29 2013-01-17 Fujitsu General Ltd Electronic device

Also Published As

Publication number Publication date
JP4464738B2 (en) 2010-05-19

Similar Documents

Publication Publication Date Title
WO2016062084A1 (en) Power-off processing method and apparatus, and electronic device
US4613939A (en) Programmable service reminder apparatus and method
US4638457A (en) Method and apparatus for the non-volatile storage of the count of an electronic counting circuit
EP0494610A2 (en) TFT LCD control method for setting display controller in sleep state when no access to vram is made
JP4464738B2 (en) Time correction method
JP2007203764A (en) Displaying device for vehicle
JPH01152311A (en) Electronic type odo/tripmeter for vehicle
US20050066112A1 (en) Data read/write control system and data read/write control method
US20030065984A1 (en) Processor device equipped with flash memory and debugger apparatus
JP2004138542A (en) Flowmeter
KR100265793B1 (en) Method and apparatus for diagnosing real time clock in computer system
JPH06236695A (en) Non-volatile memory device with exchange display function
WO2016046940A1 (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory
JP2009230425A (en) Information processor
JP2010225104A (en) Electronic device
JPH09213088A (en) Engine controller
JPS6237425B2 (en)
JPS6060515A (en) Displaying method of run distance
EP0488354B1 (en) Data storage apparatus
JPH0577718U (en) Electronic odometer
JP2979099B2 (en) Data storage device
JP2004240581A (en) Method and device for detecting error in executing program
JP3530000B2 (en) Od / trip rollover processing method and electronic od / trip device
JPH01304314A (en) Electronic odometer
JP2804939B2 (en) Vehicle mileage recording device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061002

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091109

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091117

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100113

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100219

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

Free format text: PAYMENT UNTIL: 20130226

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4464738

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140226

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees