JPS6059454A - Count data storing method to eeprom - Google Patents

Count data storing method to eeprom

Info

Publication number
JPS6059454A
JPS6059454A JP58167554A JP16755483A JPS6059454A JP S6059454 A JPS6059454 A JP S6059454A JP 58167554 A JP58167554 A JP 58167554A JP 16755483 A JP16755483 A JP 16755483A JP S6059454 A JPS6059454 A JP S6059454A
Authority
JP
Japan
Prior art keywords
data
area
storage area
data storage
division
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
JP58167554A
Other languages
Japanese (ja)
Other versions
JPH0373958B2 (en
Inventor
Soichi Yagi
八木 操一
Atsuhiko Murata
敦彦 村田
Shinzo Yokoyama
横山 信三
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.)
Koito Manufacturing Co Ltd
Original Assignee
Koito Manufacturing 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 Koito Manufacturing Co Ltd filed Critical Koito Manufacturing Co Ltd
Priority to JP58167554A priority Critical patent/JPS6059454A/en
Publication of JPS6059454A publication Critical patent/JPS6059454A/en
Publication of JPH0373958B2 publication Critical patent/JPH0373958B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)
  • For Increasing The Reliability Of Semiconductor Memories (AREA)
  • Time Recorders, Dirve Recorders, Access Control (AREA)

Abstract

PURPOSE:To suppress the rewriting frequency per area and to detect the final data out of the stored counted data by dividing the maximum number of counted digits and providing a data store area every count value for the lowest-order section. CONSTITUTION:A sensor 40 produces a pulse for each fixed distance traveled, and a display device 60 displays the distance traveled. A data rewriting prevention circuit 80 inhibits the inadvertent rewriting of data, and a data writing prevention circuit 90 prevents the writing of data when a processor 10 has a runaway. An EEPROM30 contains a program area 31 for a fixed memory and a data area 32 which is used like an RAM. Data signals D1 and D2, an address signal A1, a read control signal and a write control signal W1 are transferred to an MPU. A data store area and its corresponding sign store area are provided in order to secure the final data.

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は電気的に消去、書込みおよび読出しが可能な不
揮発性メモリであるEEFROMへのデータ収納方法、
特にNI数データの収納方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a method for storing data in an EEFROM, which is a nonvolatile memory that can be electrically erased, written, and read;
In particular, it relates to a method of storing NI number data.

〔従来技術〕[Prior art]

近年、このようなEEPROMの開う五が進み、周辺デ
バイス制御と同一の5V単−市、源で11J1打111
1り能なものも現われて、広範囲の利用、lrにに従来
困難の多かった、専用のバックアップ電踪をもたない小
形のシステムにおけるデータの保存、の問題k 19・
−決するものとしてその利用が大いに期待されている。
In recent years, the development of such EEPROM has progressed, and the peripheral device control and the same 5V single power source are 11J1 stroke 111
19・
- There are great expectations for its use as a decision-making tool.

しかしながら、停電時の一時退避用としてではなく、い
わば掲頭と同様に用いる場合には、EEPROMは通常
のRAMと異なり書込み(書換え)が、消去および書込
みの2段構えとなjl 10m5程度と比較的長い時間
を要することから、その間に中断した場合の対策、すな
わち、動作再開後に読出したデータが中断した無意味な
データではなく正しい最終データであるか否かを判断し
、あるいは中断直前の完全なデータが確実に得られるよ
うにすると吉が必要で、例えば1種類のデータについて
複数の収納エリアを設け、多数決でその最終データを判
断する等の方法が提案されている。
However, when used as a bulletin board rather than as a temporary backup during a power outage, EEPROM differs from normal RAM in that writing (rewriting) takes place in two stages: erasing and writing. Since it takes a long time to complete the process, there are measures to be taken in the event of an interruption during that time. In other words, it is necessary to determine whether the data read after restarting the operation is the correct final data rather than the meaningless data that was interrupted, or to read the complete data just before the interruption. It is necessary to ensure that accurate data can be obtained. For example, methods have been proposed in which multiple storage areas are provided for one type of data and the final data is determined by majority vote.

もう一点、EEPROMをRAMと同様の方法で用いる
場合に解決されなければならないことに、書込み回数の
制限の問題がある。すなわち、現在EEFROMの消去
・tlj、込み可能回数は10 同程度とされている。
Another issue that must be resolved when using EEPROM in a similar manner to RAM is the problem of limiting the number of writes. That is, currently, the number of times an EEFROM can be erased, tlj, and written is about the same as 10.

したがって、これを力9ンタとして利用する場合には、
特定のエリアを設け、そこに単純に計数して行く方法で
は上記消去・書込み可能回数までの言1数しかできない
ことになる。
Therefore, when using this as a force input,
If a specific area is provided and the numbers are simply counted in that area, only the number of times that erasing and writing can be performed can be achieved.

〔発明の概要〕[Summary of the invention]

本発明はこのような事情に鑑みてなされたもので、その
目的は、書込み途中の動作中断にかかわらず常に確実な
最終データが得られ、かつ個々のエリアの消去・書込み
可能回数の制限を上回る数の計数が可能なlPROMへ
の計数データ収納方法を提供することにある。
The present invention was made in view of these circumstances, and its purpose is to always obtain reliable final data regardless of interruptions in writing operations, and to exceed the limit on the number of erasing and writing times for individual areas. It is an object of the present invention to provide a method for storing count data in an IPROM that is capable of counting numbers.

