JPH06252745A - Nonvolatile counter - Google Patents

Nonvolatile counter

Info

Publication number
JPH06252745A
JPH06252745A JP5032178A JP3217893A JPH06252745A JP H06252745 A JPH06252745 A JP H06252745A JP 5032178 A JP5032178 A JP 5032178A JP 3217893 A JP3217893 A JP 3217893A JP H06252745 A JPH06252745 A JP H06252745A
Authority
JP
Japan
Prior art keywords
data
storage area
digit
rewriting
flag word
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
JP5032178A
Other languages
Japanese (ja)
Other versions
JP2917726B2 (en
Inventor
Masashi Kanda
昌司 神田
Hiroshi Niimi
浩 新美
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
NipponDenso 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 NipponDenso Co Ltd filed Critical NipponDenso Co Ltd
Priority to JP5032178A priority Critical patent/JP2917726B2/en
Publication of JPH06252745A publication Critical patent/JPH06252745A/en
Application granted granted Critical
Publication of JP2917726B2 publication Critical patent/JP2917726B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To provide a nonvolatile counter by which the reliability of stored data are always secured. CONSTITUTION:A counter section 41 consists of 200 bits, data are written sequentially by one bit each time a distance of 1km elapses and the data are entirely erased for each 200km. An integration section 42 has a storage area by 3 words (integration values A-C) to the same data. One word of a flag section 43 is prepared for each of 3-lines of data for rewrite (integration values A-C) of the integration section 42 and one word of the flag section 43 is provided for data erasure of the counter section 41. Then the erasure for carry to the counter section 1 and rewrite to the integration section 42 are implemented only after a relevant flag word is written. Thus, even when the operation of data write/ erasure by the counter section 41 and the integration section 42 is interrupted due to various reasons midst of the operation, data and a flag word are retrieved at application of power to read correct stored data at interruption of power to obtain final data surely.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、電気的に消去・書込が
可能な不揮発性記憶素子に記憶されたデータを所定のカ
ウント値に基づいて更新し、カウント動作を行う不揮発
性カウンタに係り、特にデータの更新方法に特徴を持つ
不揮発性カウンタに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a nonvolatile counter that updates the data stored in an electrically erasable / writable nonvolatile memory element based on a predetermined count value and performs a count operation. In particular, the present invention relates to a non-volatile counter characterized by a data updating method.

【0002】[0002]

【従来の技術及び発明が解決しようとする課題】従来、
例えばEEPROMのように、電気的に消去・書込が可
能な不揮発性記憶素子は、バックアップ電源を持たない
システムにおいて、電源オフ時にデータの保存を行う手
段として使用されている。一例として、パルス数等を計
数するカウント回路に並列にEEPROM(以下の説明
中、不揮発性記憶素子の代表としてEEPROMを用い
る。)を配設し、カウンタの値が変化するとその値を不
揮発性記憶素子に書き込む不揮発性カウンタが知られて
いる。
2. Description of the Related Art Conventionally, the problems to be solved by the invention
For example, an electrically erasable / writable non-volatile storage element such as an EEPROM is used as a means for saving data when the power is turned off in a system having no backup power supply. As an example, an EEPROM (an EEPROM is used as a representative of a nonvolatile memory element in the following description) is arranged in parallel with a counting circuit that counts the number of pulses, and when the value of the counter changes, the value is stored in the nonvolatile memory. Non-volatile counters that write to devices are known.

【0003】しかし、EEPROMにおける保存データ
の信憑性を確保するには、以下に示す2点に関して考慮
が必要である。第1点は、EEPROMに対するデータ
の書込・消去には通常数ms以上の時間を要することで
ある。この動作の最中に電源オフ、ノイズ重畳などが発
生しデータの書込・消去動作が中断された場合、そのデ
ータは不確定となり、保存データの信憑性は極めて低下
する。またEEPROMがビット故障を起こした場合、
そのデータが1であるか0であるかの判断は、データの
処理方法に委ねるしかない。そして、この事を改善する
方法として提案されているのは、例えば、1種類のデー
タについて複数(例えば3つ)の収納エリアを設け、3
つのデータの多数決でそのデータを判断する等の方法で
ある。
However, in order to secure the authenticity of the stored data in the EEPROM, it is necessary to consider the following two points. The first point is that it usually takes a few ms or more to write / erase data to / from the EEPROM. If the power is turned off or noise is superimposed during this operation and the data write / erase operation is interrupted, the data becomes indeterminate and the reliability of the stored data is extremely reduced. If the EEPROM has a bit failure,
The determination of whether the data is 1 or 0 depends only on the data processing method. Then, as a method of improving this, for example, a plurality of (for example, three) storage areas are provided for one type of data, and three storage areas are provided.
It is a method of judging the data by the majority vote of one data.

【0004】もう1点は、EEPROMの書換回数に制
限があることである。現状での書換回数は信頼性を考慮
すると数万回程度であり、この書換回数を越えるデータ
の書換を行えば、EEPROMがビット故障を起こす可
能性が高くなり、保存データの信憑性は極めて低下す
る。この事を改善する方法として例えば、1種類のデー
タについて複数の収納エリアを設け、書換の度に収納エ
リアを変更して1ビット当りの書換回数を低減し、保存
データの信憑性を上げる提案がされている。
Another point is that the number of rewriting times of the EEPROM is limited. At present, the number of rewrites is about tens of thousands in consideration of reliability, and if data is rewritten over this number of rewrites, there is a high possibility that the EEPROM will suffer a bit failure, and the reliability of the stored data is extremely reduced. To do. As a method of improving this, for example, a proposal has been made to provide a plurality of storage areas for one type of data, change the storage area each time rewriting to reduce the number of rewrites per bit, and increase the reliability of the stored data. Has been done.

【0005】本発明は、このような状況を鑑みてなさ
れ、その目的は、常に保存データの信憑性を確保可能な
不揮発性カウンタを提供することであり、書込・消去動
作の最中に種々の理由でその動作が中断されても常に保
存データの信憑性を確保する不揮発性カウンタ、工程能
力により制限される限界を超える書換回数を要求される
場合に対応して保存データの信憑性を確保可能な不揮発
性カウンタ、及び書込・消去動作最中の動作中断や工程
能力による限界を超える書換回数の要求があっても、常
に保存データの信憑性を確保可能な不揮発性カウンタを
提供する。
The present invention has been made in view of such circumstances, and an object thereof is to provide a non-volatile counter capable of always ensuring the authenticity of stored data, and to provide various non-volatile counters during a write / erase operation. Non-volatile counter that always secures the reliability of the stored data even if the operation is interrupted due to the reason, and the reliability of the stored data is secured when the number of rewrites exceeds the limit limited by the process capability. (EN) Provided are a non-volatile counter and a non-volatile counter capable of always ensuring the credibility of stored data even when the operation is interrupted during a write / erase operation or the number of times of rewriting exceeds the limit due to process capability.

【0006】[0006]

【課題を解決するための手段】この目的を達成するため
に成された請求項1記載の不揮発性カウンタは、図1に
例示するように、電気的に消去・書込可能な不揮発性記
憶素子に記憶されたデータを、所定のカウント値に基づ
いて更新し、カウント動作を行う不揮発性カウンタであ
って、上記不揮発性記憶素子が、1種類のデータに対し
て3つ以上設けられたデータ収納領域と、それら各デー
タ収納領域にそれぞれ対応して設けられたフラグワード
収納領域と、を有すると共に、上記データ収納領域のデ
ータを書き換える際には、それぞれ対応する上記フラグ
ワード収納領域に所定のフラグワードを書き込んだ後
に、データの書換を行う書換手段と、該書換手段による
データ書換が終了した後に、上記書き込まれたフラグワ
ードを消去する消去手段と、を備えたことを特徴とす
る。
A non-volatile counter according to claim 1, which is formed to achieve this object, is an electrically erasable / writable non-volatile memory element as shown in FIG. A non-volatile counter that updates the data stored in the memory based on a predetermined count value and performs a counting operation, wherein the non-volatile memory element is provided in three or more for one type of data. Areas and flag word storage areas provided corresponding to the respective data storage areas, and when rewriting data in the data storage areas, predetermined flags are provided in the corresponding flag word storage areas. Rewriting means for rewriting data after writing a word, and erasing for erasing the written flag word after the rewriting of data by the rewriting means is completed Characterized by comprising a stage, a.

【0007】一方、請求項2記載の不揮発性カウンタ
は、図2に例示するように、電気的に消去・書込可能な
不揮発性記憶素子に記憶されたデータを、所定のカウン
ト値に基づいて更新し、カウント動作を行う不揮発性カ
ウンタであって、上記不揮発性記憶素子が、最大計数桁
数を桁順に複数区分に分割された各区分毎に設けられ、
所定の上位桁に対応する区分について設けられた上位桁
用データ収納領域、及び所定の下位桁に対応する区分に
ついて設けられ、所定カウント値毎のイベントに応じて
1ビットずつデータを順に書き込んでいくための複数の
セルから構成された下位桁用データ収納領域と、該下位
桁用データ収納領域に対応して設けられたフラグワード
収納領域と、を有すると共に、上記下位桁用データ収納
領域において所定の桁上げ数に該当するセルにデータが
書き込まれ、桁上げのため消去する際には、上記フラグ
ワード収納領域に所定のフラグワードを書き込んだ後
に、上記下位桁対応区分のデータ収納領域のデータの消
去を行う桁上げ手段と、該桁上げ手段によるデータ消去
が終了した後に、上記書き込まれたフラグワードを消去
する消去手段と、を備えたことを特徴とする。
On the other hand, the non-volatile counter according to a second aspect of the present invention, as illustrated in FIG. 2, uses data stored in an electrically erasable / writable non-volatile storage element based on a predetermined count value. A non-volatile counter for updating and performing a counting operation, wherein the non-volatile storage element is provided for each section divided into a plurality of sections with a maximum count digit number in a digit order,
A data storage area for upper digits provided for a section corresponding to a predetermined upper digit and a section corresponding to a predetermined lower digit are provided, and data is sequentially written bit by bit in accordance with an event for each predetermined count value. And a flag word storage area provided corresponding to the lower digit data storage area and having a predetermined number in the lower digit data storage area. When data is written in the cell corresponding to the carry number of and is erased for carry, after writing a predetermined flag word in the flag word storage area, the data in the data storage area of the lower digit corresponding section is written. And carry means for erasing the data, and erasing means for erasing the written flag word after the data erasing by the carry means is completed. And it said that there were pictures.

【0008】また、請求項3記載の不揮発性カウンタ
は、図3に例示するように、電気的に消去・書込可能な
不揮発性記憶素子に記憶されたデータを、所定のカウン
ト値に基づいて更新し、カウント動作を行う不揮発性カ
ウンタであって、上記不揮発性記憶素子が、最大計数桁
数を桁順に複数区分に分割された各区分毎に設けられ、
所定の上位桁対応区分については、1種類のデータに対
して3つ以上設けられた上位桁用データ収納領域と、所
定の下位桁対応区分については、所定カウント値毎のイ
ベントに応じて1ビットずつデータを順に書き込んでい
くための複数のセルから構成された下位桁用データ収納
領域と、上記各上位桁用データ収納領域にそれぞれ対応
して設けられた上位桁用フラグワード収納領域と、上記
下位桁用データ収納領域に対応して設けられた下位桁用
フラグワード収納領域と、を有すると共に、上記上位桁
用データ収納領域のデータを書き換える際には、それぞ
れ対応する上記上位桁用フラグワード収納領域に所定の
上位桁用フラグワードを書き込んだ後に、データの書換
を行う書換手段と、該書換手段によるデータ書換が終了
した後に、上記書き込まれた上位桁用フラグワードを消
去する上位桁用消去手段と、上記下位桁対応区分のデー
タ収納領域において、所定の桁上げ数に該当するセルに
データが書き込まれ、桁上げのため消去する際には、上
記下位桁用フラグワード収納領域に所定の下位桁用フラ
グワードを書き込んだ後に、上記下位桁用データ収納領
域のデータの消去を行う桁上げ手段と、該桁上げ手段に
よるデータ消去が終了した後に、上記書き込まれた下位
桁用フラグワードを消去する上位桁用消去手段と、を備
えたことを特徴とする。
Further, as shown in FIG. 3, the non-volatile counter according to a third aspect of the invention stores data stored in an electrically erasable / writable non-volatile storage element based on a predetermined count value. A non-volatile counter for updating and performing a counting operation, wherein the non-volatile storage element is provided for each section divided into a plurality of sections with a maximum count digit number in a digit order,
For a predetermined upper digit corresponding division, three or more upper digit data storage areas are provided for one type of data, and for a predetermined lower digit corresponding division, one bit depending on an event for each predetermined count value. A lower digit data storage area composed of a plurality of cells for writing data one by one, an upper digit flag word storage area provided corresponding to each of the upper digit data storage areas, and And a lower digit flag word storage area provided corresponding to the lower digit data storage area, and when rewriting the data in the upper digit data storage area, the corresponding upper digit flag word After writing a predetermined upper digit flag word in the storage area, rewriting means for rewriting data, and after the data rewriting by the rewriting means ends, In the upper digit erasing means for erasing the entered upper digit flag word, and in the data storage area of the lower digit corresponding section, data is written in cells corresponding to a predetermined carry number, and erased for carry. At this time, after writing a predetermined lower digit flag word in the lower digit flag word storage area, carry means for erasing data in the lower digit data storage area and data erasing by the carry means. Is completed, the erasing means for upper digits erases the written flag word for lower digits.

【0009】[0009]

【作用】上記構成を有する本発明の不揮発性カウンタ
は、電気的に消去・書込可能な不揮発性記憶素子に記憶
されたデータを所定のカウント値に基づいて更新し、カ
ウント動作を行うものであり、消去・書込によるデータ
の更新に特徴を有する。
The non-volatile counter of the present invention having the above-mentioned structure is for performing the count operation by updating the data stored in the electrically erasable / writable non-volatile memory element based on the predetermined count value. Yes, and is characterized by updating data by erasing / writing.

【0010】請求項1記載の不揮発性カウンタによれ
ば、1種類のデータが、3つ以上のデータ収納領域にそ
れぞれ書き込まれ、データ収納領域のデータを書き換え
る際には、書換手段が、各データ収納領域とそれぞれ対
応するフラグワード収納領域に所定のフラグワードを書
き込んだ後にデータの書換を行い、書換手段によるデー
タ書換が終了した後に、消去手段が、その書き込まれた
フラグワードを消去する。
According to the nonvolatile counter of the first aspect, one type of data is written in each of the three or more data storage areas, and when the data in the data storage area is rewritten, the rewriting means sets each data. After writing a predetermined flag word in the flag word storage area corresponding to the storage area, the data is rewritten, and after the data rewriting by the rewriting means is completed, the erasing means erases the written flag word.

【0011】従来も、例えばデータ収納領域を3つ持
ち、その3つのデータの多数決により、1つのデータの
データ化けの検出・修正は可能であったが、2番目に書
換が行われるデータの書換動作中に、電源オフ等のトラ
ブルが発生した場合に3データ共異なったデータとなる
と、修正不可能である。
In the past, for example, there were three data storage areas, and it was possible to detect and correct the garbled data of one data by the majority decision of the three data, but the rewriting of the data to be rewritten second. If a problem such as power-off occurs during operation, if all three data are different, it cannot be corrected.

【0012】これに対し、本不揮発性カウンタによれ
ば、電源オン時にデータ収納領域のデータとフラグワー
ドを検索することにより、電源オフ時の正しい保存デー
タを読み出すことにより、確実な最終データを得ること
が可能である。従って、データ収納領域におけるデータ
の書込・消去動作の最中に種々の理由でその動作が中断
されても、常に保存データの信憑性を確保することがで
きる。
On the other hand, according to this non-volatile counter, when the power is turned on, the data and the flag word in the data storage area are searched, and the correct stored data is read when the power is turned off, thereby obtaining a reliable final data. It is possible. Therefore, even if the data write / erase operation in the data storage area is interrupted for various reasons, the reliability of the stored data can be always ensured.

【0013】一方、請求項2記載の不揮発性カウンタに
よれば、所定の下位桁に対応する区分について設けられ
た下位桁用データ収納領域には、所定のカウント値毎の
イベントに応じて各セルに1ビットずつデータが順に書
き込まれていく。そして、下位桁用データ収納領域にお
いて所定の桁上げ数に該当するセルにデータが書き込ま
れ、桁上げのため消去する際には、桁上げ手段が、フラ
グワード収納領域に所定のフラグワードを書き込んだ後
に下位桁用データ収納領域のデータ消去を行い、桁上げ
手段によるデータ消去が終了した後に、消去手段が、そ
の書き込まれたフラグワードを消去する。
On the other hand, according to the nonvolatile counter of the second aspect, in the lower digit data storage area provided for a section corresponding to a predetermined lower digit, each cell is responded to an event for each predetermined count value. The data is sequentially written bit by bit. Then, when data is written in cells corresponding to a predetermined carry number in the lower digit data storage area and erased for carry, the carry means writes a predetermined flag word in the flag word storage area. After that, the data in the lower digit data storage area is erased, and after the data has been erased by the carry means, the erase means erases the written flag word.

【0014】従って、例えばオドメータに採用し、上記
下位桁用データ収納領域を200ビットで構成し、1k
mを上記所定カウント値として1km毎にデータを順番
に書き込んで行けば、この場合200km毎に全消去が
行われ、書換回数は200km毎に1回である。これ
は、例えばバイナリコードで1km毎に200kmまで
カウントアップする場合の、最下位桁の書換回数が10
0回であるのと比べえも書換回数が低減される。また、
下位桁用データ収納領域を200ビットで構成しなくて
も、50ビットや10ビット程度でも書換回数低減効果
は十分にある。
Therefore, for example, it is adopted in an odometer, and the data storage area for the lower digit is composed of 200 bits.
If data is sequentially written every 1 km with m as the predetermined count value, in this case, all erasing is performed every 200 km, and the number of rewriting is once every 200 km. This is because the number of rewriting of the least significant digit is 10 when counting up to 200 km per 1 km in binary code, for example.
The number of times of rewriting is reduced compared with 0 times. Also,
Even if the lower digit data storage area is not composed of 200 bits, the effect of reducing the number of rewrites is sufficient even if it is about 50 bits or 10 bits.

【0015】このように、工程能力により制限される限
界を超える書換回数を要求された場合でも、それに対応
できる。例えば上述の下位桁用データ収納領域を200
ビットで構成した場合には、実質的にバイナリコードの
場合の100倍のカウント能力を持つことになり、保存
データの信憑性の確保に寄与することとなる。
As described above, even when the number of times of rewriting exceeding the limit limited by the process capability is required, it can be dealt with. For example, if the lower digit data storage area is 200
When it is composed of bits, it has substantially 100 times the counting ability as in the case of the binary code, which contributes to securing the credibility of the stored data.

【0016】また、下位桁用データ収納領域へのデータ
書込・消去動作の最中に種々の理由でその動作が中断さ
れても、電源オン時に下位桁用のデータとフラグワード
を検索し、電源オフ時の正しい保存データを読み出すこ
とにより、確実な最終データを得ることが可能である。
従って、この点でも保存データの信憑性を確保できる。
Further, even if the data write / erase operation for the lower digit data storage area is interrupted for various reasons, the lower digit data and the flag word are searched when the power is turned on. By reading the correct stored data when the power is off, it is possible to obtain reliable final data.
Therefore, also in this respect, the authenticity of the stored data can be secured.

【0017】また、請求項3記載の不揮発性カウンタに
よれば、所定の上位桁対応区分について設けられた3つ
以上の上位桁用データ収納領域に、1種類の上位桁対応
データがそれぞれ書き込まれ、所定の下位桁に対応する
区分について設けられた下位桁用データ収納領域には、
所定のカウント値毎のイベントに応じて各セルに1ビッ
トずつデータが順に書き込まれていく。
According to the non-volatile counter of the third aspect, one kind of upper digit corresponding data is written in each of the three or more upper digit data storage areas provided for a predetermined upper digit corresponding section. , The lower digit data storage area provided for the division corresponding to the predetermined lower digit,
One bit of data is sequentially written in each cell in response to an event for each predetermined count value.

【0018】そして、下位桁用データ収納領域において
所定の桁上げ数に該当するセルにデータが書き込まれ、
桁上げのため消去する際には、桁上げ手段が、フラグワ
ード収納領域に所定のフラグワードを書き込んだ後に下
位桁用データ収納領域のデータ消去を行い、桁上げ手段
によるデータ消去が終了した後に、下位桁用消去手段
が、その書き込まれたフラグワードを消去する。
Then, data is written in cells corresponding to a predetermined carry number in the lower digit data storage area,
When erasing for carry, the carry means erases the data in the lower digit data storage area after writing a predetermined flag word in the flag word storage area, and after the data erase by the carry means is completed. , The lower digit erasing means erases the written flag word.

【0019】一方、上位桁用データ収納領域のデータを
書き換える際には、書換手段が、各データ収納領域とそ
れぞれ対応する上位桁用フラグワード収納領域に所定の
上位桁用フラグワードを書き込んだ後にデータの書換を
行い、書換手段によるデータ書換が終了した後に、上位
桁用消去手段が、その書き込まれた上位桁用フラグワー
ドを消去する。
On the other hand, when rewriting the data in the upper digit data storage area, the rewriting means writes a predetermined upper digit flag word in the upper digit flag word storage area corresponding to each data storage area. After the data is rewritten and the data rewriting by the rewriting means is completed, the upper digit erasing means erases the written upper digit flag word.

【0020】このように、上位桁及び下位桁のデータ共
に、書き換え又は桁上げのための消去を行う際には、そ
れぞれ対応するフラグワードを書き込んだ後にしか行わ
ない。そのため、上位桁用又は下位桁用データ収納領域
におけるデータの書込・消去動作の最中に種々の理由で
その動作が中断されても、電源オン時に該当するデータ
及びフラグワードを検索して電源オフ時の正しい保存デ
ータを読み出すことにより、確実な最終データを得るこ
とが可能である。従って、常に保存データの信憑性を確
保することができる。
As described above, when the upper digit data and the lower digit data are both rewritten or erased for carry, they are performed only after writing the corresponding flag words. Therefore, even if the operation is interrupted for various reasons during the data write / erase operation in the upper digit or lower digit data storage area, the corresponding data and flag word are searched for when the power is turned on and the power is turned on. By reading the correct stored data when it is turned off, it is possible to obtain reliable final data. Therefore, the authenticity of the stored data can always be ensured.

【0021】また、必然的に書換回数の多くなる下位桁
については、上記請求項2の不揮発性カウンタと同様
に、工程能力により制限される限界を超える書換回数を
要求された場合でもそれに対応でき、保存データの信憑
性の確保に寄与する。このように、本不揮発性カウンタ
は、書込・消去動作最中の動作中断や工程能力による限
界を超える書換回数の要求があっても、常に保存データ
の信憑性を確保することができるのである。
Further, as for the lower digit where the number of times of rewriting is inevitably increased, like the nonvolatile counter of the above-mentioned claim 2, even when the number of times of rewriting exceeding the limit limited by the process capability is requested, it can be dealt with. , Contribute to ensuring the authenticity of stored data. As described above, this non-volatile counter can always ensure the reliability of the stored data even if the operation is interrupted during the write / erase operation or the number of times of rewriting exceeds the limit due to the process capability. .

【0022】[0022]

【実施例】以下本発明の実施例を図面に基づいて詳細に
説明する。図4は、本発明の一実施例である不揮発性カ
ウンタを電子オドメータ(走行距離計)に適用したシス
テムの概略ブロック図である。本システムは周知のCP
U10、ROM20、RAM30、電気的に消去・書込
可能な不揮発性記憶素子としてのEEPROM40を電
子制御部の中心として構成されており、CPU10に
は、入力回路60を介して車速センサ50からの信号が
入力し、またCPU10からの出力は駆動回路70を介
して表示器80に表示される。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 4 is a schematic block diagram of a system in which a nonvolatile counter according to an embodiment of the present invention is applied to an electronic odometer (odometer). This system is a well-known CP
A U10, a ROM 20, a RAM 30, and an EEPROM 40 as an electrically erasable / writable non-volatile storage element are configured as the center of the electronic control unit, and a signal from the vehicle speed sensor 50 is input to the CPU 10 via an input circuit 60. Is input, and the output from the CPU 10 is displayed on the display 80 via the drive circuit 70.

【0023】車速センサ50は、タイヤ1回転毎にn発
(n≧1)のパルスを発生する。入力回路60は、車速
センサ50からの信号を入力して波形整形およびノイズ
処理を行う。CPU10は、入力回路60から入力され
たパルス数を計数し、RAM30の所定アドレスに格納
する。
The vehicle speed sensor 50 generates n pulses (n ≧ 1) every rotation of the tire. The input circuit 60 inputs a signal from the vehicle speed sensor 50 and performs waveform shaping and noise processing. The CPU 10 counts the number of pulses input from the input circuit 60 and stores it in a predetermined address of the RAM 30.

【0024】またCPU10は、RAM30内のデータ
が予め設定された値に達する度に、EEPROM40の
所定アドレスのデータを書き換える。さらにCPU10
は、上記データを表示器80の要求するデータに変換し
て駆動回路70に転送する。ROM20は、システムを
コントロールするプログラムを内蔵する。
Further, the CPU 10 rewrites the data of the predetermined address of the EEPROM 40 each time the data in the RAM 30 reaches a preset value. Further CPU 10
Converts the above data into data required by the display 80 and transfers the data to the drive circuit 70. The ROM 20 contains a program for controlling the system.

【0025】図5には、EEPROM40内のメモリマ
ップを示す。EEPROM40は計数部41、積算部4
2、フラグ部43を備えており、図5におけるメモリマ
ップ例において、計数部41は5ビット×40ワードの
200ビット、積算部42は5ビット×12ワードの6
0ビット、フラグ部43は5ビット×4ワードの20ビ
ットで構成されている。なお、図5中の斜線入りビット
は、未使用ビットを示している。
FIG. 5 shows a memory map in the EEPROM 40. The EEPROM 40 includes a counting unit 41 and an integrating unit 4
2, the flag unit 43 is provided, and in the memory map example in FIG. 5, the counting unit 41 is 5 bits × 40 words of 200 bits, and the integrating unit 42 is 5 bits × 12 words of 6 bits.
The 0 bit and the flag portion 43 are composed of 20 bits of 5 bits × 4 words. The shaded bits in FIG. 5 indicate unused bits.

【0026】以上の構成をオドメータ用に使用する場合
は、車速センサ50で発生するセンサ信号として、タイ
ヤ1回転毎に数発の車速パルス信号が入力回路60に入
力され、入力回路60で方形波に波形整形されてCPU
10に入力される。CPU10は、車速パルス信号が入
力される度に、RAM30内の所定アドレスの「パルス
計数値」を「1」だけインクリメントする。またCPU
10は、パルス計数値をROM20内に既に格納されて
いる「100m当りの計数値」と比較し、一致した場合
は、RAM30内の所定アドレスの「100m単位計数
値」を「1」だけインクリメントする。
When the above configuration is used for an odometer, a vehicle speed pulse signal of several shots per one rotation of the tire is input to the input circuit 60 as a sensor signal generated by the vehicle speed sensor 50, and the input circuit 60 outputs a square wave. Waveform is shaped into CPU
Input to 10. The CPU 10 increments the “pulse count value” of the predetermined address in the RAM 30 by “1” each time the vehicle speed pulse signal is input. Also CPU
Reference numeral 10 compares the pulse count value with the “count value per 100 m” already stored in the ROM 20, and if they match, increments the “100 m unit count value” at a predetermined address in the RAM 30 by “1”. .

【0027】ここで「100m当りの計数値」とは、1
00mを標準タイヤ円周長さで割った値に1回転当りの
パルス数を掛けた数である。通常のオドメータの分解能
は100mである。さらにCPU10は、「100m単
位計数値」をROM20内に既に格納されている「1k
m当りの計数値」と比較し、一致した場合は、RAM3
0内の所定アドレスの「1km単位計数値」を1だけイ
ンクリメントする。同時に、後述するEEPROM40
の書換シーケンスを行う。
Here, the "count value per 100 m" is 1
It is the number obtained by dividing the value of 00 m by the circumference length of the standard tire by the number of pulses per rotation. The resolution of a normal odometer is 100 m. Further, the CPU 10 stores the “100 m unit count value” in the ROM 20 as “1 k”.
"Count value per m", and if they match, RAM3
The "1 km unit count value" of the predetermined address within 0 is incremented by 1. At the same time, the EEPROM 40 described later
The rewriting sequence of is performed.

【0028】計数部41は上述したように200ビット
で構成されており、1kmから199kmまで1km経
過する毎に、1ビットずつのデータの書込が順次行われ
(以下このようなデータを埋め込みコードデータとい
う。)ていき、200km毎に全消去が行われる。
The counting unit 41 is composed of 200 bits as described above, and every time 1 km from 1 km to 199 km elapses, 1-bit data is sequentially written (hereinafter, such data is embedded code. All data will be erased every 200 km.

【0029】このように埋め込みコードデータ方式を採
用したのは、1ビット当りの書換回数を低減させるため
であり、この場合100万km走行完了時の各ビットの
書換回数は1ビット当たり5000回となる。また読出
時には、RK1-1 から順に書込データの読出を行い、未
書込ビットをサーチすることにより、行う。この際、連
続する5ビット以上の読出データの多数決をとることに
より、1ビット以上の故障を救済することができる。
The reason why the embedded code data method is adopted is to reduce the number of rewritings per bit, and in this case, the number of rewritings of each bit at the completion of one million km travel is 5000 times per bit. Become. At the time of reading, the write data is read in order from RK 1-1 , and the unwritten bit is searched for. At this time, a failure of 1 bit or more can be relieved by taking a majority decision of continuous read data of 5 bits or more.

【0030】この多数決処理の具体例を説明する。ま
ず、正常時の読出処理を図6を参照して説明する。読出
ルールは、以下の4つである。 最下位ビット(LSB)からスタートして、最上位
ビット(MSB)まで順にシフトしながらサーチしてい
く。
A specific example of this majority vote processing will be described. First, the reading process in the normal state will be described with reference to FIG. The read rules are the following four. The search starts from the least significant bit (LSB) and sequentially shifts to the most significant bit (MSB).

【0031】 「0」の数が3以上(実際には4以上
は存在しない)になった所を最終位置とする。 1回シフトする度に、計数を1だけインクリメント
する。 以上〜のシーケンスで読み出した計数値と、R
AM30の値とが異なった場合には、RAM30の値を
真値とする。
The position where the number of “0” becomes 3 or more (4 or more does not actually exist) is set as the final position. The counter is incremented by 1 for each shift. The count value read in the above sequence, and R
When the value of AM30 is different, the value of RAM30 is set to the true value.

【0032】そして、上記ルールを採用するために、L
SBの下位に2ビット及びMSBの上位に2ビットだ
け、データ処理用仮想ビットを設定する。LSBの下位
のデータ処理用仮想ビットには「1」が2ビット設定さ
れ、MSBの上位のデータ処理用仮想ビットには「0」
が2ビット設定される。
Then, in order to adopt the above rule, L
Virtual bits for data processing are set only in the lower two bits of SB and the upper two bits of MSB. 2 bits of "1" are set in the lower data processing virtual bits of the LSB, and "0" is set in the upper data processing virtual bits of the MSB.
Is set to 2 bits.

【0033】図6に示すように、連続5ビット分の読出
用窓がLSBの下位のデータ処理用仮想ビットを2ビッ
ト分含む場合からスタートし、MSBの上位のデータ処
理用仮想ビットを2ビット分含む場合で終了する。な
お、本実施例では計数部41は計数値200毎に消去す
るため、MSBには書き込まれない。
As shown in FIG. 6, starting from the case where the reading window for 5 consecutive bits includes 2 bits of the lower data processing virtual bits of the LSB, 2 bits of the higher data processing virtual bits of the MSB are started. It ends when it includes minutes. In addition, in the present embodiment, the counting unit 41 erases every count value 200, so that it is not written in the MSB.

【0034】次に、異常ビット存在時の読出処理を図7
を参照して説明する。異常の想定モードは以下の2つで
ある。 (イ) 「1」故障…消去できないビットが存在する。 (ロ) 「0」故障…書込できないビットが存在する。
Next, the reading process when there is an abnormal bit is shown in FIG.
Will be described with reference to. There are the following two assumed modes of abnormality. (B) "1" failure ... There are bits that cannot be erased. (B) "0" failure ... There is a bit that cannot be written.

【0035】まず、上記(イ)の「1」故障の場合に
は、図7にも示すように、最終書込ビットのすぐ隣に存
在する場合から最終書込ビットの3ビット先に存在する
場合までは、読出用窓のシフトによる計数が正常値(R
AM30の値)よりも1だけ大きくなる。また、「1」
故障が最終書込ビットの4ビット(あるいはそれ以上)
先に存在する場合は、正常値と等しくなる。
First, in the case of the "1" failure of (a) above, as shown in FIG. 7, it exists three bits ahead of the final write bit from the case immediately next to the final write bit. Until then, the count by shifting the reading window is normal (R
It is 1 larger than the value of AM30). Also, "1"
Failure is 4 bits (or more) of last written bit
If it exists first, it will be equal to the normal value.

【0036】また、上記(ロ)の「0」故障の場合に
は、図7にも示すように、最終書込ビットそのものに存
在する場合から最終書込ビットよりも2ビット後に存在
する場合までは、読出用窓のシフトによる計数が正常値
(RAM30の値)よりも1だけ小さくなる。また、
「1」故障が最終書込ビットよりも3ビット(あるいは
それ以上)後に存在する場合は、正常値と等しくなる。
Further, in the case of the "0" failure of the above (b), as shown in FIG. 7, from the case where it exists in the final write bit itself to the case where it exists 2 bits after the final write bit. Is smaller than the normal value (value of the RAM 30) by 1 by the shift of the reading window. Also,
If a "1" fault exists 3 bits (or more) after the last written bit, then it equals the normal value.

【0037】このように、正常値とそれぞれ+1,−1
だけ異なる結果となった場合には、上記ルールに従
い、RAM30の値を書き込んでいく。但し、電源投入
時は、上記ルール〜の手順に従って、EEPROM
40の値の読出を行い、RAM30に値を貯える。
In this way, the normal value and +1 and -1, respectively.
If the result is different, the value of the RAM 30 is written according to the above rule. However, when the power is turned on, the EEPROM follows the procedure from the above rules to.
The value of 40 is read and the value is stored in the RAM 30.

【0038】一方、積算部42は、上位3桁のBCDコ
ードデータと、下位1桁の埋め込みコードデータで構成
されている。さらに、同一データに対し3ワードずつの
収納領域を有する。これは、データの信憑性を高めるた
め3ワードの多数決を行うためである。上位3桁をBC
Dコードとした理由は、表示器の数値セグメント用デー
タに変換し易くするためである。
On the other hand, the integrating section 42 is composed of BCD code data of upper 3 digits and embedded code data of lower 1 digit. Further, it has a storage area for each 3 words of the same data. This is to make a majority decision of 3 words in order to increase the credibility of the data. The upper 3 digits are BC
The reason for using the D code is to facilitate conversion into the data for the numerical segment of the display.

【0039】また、下位1桁(この場合は100kmの
オーダー)を埋め込みコードデータとした理由は、10
0万km走行完了時の書換回数を低減するためである。
書込は1ビットずつ行えるが、消去は1行(4ワード)
ずつしか出来ない。仮に4桁共をBCDコードで構成し
た場合は100km毎に書換を行う必要があるため、1
00万km走行完了時の書換回数は、最も多く書換が行
われる最下位桁の最下位ビットにて1ビット当たり50
00回である。
The reason why the lower 1 digit (in this case, the order of 100 km) is the embedded code data is 10
This is to reduce the number of rewrites after the completion of traveling of 0,000 km.
Writing can be done bit by bit, but erasing is done in one row (4 words)
You can only do it one by one. If all 4 digits are composed of BCD code, it is necessary to rewrite every 100 km.
The number of rewrites at the completion of running of, 000,000 km is 50 per 1 bit in the least significant bit of the least significant digit where rewriting is performed the most.
It is 00 times.

【0040】これに対し、最下位桁を埋め込みコードデ
ータで構成した場合には、200km毎に1ビットずつ
を800kmまで順に埋め込んでいき、1000km毎
に消去するため、100万km走行完了時の書換回数は
1ビット当たり1000回となる(図6に両者の比較を
示す)。
On the other hand, when the lowest digit is composed of embedded code data, one bit is embedded every 200 km up to 800 km and erased every 1000 km. The number of times is 1000 times per bit (a comparison of both is shown in FIG. 6).

【0041】また各行の書換は、1行ずつ順に行われ
る。なお、以下の説明において、積算部42の3行のそ
れぞれに対して、図5に示すように、RS1-1 〜RS
1-4 を積算値A、同様に、RS2-1 〜RS2-4 を積算値
B、RS3-1 〜RS3-4 を積算値Cと呼ぶことにする。
Rewriting of each line is performed one line at a time. In the following description, for each of the three rows of the integrating unit 42, as shown in FIG. 5, RS 1-1 to RS
1-4 are referred to as integrated values A, similarly RS 2-1 to RS 2-4 are referred to as integrated values B, and RS 3-1 to RS 3-4 are referred to as integrated values C.

【0042】また、フラグ部43は、積算部42の3行
の各データ(積算値A〜C)書換用に1ワードずつ、計
数部41のデータ消去用に1ワード用意されている。図
5においてフラグワードRF1-1 が計数部41消去用、
RF1-2 が積算値A書換用、RF1-3 が積算値B書換
用、RF1-4 が積算値C書換用である。
Further, the flag section 43 is prepared for each word for rewriting each data (integrated values A to C) of the three rows of the integrating section 42 and for one word for erasing the data of the counting section 41. In FIG. 5, the flag word RF 1-1 is for erasing the counting unit 41,
RF 1-2 is for rewriting integrated value A, RF 1-3 is for rewriting integrated value B, and RF 1-4 is for rewriting integrated value C.

【0043】まず、計数部41消去用のフラグワードR
1-1 は、200km毎の計数部データ消去前にオール
1を書き込まれ、計数部データの消去確認後にそのフラ
グワードRF1-1 が消去される。この動作により、計数
部データ消去直前あるいは消去動作中に電源断等のトラ
ブルが発生しデータが不確定となっても、既に書込が終
了しているフラグワードRF1-1 を電源オン時に検索す
ることにより、トラブルの発生を知ることが可能であ
る。
First, the flag word R for erasing the counting section 41
In F 1-1 , all 1's are written before erasing the counting data every 200 km, and the flag word RF 1-1 is erased after confirming the erasing of the counting data. By this operation, even if a problem such as power failure occurs immediately before or during the erase operation of the counting section data and the data becomes indeterminate, the flag word RF 1-1 that has already been written is searched when the power is turned on. By doing so, it is possible to know the occurrence of trouble.

【0044】また、フラグワードRF1-1 の書込あるい
は消去時に同様のトラブルが発生したとしても、既に消
去あるいは書込が終了している計数部データを検索する
ことにより、データの信憑性は保存される。以上のよう
に、電源オン時に、計数部データとフラグワードRF
1-1 を検索することにより、電源オフ時の正しい保存デ
ータを読み出すことが可能である。
Even if the same trouble occurs when writing or erasing the flag word RF 1-1 , the reliability of the data can be confirmed by searching the counting section data which has already been erased or written. Saved. As described above, when the power is turned on, the counter data and the flag word RF are
By searching 1-1 , it is possible to read the correct saved data when the power is off.

【0045】次に、積算値書換用フラグワードRF1-2
〜RF1-4 も同様に、各積算値A〜Cの書換直前にオー
ル1を書込、積算部42データの書換終了後に消去す
る。積算部42は、積算値A〜Cの3ワードだけでも、
それらの多数決により1ワードのデータ化けの検出、修
正は可能であるが、3ワード共異なるデータとなった場
合は修正不可能である。仮に2番目に書換が行われるワ
ード(例えば積算値B)の書換動作中に、電源オフ等の
トラブルが発生した場合には、3ワード共異なったデー
タとなりうる。
Next, the integrated value rewriting flag word RF 1-2
~RF 1-4 Similarly, write all 1's to rewrite before each integrated value A through C, it is erased after rewriting completion of the integration unit 42 data. The integrating unit 42 uses only the three words of the integrated values A to C,
It is possible to detect and correct the garbled data of one word by the majority decision, but it is impossible to correct when the data becomes different for all three words. If a trouble such as power-off occurs during the rewriting operation of the word (for example, integrated value B) to be rewritten second, the three words may have different data.

【0046】これに対して、電源オン時に積算部42デ
ータとフラグ部43の積算値書換用フラグワードRF
1-2 〜RF1-4 を検索することにより、電源オフ時の正
しい保存データを読み出すことが可能である。なお、フ
ラグ部43の各フラグワードRF1-1 〜RF1-4 を5ビ
ットで構成する理由は、自身のビット故障を救済するた
めである。
On the other hand, when the power is turned on, the integration unit 42 data and the integration value rewriting flag word RF of the flag unit 43 are rewritten.
By searching 1-2 to RF 1-4 , it is possible to read the correct stored data when the power is off. The reason why each flag word RF 1-1 to RF 1-4 of the flag unit 43 is composed of 5 bits is to relieve its own bit failure.

【0047】上記説明のEEPROM40の書換シーケ
ンスのフローチャートを、図7及び図8に示す。図7は
通常時の書換シーケンスを示すフローチャートである。
ステップ100(以下単にS100と呼ぶ。以下同
様。)で計数部41から計数値データを読み出し、S1
10,120で、ビット故障を考慮して多数決処理を行
いながら結果をインクリメントして計数部41に書き込
む。そして、S130で、200kmになったか否か
(すなわち計数部41にデータが全て埋め込まれたか否
か)を判断し、200kmになっていない場合は、S1
40で積算値A〜Cを読み出して、一旦処理を終了す
る。
7 and 8 are flowcharts of the rewriting sequence of the EEPROM 40 described above. FIG. 7 is a flowchart showing the rewriting sequence in the normal time.
In step 100 (hereinafter, simply referred to as S100. The same applies hereinafter), the count value data is read from the counter 41, and S1 is read.
At 10 and 120, the result is incremented and written in the counting unit 41 while performing the majority decision process in consideration of the bit failure. Then, in S130, it is determined whether or not the distance is 200 km (that is, whether or not all the data is embedded in the counting unit 41). If the distance is not 200 km, S1 is determined.
At 40, the integrated values A to C are read out, and the process is once terminated.

【0048】一方、S130で200kmになった場合
(計数部41にデータが全て埋め込まれた場合)は、S
150に移行して、積算値A〜Cを読み出し、ビット故
障を考慮して多数決処理を行ってその結果インクリメン
トする。そして、まずS160で計数部41消去用のフ
ラグワードRF1-1 を書き込んだ後、S170で計数部
41を全て消去する。
On the other hand, when the value reaches 200 km in S130 (when all the data is embedded in the counting unit 41), S
In step 150, the integrated values A to C are read, the majority process is performed in consideration of the bit failure, and the result is incremented. Then, first, in S160, the flag word RF 1-1 for erasing the counting unit 41 is written, and then in S170, the entire counting unit 41 is erased.

【0049】続くS180〜S230で積算値A〜Cの
書換を行うのであるが、まず、積算値A書換用のフラグ
ワードRF1-2 を書き込んだ後で、積算値Aを書き換え
(S180,190)、同様に、積算値B書換用のフラ
グワードRF1-3 を書き込んだ後で、積算値Bを書き換
え(S200,210)、積算値C書換用のフラグワー
ドRF1-4 を書き込んだ後で、積算値Cを書き換える
(S220,230)。
The integrated values A to C are rewritten in subsequent S180 to S230. First, the integrated value A is rewritten after the flag word RF 1-2 for rewriting the integrated value A is written (S180, 190). ) Similarly, after writing the flag word RF 1-3 for rewriting the integrated value B, rewriting the integrated value B (S200, 210), after writing the flag word RF 1-4 for rewriting the integrated value C Then, the integrated value C is rewritten (S220, 230).

【0050】そして、その後、フラグ部43の各フラグ
ワードRF1-1 〜RF1-4 を全て消去して、本処理を終
了する。一方、図8は電源オン時の書換シーケンスを示
すフローチャートである。まず、S300でフラグ部4
3の各フラグワードRF1-1 〜RF1-4 の値(フラグ
値)を読み込み、S310〜S340において順に、計
数部41が消去中か否か(S310)、積算値Aが書換
中か否か(S320)、積算値Bが書換中か否か(S3
30)、積算値Cが書換中か否か(S340)をそれぞ
れ判断する。
After that, all the flag words RF 1-1 to RF 1-4 of the flag section 43 are erased, and this processing is ended. On the other hand, FIG. 8 is a flowchart showing a rewriting sequence when the power is turned on. First, in S300, the flag unit 4
The values (flag values) of the respective flag words RF 1-1 to RF 1-4 of 3 are read, and in S310 to S340, whether the counting unit 41 is erasing (S310) or whether the integrated value A is being rewritten. (S320), whether the integrated value B is being rewritten (S3)
30), and it is determined whether the integrated value C is being rewritten (S340).

