JP2004005179A - Data storage method of eeprom - Google Patents

Data storage method of eeprom Download PDF

Info

Publication number
JP2004005179A
JP2004005179A JP2002159700A JP2002159700A JP2004005179A JP 2004005179 A JP2004005179 A JP 2004005179A JP 2002159700 A JP2002159700 A JP 2002159700A JP 2002159700 A JP2002159700 A JP 2002159700A JP 2004005179 A JP2004005179 A JP 2004005179A
Authority
JP
Japan
Prior art keywords
data
eeprom
stored
storage
year
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002159700A
Other languages
Japanese (ja)
Inventor
Yoji Yokota
横田 洋二
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
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2002159700A priority Critical patent/JP2004005179A/en
Publication of JP2004005179A publication Critical patent/JP2004005179A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce an amount of data stored in an EEPROM, i.e., storage capacity of the EEPROM, in a data storage method for the EEPROM having an error detection function. <P>SOLUTION: A conversion table for input data is prepared, the input data is converted into the storage data by use of the conversion table, the converted data is stored in the EEPROM 20, and the data read from the EEPROM 20 is inversely converted by use of the conversion table. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、EEPROMのデータ記憶方法に関するものである。
【0002】
【従来の技術】
従来より、EEPROMにデータを記憶する方法として、記憶データのミラーデータを記憶する技術がある。記憶方法は、記憶データ+記憶データの補数(詳しくは、1の補数)を1組としてEEPROMの記憶領域に記憶する。この方法では、EEPROMの記憶領域の消費量は記憶する1データのバイト数の2倍となる。また、記憶データのエラー検出は、記憶データとミラーデータの和を確認して行う。
【0003】
しかしながら、上記技術ではEEPROMの記憶領域が、記憶するデータのサイズに依存しており、EEPROMに記憶するデータの量(EEPROMの記憶容量)を削減したいという要求がある。特に、バイト数は大きいが実際に取りうる値の数が小さなデータに対してはEEPROMの使用効率が悪い。
【0004】
例えば、製造年月日をEEPROMに書き込む場合、年を表すのに必要なバイト数は2バイト(下2桁表示なら1バイトとなるが)、月を表すのに必要なバイト数は1バイト、日を表すのに必要なバイト数は1バイトである。そのため、全部でEEPROMの使用量は(2+1+1)×2=8バイト必要である。
【0005】
しかし、実際に使用される値の範囲は、年については20種類程度(生産開始年度〜20年位)、月は1〜12、日は1〜31と非常に少ない。
このように従来技術では、データサイズは大きいが使用されるデータの範囲が狭い場合にはEEPROMの記憶効率が悪くなる傾向がある。
【0006】
【発明が解決しようとする課題】
本発明はこのような背景の下になされたものであり、その目的は、エラー検出機能を有するEEPROMのデータ記憶方法においてEEPROMに記憶するデータの量、即ち、EEPROMの記憶容量を削減することができるようにすることにある。
【0007】
【課題を解決するための手段】
請求項1に記載のEEPROMのデータ記憶方法においては、入力データの変換テーブルを用意し、この変換データを用いて入力データを記憶データに変換し、当該変換したデータをEEPROMに記憶するとともに、前記EEPROMから読み込んだデータを前記変換テーブルを用いて逆変換するようにしている。よって、逆変換できないことはエラーが発生していることを意味し、これによりエラー検出することができる。その結果、エラー検出機能を有するEEPROMのデータ記憶方法においてEEPROMに記憶するデータの量としては、従来では記憶データとミラーデータの和であったが、本発明ではミラーデータの無いデータ(変換データ)であり、EEPROMに記憶するデータの量、即ち、EEPROMの記憶容量を削減することができる。
【0008】
特に、請求項6に記載のように入力データが年月日を表すデータ等である場合、つまり、データサイズは大きいが使用されるデータ範囲が狭い場合においては使用されるデータ範囲での変換テーブルを用意すればよく、記憶データ(変換データ)の量、即ち、EEPROMの記憶容量をより削減することができる。
【0009】
請求項2に記載のように、前記変換テーブルを用いて逆変換する際に、EEPROMから読み込んだデータに対応するデータがない場合はエラーが発生したとしてデフォルト値を設定するとよい。
【0010】
請求項3に記載のように、記憶データにおけるデータ構成を、二進数での「0」と「1」の数を予め定めた数とし、例えば、請求項4に記載のように、二進数での「0」と「1」の数を同数とすることができる。
【0011】
請求項5に記載のように、EEPROMから読み込んだデータが予め定めたデータ構成となっていない場合はエラーが発生したとしてデフォルト値を設定するとよい。
【0012】
【発明の実施の形態】
以下、この発明を具体化した一実施の形態を図面に従って説明する。
本実施形態においては自動車用電子制御装置(自動車用ECU)に適用しており、図1のEEPROM20に同ECUの製造年月日を記憶するようにしている。
【0013】
図1において、ECUはコントローラ10とEEPROM20とメモリ30を備えている。コントローラ10には入力データとして年月日を表すデータが入力される。メモリ30には、テーブル31,32,33が記憶されている。各テーブル31,32,33は入力データをEEPROM記憶用データに変換するためのものであり、テーブル31が年変換用、テーブル32が月変換用、テーブル32が日変換用である。具体的には、例えば年変換テーブル31については、表1に示すように、入力データに対しEEPROM20に記憶するデータとして、2進数での「0」の数と「1」の数を同じにして記憶させている。具体的には、8ビットのうち、「0」の数が4つ、「1」の数が4つである。
【0014】
【表1】