このような目的を達成するために、本発明は、最大計数
桁数を桁順に複数区分に分割し、上位区分については区
分ごとに計数データ収納エリアを設けるとともに、最下
位区分については1計数値ごとに当該区分の最大計数値
より少ない個数の計数データ収納エリアを設け、言]数
値の更新にあたっては、最下位区分の言1数データ収納
エリアの内容から自然数列が乱れる直前のものを最終デ
ータとして検索し、その次の順位のエリアに更新値を収
納し、その更新値が101となる場合には、さらに上位
区分の内容の更新を行なうものである。
In order to achieve such an object, the present invention divides the maximum number of counted digits into multiple sections in order of digits, provides a counting data storage area for each section for the upper section, and provides one count data storage area for the lowest section. A count data storage area with a number smaller than the maximum count value of the relevant division is provided for each division, and when updating the numerical value, the final data is the one immediately before the natural number sequence is disturbed from the contents of the count data storage area of the lowest division. The updated value is stored in the area of the next rank, and when the updated value becomes 101, the contents of the higher classification are further updated.

一般的に、最終データを確保する方法として、収納すべ
きデータの種類ごとに3以上のn個のデータ収納エリア
と、これに対応するサイン収納エリアとを設け、サイン
収納エリアには順位が特定可能なn+1個以上の異なっ
たサイン、例えば連続する自然数のいずれかを収納する
ようにし、データの更新にあたっては、サインのうち連
続する最後順位のものを最終データに対応するものとし
て検索し、対応するデータ収納エリアの次順位のデータ
収納エリアに更新データを収納した後、それに対応する
サイン収納エリアのサインを上記最後順位のサインより
1順位後順位のサインに書換える方法が考えられる。ず
なわら、新データの書込みが完了した時点でサインの書
換えを行ない、との”リーインによって、完全なデ〜り
のうらでは最も新しい最終データが検出できるようにし
たものであるが、この方法を言1数データの収納に用い
るには、前述した書込み回数の制限の問題がある一方で
、計数データの場合には、データそのものが連続する自
然数であることから、これをそのままサインとしても兼
用することができる。
Generally, as a method of securing the final data, three or more n data storage areas are provided for each type of data to be stored, and a corresponding signature storage area is provided, and the signature storage areas are assigned a specific rank. It is possible to store n+1 or more different signs, for example, any one of consecutive natural numbers, and when updating data, the last consecutive sign is searched as corresponding to the final data, and the corresponding one is searched. A conceivable method is to store the updated data in the next data storage area of the data storage area, and then rewrite the signature in the corresponding signature storage area to a sign one rank after the last one. Of course, the signature is rewritten as soon as the writing of new data is completed, so that the latest final data can be detected even after a complete write-in, but this method When used to store 1-number data, there is the problem of the limit on the number of writes mentioned above, but in the case of count data, since the data itself is a continuous natural number, it can also be used as a signature. can do.

したがって本発明は、最大計数桁数を分割し、最下位区
分については1計数値ご七にデータ収納エリアを設ける
という方法によりlエリア当りの1換え回数を抑えると
ともに、その収容している計数データそのものから最終
データの検出が行なえるようにしたものである。上位区
分については、上述したように各区分ごとに3以上のデ
ータ収納エリアおよびサイン収納エリアを設ける方法を
とってもよいし、あるいは他の、例えは前述したような
多数決法により最終データを把握できるようにすればよ
い。以下、実施例を用いて本発明の詳細な説明する。
Therefore, the present invention reduces the number of changes per area by dividing the maximum number of counting digits and providing a data storage area for every seven counting digits in the lowest division. The final data can be detected from the data itself. Regarding the upper divisions, it is possible to use a method of providing three or more data storage areas and signature storage areas for each division as described above, or to use another method, for example, by using the majority voting method as described above, so that the final data can be grasped. Just do it. Hereinafter, the present invention will be explained in detail using Examples.

〔実施例〕 第1図は本発明を電子オドメータに適用した場合の一実
施例を示すシステムの11・1段図である。図において
、10はプロセッッ゛で、具体的にtま例えば周知のマ
イクロプロセッサにより構成さノ′しる。
[Embodiment] FIG. 1 is an 11-1 stage diagram of a system showing an embodiment of the present invention applied to an electronic odometer. In the figure, reference numeral 10 denotes a processor, specifically constituted by, for example, a well-known microprocessor.