【0051】そして、S310〜S340において全て
否定判断の場合、すなわち、計数部41及び積算部42
において消去中あるいは書換中には中断されていない場
合には、S350で計数値、S360で積算値A〜Cを
それぞれ読み出して一旦処理を終了する。
Then, in the case of all negative determinations in S310 to S340, that is, the counting unit 41 and the integrating unit 42.
If no interruption is being made during erasing or rewriting, the count value is read out in S350 and the integrated values A to C are read out in S360, and the process is temporarily terminated.

【0052】一方、S310〜S340において肯定判
断の時には、各場合に続く処理であるS370〜S40
0の処理を行ってから、各場合とも、S410以下の処
理を行う。まず、計数部41が消去中の場合(S31
0:YES)には、積算値A〜Cを読み出し、多数決処
理を行ってその結果をインクリメントする(S37
0)。また、積算値Aが書換中の場合(S320:YE
S)にも、積算値A〜Cを読み出し、多数決処理を行っ
てその結果をインクリメントする(S380)。この場
合は積算値Aが書換中であり、積算値Aのみが不確定で
あるので、積算値A〜Cを多数決処理すれば確定でき
る。
On the other hand, when an affirmative determination is made in S310 to S340, the processing subsequent to each case is S370 to S40.
After performing the process of 0, in each case, the process of S410 and subsequent steps is performed. First, when the counting unit 41 is erasing (S31
In the case of 0: YES, the integrated values A to C are read, the majority process is performed, and the result is incremented (S37).
0). When the integrated value A is being rewritten (S320: YE
Also in S), the integrated values A to C are read, a majority process is performed, and the result is incremented (S380). In this case, since the integrated value A is being rewritten and only the integrated value A is uncertain, it can be confirmed by majority processing of the integrated values A to C.

