JPH0311040B2 - - Google Patents
Info
- Publication number
- JPH0311040B2 JPH0311040B2 JP27313584A JP27313584A JPH0311040B2 JP H0311040 B2 JPH0311040 B2 JP H0311040B2 JP 27313584 A JP27313584 A JP 27313584A JP 27313584 A JP27313584 A JP 27313584A JP H0311040 B2 JPH0311040 B2 JP H0311040B2
- Authority
- JP
- Japan
- Prior art keywords
- address
- data
- stored
- end mark
- contents
- 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.)
- Expired - Lifetime
Links
Landscapes
- Read Only Memory (AREA)
- For Increasing The Reliability Of Semiconductor Memories (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、EEPROM(Electrically Erasable
and Programmable Read Only Memory.)等
の、内容更新が可能であり、かつ、電源が切断さ
れても内容を保持すると共に、内容更新の回数が
制限されているメモリに対し、内容の格納を行な
う方法に関するものである。[Detailed Description of the Invention] [Field of Industrial Application] The present invention is directed to EEPROM (Electrically Erasable
A method of storing contents in memory that can be updated, retains the contents even when the power is turned off, and limits the number of times the contents can be updated, such as Programmable Read Only Memory. It is related to.
一般に、制御装置、データ処理装置において
は、半固定的なデータ、または、動作上逐次発生
する可変データ中後に参照するものは、RAM
(Random Access Memory.)へ格納のうえ、電
源の切断によつても内容が消滅しないものとする
目的上、RAMを電池等のバツクアツプ電源によ
り動作状態を維持するものとしているが、電池の
交換またはバツクアツプ電源への切替回路等を要
するため、近来は、EEPROMを用いるものとな
つている。
In general, in control devices and data processing devices, semi-fixed data or variable data that is generated sequentially during operation is referred to later in RAM.
(Random Access Memory.) In order to ensure that the contents do not disappear even if the power is cut off, the RAM is maintained in an operating state by a backup power source such as a battery, but if the battery is replaced or Since it requires a switching circuit to a backup power source, EEPROM has recently been used.
しかし、現在のEEPROMは、内容更新の回数
に制限があり、一般のRAMと同じくランダムに
任意な番地へデータを格納し、かつ、これと同一
番地の内容を更新しながらデータを格納すると、
短期間により内容の更新が不可能となる問題を生
ずる。
However, the current EEPROM has a limit on the number of times its contents can be updated, so if you store data at a random address like general RAM, and update the contents at the same address while storing the data,
A problem arises in that it is impossible to update the content for a short period of time.
前述の問題を解決するため、本発明はつぎの手
段により構成するものとなつている。
In order to solve the above-mentioned problem, the present invention is constructed by the following means.
すなわち、EEPROM等のメモリに対し内容の
格納を行なう方法において、最初のデータ格納に
際し、メモリの格納エリア中特定番地へデータを
格納すると共に次位およびこれにつぐ番地へ各々
エンドマークを格納し、つぎのデータ格納時には
エンドマークの格納された先位側の番地へ内容を
更新のうえデータを格納すると共にエンドマーク
の格納された後位側番地の次位の番地へエンドマ
ークを格納し、以降同様の格納操作を必要に応じ
て反復するものとしている。 That is, in a method of storing contents in a memory such as an EEPROM, when storing data for the first time, the data is stored at a specific address in the storage area of the memory, and an end mark is stored at the next and subsequent addresses, respectively. When storing the next data, the contents are updated and stored at the address on the preceding side where the end mark was stored, and the end mark is stored at the address next to the address on the subsequent side where the end mark was stored. Similar storage operations are repeated as necessary.
したがつて、まず、格納エリアの特定番地へデ
ータが格納され、ついで、エンドマークの格納さ
れた先位側の番地へ内容を更新のうえ、つぎのデ
ータが格納され、以降順次に、必要に応じて以上
の操作が反復されるものとなり、各番地の内容更
新回数がほゞ均等になると共に、格納中に電源が
切断されても内容の有効性決定が支障なく行なえ
るものとなる。
Therefore, data is first stored at a specific address in the storage area, then the content is updated to the address on the preceding side where the end mark is stored, and the next data is stored. The above operations are repeated accordingly, and the number of updates of the contents at each address becomes approximately equal, and even if the power is cut off during storage, the validity of the contents can be determined without any problem.
以下、実施例を示す図によつて本発明の詳細を
説明する。
Hereinafter, details of the present invention will be explained with reference to figures showing examples.
第2図は、EEPROMを用いる装置のブロツク
図であり、マイクロプロセツサ等のプロセツサ
(以下、CPU)1を中心とし、固定メモリ(以
下、ROM)2、可変メモリ(以下、RAM)3、
EEPROM4〜6、および、インターフエイス
(以下、I/F)7,8を周辺に配し、これらを
母線により接続しており、I/F・7を介しては
図上省略した上位の主電算機またはキーボード、
ブラウン管表示装置等からなる端末機器が接続さ
れ、I/F・8を介してはプリンタ(以下、
PRT)9が接続されている。 FIG. 2 is a block diagram of a device using EEPROM, which includes a processor such as a microprocessor (hereinafter referred to as CPU) 1, fixed memory (hereinafter referred to as ROM) 2, variable memory (hereinafter referred to as RAM) 3,
EEPROMs 4 to 6 and interfaces (hereinafter referred to as I/Fs) 7 and 8 are arranged around the periphery, and these are connected by a bus bar. machine or keyboard,
A terminal device such as a cathode ray tube display device is connected, and a printer (hereinafter referred to as
PRT) 9 is connected.
こゝにおいて、CPU1はROM2中の命令を実
行し、I/F・7を介する入力データに応じて制
御動作を行ない、必要とするデータをRAM3に
対してアクセスすると共に、EEPROM4〜6へ
もアクセスし、EEPROM4〜6中へ格納されて
いる文字、記号等のパターンを用いてプリントア
ウトのデータを編集のうえ、I/F・8を介して
PRT9へ送出し、これによつて所定のデータを
印字させるものとなつている。 Here, CPU 1 executes instructions in ROM 2, performs control operations according to input data via I/F 7, accesses necessary data to RAM 3, and also accesses EEPROMs 4 to 6. Then, edit the printout data using the patterns of characters, symbols, etc. stored in EEPROM 4 to 6, and then print it via I/F 8.
The data is sent to the PRT9, thereby causing predetermined data to be printed.
なお、文字、記号等のパターンは、I/F・7
を介して必要とするものが与えられ、これを
EEPROM4〜6へ格納のうえ使用される。 Please note that the patterns of characters, symbols, etc.
You will be given what you need via
It is used after being stored in EEPROM 4 to 6.
第1図は、EEPROM4〜6に対するデータの
格納状況を示す図であり、この例では、これらが
コードエリアCEとデータエリアDEとに分割さ
れ、データエリアDEには文字、記号等のパター
ンを示すデータDT0〜DToが順次に格納され、格
納エリアとして用いるコードエリアCEの先頭番
地#
0乃至最終番地#
n+2にわたつては、デー
タDT0〜DToに対応させたデータコードDC0〜
DCo、および、エンドマークEMが格納されると
共に、コードエリアCEおよびデータエリアDE以
外の番地#
rには、データコードDC0〜DCoが有
効であることを示す有効マークAMが格納される
ものとなつている。 FIG. 1 is a diagram showing the storage status of data in EEPROMs 4 to 6. In this example, these are divided into a code area CE and a data area DE, and the data area DE shows patterns of characters, symbols, etc. Data DT 0 to DT o are sequentially stored, and from the first address #0 to the last address #n+2 of the code area CE used as a storage area, data codes DC 0 to DT o corresponding to the data DT 0 to DT o are stored sequentially.
DC o and end mark EM are stored, and a valid mark AM indicating that data codes DC 0 to DC o are valid is stored at address #r other than code area CE and data area DE. It has become a thing.
すなわち、最初のデータ格納に際しては、(A)の
とおり、特定番地としての先頭番地#
0へデータ
コードDC0を格納すると共に、次位の番地#
1お
よびこれにつぐ番地#
2へ各々エンドマークEM
を格納する一方、データコードDC0と対応するデ
ータDT0をデータエリアDEの先頭番地を基準と
して複数番地にわたり連接して格納する。 That is, when storing the first data, as shown in (A), data code DC 0 is stored in the first address #0 as a specific address, and an end mark is stored in the next address #1 and the address #2 following this. E.M.
On the other hand, the data code DC 0 and the corresponding data DT 0 are stored in a concatenated manner over multiple addresses with the starting address of the data area DE as a reference.
なお、*印が新らたに格納されたことを示して
いる。 Note that the * mark indicates that the data has been newly stored.
ついで、(B)のとおり、つぎのデータを格納する
ときは、コードエリアCEのエンドマークEMが
格納されている先位側の番地#
1へ内容を更新の
うえデータコードDC1を格納すると共に、エンド
マークEMの格納された後位側番地#
2の次位の
番地#
3へエンドマークを格納し、データエリア
DEにはデータDT0につぐ各番地へデータDT1を
格納し、以降、同様の操作を最終番地#
n+2ま
で反復する。 Next, as shown in (B), when storing the next data, update the contents to address #1 on the preceding side where the end mark EM of the code area CE is stored, and store the data code DC 1 . , the end mark is stored in the next address #3 of the next address #2 where the end mark EM is stored, and the end mark is stored in the data area.
Data DT 1 is stored in each address following data DT 0 in DE, and the same operation is repeated until the final address #n+2.
すると最後には、(C)のとおり最終番地#
n+2
およびこれの直前の番地#
n+1へエンドマーク
EMが格納され、エンドマークEMの格納された
先位側番地#
n+1の直前の番地#
nへデータコ
ードDCoが格納されると共に、データエリアDE
では、最終番地側へデータDToが格納される。 Then, finally, as shown in (C), the final address #n+2
and end mark to address #n+1 immediately before this
EM is stored, and the data code DC o is stored in the address #n immediately before the leading address #n+1 where the end mark EM is stored, and the data area DE
Then, data DT o is stored on the final address side.
したがつて、コードエリアCEにおいては、番
地#
0および#
n+2が各1回、番地#
1〜#
n
+1では各2回の格納がなされると共に、データ
エリアDEにおいては各番地に対し各々1回の格
納が行なわれるものとなり、格納回数の平均化が
実現する。 Therefore, in code area CE, addresses #0 and #n+2 are used once each, and addresses #1 to #n
+1, each address is stored twice, and in the data area DE, each address is stored once, so that the number of times of storage can be averaged.
また、内容の読み出しに際しては、まず、番地
#
rの有効マークAMをチエツクし、これが正常
であれば、番地#
0から、エンドマークEMが正
常に連続して格納されている先位側番地の直前の
番地までのデータコードが有効であり、データコ
ードに応じてデータエリアDEのデータを読み出
して用いるものとすればよい。 Also, when reading the contents, first check the valid mark AM at address #r, and if it is normal, read from address #0 to the preceding address where end marks EM are normally stored consecutively. The data code up to the immediately previous address is valid, and the data in the data area DE may be read and used according to the data code.
たゞし、エンドマークEMが連続して格納され
ていなければ、後位側のエンドマークEMを格納
する際に電源断等が生じた場合であり、格納され
ているエンドマークEMの番地から2を差引いた
順位の番地までのデータコードが有効となる。 However, if the end marks EM are not stored consecutively, this is due to a power outage, etc. when storing the subsequent end mark EM, and the end mark EM is not stored consecutively. The data code up to the address after subtracting the number is valid.
以上に対し、内容をクリアして再度格納を行な
う際は、クリアと共に有効コードAMの各ビツト
を反転してとするか、各ビツトのクリアを行
なうことにより、内容がすべてクリアされている
ことを表示できる。 In contrast to the above, when clearing the contents and storing them again, either invert each bit of the valid code AM at the same time as clearing, or clear each bit to make sure that all the contents have been cleared. Can be displayed.
第3図は、CPU1による格納操作のフローチ
ヤートであり、まず、番地“#
rにAMあり?”
101をチエツクし、これがNOであれば“DC0
→#
0”111により番地#
0へデータコード
DC0を格納し、“DT0→DE”112によりデータ
DT0をデータエリアDEへ格納のうえ、“EM→#
1・#
2”113によつてエンドマークEMを番
地#
1,#
2へ格納し、かつ、有効マーク“AM
→#
r”114により番地rへ格納する。 Figure 3 is a flowchart of the storage operation by CPU 1. First, the question "Is there AM at address #r?"
Check 101 and if this is NO then “DC 0
→Data code to address #0 by #0”111
DC 0 is stored and the data is set by “DT 0 →DE”112.
After storing DT 0 in data area DE, “EM→#
1 and #2” 113, store the end mark EM in addresses #1 and #2, and store the valid mark “AM”.
→ Store at address r by #r”114.
また、ステツプ101がYESのときは、“DCi
→EMの格納済先位番地”121によりi番目の
データコードDCiをエンドマークEMの格納され
ている先位側の番地へ格納し、i番目のデータ
DTiを“DTi→DE”122により格納してから、
エンドマーク“EM→EMの格納済後位番地+1”
123により、エンドマークEMの格納されてい
る後位側番地の次位の番地へエンドマークEMを
格納し、主ルーチンを介してステツプ101以降
を必要に応じて反復する。 Also, when step 101 is YES, “DC i
→The i-th data code DC i is stored at the leading address where the end mark EM is stored, and the i-th data
After storing DT i by “DT i →DE”122,
End mark “EM→EM stored rear address +1”
At step 123, the end mark EM is stored at the next address after the address where the end mark EM is stored, and steps 101 and subsequent steps are repeated as necessary via the main routine.
第4図は、同様の読み出し操作を示すフローチ
ヤートであり、番地“#
rにAMあり?”201
がYESであれば、エンドマーク“EM連続?”2
02をチエツクし、これのYESに応じて先頭番
地“#
0から先位EMの直前の番地までの内容有
効”211と決定し、データエリア“DEの対応
するデータ読み出し”212を行なう。 FIG. 4 is a flowchart showing a similar read operation.
If YES, end mark “EM continuous?” 2
02 is checked, and in response to YES, it is determined that the contents from the head address "#0 to the address immediately before the leading EM are valid" 211, and a data area "corresponding data reading of DE" 212 is performed.
また、ステツプ202がNOのときは、先頭番
地“#
0からEMの番地−2までの内容有効”2
21の決定を行ない、ステツプ212へ移行す
る。 In addition, if step 202 is NO, the contents from the first address "#0 to EM address -2 are valid" 2
21 is made, and the process moves to step 212.
これに対し、ステツプ201がNOのときは、
“内容無効”231と決定する。 On the other hand, when step 201 is NO,
“Content invalid” 231 is determined.
第5図は、他の実施例を示す格納状況の図であ
り、第1図と同様であるが、コードエリアCEは
先頭番地#
0〜最終番地#
nにより構成され、デ
ータコードDC1以降、エンドコードEM、および、
スタートマークSMが格納されるものとなつてお
り、番地#
0〜#
nが#
nから#
0へかけても循
環的に使用されるものとなつている。 FIG. 5 is a storage situation diagram showing another embodiment, which is the same as FIG. 1, but the code area CE is composed of the first address #0 to the last address #n, and the data code DC 1 and later, end code EM, and
The start mark SM is stored, and addresses #0 to #n are used cyclically from #n to #0.
なお、データエリアDEも同様に循環的に使用
される。 Note that the data area DE is also used cyclically.
すなわち、最初のデータ格納に際しては、(A)の
とおり、先頭番地#
0および次位の番地#
1へス
タートマークSMを格納すると共に、第3位の番
地#
2へデータコードDC1を格納し、かつ、これ
の次位の番地#
3およびこれにつぐ番地#
4へ
各々エンドマークEMを格納する一方、データコ
ードDC1と対応するデータDT1をデータエリア
DEの先頭番地を基準として複数番地にわたり連
続して格納する。 That is, when storing the first data, as shown in (A), the start mark SM is stored in the first address #0 and the next address #1, and the data code DC 1 is stored in the third address #2. , and store the end mark EM in the next address #3 and the address #4 following this, respectively, and store the data code DC 1 and the corresponding data DT 1 in the data area.
Continuously stores data at multiple addresses based on the first address of DE.
なお、*印が第1図と同じく新らたに格納され
たことを示している。 Note that, as in FIG. 1, the * mark indicates that the data has been newly stored.
ついで(B)のとおり、つぎのデータを格納すると
きは、コードエリアCEのエンドマークEMが格
納されている先位側の番地#
3へ内容を更新のう
えデータコードDC2を格納すると共に、エンドマ
ークEMの格納されている後位側番地の次位の番
地#
5へエンドマークEMを格納し、データエリ
アDEにはデータDT1につぐ各番地へデータDT2
を格納し、以降、同様の格納操作を最終番地#
n
まで反復する。 Next, as shown in (B), when storing the next data, update the contents to address #3 on the preceding side where the end mark EM of the code area CE is stored, and store the data code DC 2 . The end mark EM is stored in the next address #5 after the address where the end mark EM is stored, and the data DT 2 is stored in the data area DE at each address following data DT 1 .
From then on, similar storage operations are performed at the final address #n
Repeat until.
すると、遂には(C)のとおり、最終番地#
nより
二つ前の番地#
n−2へデータコードDCo-3が格
納されると共に、最終番地#
nにはエンドマーク
EMが格納され、データエリアDEにおいてはデ
ータDTo-3が格納される。 Then, as shown in (C), data code DC o-3 is finally stored at address #n-2, which is two addresses before the final address #n, and an end mark is placed at the final address #n.
EM is stored, and data DT o-3 is stored in the data area DE.
また、これにつぐデータの格納時には、最終番
地#
nの直前の番地#
n−1へデータコード
DCo-2を格納すると共に、先頭番地#
0へエンド
マークEMを、スタートマークSMの格納された
後位側番地#
1の次位の番地#
2へスタートマー
クSMを各々内容を更新のうえ格納する一方、デ
ータエリアDEには、データコードDCo-2と対応
するデータDTo-2を格納し、(D)の状態とする。 Also, when storing subsequent data, the data code is sent to the address #n-1 immediately before the final address #n.
At the same time as storing DC o-2 , update the contents of the end mark EM to the first address #0 and the start mark SM to the next address #2 of the next address #1 where the start mark SM is stored. On the other hand, the data code DC o-2 and the corresponding data DT o-2 are stored in the data area DE, resulting in the state of (D).
更に、データを格納する際は、(E)のとおり、エ
ンドマークEMの格納された先位側番地#
nへデ
ータコードDCo-1を格納すると共に、エンドマー
クEMの格納された番地#
0の次位の番地#
1へ
エンドマークEMを格納し、かつ、スタートマー
クSMの格納された後位側番地#
2の次位の番地
#
3へスタートマークSMを格納し、以降、同様
の格納操作を必要に応じて反復すると、(F)の状態
を介して逐次データコードDCo以降およびデータ
DTo以降が順次にかつ循環的に格納され、これに
よつて内容の更新が行なわれる。 Furthermore, when storing data, as shown in (E), data code DC o-1 is stored in the leading address #n where the end mark EM is stored, and data code DC o-1 is stored in the address #0 where the end mark EM is stored. The end mark EM is stored at the next address #1, and the start mark SM is stored at the next address #3 after the address #2 where the start mark SM is stored. Repeating the operation as necessary will sequentially pass the data code DC o through the state of (F) and the data
The data after DT o are stored sequentially and cyclically, and the contents are thereby updated.
なお、データコードDC0〜DCoおよびDC1以降
としては2バイトが用いられ、有効マークAM、
スタートマークSMおよびエンドマークEMとし
ては、データコードDC0〜DCoおよびDC1以降と
は別個のコードを用いるものとなつており、デー
タDT0〜DToおよびDT1以降は各々が72バイトに
より構成されるものとなつているため、これらの
バイト数に応じて各エリアCE,DEおよびスペー
スの番地数および格納容量が定められる。 Note that 2 bytes are used for data codes DC 0 to DC o and DC 1 onwards, and valid marks AM,
As start mark SM and end mark EM, codes are used that are different from data codes DC 0 to DC o and DC 1 onwards, and data DT 0 to DT o and DT 1 onwards are each made up of 72 bytes. Therefore, the number of addresses and storage capacity of each area CE, DE and space are determined according to the number of bytes.
したがつて、第5図の場合、コードエリアCE
においては、(A)〜(F)を1周期とすれば、番地#
0,#
2,#
3が各3回、番地#
1,#
4,#
n
が各2回、その他の各番地が各1回の格納操作を
受けるものとなり、これと同様の周期を必要に応
じて反復すれば、各番地の内容更新回数がほゞ均
等となる。 Therefore, in the case of Figure 5, the code area CE
, if (A) to (F) are one cycle, address #
0, #2, #3 three times each, address #1, #4, #n
is subjected to the storage operation twice, and each of the other addresses is subjected to the storage operation once.If the same cycle is repeated as necessary, the number of times the contents of each address are updated will be approximately equal.
また、内容の読み出しに際しては、各スタート
コードSMをチエツクし、これらが正常であれ
ば、これらにつぐ番地乃至二つのエンドマーク
EMが正常に格納されている番地の直前の番地ま
でのデータコードが有効であり、これを番地#
0
〜#
n、更に#
nから#
0へかけて循環的に確認
し、データコードに応じてデータエリアDEのデ
ータを読み出して用いるものとすればよい。 Also, when reading the contents, check each start code SM, and if these are normal, read the address next to these or two end marks.
The data code up to the address immediately before the address where EM is normally stored is valid, and this is stored as address #0.
~#n, and further from #n to #0, the data in the data area DE may be read out and used according to the data code.
すなわち、スタートマークSMおよびエンドマ
ークEMが正常に格納されていれば、データコー
ドおよびデータも正常であり、電源断等により格
納中に異常を生ずれば、スタートコードSMまた
はエンドマークEMが正常に格納されないものと
なる。 In other words, if the start mark SM and end mark EM are stored normally, the data code and data are also normal. If an abnormality occurs during storage due to a power cut, etc., the start code SM or end mark EM will not be stored normally. It will not be stored.
このため、同様の手順により、電源切断後の再
投入時に内容のチエツクを行ない、内容が有効か
否かを高信頼性により判断することができる。 Therefore, by using the same procedure, the contents can be checked when the power is turned off and turned on again, and it is possible to determine with high reliability whether the contents are valid or not.
第6図は、CPU1による格納操作のフローチ
ヤートであり、“最初のデータ?”301を判断
し、これがYESであれば、“SM→#
0・#
1”
311によりスタートマークSMを番地#
0およ
び#
1へ格納し、“DC1→#
2”312によつて
データコードDC1を番地#
2へ格納のうえ、
“DT1→DE”313によりデータDT1をデータエ
リアDEへ格納してから、“EM→#
3・#
4”3
14によつてエンドマークEMを番地#
3および
#
4へ格納する。 FIG. 6 is a flowchart of the storage operation by the CPU 1. It judges "first data?" 301, and if this is YES, "SM→#0/#1"
The start mark SM is stored in addresses #0 and #1 by 311, and the data code DC 1 is stored in address #2 by "DC 1 → #2" 312.
Data DT 1 is stored in the data area DE by “DT 1 → DE” 313, and then “EM → # 3・# 4” 3
14, the end mark EM is stored at addresses #3 and #4.
ステツプ301がNOであれば、番地“#
nに
EM格納後?”302をチエツクし、これのNO
に応じてi番目のデータコード“DCi→EMの格
納済先位番地”321によりエンドマークEMの
格納されている先位番地へ格納し、これに応ずる
データ“DTi→DE”322によつてデータエリ
アDEへ格納のうえ、“EM→EMの格納済後位番
地+1”323により、循環的な順位を含めてエ
ンドマークEMをこれの格納されている後位番地
の次位の番地へ格納する。 If step 301 is NO, address “#n” is
After storing EM? ”Check 302, NO of this
Accordingly, the i-th data code “DC i → EM stored first address” 321 is used to store the end mark EM at the first address stored, and the corresponding data “DT i →DE” 322 is used to store the end mark EM. and stores it in the data area DE, and then moves the end mark EM to the address next to the last address where it is stored, including the circular order, by "EM→EM stored last address + 1" 323. Store.
また、ステツプ302のYESに応じては、ス
タートマーク“SM→SMの格納済後位番地+1”
331、および、ステツプ321,322と同じ
く“DCi→EMの格納済先位番地332、“DTi→
DE”333を行ない、エンドマーク“EM→SM
の格納済先位番地”334を行なつてから、主ル
ーチンを介しステツプ301以降を反復する。 In addition, in response to YES in step 302, the start mark "SM→Stored rear address of SM+1"
331, and as in steps 321 and 322, "DC i → EM stored leading address 332," DT i →
Perform “DE”333 and end mark “EM→SM”
334, and then repeats steps 301 and subsequent steps through the main routine.
第7図は、同様な読み出し操作を示すフローチ
ヤートであり、まず、コードエリアCEにスター
トマーク“SMあり?”401およびエンドマー
ク“EMあり?”402をチエツクし、いずれも
YESであれば、スタートマーク“SM連続?”4
11およびエンドマーク“EM連続?”412を
確認し、これらのYESに応じて“後位SMのつぎ
の番地から先位EMの直前の番地までの内容有
効”421と決定し、データエリア“DEから対
応するデータ読み出し”422を行なう。 FIG. 7 is a flowchart showing a similar read operation. First, a start mark "SM present?" 401 and an end mark "EM present?" 402 are checked in the code area CE.
If YES, start mark “SM consecutive?” 4
11 and the end mark "EM continuous?" 412, and in response to these YES, it is determined that "contents from the next address of the succeeding SM to the address immediately before the preceding EM are valid" 421, and the data area "DE" is checked. The corresponding data readout ``422'' is performed.
また、ステツプ412がNOのときは、“後位
SMのつぎの番地からEMの番地−2までの内容
有効”431と決定し、ステツプ422へ移行す
る。 In addition, when step 412 is NO, “Successor
It is determined that the contents from the next address of SM to address -2 of EM are valid" 431, and the process moves to step 422.
一方、ステツプ411のNOに応じては、エン
ドマーク“EM連続?”441を確認し、これが
YESであれば、スタートマーク“SMの番地+2
から後位EMの直前の番地までの内容有効”45
1と決定し、ステツプ422へ移行する。 On the other hand, in response to NO in step 411, the end mark "EM continuous?" 441 is checked and this is confirmed.
If YES, start mark “SM address +2
Contents valid from to the address immediately before the succeeding EM” 45
1, and the process moves to step 422.
また、ステツプ441がNOのときは、スター
トマーク“SMの番地+2からEMの番地−2ま
での内容有効”461と決定し、ステツプ422
へ移行する。 If step 441 is NO, the start mark is determined to be "Contents valid from address +2 of SM to address -2 of EM" 461, and step 422 is determined.
Move to.
以上に対し、ステツプ401,402のいずれ
かがNOのときは“内容無効”471と決定し、
直ちに主ルーチンを介してステツプ401以降を
反復する。 Regarding the above, if either step 401 or 402 is NO, it is determined that "content is invalid" 471,
Step 401 and subsequent steps are immediately repeated via the main routine.
たゞし、第1図および第5図においては、デー
タDT0〜DToおよびDT1以降のバイト数が多いた
め、コードエリアCEと別途にデータエリアDEを
設けたが、データDT0〜DToおよびDT1以降のバ
イト数が少なければ、コードエリアCEのみとし、
データコードDC0〜DCoおよびDC1以降としてデ
ータDT0〜DToおよびDT1以降を格納してもよ
く、第1図または第5図の構成とする場合は、デ
ータコードDC0〜DCoおよびDC1以降へデータ
DT0〜DToおよびDT1以降の格納番地コードを付
加し、あるいは、CPU1がデータコードDC0〜
DCoおよびDC1以降に応じてデータDT0〜DToお
よびDT1以降の格納番地を判断し、データエリア
DEにおいて格納番地を順次に定めるものとして
もよく、第2図の構成も条件に応じた選定が任意
である等、種々の変形が自在である。 However, in Figures 1 and 5, since the number of bytes after data DT 0 to DT o and DT 1 is large, a data area DE is provided separately from the code area CE, but data DT 0 to DT If the number of bytes after o and DT 1 is small, use only code area CE,
Data DT 0 - DT o and DT 1 onwards may be stored as data codes DC 0 - DC o and DC 1 onwards, and when the configuration shown in Fig. 1 or 5 is used, data codes DC 0 - DC o and data to DC 1 or later
Add the storage address code from DT 0 to DT o and DT 1 onwards, or CPU1 adds the data code DC 0 to
The storage address of data DT 0 to DT o and DT 1 and later is determined according to DC o and DC 1 and later, and the data area
The storage addresses may be determined sequentially in the DE, and the configuration shown in FIG. 2 can be arbitrarily selected depending on the conditions, and various modifications are possible.
以上の説明により明らかなとおり本発明によれ
ば、EEPROM等の内容更新回数が制限されたメ
モリにおいて、各番地毎にほゞ均等な回数により
内容更新が行なわれ、特定番地へ内容更新の回数
が集中せず、メモリの全般的な寿命が延長される
ものになると共に、EEPROMへデータを格納中
に電源が切断されてもエンドマークEMが消滅せ
ず、有効性の決定が支障なく行なえ、かゝるメモ
リの内容格納方法として顕著な効果が得られる。
As is clear from the above explanation, according to the present invention, in a memory such as an EEPROM where the number of times content can be updated is limited, the content is updated almost equally for each address, and the number of times content is updated to a specific address is increased. In addition, the end mark EM will not disappear even if the power is cut off while data is being stored in the EEPROM, and the validity determination can be made without any problems. A remarkable effect can be obtained as a method of storing contents in memory.
図は本発明の実施例を示し、第1図は
EEPROMに対するデータの格納状況を示す図、
第2図はEEPROMを用いる装置のブロツク図、
第3図はCPUによる格納状況のフローチヤート、
第4図は同様の読み出し状況を示すフローチヤー
ト、第5図は他の実施例を示す第1図と同様な
図、第6図および第7図は第5図と対応する第3
図および第4図と同様な図である。
1……CPU(プロセツサ)、4〜6……
EEPROM(メモリ)、CE……コードエリア(格納
エリア)、DE……データエリア、DC0〜DCo……
データコード、AM……有効マーク、SM……ス
タートマーク、EM……エンドマーク、DT0〜
DTo……データ。
The figures show an embodiment of the invention, FIG.
Diagram showing how data is stored in EEPROM,
Figure 2 is a block diagram of a device using EEPROM.
Figure 3 is a flowchart of the storage status by the CPU.
FIG. 4 is a flowchart showing a similar readout situation, FIG. 5 is a diagram similar to FIG. 1 showing another embodiment, and FIGS. 6 and 7 are flowcharts corresponding to FIG.
FIG. 4 is a diagram similar to FIG. 1...CPU (processor), 4 to 6...
EEPROM (memory), CE...Code area (storage area), DE...Data area, DC 0 to DC o ...
Data code, AM...Valid mark, SM...Start mark, EM...End mark, DT 0 ~
DT o ...Data.
Claims (1)
されても内容を保持すると共に、内容更新の回数
が制限されているメモリに対し、内容の格納を行
なう方法において、 最初のデータ格納に際し、前記メモリの格納エ
リア中特定番地へデータを格納すると共に、次位
の番地およびこれにつぐ番地へ各々エンドマーク
を格納し、 つぎのデータ格納時には、前記エンドマークの
格納された先位側の番地へ内容を更新のうえデー
タを格納すると共に、前記エンドマークの格納さ
れた後位側番地の次位の番地へ前記エンドマーク
を格納し、 以降同様の格納操作を必要に応じて反復するこ
とを特徴としたメモリの内容格納方法。[Scope of Claims] 1. A method for storing contents in a memory whose contents can be updated, retains the contents even when the power is turned off, and whose number of contents can be updated is limited. When storing data for the first time, the data is stored at a specific address in the storage area of the memory, and an end mark is stored at the next address and the address following this, and when the next data is stored, the end mark is stored at the next address. The content is updated and the data is stored at the address on the preceding side where the end mark was stored, and the end mark is stored at the address next to the address on the subsequent side where the end mark was stored. A method for storing contents in memory, which is characterized by repeating according to the timing.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP59273135A JPS61151897A (en) | 1984-12-26 | 1984-12-26 | Storing method for memory contents |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP59273135A JPS61151897A (en) | 1984-12-26 | 1984-12-26 | Storing method for memory contents |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS61151897A JPS61151897A (en) | 1986-07-10 |
| JPH0311040B2 true JPH0311040B2 (en) | 1991-02-15 |
Family
ID=17523606
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP59273135A Granted JPS61151897A (en) | 1984-12-26 | 1984-12-26 | Storing method for memory contents |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS61151897A (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1932784B (en) | 1996-06-28 | 2010-06-09 | 索尼株式会社 | Information processing method and information processing device |
-
1984
- 1984-12-26 JP JP59273135A patent/JPS61151897A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS61151897A (en) | 1986-07-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0089646B1 (en) | Input system using switch matrix | |
| JPH0311040B2 (en) | ||
| US5671238A (en) | Method and circuitry for generating r-bit parallel CRC code for an l-bit data source | |
| JPH0375959B2 (en) | ||
| EP0156162B1 (en) | Programmable controller | |
| JPS6234260A (en) | Non-volatile memory access method | |
| EP0108473B1 (en) | Slew length timer | |
| JP3190861B2 (en) | Pseudo N-key rollover keyboard input device and processing method | |
| US4941109A (en) | Method of effectively performing a feed operation and printing apparatus for realizing the method | |
| JPS61150195A (en) | Memory content storing method | |
| JPH01128147A (en) | Arithmetic unit | |
| JPS58197557A (en) | Message control system | |
| KR830000696B1 (en) | Data processing systems | |
| JP2582444B2 (en) | × 2 ▲ upper n ▼ arithmetic circuit | |
| KR100216045B1 (en) | Bit arithmetic processing method and apparatus of programmable controller | |
| JPS6217847Y2 (en) | ||
| JPS60178570A (en) | Data receiver | |
| KR900002790B1 (en) | Key's place changeable control method for keyboard | |
| JPH0310123B2 (en) | ||
| JP2517665B2 (en) | Method of transmitting signal to operation control device on operation panel | |
| JPS6330678B2 (en) | ||
| JPH052669A (en) | Digital counter memory system | |
| JPH0569231B2 (en) | ||
| JPS5920199B2 (en) | Memory check method | |
| JPS6326889B2 (en) |