20はRAM、30はEEPROM Tある。また4o
はセンサで、一定の走行距離ごとに発生ずるパルス信号
PSを入力インターフェース5oを介してプロセツザ1
0に送出する。さらに60は走行距離を表示する表示器
、70はその駆動回路であり、プロセッサ10により制
御される。EEPROM 30には、固定メモリとして
用いるプログラムエリア31と、RAMと同様に使用す
るデータエリア32とが設けである。Dlはプロセッサ
10と上記データエリア32との間でやり取りされるデ
ータ信号、Dlは上記プログラムエリア31から読出さ
れるデータ信号、A1は上記データエリアもしくね、プ
ログラムエリアの特定番地エリアを指定するアドレス信
号、R1は読出し制御信号、Wl は書込み制御信号で
ある。
20 is RAM and 30 is EEPROM T. Also 4o
is a sensor which inputs a pulse signal PS generated every fixed distance traveled to the processor 1 via an input interface 5o.
Send to 0. Further, 60 is a display that displays the distance traveled, and 70 is a driving circuit thereof, which is controlled by the processor 10. The EEPROM 30 is provided with a program area 31 used as a fixed memory and a data area 32 used similarly to a RAM. Dl is a data signal exchanged between the processor 10 and the data area 32, Dl is a data signal read from the program area 31, and A1 designates the data area or a specific address area of the program area. The address signal, R1, is a read control signal, and Wl is a write control signal.

上記構成において、プログラムエリア31は1例えば標
準径タイヤ円周長←ン/タイヤ1回転当りのパルス数=
人とし、n (r−11Jt)/A 、!ニし請求めた
100m当りにセンサ40から入力する・くルス数など
、固定的なデータを予め収納しておくのに用い、データ
エリア32は、上記パルス数を言1数する計数データの
収納に用いる。なお、80は例えば上記固定データなど
不用意に書換えが行なわれてはならないデータの書換え
を防ぐための回路で、特定のアドレス信号線に信号が送
出されていないことを条件として、すなわちナンド回路
NAND 1の全入力が非能動であることを条件として
、書込み制御信号線上に設けたアンド回路AND 1を
開くようにすることにより、上記特定のアドレス信号線
に対応する桁が“1″となるアドレスの内容の書換えを
防止するものである。また、90はプロセッサ10が暴
走した際に誤ったデータの1込みが行なわれるのを防ぐ
だめの回路で、プロセッサ10が正常動作中は当該プロ
セッサから送出されるクロックパルスにより放電を繰返
してその端子電圧が1定レベル以下に抑えられているコ
ンデンfctの当該端子電圧が、上記一定レベルより高
い基準電圧Bを越えたことを比較器により検出して、す
なわちその場合に比較器COMIの出力が0°′となる
ことKよりアンド回路AND 、を閉じ、書込みを禁止
するものである。
In the above configuration, the program area 31 is 1, for example, standard diameter tire circumference ← / number of pulses per rotation of tire =
As a person, n (r-11Jt)/A,! The data area 32 is used to store fixed data such as the number of pulses input from the sensor 40 per 100 m that is requested, and the data area 32 is used to store counting data that counts the number of pulses mentioned above. used for Note that 80 is a circuit for preventing rewriting of data that should not be rewritten carelessly, such as the above-mentioned fixed data. By opening the AND circuit AND1 provided on the write control signal line on the condition that all inputs of 1 are inactive, the address where the digit corresponding to the above specific address signal line becomes ``1'' can be determined. This prevents the contents from being rewritten. Further, 90 is a circuit that prevents erroneous data from being loaded when the processor 10 goes out of control, and when the processor 10 is in normal operation, it is repeatedly discharged by the clock pulses sent from the processor to the terminals. The comparator detects that the terminal voltage of the capacitor fct, whose voltage is suppressed below 1 constant level, exceeds the reference voltage B higher than the above-mentioned constant level, that is, in that case, the output of the comparator COMI becomes 0. Since K becomes '°', the AND circuit AND is closed and writing is prohibited.

そこで、EEPROM30の容量を512バイトとし、
最大計数桁数′f:4バイトー32ビットとして、EE
PROM30のエリアを1fi2図のように2分し、そ
の一方に最下位バイト用の計数データ収納エリア■す4
(i=1〜255)を設けるとともに、他方に上位3バ
イト用のg]数データ収納エリアR2,j、RB、j。
Therefore, the capacity of EEPROM30 is set to 512 bytes,
Maximum number of counting digits'f: 4 bytes to 32 bits, EE
Divide the PROM30 area into two as shown in the 1fi2 diagram, and place a count data storage area for the lowest byte on one side4.
(i=1 to 255), and on the other hand, g] number data storage areas R2,j, RB,j for the upper 3 bytes.

曳、jおよびサイン収納エリアNj (−、=1〜3)
を設ける。4バイト=:32ビットは、lO進数では4
.2949×IU9となり、オドメータの場合通常10
万Kmまで、すなわち分解能’5100mとしても10
 回まで計数できればよいから、この使用目的のために
は十分な桁数である。このEEPROM30は、予め外
部制御によりイニシャライズが行なわれるが、そのイニ
シャライズ条件は、最下位バイトのデータ収納エリアR
]、iおよび上位3バイトのデータ収納エリアR2,j
+R11jlR4’jの内容をすべて1(月とするのに
対し、サイン収納エリアNj にはα−tJ、1,2.
3のいずれかの値を収納するが、その1シリ合、サイン
n2;α、n8−α+1、nl;α−1の関係を満足す
るようにする。ただし、3+1=0 とする。すなわち
、サイン収納エリアはリングカウンタとして使用する。
Hiki, j and sign storage area Nj (-, = 1 to 3)
will be established. 4 bytes =: 32 bits is 4 in lO base
.. 2949 x IU9, which is usually 10 for an odometer.
up to 10,000 km, that is, even if the resolution is 5100 m, it is 10
Since it is sufficient to be able to count times, this is a sufficient number of digits for this purpose. This EEPROM 30 is initialized in advance by external control, and the initialization condition is that the data storage area R of the lowest byte is
], i and upper 3 byte data storage area R2,j
While the contents of +R11jlR4'j are all 1 (month), the signature storage area Nj has α-tJ, 1, 2 .
3 is stored, and the 1 series is made to satisfy the relationship of sign n2;α, n8-α+1, nl;α-1. However, 3+1=0. That is, the signature storage area is used as a ring counter.