【0053】一方、積算値Bが書換中の場合(S33
0:YES)には、積算値A〜Cを読み出し、積算値C
をインクリメントしてから多数決処理を行う(S39
0)。この場合は積算値Bが書換中であり不確定であ
る。また、積算値Aは確定であり書換は終了している。
積算値Cは確定であり書換前である。よって、積算値C
をインクリメントして積算値A〜Cの多数決処理をする
ことにより確定できる。
On the other hand, when the integrated value B is being rewritten (S33
0: YES), the integrated values A to C are read and the integrated value C
Is incremented and then a majority process is performed (S39
0). In this case, the integrated value B is being rewritten and is indeterminate. Further, the integrated value A is confirmed and the rewriting is completed.
The integrated value C is fixed and before rewriting. Therefore, the integrated value C
Can be determined by incrementing and performing majority processing of the integrated values A to C.

【0054】また、積算値Cが書換中の場合(S34
0:YES)には、積算値A〜Cを読み出して多数決処
理を行う(S400)。この場合は積算値Cが書換中で
あり不確定である。また積算値A、Bは確定であるた
め、単に積算値A〜Cの多数決処理をすることにより確
定できる。
When the integrated value C is being rewritten (S34
If 0: YES), the integrated values A to C are read out and a majority process is performed (S400). In this case, the integrated value C is being rewritten and is indeterminate. Further, since the integrated values A and B are fixed, they can be fixed simply by performing a majority process of the integrated values A to C.