Figure 2004005179
そして、本実施形態においては、入力データを直接、EEPROM20に記憶するのではなく、入力データ(記憶したいデータ)を、テーブルを用いて変換し、その変換したデータをEEPROM20に記憶するようにしている。
【0015】
つまり、データ書き込みの際には、図2に示すように、コントローラ10はステップ100で書き込みたいデータAを算出する。詳しくは、入力データはRAM(図示略)に一時的に保存され、コントローラ10はこのデータAを読み出す。そして、コントローラ10はステップ101でデータAの値に対応する真の書き込みデータBをテーブルCから取得する(入力データをテーブルCを用いて記憶データBに変換する)。さらに、コントローラ10はステップ102でデータBをEEPROM20へ記憶する。
【0016】
データ読み出しの際には、図3に示すように、コントローラ10はステップ200でEEPROM20からデータBを読み込む。そして、コントローラ10はステップ201でデータBにおける「0」の数と「1」の数が同数か否か判定する。データBにおける「0」の数と「1」の数が同数ならば、コントローラ10はステップ202に移行してテーブルCにおいてデータBに対応するデータがあるか否か判定する。データBに対応するデータがあると、コントローラ10はステップ203に移行してテーブルCにおけるデータBに対応するデータAを取り出して使用する。詳しくは、コントローラ10はテーブルCにより逆変換したデータAをRAM(図示略)に保存し、これが使用される。
【0017】
一方、コントローラ10は、ステップ201でデータBにおける「0」の数と「1」の数が同数でない場合、および、ステップ202でデータBに対応するデータがない場合には、ステップ204に移行する。ステップ204においてコントローラ10はデータBはエラーと判定し、データAにはデフォイル値を代入する。
【0018】
次に、図2での製造年月日をEEPROM20に書き込む場合について詳しく説明する。
記憶したい年,月,日を、Y,M,Dとする。
【0019】
年データYに対して実際に記憶するデータをE_Y、同様に、月データMについてはE_M、日データDについてはE_Dとする。
YとE_Yとの変換テーブルをT_Y、MとE_Mとの変換テーブルをT_M、DとE_Dとの変換テーブルをT_Dとする。
【0020】
変換テーブルT_*(*はYまたはMまたはD)は、入力データをEEPROM記憶用データに変換するテーブルであり、EEPROM記憶用データとしては2進数化したときに「1」であるビットの数と、「0」であるビットの数が等しいデータの集合であり、入力と出力が常に1対1になるようにテーブルを設計している。これにより、EEPROMの書き込み/読み出しにエラーが生じた場合、変換テーブル中に存在しないデータとなり、エラーの検出を容易に行うことができる。
【0021】
さらに、記憶するデータは、ビットの「1」の数と「0」の数が等しいため、エラー検出を行うことができる。
このように、図1のEEPROM20のデータ記憶方法として、入力データの変換テーブル31,32,33を用意し、この変換テーブル31,32,33を用いて、図2のごとく入力データを記憶データに変換し、当該変換したデータをEEPROM20に記憶するとともに、図3のごとくEEPROM20から読み込んだデータを変換テーブル31,32,33を用いて逆変換するようにした。よって、逆変換できないことはエラーが発生していることを意味し、これによりエラー検出することができる。その結果、エラー検出機能を有するEEPROM20のデータ記憶方法においてEEPROM20に記憶するデータの量としては、従来では記憶データとミラーデータの和であったが、本実施形態ではミラーデータの無いデータ(変換データ)であり、EEPROM20に記憶するデータの量、即ち、EEPROM20の記憶容量を削減することができる。
【0022】
特に、入力データが年月日を表すデータである場合、つまり、データサイズは大きいが使用されるデータ範囲が狭い場合においては使用されるデータ範囲での変換テーブルを用意すればよく、記憶データ(変換データ)の量、即ち、EEPROM20の記憶容量をより削減することができる。
【0023】
また、変換テーブル31,32,33を用いて逆変換する際に、図3のステップ202においてEEPROM20から読み込んだデータに対応するデータがない場合は図3のステップ204においてエラーが発生したとしてデフォルト値を設定するようにしたので、エラー発生時の対処として好ましい。
【0024】
さらに、記憶データにおけるデータ構成を、二進数での「0」と「1」の数を予め定めた数とし、詳しくは、二進数での「0」と「1」の数を同数とした。そして、図3のステップ201においてEEPROM20から読み込んだデータが予め定めたデータ構成となっていない場合は図3のステップ204においてエラーが発生したとしてデフォルト値を設定するようにした。よって、エラー発生時の対処として好ましいものとなる。
【0025】
以下、より詳しく説明する。
2000年から2020年までの製造年月日をEEPROMに記憶する方法を例に挙げる。
(i)前提条件として、年月日の各パラメータを、
年:u2_Year
月:u1_Month
日:u1_Date
とする。また、EEPROMに記憶するパラメータ名を、それぞれ記憶する年月日パラメータに合わせて「E_Year」,「E_Month」,「E_Date」とする。
(ii)具体的動作としては次のようになる。
【0026】
まず最初に、実際に使用するパラメータとEEPROMに記憶するパラメータの対応表を作成し、そのパラメータ表を用いてu2_YearとE_Year、u1_MonthとE_Month、u1_DateとE_Dateの対応をとる。
【0027】
そのための第1段階として、u2_YearのEEPROM対応表を作成する。
具体的には、2000年から2020年までを使用したい範囲としているので、u2_Yearがとりうるパラメータは全部で21通りとなる。
【0028】
1バイト=8ビットであるから、8ビット中、4ビットが「1」となる組み合せは、
=70>21
となり、1バイトで2000年〜2020年までのデータに対する記憶データを作成可能である。そして、入力データu2_Yearと記憶データE_Yearの対応表を表2のように設定する。
【0029】
このとき、E_Yearのサイズは1バイトで十分である。
【0030】
【表2】
Figure 2004005179
第2段階として、u1_Monthおよびu1_DateのEEPROM対応表を作成する。
【0031】
具体的には、u1_Monthおよびu1_Dateについても、年パラメータと同様のアプローチで表3を作成する。ただし、月,日については表3を共用することができる。
【0032】
このとき、E_MonthおよびE_Dateのサイズはそれぞれ1バイトで十分である。
【0033】
【表3】
Figure 2004005179
第3段階として、その使用方法を説明する。
【0034】
EEPROMへの記憶方法として、EEPROMに2002年11月10日を記憶させる場合について述べる。
第1工程;u2_Year=2002、u1_Month=11、u1_Date=10となる。
【0035】
第2工程;表2から、u2_Year=2002に対応するEEPROM記憶値E_Yearは「0x1b」となる。
表3から、u1_Month=11に対応するEEPROM記憶値E_Monthは「0x35」となる。
【0036】
表3から、u1_Date=10に対応するEEPROM記憶値E_Dateは「0x33」となる。
よって、記憶パラメータは表4のようになり、EEPROMでの記憶領域として3バイトあればよい。
【0037】
【表4】
Figure 2004005179
次に、EEPROMからの読み出し方法(EEPROMの記憶値からデータを読み出す場合)について述べる。
【0038】
記憶データが正しい場合の例として、E_Year=0x17,E_Month=0x35,E_Date=0x53の場合は次のようになる。
E_Year,E_Month,E_Dateを、表2,3を用いてu2_Year,u1_Month,u1_Dateに逆変換すると、
u2_Year=2001,u1_Month=11,u1_Date=20
となる。
【0039】
記憶データが間違っている場合の例として、E_Year=0x17,E_Month=0x35,E_Date=0x54の場合は次のようになる。
E_Year,E_Month,E_Dateを、表2,3を用いてu2_Year,u1_Month,u1_Dateに逆変換すると、
u2_Year=2001,u1_Month=11までは逆変換できるが、u1_Dateは対応するパラメータがないため、エラー処理を行う(図3のステップ204でデフォルト値を設定する)。
【0040】
次に、従来手法について説明を加える。
今、入力データとして、
u2_Year;(年を記憶する2バイトのデータ)、
u1_Month;(月を記憶する1バイトのデータ)、
u1_Date;(日を記憶する1バイトのデータ)
を想定する。
【0041】
従来のミラー手法でEEPROMに記憶する場合、記憶したいデータの領域と同等のミラー領域が必要となり、図4のようにEEPROMに記憶される。この際、記憶に必要な領域は、
(2+1+1)・2=8
より、8バイトである。
【0042】
本実施形態における記憶可能なデータ数に関しては、次のようになる。
本実施形態ではEEPROMで記憶するデータ領域をN−バイトとすると、N−バイトで記憶できる数は、
8・N8・N/2
で表すことができる。
【0043】
表5に、Nの値(N=1,2,4)における、その記憶可能データ数を示す。即ち、例えば1バイトでは=70となる。さらに表5においてミラー手法を使用した時の記憶データ数も併せて示す。即ち、ミラー手法では例えば1バイトでは8ビットのうち4ビットがミラーデータとして使用されることから記憶データ数は4ビット分の「16」となる。
【0044】
【表5】
Figure 2004005179
この表5から、同じバイト数であれば記憶データ数は本実施形態の方がミラー手法より多く、本実施形態の方が優れていることは明らかである。
【0045】
さらに、使用効率に関しては、以下のようになる。
本実施形態での使用効率をRATE_E、ミラー手法での使用効率をRATE_Mとしたときに、N−バイトにおける各手法での使用効率を考える。
【0046】
エラー検出機能を付けない場合(通常使用時)のN−バイトで表されるデータ数をSUM_Nとし、本実施形態の手法で扱えるデータ数をSUM_E、ミラー手法にて扱えるデータ数をSUM_Mとしたとき、各手法での使用効率を
RATE_E={(SUM_E)/(SUM_N)}・100(%)
RATE_M={(SUM_M)/(SUM_N)}・100(%)
で表すと、各効率は表6のようになる。
【0047】
【表6】
Figure 2004005179
この表6において、1バイトではRATE_E=27.3%、RATE_M=6.25%であり、2バイトではRATE_E=19.6%、RATE_M=0.39%である。よって、本実施形態での使用効率RATE_Eはミラー手法での使用効率RATE_Mに比べ格段に高いことが分かる。
【図面の簡単な説明】
【図1】実施の形態におけるECUの内部構成を示す図。
【図2】作用を説明するためのフローチャート。
【図3】作用を説明するためのフローチャート。
【図4】ミラー手法を用いた場合のEEPROMのデータ記憶状態を示す図。
【符号の説明】
10…コントローラ、20…EEPROM、30…メモリ。[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an EEPROM data storage method.
[0002]
[Prior art]
Conventionally, as a method of storing data in an EEPROM, there is a technique of storing mirror data of stored data. As a storage method, storage data + complement of storage data (specifically, one's complement) is stored as a set in a storage area of the EEPROM. In this method, the amount of consumption of the storage area of the EEPROM is twice the number of bytes of one data to be stored. The error detection of the stored data is performed by confirming the sum of the stored data and the mirror data.
[0003]
However, in the above technology, the storage area of the EEPROM depends on the size of data to be stored, and there is a demand to reduce the amount of data to be stored in the EEPROM (the storage capacity of the EEPROM). In particular, the use efficiency of the EEPROM is poor for data having a large number of bytes but a small number of values that can be actually taken.
[0004]
For example, when writing the date of manufacture in an EEPROM, the number of bytes required to represent the year is 2 bytes (although 1 byte if the last two digits are displayed), the number of bytes required to represent the month is 1 byte, The number of bytes required to represent a day is one byte. Therefore, the total usage of the EEPROM requires (2 + 1 + 1) × 2 = 8 bytes.
[0005]
However, the range of values actually used is about 20 types for the year (production start year to about 20 years), and is very small, such as 1 to 12 for the month and 1 to 31 for the day.
As described above, in the related art, when the data size is large but the range of data to be used is narrow, the storage efficiency of the EEPROM tends to deteriorate.
[0006]
[Problems to be solved by the invention]
The present invention has been made under such a background, and an object of the present invention is to reduce the amount of data to be stored in an EEPROM in an EEPROM data storage method having an error detection function, that is, to reduce the storage capacity of the EEPROM. To be able to do it.
[0007]
[Means for Solving the Problems]
In the data storage method for an EEPROM according to claim 1, a conversion table for input data is prepared, the input data is converted into storage data using the conversion data, and the converted data is stored in the EEPROM. The data read from the EEPROM is inversely converted using the conversion table. Therefore, the fact that the reverse conversion cannot be performed means that an error has occurred, and thus the error can be detected. As a result, in the data storage method of the EEPROM having the error detection function, the amount of data stored in the EEPROM is conventionally the sum of the storage data and the mirror data, but in the present invention, the data without the mirror data (conversion data) Thus, the amount of data stored in the EEPROM, that is, the storage capacity of the EEPROM can be reduced.
[0008]
In particular, when the input data is data representing the date, etc., as described in claim 6, that is, when the data size is large but the used data range is narrow, the conversion table in the used data range is used. And the amount of storage data (conversion data), that is, the storage capacity of the EEPROM can be further reduced.
[0009]
As described in claim 2, when performing reverse conversion using the conversion table, if there is no data corresponding to the data read from the EEPROM, a default value may be set assuming that an error has occurred.
[0010]
According to a third aspect of the present invention, the data configuration of the stored data is set to a predetermined number of binary numbers “0” and “1”. The number of “0” and “1” can be the same.
[0011]
As described in claim 5, when the data read from the EEPROM does not have a predetermined data configuration, it is preferable to determine that an error has occurred and set a default value.
[0012]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described below with reference to the drawings.
In the present embodiment, the present invention is applied to a vehicle electronic control unit (vehicle ECU), and the manufacturing date of the ECU is stored in the EEPROM 20 of FIG.
[0013]
1, the ECU includes a controller 10, an EEPROM 20, and a memory 30. Data representing the date is input to the controller 10 as input data. In the memory 30, tables 31, 32, and 33 are stored. Each of the tables 31, 32, and 33 is for converting input data into data for EEPROM storage. The table 31 is for year conversion, the table 32 is for month conversion, and the table 32 is for day conversion. Specifically, for example, as shown in Table 1, as for the year conversion table 31, as the data to be stored in the EEPROM 20 with respect to the input data, the number of binary "0" and the number of "1" are the same. I remember. Specifically, among the eight bits, the number of “0” is four and the number of “1” is four.
[0014]
[Table 1]
Figure 2004005179
In the present embodiment, the input data is not directly stored in the EEPROM 20, but the input data (data to be stored) is converted by using a table, and the converted data is stored in the EEPROM 20. .
[0015]
That is, when writing data, as shown in FIG. 2, the controller 10 calculates data A to be written in step 100. Specifically, the input data is temporarily stored in a RAM (not shown), and the controller 10 reads this data A. Then, the controller 10 acquires the true write data B corresponding to the value of the data A from the table C in step 101 (converts the input data into the storage data B using the table C). Further, the controller 10 stores the data B in the EEPROM 20 in step 102.
[0016]
When reading data, the controller 10 reads data B from the EEPROM 20 in step 200 as shown in FIG. Then, in step 201, the controller 10 determines whether the number of “0” and the number of “1” in the data B are the same. If the number of “0” and the number of “1” in the data B are the same, the controller 10 proceeds to step 202 and determines whether or not there is data corresponding to the data B in the table C. When there is data corresponding to the data B, the controller 10 proceeds to step 203 and extracts and uses the data A corresponding to the data B in the table C. More specifically, the controller 10 stores the data A, which has been inversely converted by the table C, in a RAM (not shown) and uses the data A.
[0017]
On the other hand, when the number of “0” and the number of “1” in data B are not the same in step 201, and when there is no data corresponding to data B in step 202, the controller 10 proceeds to step 204. . In step 204, the controller 10 determines that the data B is an error, and substitutes a default value for the data A.
[0018]
Next, the case where the manufacturing date in FIG. 2 is written in the EEPROM 20 will be described in detail.
The year, month, and day to be stored are Y, M, and D.
[0019]
The data actually stored for the year data Y is E_Y, similarly, the month data M is E_M, and the day data D is E_D.
The conversion table between Y and E_Y is T_Y, the conversion table between M and E_M is T_M, and the conversion table between D and E_D is T_D.
[0020]
The conversion table T_ * (* is Y or M or D) is a table for converting input data into EEPROM storage data. The EEPROM storage data includes the number of bits that are “1” when converted to binary. , "0" are sets of data having the same number of bits, and the table is designed so that the input and output are always one-to-one. As a result, if an error occurs in the writing / reading of the EEPROM, the data becomes data that does not exist in the conversion table, and the error can be easily detected.
[0021]
Further, in the data to be stored, the number of bits “1” and the number of bits “0” are equal, so that error detection can be performed.
As described above, as the data storage method of the EEPROM 20 of FIG. 1, the conversion tables 31, 32, and 33 of the input data are prepared, and the conversion data 31, 32, and 33 are used to convert the input data into the storage data as shown in FIG. The converted data is stored in the EEPROM 20, and the data read from the EEPROM 20 is inversely converted using the conversion tables 31, 32, and 33 as shown in FIG. Therefore, the fact that the reverse conversion cannot be performed means that an error has occurred, and thus the error can be detected. As a result, in the data storage method of the EEPROM 20 having the error detection function, the amount of data stored in the EEPROM 20 is conventionally the sum of the storage data and the mirror data. ), The amount of data stored in the EEPROM 20, that is, the storage capacity of the EEPROM 20 can be reduced.
[0022]
In particular, when the input data is data representing the date, that is, when the data size is large but the data range to be used is narrow, a conversion table for the data range to be used may be prepared, and the storage data ( Conversion data), that is, the storage capacity of the EEPROM 20 can be further reduced.
[0023]
When there is no data corresponding to the data read from the EEPROM 20 in step 202 of FIG. 3 when performing the inverse conversion using the conversion tables 31, 32, and 33, it is determined that an error has occurred in step 204 of FIG. Is set, which is preferable as a countermeasure when an error occurs.
[0024]
Further, the data configuration of the stored data is such that the number of binary "0" and "1" is a predetermined number, and in detail, the number of binary "0" and "1" is the same. If the data read from the EEPROM 20 does not have a predetermined data structure in step 201 of FIG. 3, a default value is set as an error has occurred in step 204 of FIG. Therefore, this is preferable as a measure to be taken when an error occurs.
[0025]
Hereinafter, this will be described in more detail.
A method of storing the date of manufacture from 2000 to 2020 in an EEPROM will be described as an example.
(I) As a prerequisite,
Year: u2_Year
Month: u1_Month
Day: u1_Date
And The parameter names stored in the EEPROM are "E_Year", "E_Month", and "E_Date" in accordance with the date parameters stored respectively.
(Ii) The specific operation is as follows.
[0026]
First, a correspondence table between parameters actually used and parameters stored in the EEPROM is created, and the correspondence between u2_Year and E_Year, u1_Month and E_Month, and u1_Date and E_Date is determined using the parameter table.
[0027]
As a first step for this, an EEPROM correspondence table of u2_Year is created.
Specifically, since the range from 2000 to 2020 is to be used, u2_Year has a total of 21 possible parameters.
[0028]
Since 1 byte = 8 bits, a combination in which 4 bits are “1” out of 8 bits is
8 C 4 = 70> 21
Thus, storage data for data from 2000 to 2020 can be created with one byte. Then, a correspondence table between the input data u2_Year and the storage data E_Year is set as shown in Table 2.
[0029]
At this time, one byte is sufficient for the size of E_Year.
[0030]
[Table 2]
Figure 2004005179
As a second step, an EEPROM correspondence table of u1_Month and u1_Date is created.
[0031]
Specifically, Table 3 is created for u1_Month and u1_Date using the same approach as the year parameter. However, Table 3 can be shared for month and day.
[0032]
At this time, it is sufficient that the size of each of E_Month and E_Date is 1 byte.
[0033]
[Table 3]
Figure 2004005179
As a third stage, the method of use will be described.
[0034]
As a method of storing data in the EEPROM, a case where November 10, 2002 is stored in the EEPROM will be described.
First step: u2_Year = 2002, u1_Month = 11, u1_Date = 10.
[0035]
Second step: From Table 2, the EEPROM storage value E_Year corresponding to u2_Year = 2002 is “0x1b”.
From Table 3, the EEPROM storage value E_Month corresponding to u1_Month = 11 is “0x35”.
[0036]
From Table 3, the EEPROM storage value E_Date corresponding to u1_Date = 10 is “0x33”.
Therefore, the storage parameters are as shown in Table 4, and it is sufficient if the storage area in the EEPROM is 3 bytes.
[0037]
[Table 4]
Figure 2004005179
Next, a method of reading data from the EEPROM (when data is read from the stored value of the EEPROM) will be described.
[0038]
As an example of the case where the stored data is correct, when E_Year = 0x17, E_Month = 0x35, and E_Date = 0x53, the following is performed.
When E_Year, E_Month, and E_Date are inversely converted to u2_Year, u1_Month, and u1_Date using Tables 2 and 3,
u2_Year = 2001, u1_Month = 11, u1_Date = 20
It becomes.
[0039]
As an example of the case where the stored data is incorrect, the following is performed when E_Year = 0x17, E_Month = 0x35, and E_Date = 0x54.
When E_Year, E_Month, and E_Date are inversely converted to u2_Year, u1_Month, and u1_Date using Tables 2 and 3,
The inverse conversion can be performed up to u2_Year = 2001 and u1_Month = 11, but since u1_Date has no corresponding parameter, error processing is performed (the default value is set in step 204 in FIG. 3).
[0040]
Next, the conventional method will be described.
Now, as input data,
u2_Year; (two-byte data for storing the year),
u1_Month; (1 byte data for storing the month),
u1_Date; (1 byte data for storing date)
Is assumed.
[0041]
When the data is stored in the EEPROM by the conventional mirror method, a mirror area equivalent to the area of the data to be stored is required, and the data is stored in the EEPROM as shown in FIG. At this time, the area required for storage is
(2 + 1 + 1) · 2 = 8
8 bytes.
[0042]
The number of data that can be stored in the present embodiment is as follows.
In this embodiment, if the data area stored in the EEPROM is N-bytes, the number that can be stored in N-bytes is:
8 · N C 8 · N / 2
Can be represented by
[0043]
Table 5 shows the number of storable data at the value of N (N = 1, 2, 4). That is, for example, for one byte, 8 C 4 = 70. Table 5 also shows the number of stored data when the mirror method is used. That is, in the mirror method, for example, 4 bits out of 8 bits in 1 byte are used as mirror data, so that the number of stored data is "16" for 4 bits.
[0044]
[Table 5]
Figure 2004005179
From Table 5, it is clear that the number of stored data is greater in the present embodiment than in the mirror method if the number of bytes is the same, and the present embodiment is superior.
[0045]
Further, the usage efficiency is as follows.
Assuming that the use efficiency in the present embodiment is RATE_E and the use efficiency in the mirror method is RATE_M, the use efficiency in each method in N-bytes will be considered.
[0046]
When the number of data represented by N-bytes when the error detection function is not provided (during normal use) is SUM_N, the number of data that can be handled by the method of the present embodiment is SUM_E, and the number of data that can be handled by the mirror method is SUM_M. , RATE_E = {(SUM_E) / (SUM_N)} · 100 (%)
RATE_M = {(SUM_M) / (SUM_N)} · 100 (%)
, Each efficiency is as shown in Table 6.
[0047]
[Table 6]
Figure 2004005179
In Table 6, RATE_E = 27.3% and RATE_M = 6.25% for one byte, and RATE_E = 19.6% and RATE_M = 0.39% for two bytes. Therefore, it can be seen that the usage efficiency RATE_E in the present embodiment is much higher than the usage efficiency RATE_M in the mirror method.
[Brief description of the drawings]
FIG. 1 is a diagram showing an internal configuration of an ECU according to an embodiment.
FIG. 2 is a flowchart for explaining the operation.
FIG. 3 is a flowchart for explaining the operation.
FIG. 4 is a diagram showing a data storage state of an EEPROM when a mirror method is used.
[Explanation of symbols]
10 ... controller, 20 ... EEPROM, 30 ... memory.

Claims (6)

入力データの変換テーブルを用意し、この変換データを用いて入力データを記憶データに変換し、当該変換したデータをEEPROMに記憶するとともに、前記EEPROMから読み込んだデータを前記変換テーブルを用いて逆変換するようにしたことを特徴とするEEPROMのデータ記憶方法。A conversion table for the input data is prepared, the input data is converted into storage data using the conversion data, the converted data is stored in the EEPROM, and the data read from the EEPROM is inversely converted using the conversion table. A method for storing data in an EEPROM. 前記変換テーブルを用いて逆変換する際に、EEPROMから読み込んだデータに対応するデータがない場合はエラーが発生したとしてデフォルト値を設定するようにしたことを特徴とする請求項1に記載のEEPROMのデータ記憶方法。2. The EEPROM according to claim 1, wherein when performing reverse conversion using the conversion table, if there is no data corresponding to data read from the EEPROM, an error has occurred and a default value is set. Data storage method. 記憶データにおけるデータ構成を、二進数での「0」と「1」の数を予め定めた数としたことを特徴とする請求項1に記載のEEPROMのデータ記憶方法。2. The data storage method for an EEPROM according to claim 1, wherein the data configuration of the stored data is such that the number of "0" and "1" in a binary number is a predetermined number. 前記二進数での「0」と「1」の数を同数としたことを特徴とする請求項3に記載のEEPROMのデータ記憶方法。4. The EEPROM data storage method according to claim 3, wherein the number of "0" and "1" in the binary number is the same. 前記EEPROMから読み込んだデータが予め定めたデータ構成となっていない場合はエラーが発生したとしてデフォルト値を設定するようにしたことを特徴とする請求項3または4に記載のEEPROMのデータ記憶方法。5. The EEPROM data storage method according to claim 3, wherein when data read from the EEPROM does not have a predetermined data configuration, an error has occurred and a default value is set. 前記入力データは、年月日を表すデータであることを特徴とする請求項1〜5のいずれか1項に記載のEEPROMのデータ記憶方法。6. The data storage method for an EEPROM according to claim 1, wherein the input data is data representing a date.
JP2002159700A 2002-05-31 2002-05-31 Data storage method of eeprom Pending JP2004005179A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002159700A JP2004005179A (en) 2002-05-31 2002-05-31 Data storage method of eeprom

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002159700A JP2004005179A (en) 2002-05-31 2002-05-31 Data storage method of eeprom

Publications (1)

Publication Number Publication Date
JP2004005179A true JP2004005179A (en) 2004-01-08

Family

ID=30429371

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002159700A Pending JP2004005179A (en) 2002-05-31 2002-05-31 Data storage method of eeprom

Country Status (1)

Country Link
JP (1) JP2004005179A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100332737A1 (en) * 2009-06-24 2010-12-30 Samsung Electronics Co., Ltd. Flash memory preprocessing system and method
US8255643B2 (en) 2009-02-24 2012-08-28 Samsung Electronics Co., Ltd. Memory system and data processing method thereof
KR20140011268A (en) * 2012-07-18 2014-01-28 가부시키가이샤 에바라 세이사꾸쇼 Plating apparatus and method for cleaning substrate holder

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8255643B2 (en) 2009-02-24 2012-08-28 Samsung Electronics Co., Ltd. Memory system and data processing method thereof
US20100332737A1 (en) * 2009-06-24 2010-12-30 Samsung Electronics Co., Ltd. Flash memory preprocessing system and method
US8583855B2 (en) * 2009-06-24 2013-11-12 Samsung Electronics Co., Ltd. Flash memory preprocessing system and method
KR101572833B1 (en) * 2009-06-24 2015-12-01 삼성전자주식회사 Flash memory preprocessing system and method thereof
KR20140011268A (en) * 2012-07-18 2014-01-28 가부시키가이샤 에바라 세이사꾸쇼 Plating apparatus and method for cleaning substrate holder

Similar Documents

Publication Publication Date Title
EP1434419A3 (en) Image processing apparatus and image processing method
US6639843B2 (en) Semiconductor memory device with block-unit erase type nonvolatile memory
JP2004005179A (en) Data storage method of eeprom
JPH02279015A (en) Delay circuit
TW200828244A (en) Common voltage adjustment apparatus
JP3775487B2 (en) Digital waveform data recording circuit and digital waveform data recording method
JP2850049B2 (en) IC card
US7065606B2 (en) Controller architecture for memory mapping
JP2507399B2 (en) Database equipment
JP2718129B2 (en) IC card
JP2766921B2 (en) Layout pattern generator
JPH02294714A (en) Dominical year identifying and processing method
JP3537032B2 (en) Data type conversion method between different programming languages
CN113727190A (en) Multi-format video image conversion method, system, terminal and storage medium
JPH0256073A (en) Semiconductor mask forming data converter
JPS6223902B2 (en)
TWI406175B (en) Memory card and method for memory card
TW202125243A (en) One-time programmable memory device and fault tolerant method thereof
JPS6061842A (en) Access system of structure memory
KR100237879B1 (en) File format transformation method
JPS61246848A (en) Operation hysteresis storage circuit
JPH09185565A (en) Network system with program transferring function
JPS60205485A (en) Form data memory system
JPH0770237B2 (en) Partial correction circuit for mask ROM read data
JPH0573385A (en) Data definition information storage system