また、最下位バイトのデータ収納エリアR,には1〜2
55の組数データを収容できるが、256となる場合に
は桁上げが行なわれて最下位バイトのデータ収納エリア
の内容としては「0」となる。すなわち、この最下位バ
イトのデータ収納エリアもリングカウンタとし7て用い
られることに々る。なお、Fはオーバーフローエリアで
、後述するように最下位バイトから旧位バイI・への桁
上げが正しく行なわれたか否かを識別するために用いる
ものである。
In addition, the data storage area R of the lowest byte contains 1 to 2
Although 55 set number data can be accommodated, when the number of sets becomes 256, a carry is performed and the content of the data storage area of the least significant byte becomes "0". That is, the data storage area of this least significant byte is also often used as a ring counter 7. Note that F is an overflow area, which is used to identify whether or not the carry from the least significant byte to the older byte has been correctly performed, as will be described later.

一方、RAM20 には第3図に示すように各バイトに
対応したエリアR1〜R4からなる計数データ収納エリ
アが設けられ、lFROM30の計数データの更新は、
上記RAMデータが変化するごとに、その新データを順
次上記各データ収納エリアに収納して行くことにより行
なわれる。
On the other hand, the RAM 20 is provided with a counting data storage area consisting of areas R1 to R4 corresponding to each byte as shown in FIG.
This is done by sequentially storing the new data in each of the data storage areas each time the RAM data changes.

以下、第4図のフローチャートを用いてEEI’ROM
30への計数データ収納動作を説明する。すなわち、第
4図はプロセッサ10における実行プログラムの一例を
示すフローチャー1・である。なお、このプログラムを
収納するためのROMが必ρであることは言うまでもな
いが、第1図では省略した。
Below, using the flowchart in Figure 4, EEI'ROM
The operation of storing count data into 30 will be explained. That is, FIG. 4 is a flowchart 1 showing an example of an execution program in the processor 10. It goes without saying that a ROM for storing this program is required, but it is omitted in FIG.

′電源が投入され(イグニッションスイッチ オン)プ
ログラムの実行が開始すると、プロセッサ10はステッ
プ101で上位3バイトの最終データを収納したエリア
R4−j +R8−j +R2−j およびその内容r
4.j+r8.jlr2.j を確認する。これは、次
のように行なわれる。す々わち、順次サイン収納エリア
N1〜N8にアクセスしてその内容n□〜n、を読出し
た後、= ・−・ 読出したサインn1〜n8のうちから連続する最後順位
のnを検出する。例えば上記サイン0,1.2であれば
目的とするサインは2°であり3,0.1であれば0と
なる。このようにして得られたサインnを収納するサイ
ン収納エリアNjに対応するデータ収納エリアR4,j
、R8,j、R2,j が最終データを収納したエリア
であり1その内容r4・j+rs中rllJが七の最終
データと判断される。
'When the power is turned on (the ignition switch is turned on) and program execution starts, the processor 10 in step 101 stores the area R4-j +R8-j +R2-j containing the final data of the upper 3 bytes and its contents r.
4. j+r8. jlr2. Check j. This is done as follows. After sequentially accessing the signature storage areas N1 to N8 and reading out their contents n□ to n, = --- Detecting the last consecutive n from the read signatures n1 to n8. . For example, if the above-mentioned signs are 0 and 1.2, the target sign is 2°, and if it is 3 and 0.1, it is 0. A data storage area R4,j corresponding to the signature storage area Nj that stores the signature n obtained in this way
, R8,j, and R2,j are the areas storing the final data, and rllJ among the contents r4.j+rs is determined to be the final data of 7.

次ニ、ステップ102〜105において最下位ノ(イト
の全データ収納エリアR1,i (1は1’−255)
の内’6r1.lを読出した後、ステップ106〜10
8におれる直前、すなわちr□、i+□八rへ1 、 
)+“01□6′となるr□、lを検出する。例えば上
記名データ収納エリアのデータが第5図のようであった
とすれば、上記連続性が乱れる直前のデータはエリアR
1,iに収納されたrl、l =“orb、となシ、こ
れが最終データとなる。
Next, in steps 102 to 105, the entire data storage area R1,i (1 is 1'-255)
'6r1. After reading l, steps 106-10
Immediately before entering 8, that is, r □, i + □ 8 r to 1,
) + "01□6'".For example, if the data in the above name data storage area is as shown in Figure 5, the data immediately before the continuity is disturbed is in area R.
rl, l = "orb," stored in 1, i, and this becomes the final data.