【0055】この後の、S410〜S490の処理は、
上述した通常時の書換シーケンスを示すフローチャート
(図9)におけるS160〜S240の処理と同じなの
で、説明は省略する。なお、本実施例は、請求項3記載
の発明に係る場合であり、図3に示した各手段との対応
を簡単に説明しておくと、上記図7におけるS160,
170の処理の実行が桁上げ手段として働き、S180
〜S230の処理の実行が書換手段として働く。また、
S240の処理の実行が上位桁用消去手段及び下位桁用
消去手段として働く。
After this, the processing of S410 to S490 is
Since it is the same as the processing of S160 to S240 in the flowchart (FIG. 9) showing the above-described normal rewriting sequence, description thereof will be omitted. It should be noted that the present embodiment relates to the invention according to claim 3, and a brief description of the correspondence with each means shown in FIG. 3 will be made when S160 in FIG.
The execution of the processing of 170 functions as a carry means, and S180
Execution of the process of S230 works as a rewriting means. Also,
Execution of the process of S240 works as an erasing unit for upper digits and an erasing unit for lower digits.

【0056】一方、図5における計数部41が下位桁用
データ収納領域に対応し、積算部42が上位桁用データ
収納領域に対応する。従って、フラグ部43の計数部消
去用フラグワードRF1-1 が下位桁用フラグワードとし
て働き、積算値書換用フラグワードRF1-2 〜RF1-4
が上位桁用フラグワードとして働く。
On the other hand, the counting unit 41 in FIG. 5 corresponds to the lower digit data storage area, and the integrating unit 42 corresponds to the upper digit data storage area. Accordingly, the flag word RF 1-1 for erasing the counting section of the flag section 43 functions as a flag word for lower digits, and the integrated value rewriting flag words RF 1-2 to RF 1-4.
Acts as the flag word for the upper digits.