ここで、この最終データr+、iが’oo”、。である
場合には、前回の更新において桁上げが行なわれたはず
であるが、その桁上げが正しく行なわれたか否か、すな
わち桁上げ途中での書込み中断が行なわれなかったか否
かを確認し、桁上げが行なわれていなければ、この時点
でその桁上げを行なう。
Here, if this final data r+,i is 'oo'', then a carry should have been performed in the previous update, but it is difficult to determine whether the carry was performed correctly or not. It is checked whether or not writing was interrupted midway, and if a carry has not been performed, the carry is performed at this point.

すなわち、ステップ109においてRt、iが00°′
16であることが確認さハ、た場合、プロセッサ10は
ステップ110においてオーバーフローエリアFにアク
セスしてその内容fを読出す。後述するようにこのオー
バーフローエリアFには、最下位バイトから上位バイト
への桁上げを行なう際に、上位3バイトのうちの最下位
バイトのデータ収納エリアR2,jの上記桁上げ後の内
容を、実際にエリアR2,jの更新を行なうに先立って
書込んでおくため、その内容fがエリアR2,jの内容
r2.jに一致しないということは桁」二が正しく行な
われなかったことになる。したがってステップ111に
おいでf−4r2.jが確認されれば、ステップ112
,113において先に最終データ収納エリアと判断され
た次順位のエリアに着終データに「1」を加えた値を収
納し、対応するフィン収納エリアのサインを上記最終デ
ータに対応するサインより1順位後順位のサインに再換
える。
That is, in step 109, Rt,i is 00°'
16, the processor 10 accesses the overflow area F and reads its contents f in step 110. As will be described later, when performing a carry from the least significant byte to the most significant byte, this overflow area F stores the contents of the data storage area R2,j of the least significant byte of the three most significant bytes after the carry. , are written before actually updating area R2,j, so that the content f is the same as the content r2., of area R2,j. If it does not match j, it means that digit ``2'' was not executed correctly. Therefore, in step 111, f-4r2. If j is confirmed, step 112
, 113, store the value obtained by adding "1" to the final data in the area of the next rank that was previously determined to be the final data storage area, and change the sign of the corresponding fin storage area by 1 from the sign corresponding to the final data. After the ranking, change to the ranking sign again.

以上で各バイ)・について最終データが確認される。以
上がいわばイニシャライズ処理といえる。
With the above, the final data for each buy) is confirmed. The above can be called initialization processing.

てこで、以下、プロセッサ10は所定のサンプリング周
期で計数入力、ず々わちセンサ40からのパルス入力を
監視し、計数入力が検出されるごとにステップ115に
おいてRAM20に設けた計数データ収納エリアR1(
L、の内容を1−11インクリメントする。
Hereinafter, the processor 10 monitors the count input and the pulse input from the sensor 40 at a predetermined sampling period, and each time a count input is detected, the processor 10 stores the count data storage area R1 provided in the RAM 20 in step 115. (
Increment the contents of L by 1-11.

次に、文才しに従ってEEPROM30の側の計数値の
更新を行なうが、その時、上記インクリメントの結果最
下位バイトのエリアR□の内容r1が“oo”、。
Next, the count value on the EEPROM 30 side is updated according to the literary style, but at this time, as a result of the above increment, the content r1 of the area R□ of the least significant byte is "oo".

になった場合には、ステップ117において予めオーバ
ーフローエリアにエリアR2の内Wr2を書込んでおく
。次いでステップ118,119で前述した最終データ
収納エリアの次順位の最下位バイトデータ収納エリアR
□、Iに上記RAM200対応するエリアR0のデータ
を収納し、さらにステップ120゜121で同じく最終
データ収納エリアの次順位の上位3バイトデータ収納エ
リアR4,j、RB、j、R2,i にRAM22の対
応エリアR,、R3,R2のデータを順次収納した後、
対応するサイン収納エリアの丈インを上記最終データに
対応するサインよシ1順位後順位のサインに書換える。
If so, in step 117, Wr2 of area R2 is written in the overflow area in advance. Next, in steps 118 and 119, the lowest byte data storage area R next to the final data storage area mentioned above is
The data of the area R0 corresponding to the RAM 200 is stored in □, I, and in steps 120 and 121, the RAM 22 is stored in the next highest 3-byte data storage areas R4,j, RB,j, and R2,i of the final data storage area. After sequentially storing the data of the corresponding areas R,, R3, and R2,
The length in of the corresponding signature storage area is rewritten to the signature corresponding to the above final data and ranked one rank after the signature.

ステップ116において、更新後のRAMデーデー□が
°’Of)”、6でないと判断された場合には、ステッ
プ122,123においてggpItoM30の最下位
バイトのデータの更新のみを行なう。
If it is determined in step 116 that the updated RAM data □ is not 6, then only the least significant byte of ggpItoM30 is updated in steps 122 and 123.

このようにオーバーフローエリアFを設けであるため、
動作中断による割数誤差は最小分解化分に留めることが
できる。オーバーフローエリアFがないと、最下位区分
のエリアR工、iのみ更新されて(更新結果“00”°
□6)上位区分への桁上げが行なわれなかった場合、2
55倍の誤差が生じることとなる。。
Since the overflow area F is provided in this way,
The division error due to the interruption of operation can be kept to the minimum decomposition amount. If there is no overflow area F, only the area R, i in the lowest classification will be updated (update result “00”°
□6) If carry-up to a higher category is not carried out, 2
This results in an error of 55 times. .

以上説明したように、上位3区分についてはデータ収納
エリアに新データケ書込んだ後でサインの書換えが行な
われ、上述した方法で検出したサインは更新が完全に終
了した最終のデータに対応するものであることから、書
込み途中で中断があっても、動作再開時には書込み開始
前の旧データが確実な最終データとして利用できる。連
続性を見るため、サイン収納エリア、したがってそれに
対応してデータ収納エリアも各データごとに少なくとも
3個必要である。この場合、上述した実施例では上位3
バイトのデータ収納エリアI M#に対してサイン収納
エリアを1つずつ対応させる方法をとつ/こが、例えば
第6図に示すように各バイトごとにサイン収納エリアN
2 、 j、N)1 、 j、N4 、 jを設けても
よい1つ このような3以上のn個のサイン収納エリアに対し、連
続性の乱れを見るために、サインそのものはそれより少
なくとも1多(、、n+1個以上必要である。この場合
、サインは順位が特定できるものであれば、あるいは特
定の順位を取決めて使えばどのような符号を用いてもよ
いが、上述した例のように連続した自然数を用い、その
数も、最低の4個か、あるいは特に8ビツト構成のシス
テムなら1語であられせる最大の256個とすることが
最も実際的である。
As explained above, the signatures for the top three categories are rewritten after new data is written to the data storage area, and the signatures detected using the method described above correspond to the final data that has been completely updated. Therefore, even if there is an interruption during writing, the old data before the start of writing can be used as reliable final data when the operation is restarted. To ensure continuity, at least three signature storage areas, and therefore correspondingly data storage areas, are required for each data. In this case, in the embodiment described above, the top three
For example, as shown in FIG. 6, a signature storage area N is created for each byte as shown in FIG.
2, j, N) 1, j, N4, j may be provided.For such n sign storage areas of 3 or more, in order to see the disturbance of continuity, the sign itself is at least 1 or more (, n+1 or more are required. In this case, any sign can be used as long as the order can be specified, or if a specific order is determined and used, but in the above example, It is most practical to use consecutive natural numbers, such as the minimum number of 4, or especially in an 8-bit system, the maximum of 256 that can be included in one word.

この丈イン収納エリアとサインとの関係は最下位バイト
についても全く同様である。すなわち、最下位バイトに
ついてはデータ収納エリアをサイン収納エリアに兼用し
、自然数列であるデータそのものをサインとしても兼用
するのであるが、その場合サインの数が最大計数j&、
 、J二連した実施例では0〜255の256と々るた
め設定できるサイン収納エリアすなわちデータ収納エリ
アの数はそれより少なく、最大255個となる。この最
下位バイトについてはなるべく多くのエリアに分散して
同一エリアについての書込み回数を減らす目的があるた
め、上述した実施例では最大の255個のデータ収納エ
リア勿設定している。
The relationship between the length-in storage area and the sign is exactly the same for the lowest bite. In other words, for the least significant byte, the data storage area is used as a signature storage area, and the data itself, which is a sequence of natural numbers, is also used as a signature, but in that case, the number of signatures is the maximum count j&,
, J in the embodiment has 256 signature storage areas from 0 to 255, so the number of signature storage areas, that is, data storage areas that can be set is smaller than that, and is 255 at maximum. This least significant byte is distributed over as many areas as possible to reduce the number of writes to the same area, so in the above-described embodiment, a maximum of 255 data storage areas are set.

以上説明した方法によれば、EEPROMを利用した文
字通りの電子オドメータが実現でき、機械的な構成によ
った場合に比較して而づ人件が向上し山形化が可能とな
るとともに、十分に確度が保証された積算走行距離の表
示データが得られる。
According to the method explained above, it is possible to realize a literal electronic odometer using an EEPROM, and compared to a mechanical configuration, it is possible to improve the manpower and make it possible to form a mountain shape, and it also has sufficient accuracy. Guaranteed cumulative mileage display data can be obtained.

なお、EEPROM30は仁のようにRAMと同様に使
用する他に通常のROMと同様に使うことも当然考えら
れる。すなわち、サブルーチンやバリニー/コン定数を
予め収納しておき、プロセッサが随時にこれを読出して
使う方法で、このような使い方をしプこ場合、例えば基
本ルーチン(仕様)は同じで計嘗式や定数を釉々変更し
たバリエーション製品を作るような場合、製造者はソフ
トのみで対処でき、システムの汎用性が飛躍的に拡大す
る。
It is of course conceivable that the EEPROM 30 may be used in the same way as a RAM, or in the same way as a normal ROM. In other words, subroutines and Baliney/con constants are stored in advance and the processor reads and uses them at any time.If this is the case, for example, the basic routine (specification) is the same, but the If a manufacturer wants to create a product with variations in which the constants have been radically changed, the manufacturer can handle this using only software, dramatically expanding the versatility of the system.

上述した実施例ではプログラムエリア31がこの目的に
使用されているが、これに収納しておく固定データとし
ては前述した1人カパルス当りの走行距離値の他にも、
例えばKm/mil@、17gallon。
In the above-described embodiment, the program area 31 is used for this purpose, but the fixed data stored therein include, in addition to the mileage value per person capulus mentioned above,
For example, Km/mil@, 17 gallon.

Kg/pond などの使用単位間の変換定数、表示最
小桁(表示分解能)がIKmであるか100mである1
0mであるか 金で表示最大桁が11001(であるかあるいはIO[
)01Gn、1万脂、10万馳 であるかなどがある。
Conversion constant between used units such as kg/pond, minimum display digit (display resolution) is IKm or 100m1
0m or the maximum digit is 11001 (or IO[
)01Gn, 10,000 fat, 100,000 and so on.

なお、この表示最大桁の指定は、指定桁でオーバーフロ
ーした場合に「0」に戻すために心安である。
Note that this designation of the maximum display digit is safe because in the event of an overflow at the designated digit, it will return to "0".

以上、電子オドメータに適用した例について説明したが
、ストップウォッチ、その他一般のカウンタなど規則的
な計数を行なう場合に広く適用できる。捷だ、加算計数
のみならず減算割数の場合にも基本的には全く同様に適
用できる。
Although an example in which the present invention is applied to an electronic odometer has been described above, it can be widely applied to stopwatches and other general counters that perform regular counting. Well, basically it can be applied in exactly the same way not only to addition counts but also to subtractive divisors.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば、最大割数桁数を
複数区分に分割し、その最下位区分について1計数値ご
とに、尚該最下位区分の最大計数値より少ない計数デー
タ収納エリアを設け、割数値の更新に当っては、上記最
下位区分の割截データ収納エリアの内容のうち自然数列
の乱れる直前のものを収納したエリアの次順位の計数デ
ータ収納エリアに更新値を収納し、更新値か10−1と
なる場合にはさらに別に設けた上位区分の計数データ収
納エリアの内容を更新するようにしたことにより、書込
み時の動作中断にかかわらず常に確実なjp終データが
得られ、かつEEPROMの消去・書込み可能回数の制
限を上回る数の計数が可能となる。
As explained above, according to the present invention, the maximum number of divisible digits is divided into a plurality of divisions, and for each count value of the lowest division, the count data storage area is smaller than the maximum count value of the lowest division. When updating the division value, the updated value is stored in the count data storage area next to the area that stores the contents of the division data storage area of the lowest division mentioned above that are immediately before the natural number sequence is disturbed. However, if the updated value is 10-1, the contents of the count data storage area of the upper division, which is provided separately, are updated, so that reliable JP final data is always available regardless of interruptions in writing operations. In addition, it becomes possible to count a number exceeding the limit on the number of erasable and writable times of EEPROM.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明を電子オドメータに適用した場合の一実
施例を示すシステムのブロック図、第2図はBEPRO
Mの第141戊を示すメモリマツプ、第3図ij: R
AMの’t’ilJ成を示すメモリマツプ、第4図はプ
ロセッサにおける実行プログラムの一例を示すフローチ
ャート、第5図は最下位区分の最終データ検出法を説明
するだめの図、第6図はEEPROMの他の4’f’?
成例を示すメモリマツプである。 10・・・・プロセッサ、20・・・・RAM M2O
・・・・EEPROM S 40・・・・センサ、50
・・・・入力インターフェイス、R1,i・・・・最下
位バイトの11数データ収納エリア、R4−j lR8
、j +R2,j ・・・上位3バイトの割数データ収
納エリア% Nj+N4゛j+Na−j+N2−j ”
 ”−’イン収K13エリア、F・・・・オーバーフロ
ーエリア。 特許出願人 株式会社小糸製作所 代理人 山川数例(I獅寸名) 第1図 第2図 第3図 第5図 第6図
FIG. 1 is a block diagram of a system showing an embodiment of the present invention applied to an electronic odometer, and FIG.
Memory map showing the 141st chapter of M, Figure 3 ij: R
FIG. 4 is a flowchart showing an example of an execution program in the processor; FIG. 5 is a diagram explaining the final data detection method of the lowest division; FIG. 6 is a diagram showing the configuration of the EEPROM. Other 4'f'?
This is a memory map showing an example. 10... Processor, 20... RAM M2O
...EEPROM S 40...Sensor, 50
... Input interface, R1, i ... 11 data storage area of the least significant byte, R4-j lR8
,j +R2,j ...Division data storage area% of upper 3 bytes Nj+N4゛j+Na-j+N2-j ”
"-' In-accommodation K13 area, F... overflow area. Patent applicant: Koito Seisakusho Co., Ltd. Agent: Several Yamakawas (I Shisuna) Figure 1 Figure 2 Figure 3 Figure 5 Figure 6

Claims (2)

【特許請求の範囲】[Claims] (1)最大割数桁数を桁順に複数区分に分割し、上位区
分については各区分ごとに計数データ収納エリアを設け
るとともに、最下位区分については1計数値ごとに最下
位区分の最大計数値より少ない個数の計数データ収納エ
リアを設け、計数値の更新は、最下位区分の割数データ
収納エリアの内容のうち自然数列の乱れる直前のものを
最終データとして検索し、当該計数データ収納エリアの
次順位の計数データ収納エリアに更新値を収納するとと
もに、更新値が[01となる場合にはさらに、上位区分
の計数データ収納エリアの内容を更新することにより行
なうことを特徴とするEEPROMへの計数データ収納
方法。
(1) Divide the maximum divisible number of digits into multiple categories in order of digits, provide a counting data storage area for each category for the upper category, and set the maximum count value for each count for the lowest category. A counting data storage area with a smaller number of items is provided, and to update the counting value, the contents of the division data storage area of the lowest division are searched for the content immediately before the natural number sequence is disturbed as the final data, and then the content of the counting data storage area is updated. The method of storing the updated value in the counting data storage area of the next rank, and further updating the content of the counting data storage area of the higher classification when the updated value becomes [01]. Counting data storage method.
(2)桁−ヒけが正しく行なわれたかを識別するだめの
オーバーフローエリアを設け、最下位区分について検索
された最終データが[01であるときには更新値の収納
に先立って上位区分中の最下位桁をオーバーフローエリ
アの内容と比較して一致しなければ当該上位区分の計数
値を更新し、他方、最下位区分の更新値が「0」となる
場合には上位区分のデータ収納エリアの内容の更新に先
立って上位区分中の最下位桁の更新値をオーバーフロー
エリアに収納しておくことを特徴とする特許請求範囲第
1項記載のEEFROMへの計数データ収納方法。
(2) Digit - An overflow area is provided to identify whether the discrepancy has been performed correctly, and if the final data retrieved for the lowest division is [01, the lowest digit in the upper division is is compared with the contents of the overflow area, and if they do not match, the count value of the upper division is updated. On the other hand, if the updated value of the lowest division is "0", the contents of the data storage area of the upper division are updated. 2. A method for storing count data in an EEFROM according to claim 1, characterized in that the updated value of the least significant digit in the upper division is stored in an overflow area prior to the above.
JP58167554A 1983-09-13 1983-09-13 Count data storing method to eeprom Granted JPS6059454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58167554A JPS6059454A (en) 1983-09-13 1983-09-13 Count data storing method to eeprom

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58167554A JPS6059454A (en) 1983-09-13 1983-09-13 Count data storing method to eeprom

Publications (2)

Publication Number Publication Date
JPS6059454A true JPS6059454A (en) 1985-04-05
JPH0373958B2 JPH0373958B2 (en) 1991-11-25

Family

ID=15851871

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58167554A Granted JPS6059454A (en) 1983-09-13 1983-09-13 Count data storing method to eeprom

Country Status (1)

Country Link
JP (1) JPS6059454A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04248646A (en) * 1990-12-28 1992-09-04 Internatl Business Mach Corp <Ibm> Durable control for solid file
JP2005173699A (en) * 2003-12-08 2005-06-30 Fujitsu Ten Ltd Data storage device
US7492660B2 (en) 1989-04-13 2009-02-17 Sandisk Corporation Flash EEprom system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7492660B2 (en) 1989-04-13 2009-02-17 Sandisk Corporation Flash EEprom system
JPH04248646A (en) * 1990-12-28 1992-09-04 Internatl Business Mach Corp <Ibm> Durable control for solid file
JP2005173699A (en) * 2003-12-08 2005-06-30 Fujitsu Ten Ltd Data storage device
JP4592280B2 (en) * 2003-12-08 2010-12-01 富士通テン株式会社 Data storage

Also Published As

Publication number Publication date
JPH0373958B2 (en) 1991-11-25

Similar Documents

Publication Publication Date Title
US4176394A (en) Apparatus for maintaining a history of the most recently executed instructions in a digital computer
US7117348B2 (en) Method and system for detecting the validity of configuration data
JP2755581B2 (en) Digital data processing system
US4638457A (en) Method and apparatus for the non-volatile storage of the count of an electronic counting circuit
CN115562587A (en) Data storage method, device and equipment applied to storage medium and storage medium
JPS6059454A (en) Count data storing method to eeprom
CN103365792A (en) Information processing apparatus, and method of controlling information processing apparatus
JPH05274499A (en) Portable data carrier
JPH0449142B2 (en)
JPH07507138A (en) Counter with high protection
CN108628699B (en) ECC-based FLASH data exception processing method and device
JPS6060515A (en) Displaying method of run distance
JPH0776895B2 (en) Small portable devices
CN117687704B (en) Display card initialization method, device, equipment and storage medium
CN116821006B (en) Flash memory data loss prevention and erasure balance method, system, device and medium
CN107562655A (en) A kind of date storage method and device
SU1163328A1 (en) Device for checking microcomputer
CN115826868A (en) Method, device and equipment for querying data and storing data in NAND Flash
JPH074503Y2 (en) Vehicle mileage recorder
EP0252042B1 (en) Method and apparatus for determining in a computer which of a number of programmes are allowed to utilise a rapid access memory
JPH0715623B2 (en) Display device
JPS59158450A (en) Program test device
CN114722005A (en) Method and device for searching matching, electronic equipment and readable storage medium
SU1509871A1 (en) Device for sorting information
JPH0863631A (en) Vehicle traveling distance recorder