【0057】以上本発明はこの様な実施例に何等限定さ
れるものではなく、本発明の要旨を逸脱しない範囲にお
いて種々なる態様で実施し得る。上述した実施例では不
揮発性記憶素子の代表としてEEPROM41を用いた
が、他にも例えばフロッピーディスクや磁気テープ等の
ように、データの書換最中にデータの破壊が起こる可能
性がある記憶素子であれば有効に適用できる。
The present invention is not limited to the embodiments as described above, and can be carried out in various modes without departing from the scope of the present invention. Although the EEPROM 41 is used as a representative of the non-volatile storage element in the above-described embodiment, other storage elements such as a floppy disk and a magnetic tape which may cause data destruction during data rewriting. If it can be applied effectively.

【0058】[0058]

【発明の効果】以上詳述したように、請求項1記載の不
揮発性カウンタによれば、データ収納領域におけるデー
タの書込・消去動作の最中に種々の理由でその動作が中
断されても、常に保存データの信憑性を確保することが
できる。
As described above in detail, according to the non-volatile counter of the first aspect, even if the data write / erase operation in the data storage area is interrupted due to various reasons. , Can always ensure the authenticity of the stored data.

【0059】また、請求項2記載の不揮発性カウンタに
よれば、工程能力により制限される限界を超える書換回
数を要求された場合でも、それに対応でき、保存データ
の信憑性の確保に寄与すると共に、下位桁用データ収納
領域へのデータ書込・消去動作の最中の動作中断に対し
ても、電源オン時に下位桁用のデータとフラグワードを
検索して電源オフ時の正しい保存データを読み出すこと
により、確実な最終データを得ることが可能である。従
って、この点でも保存データの信憑性を確保できる。ま
た、請求項3記載の不揮発性カウンタによれば、上位桁
用又は下位桁用データ収納領域におけるデータの書込・
消去動作最中の動作中断があっても、電源オン時に該当
するデータ及びフラグワードを検索して電源オフ時の正
しい保存データを読み出すことにより、確実な最終デー
タを得ることが可能である。従って、常に保存データの
信憑性を確保することができる。そしてまた、必然的に
書換回数の多くなる下位桁については、工程能力により
制限される限界を超える書換回数を要求された場合でも
それに対応でき、保存データの信憑性確保に寄与する。
Further, according to the non-volatile counter of the second aspect, even when the number of rewrites exceeding the limit limited by the process capability is requested, it can be dealt with, and it contributes to secure the credibility of the stored data. , Even if the operation of writing / erasing data in the lower digit data storage area is interrupted, the lower digit data and flag words are searched when the power is turned on and the correct saved data is read when the power is turned off. By doing so, it is possible to obtain reliable final data. Therefore, also in this respect, the authenticity of the stored data can be secured. Further, according to the nonvolatile counter of the third aspect, writing / writing of data in the data storage area for the upper digit or the lower digit is performed.
Even if the operation is interrupted during the erase operation, it is possible to obtain reliable final data by searching the corresponding data and flag word when the power is on and reading the correct stored data when the power is off. Therefore, the authenticity of the stored data can always be ensured. In addition, for the lower digit, which inevitably has a large number of rewrites, even if the number of rewrites exceeding the limit limited by the process capability is requested, it is possible to contribute to ensuring the authenticity of the stored data.

【図面の簡単な説明】[Brief description of drawings]

【図1】 請求項1記載の不揮発性カウンタの基本的構
成を例示するブロック図である。
FIG. 1 is a block diagram illustrating a basic configuration of a nonvolatile counter according to claim 1.

【図2】 請求項2記載の不揮発性カウンタの基本的構
成を例示するブロック図である。
FIG. 2 is a block diagram illustrating a basic configuration of the nonvolatile counter according to claim 2;

【図3】 請求項3記載の不揮発性カウンタの基本的構
成を例示するブロック図である。
FIG. 3 is a block diagram illustrating a basic configuration of the nonvolatile counter according to claim 3;

【図4】 本発明の一実施例の不揮発性カウンタを電子
オドメータに適用したシステムの概略ブロック図であ
る。
FIG. 4 is a schematic block diagram of a system in which a nonvolatile counter according to an embodiment of the present invention is applied to an electronic odometer.

【図5】 本実施例のEEPROM内のメモリマップを
示す説明図である。
FIG. 5 is an explanatory diagram showing a memory map in the EEPROM of this embodiment.

【図6】 読出データ多数決処理の具体例における正常
時の読出処理を示す説明図である。
FIG. 6 is an explanatory diagram showing a normal reading process in a specific example of the read data majority decision process.

【図7】 読出データ多数決処理の具体例における異常
ビット存在時の読出処理を示す説明図である。
FIG. 7 is an explanatory diagram showing a read process when an abnormal bit exists in a specific example of the read data majority decision process.

【図8】 BCDコード及び埋め込みコードでデータを
構成した場合の両者の書換回数の比較の一例を示す説明
図である。
FIG. 8 is an explanatory diagram showing an example of a comparison of the number of times of rewriting of BCD code and embedded code in the case of forming data.

【図9】 通常時の書換シーケンスを示すフローチャー
トである。
FIG. 9 is a flowchart showing a rewriting sequence in a normal time.

【図10】 電源オン時の書換シーケンスを示すフロー
チャートである。
FIG. 10 is a flowchart showing a rewriting sequence when the power is turned on.

【符号の説明】[Explanation of symbols]

A〜C…積算値、 RF1-1 …計数部消去用フラグ
ワード、RF1-2 〜RF1-4 …積算値書換用フラグワー
ド、41…計数部、 42…積算部、 43…フラ
グ部、 50…車速センサ、60…入力回路、 70…
駆動回路、 80…表示器
A to C ... Accumulated value, RF 1-1 ... Flag word for erasing counting section, RF 1-2 to RF 1-4 ... Flag word for rewriting accumulated value, 41 ... Counting section, 42 ... Accumulation section, 43 ... Flag section , 50 ... Vehicle speed sensor, 60 ... Input circuit, 70 ...
Drive circuit, 80 ... Indicator

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 電気的に消去・書込可能な不揮発性記憶
素子に記憶されたデータを、所定のカウント値に基づい
て更新し、カウント動作を行う不揮発性カウンタであっ
て、 上記不揮発性記憶素子が、 1種類のデータに対して3つ以上設けられたデータ収納
領域と、 それら各データ収納領域にそれぞれ対応して設けられた
フラグワード収納領域と、を有すると共に、 上記データ収納領域のデータを書き換える際には、それ
ぞれ対応する上記フラグワード収納領域に所定のフラグ
ワードを書き込んだ後に、データ書換を行う書換手段
と、 該書換手段によるデータ書換が終了した後に、上記書き
込まれたフラグワードを消去する消去手段と、 を備えたことを特徴とする不揮発性カウンタ。
1. A non-volatile counter that updates the data stored in an electrically erasable / writable non-volatile memory element based on a predetermined count value and performs a counting operation. The element has three or more data storage areas for one type of data, and flag word storage areas provided corresponding to the respective data storage areas, and the data of the data storage area When rewriting, the rewriting means for rewriting the data after writing a predetermined flag word in the corresponding flag word storage area, and the written flag word after the data rewriting by the rewriting means are completed. A non-volatile counter, comprising: an erasing unit for erasing.
【請求項2】 電気的に消去・書込可能な不揮発性記憶
素子に記憶されたデータを、所定のカウント値に基づい
て更新し、カウント動作を行う不揮発性カウンタであっ
て、 上記不揮発性記憶素子が、 最大計数桁数を桁順に複数区分に分割された各区分毎に
設けられ、所定の上位桁に対応する区分について設けら
れた上位桁用データ収納領域、及び所定の下位桁に対応
する区分について設けられ、所定カウント値毎のイベン
トに応じて1ビットずつデータを順に書き込んでいくた
めの複数のセルから構成された下位桁用データ収納領域
と、 該下位桁用データ収納領域に対応して設けられたフラグ
ワード収納領域と、を有すると共に、 上記下位桁用データ収納領域において所定の桁上げ数に
該当するセルにデータが書き込まれ、桁上げのため消去
する際には、上記フラグワード収納領域に所定のフラグ
ワードを書き込んだ後に、上記下位桁対応区分のデータ
収納領域のデータの消去を行う桁上げ手段と、 該桁上げ手段によるデータ消去が終了した後に、上記書
き込まれたフラグワードを消去する消去手段と、 を備えたことを特徴とする不揮発性カウンタ。
2. A non-volatile counter that updates the data stored in an electrically erasable / writable non-volatile memory element based on a predetermined count value and performs a count operation. An element is provided for each division into which the maximum number of digits is divided into a plurality of divisions in order of digits, and corresponds to the upper digit data storage area provided for the division corresponding to the predetermined higher digit and the predetermined lower digit. It corresponds to the lower digit data accommodating area, which is provided for each section and is composed of a plurality of cells for sequentially writing data bit by bit according to an event for each predetermined count value, and the lower digit data accommodating area. And a flag word storage area provided in the lower digit data storage area, and data is written in a cell corresponding to a predetermined carry number in the lower digit data storage area and erased for carry. In this case, after writing a predetermined flag word in the flag word storage area, carry means for erasing the data in the data storage area of the lower digit corresponding section, and the data erasing by the carry means are completed. And a erasing unit that erases the written flag word later.
【請求項3】 電気的に消去・書込可能な不揮発性記憶
素子に記憶されたデータを、所定のカウント値に基づい
て更新し、カウント動作を行う不揮発性カウンタであっ
て、 上記不揮発性記憶素子が、 最大計数桁数を桁順に複数区分に分割された各区分毎に
設けられ、所定の上位桁対応区分については、1種類の
データに対して3つ以上設けられた上位桁用データ収納
領域と、 所定の下位桁対応区分については、所定カウント値毎の
イベントに応じて1ビットずつデータを順に書き込んで
いくための複数のセルから構成された下位桁用データ収
納領域と、 上記各上位桁用データ収納領域にそれぞれ対応して設け
られた上位桁用フラグワード収納領域と、 上記下位桁用データ収納領域に対応して設けられた下位
桁用フラグワード収納領域と、を有すると共に、 上記上位桁用データ収納領域のデータを書き換える際に
は、それぞれ対応する上記上位桁用フラグワード収納領
域に所定の上位桁用フラグワードを書き込んだ後に、デ
ータの書換を行う書換手段と、 該書換手段によるデータ書換が終了した後に、上記書き
込まれた上位桁用フラグワードを消去する上位桁用消去
手段と、 上記下位桁対応区分のデータ収納領域において、所定の
桁上げ数に該当するセルにデータが書き込まれ、桁上げ
のため消去する際には、上記下位桁用フラグワード収納
領域に所定の下位桁用フラグワードを書き込んだ後に、
上記下位桁用データ収納領域のデータの消去を行う桁上
げ手段と、 該桁上げ手段によるデータ消去が終了した後に、上記書
き込まれた下位桁用フラグワードを消去する下位桁用消
去手段と、 を備えたことを特徴とする不揮発性カウンタ。
3. A non-volatile counter that updates the data stored in an electrically erasable / writable non-volatile memory element based on a predetermined count value and performs a count operation. An element is provided for each division into which the maximum number of digits is divided into a plurality of divisions in order of digits, and for a given upper digit corresponding division, three or more upper digit data storage is provided for one type of data. As for the area and the predetermined lower digit corresponding division, a lower digit data storage area composed of a plurality of cells for sequentially writing data bit by bit according to an event for each predetermined count value, and each of the above upper digits An upper digit flag word storage area provided corresponding to the digit data storage area, and a lower digit flag word storage area provided corresponding to the lower digit data storage area. At the same time, when rewriting the data in the upper digit data storage area, a rewriting means for rewriting the data after writing a predetermined upper digit flag word in the corresponding upper digit flag word storage area, respectively. After the data rewriting by the rewriting means is completed, the upper digit erasing means for erasing the written upper digit flag word and the predetermined digit carry number in the data storage area of the lower digit corresponding section When data is written in a cell and erased for carry, after writing a predetermined lower digit flag word in the lower digit flag word storage area,
Carry means for erasing the data in the lower digit data storage area, and lower digit erasing means for erasing the written lower digit flag word after the data erasing by the carry means is completed. A non-volatile counter characterized by being provided.
JP5032178A 1993-02-22 1993-02-22 Non-volatile counter Expired - Fee Related JP2917726B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5032178A JP2917726B2 (en) 1993-02-22 1993-02-22 Non-volatile counter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5032178A JP2917726B2 (en) 1993-02-22 1993-02-22 Non-volatile counter

Publications (2)

Publication Number Publication Date
JPH06252745A true JPH06252745A (en) 1994-09-09
JP2917726B2 JP2917726B2 (en) 1999-07-12

Family

ID=12351684

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5032178A Expired - Fee Related JP2917726B2 (en) 1993-02-22 1993-02-22 Non-volatile counter

Country Status (1)

Country Link
JP (1) JP2917726B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7551706B2 (en) 2004-12-03 2009-06-23 Kyocera Mita Corporation Counter device and counting method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7551706B2 (en) 2004-12-03 2009-06-23 Kyocera Mita Corporation Counter device and counting method

Also Published As

Publication number Publication date
JP2917726B2 (en) 1999-07-12

Similar Documents

Publication Publication Date Title
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
JPH08202626A (en) Memory controller
JPH0217058B2 (en)
JPS6196598A (en) Count data memory method of electric erasable p-rom
JPH06252745A (en) Nonvolatile counter
JP3261745B2 (en) Electronic odometer
JP2858519B2 (en) Electronic odometer
JP2848119B2 (en) Electronic odometer
JPH0565010B2 (en)
JP2861675B2 (en) Electronic odometer
JP3003543B2 (en) Electronic odometer
JP2850667B2 (en) Electronic odometer
JPS62254013A (en) Electronic odometer
JP2870679B2 (en) Vehicle mileage recording method
JP2904401B2 (en) Vehicle mileage recording device
JP2906737B2 (en) Data evacuation method
JP2533055Y2 (en) Vehicle mileage accumulator
JP2872031B2 (en) Electronic odometer
JPS6060515A (en) Displaying method of run distance
JP2804939B2 (en) Vehicle mileage recording device
JP2848102B2 (en) Electronic odometer
JPH0373958B2 (en)
JP2904394B2 (en) Vehicle mileage recording device
JPH074503Y2 (en) Vehicle mileage recorder
JPS60114711A (en) Electronic odometer

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080423

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20110423

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees