JP3425838B2 - Data save read method - Google Patents

Data save read method

Info

Publication number
JP3425838B2
JP3425838B2 JP10926396A JP10926396A JP3425838B2 JP 3425838 B2 JP3425838 B2 JP 3425838B2 JP 10926396 A JP10926396 A JP 10926396A JP 10926396 A JP10926396 A JP 10926396A JP 3425838 B2 JP3425838 B2 JP 3425838B2
Authority
JP
Japan
Prior art keywords
data
code
read
saved
volatile memory
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 - Fee Related
Application number
JP10926396A
Other languages
Japanese (ja)
Other versions
JPH09297715A (en
Inventor
節生 吉岡
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP10926396A priority Critical patent/JP3425838B2/en
Publication of JPH09297715A publication Critical patent/JPH09297715A/en
Application granted granted Critical
Publication of JP3425838B2 publication Critical patent/JP3425838B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、データ退避読み出
し方法に係り、特に、退避データ量の少ない情報処理機
器に好適なデータ退避読み出し方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data saving / reading method, and more particularly to a data saving / reading method suitable for an information processing device having a small amount of saved data.

【0002】[0002]

【従来の技術】従来、電源遮断時に情報を退避保持する
情報処理装置は、装置の電源が落ちる前にそれを検知
し、保持しておく必要のある情報を不揮発性メモリに書
き込む。そして、装置の電源が投入された時、不揮発性
メモリに記憶させておいた情報を再び読み出して使用す
る。
2. Description of the Related Art Conventionally, an information processing apparatus that saves and holds information when the power is cut off detects the power supply to the apparatus before it is turned off and writes the information that needs to be held in a non-volatile memory. Then, when the power of the device is turned on, the information stored in the non-volatile memory is read again and used.

【0003】データ退避用の不揮発性メモリには、電気
的にデータの書き換えが可能な、EEPROM,Fla
sh Memory,NVRAM等が用いられ、データ
を退避すべき機会が生じる度に不揮発性メモリの内容を
書き換えて情報を退避させていた。一方、情報を保持す
る手段として、バッテリー等の二次電源を用いる方法も
あるが、情報の保持時間の制約から、不揮発性メモリを
採用する方式が主流となっている。
The non-volatile memory for saving data is electrically rewritable EEPROM, FLA.
Sh Memory, NVRAM, etc. are used, and the contents of the non-volatile memory are rewritten and the information is saved whenever the opportunity to save the data occurs. On the other hand, although there is a method of using a secondary power source such as a battery as a means for holding information, a method of adopting a non-volatile memory is predominant due to the restriction of information holding time.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記従
来例にあっては、必要とする情報量に比べはるかに大規
模で高価な不揮発性メモリを採用せねばならない不都合
があった。これは、情報を退避するのに不揮発性メモリ
は必然である一方、一般に入手され使用可能な素子の選
択範囲は限られ、必要とする情報量に比べはるかに大規
模で高価な素子を使用せざるをえないからである。
However, in the above-mentioned conventional example, there is a disadvantage that a large-scale and expensive nonvolatile memory must be adopted as compared with the required amount of information. This means that non-volatile memory is inevitable for saving information, but the selection range of commonly available and usable elements is limited, and a much larger and more expensive element than the required amount of information must be used. Because there is no choice but to avoid it.

【0005】また、退避情報の記録では、記録処理の所
用時間が短いことが強く望まれるが、不揮発性メモリの
書き換え処理には、相応に時間を要するという不都合が
あった。即ち、一般に使用できる書き換え可能な不揮発
性メモリは、書き換え処理、特に前の情報を消去するの
に時間を費やすものであったため、緊急遮断時に備えて
補助電源を強力にするなど、電力確保の策を講じる必要
があった。
Further, in saving the saved information, it is strongly desired that the time required for the recording process is short, but there is a disadvantage that the rewriting process of the nonvolatile memory requires a corresponding time. That is, since a rewritable non-volatile memory that can be generally used takes time for rewriting processing, particularly for erasing the previous information, measures for securing electric power such as strengthening the auxiliary power supply in case of emergency cutoff. Had to take action.

【0006】ここで、書き換え特性が改善された素子も
開発されつつあるが、未だ非常に高価である。
Here, although an element having an improved rewriting characteristic is being developed, it is still very expensive.

【0007】[0007]

【発明の目的】本発明は、かかる従来例の有する不都合
を改善し、特に、不揮発性メモリを比較的安価なもの
(PROM等)へ置き換え、また、退避に要する所要時
間を短縮することにより補助電源の軽減を図ることで、
情報退避手段に係わるコスト低減を実現するデータ退避
読み出し方法を提供することを、その目的とする。
It is an object of the present invention to improve the inconvenience of the conventional example, and in particular, to replace the non-volatile memory with a relatively inexpensive one (such as PROM) and to shorten the time required for saving. By reducing the power supply,
It is an object of the present invention to provide a data saving / reading method that realizes cost reduction related to the information saving means.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するた
め、請求項1記載の発明では、定常動作においてデータ
の退避が必要か否かを判断し、退避が必要なデータを予
め揮発性メモリに保持しておき、装置の電源遮断前に揮
発性メモリ上に存するデータを不揮発性メモリに一時退
避させ、装置の再起動時に不揮発性メモリから前記デー
タを再び読み出して使用するためのデータ退避読み出し
方法であって、データを、不揮発メモリに既に退避され
ているデータの格納領域と重ならない格納領域に退避さ
せるようにデータの退避先アドレスを設定する、という
方法を採っている。本発明では、退避データは、不揮発
性メモリの未書き込みの領域に格納される。
In order to achieve the above-mentioned object, in the invention according to claim 1, in the steady operation, the data is stored.
Data that needs to be saved and
Therefore, to retain the data in the volatile memory, temporarily save the data existing in the volatile memory to the non-volatile memory before shutting down the power of the device, and read the data from the non-volatile memory again when the device is restarted for use. The data saving / reading method is used to set the data save destination address so that the data is saved in a storage area that does not overlap with the data storage area already saved in the non-volatile memory. In the present invention, the saved data is stored in the unwritten area of the non-volatile memory.

【0009】請求項2記載の発明では、退避先アドレス
は、データを不揮発性メモリの先頭アドレスに最も近い
格納領域に退避させるように設定する、という方法を採
っている。本発明では、退避データが、不揮発性メモリ
の先頭アドレスに最も近い未書き込み領域から順々に格
納されてゆく。
According to the second aspect of the invention, the save destination address is set so that the data is saved in the storage area closest to the start address of the nonvolatile memory. According to the present invention, the saved data is stored in order from the unwritten area closest to the head address of the non-volatile memory.

【0010】請求項3記載の発明では、不揮発性メモリ
に退避されたデータを読み出すと共に当該データに無効
を示すコードを付加し、この無効を示すコードが付加さ
れたデータは読み出さない、という方法を採っている。
本発明では、直前に退避させたデータは再起動時に読み
出されるけれども、それ以前に退避されそのまま残留し
ていたデータは読み出されない。
According to the third aspect of the invention, there is provided a method of reading the data saved in the non-volatile memory, adding a code indicating invalidity to the data, and not reading the data to which the code indicating invalidity is added. I am collecting.
In the present invention, the data saved immediately before is read at the time of restart, but the data saved before that and remaining as it is is not read.

【0011】請求項4記載の発明では、データを不揮発
性メモリに退避させた後、当該データを電源切断前に読
み出して該データの正否を確認し、データ誤りがある場
合には揮発性メモリに存するデータを不揮発性メモリに
再退避させる、という方法を採っている。本発明では、
一度退避されたデータが正しく格納されているか否かが
確認され、正しくない場合は、不揮発性メモリのハード
ウェア的不良箇所を避けるために不揮発性メモリの格納
領域を改めて再退避される。
According to the fourth aspect of the invention, after saving the data in the non-volatile memory, the data is read before the power is turned off to check the correctness of the data. If there is a data error, the data is stored in the volatile memory. The method of saving the existing data to the non-volatile memory again is adopted. In the present invention,
It is confirmed whether or not the data once saved is correctly stored, and if it is not correct, the storage area of the non-volatile memory is re-saved again in order to avoid a hardware defective part of the non-volatile memory.

【0012】請求項5記載の発明では、上記データ誤り
のあるデータに無効を示すコードを付加し、この無効を
示すコードが付加されたデータは読み出さない、という
方法を採っている。本発明では、退避時に不揮発性メモ
リに正しく格納されなかったデータは装置の再起動時に
読み出されないけれども、その後に再退避されたデータ
が装置の再起動時に読み出される。
According to a fifth aspect of the present invention, a method is adopted in which a code indicating invalidity is added to the data having the data error and the data to which the code indicating invalidity is added is not read. In the present invention, the data that was not correctly stored in the non-volatile memory at the time of saving is not read when the device is restarted, but the data that is subsequently saved again is read when the device is restarted.

【0013】これらにより、前述した目的を達成しよう
とするものである。
The above aims to achieve the above-mentioned object.

【0014】[0014]

【発明の実施の形態】以下、本発明の一実施形態を図1
乃至図3に基づいて説明する。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of the present invention will be described below with reference to FIG.
It will be described with reference to FIG.

【0015】図1は本実施形態の構成を示すブロック図
である。本実施形態における退避情報記録装置は、不揮
発性メモリ1と、この不揮発性メモリ1にデータを書き
込むデータ書き込み手段2と、不揮発メモリ1からデー
タを読み出すデータ読み出し手段3と、主電源の切断か
ら所定時間に渡り装置要素への電力の供給を保つ補助電
源4と、これら各装置要素の動作タイミングを制御する
制御手段5とを備えている。
FIG. 1 is a block diagram showing the configuration of this embodiment. The save information recording apparatus according to the present embodiment includes a non-volatile memory 1, a data writing unit 2 that writes data to the non-volatile memory 1, a data reading unit 3 that reads data from the non-volatile memory 1, and a predetermined period after the main power is turned off. It is provided with an auxiliary power supply 4 for keeping the power supply to the device elements over time and a control means 5 for controlling the operation timing of each of these device elements.

【0016】以下の説明において、制御手段5により書
き込み手段2をして不揮発性メモリ1に退避されるデー
タを単位データ111という。
In the following description, the data saved in the non-volatile memory 1 by the writing means 2 by the control means 5 is called unit data 111.

【0017】制御手段5では、不揮発性メモリ1に書き
込むべき単位データの形式が予め定義されている。この
単位データ111の構成例を図2に示す。この図2に示
す単位データは、不揮発性メモリ1に退避させるべき本
来の退避情報113(退避データ)と、この退避情報1
13が不揮発性メモリ1に正しく格納されたか否かを判
断するためのチェックコード114と、当該単位データ
の処理状況を示す処理コード112とを備えている。
In the control means 5, the format of the unit data to be written in the non-volatile memory 1 is defined in advance. An example of the structure of this unit data 111 is shown in FIG. The unit data shown in FIG. 2 includes original save information 113 (save data) to be saved in the non-volatile memory 1 and the save information 1
A check code 114 for determining whether 13 is correctly stored in the non-volatile memory 1 and a processing code 112 indicating the processing status of the unit data are provided.

【0018】この単位データ111は、制御手段5によ
り、既に格納されている単位データの格納領域と重なら
ない格納領域に退避されるようになっている。また、単
位データ111は、不揮発性メモリ1の先頭アドレスに
最も近い格納領域に退避されるようになっている。単位
データ111が書き込み手段2により不揮発性メモリ1
に書き込まれた際には、当該書き込み後の単位データが
正しく格納されているか否かがチェックコード114の
参照により確認されるようになっている。
The unit data 111 is saved by the control means 5 in a storage area which does not overlap with the storage area of the already stored unit data. The unit data 111 is saved in the storage area closest to the start address of the nonvolatile memory 1. The unit data 111 is written in the nonvolatile memory 1 by the writing unit 2.
When written in, the check code 114 refers to whether or not the unit data after the writing is correctly stored.

【0019】次に、上記実施形態の全体動作を図3に基
づいて説明する。
Next, the overall operation of the above embodiment will be described with reference to FIG.

【0020】主装置の電源が投入されると、退避情報記
録装置も稼働する(ステップS1)。制御手段5は、電
源投入時に、既に不揮発性メモリ1に記憶されている単
位データのチェックを実行する。このため、まず、読み
出しアドレスを不揮発性メモリ1の先頭アドレスに設定
し(ステップS2)、このアドレスを保存する(ステッ
プS3)。続いて、制御手段5は、設定したアドレスか
ら単位データを読み出し(ステップS4)、上述した単
位データの処理コード112及びチェックコード114
を参照して、当該単位データが有効なデータとして扱う
べきもの(以下、有効データという)か否かを判断する
(ステップS5)。この結果、有効データであれば当該
単位データ中に含まれた退避情報113に基づいて所定
の処理を実行した後(ステップS7)、当該単位データ
は処理済のものであることを明示するために、処理コー
ド112を無効データを示す所定のコードに書き換える
(ステップS8)。
When the main device is powered on, the save information recording device also operates (step S1). The control means 5 checks the unit data already stored in the nonvolatile memory 1 when the power is turned on. Therefore, first, the read address is set to the top address of the nonvolatile memory 1 (step S2), and this address is stored (step S3). Subsequently, the control means 5 reads the unit data from the set address (step S4), and the above-mentioned processing code 112 and check code 114 of the unit data.
It is determined whether or not the unit data is to be treated as valid data (hereinafter referred to as valid data) (step S5). As a result, if the data is valid data, after performing a predetermined process based on the save information 113 included in the unit data (step S7), it is necessary to clearly indicate that the unit data has been processed. The processing code 112 is rewritten to a predetermined code indicating invalid data (step S8).

【0021】そして、不揮発性メモリ1から単位データ
を読み出すべきアドレスを1データ分進めて(ステップ
S9)、ステップS3からの処理を繰り返す。処理を進
めた結果、読み出しアドレスが単位データの未だ書き込
まれていない未書き込み部分に達すると、主装置が行う
本来の動作に処理を渡す(ステップS6,S10)。こ
こで、未書き込み部分の判定は、単位データの読み出し
工程において(ステップS4)、未書き込み領域に対応
した処理コードが取得されることに基づいて行われる
(ステップS6)。
Then, the address for reading the unit data from the non-volatile memory 1 is advanced by one data (step S9), and the processing from step S3 is repeated. As a result of advancing the processing, when the read address reaches the unwritten portion of the unit data which has not been written yet, the processing is passed to the original operation performed by the main device (steps S6 and S10). Here, the determination of the unwritten portion is performed based on the acquisition of the processing code corresponding to the unwritten area in the unit data reading process (step S4) (step S6).

【0022】主装置の処理が開始されると(ステップS
10)、その処理中に情報の退避が必要か否かが逐次判
断され(ステップS12)、必要であれば、当該退避情
報が単位データとしてRAM(図示せず)に一時留保さ
れる(ステップS13)。その後、主装置本来の処理が
実行され(ステップS14)、当該退避情報にまつわる
処理が無事に終了すれば、保持の必要がなくなったRA
M上の単位データを消去し(ステップS16)、ステッ
プS10からの処理が繰り返される。
When the processing of the main device is started (step S
10) It is sequentially determined whether or not it is necessary to save the information during the processing (step S12), and if necessary, the saved information is temporarily retained in the RAM (not shown) as unit data (step S13). ). After that, the original processing of the main device is executed (step S14), and if the processing related to the save information ends without any trouble, it is no longer necessary to hold the RA.
The unit data on M is erased (step S16), and the processing from step S10 is repeated.

【0023】一方、主装置の処理中に当該装置の主電源
が遮断されると(ステップS17)、RAM上に退避情
報が留保されているか否かが確認され(ステップS1
8)、存在する場合は、当該単位データが不揮発性メモ
リ1にコピーされる(ステップS19)。そして、その
後に補助電源4が切断される(ステップS20)。
On the other hand, when the main power supply of the main device is cut off during the processing of the main device (step S17), it is confirmed whether or not the save information is retained in the RAM (step S1).
8) If present, the unit data is copied to the non-volatile memory 1 (step S19). Then, after that, the auxiliary power supply 4 is cut off (step S20).

【0024】従って、電源遮断時には、最小限の情報を
書き込む処理のみを行えば良く、不揮発性メモリ中のデ
ータの消去が必要な従来例に比べ、大幅な退避処理の時
間短縮を実現することができ、また、この間の電力を供
給する補助電源の規模も縮小することができる。更に、
退避情報を検索し単位データの有効性を識別して処理す
るので、以前の情報が残されていても差し支えなく、デ
ータ消去が行えないPROMを不揮発性メモリとして使
用できるようになる。
Therefore, at the time of power-off, only the process of writing a minimum amount of information needs to be performed, and a significant reduction in the save process time can be realized as compared with the conventional example in which the data in the nonvolatile memory needs to be erased. It is also possible to reduce the scale of the auxiliary power supply that supplies power during this time. Furthermore,
Since the saved information is searched and the validity of the unit data is identified and processed, there is no problem even if the previous information remains, and the PROM that cannot erase the data can be used as the nonvolatile memory.

【0025】[0025]

【実施例】【Example】

【0026】以下、上記実施形態に基づく詳細な実施例
を図4乃至図10に基づいて説明する。
Detailed examples of the above embodiment will be described below with reference to FIGS. 4 to 10.

【0027】図4は、本実施例に係るデータ退避読み出
し装置の構成を示すブロック図である。この図4に示す
データ退避読み出し装置は、データ退避用のPROM1
1と、このPROM11に退避させるためのデータを一
時保持するRAM52と、PROM11を書き込みモー
ドと読み出しモードに切り替えるスイッチ22とを備え
ている。また、RAM52又はPROM11にデータ書
き込み用の信号を印加するデコーダ21,31と、これ
ら各装置要素の動作を制御するプロセッサ51とを有し
ている。ここで、符号41は、装置の動作用電源を示
す。
FIG. 4 is a block diagram showing the configuration of the data saving / reading device according to the present embodiment. The data saving / reading device shown in FIG. 4 includes a PROM 1 for saving data.
1, a RAM 52 that temporarily holds data to be saved in the PROM 11, and a switch 22 that switches the PROM 11 between a write mode and a read mode. Further, it has decoders 21 and 31 for applying a signal for writing data to the RAM 52 or PROM 11, and a processor 51 for controlling the operation of these respective device elements. Here, reference numeral 41 indicates a power supply for operating the apparatus.

【0028】これを更に詳述すると、本実施例におい
て、プロセッサ51は、予め準備された制御プログラム
に従い、制御信号線500を制御することにより上述の
各構成要素の動作タイミングを制御する。制御信号線5
00は、アドレスの指定を行うI/Oアドレス信号50
1と、I/Oライトストローブ信号502と、I/Oリ
ードストローブ信号503と、データの指定及び読み出
しを行うI/Oデータ信号504とを選択的に出力可能
となっている。
More specifically, in this embodiment, the processor 51 controls the operation timing of each of the above-mentioned components by controlling the control signal line 500 in accordance with a control program prepared in advance. Control signal line 5
00 is an I / O address signal 50 for designating an address
1, an I / O write strobe signal 502, an I / O read strobe signal 503, and an I / O data signal 504 for designating and reading data can be selectively output.

【0029】また、デコーダ21は、プロセッサ51か
ら出力されたI/Oアドレス信号501,及びI/Oラ
イトストローブ信号502を入力として、RAM52へ
のライトストローブ信号201,PROM11へのライ
ストストローブ信号202,及びスイッチ22を切り替
える制御信号203を出力する。
The decoder 21 receives the I / O address signal 501 and the I / O write strobe signal 502 output from the processor 51 as inputs, and writes the write strobe signal 201 to the RAM 52, the write strobe signal 202 to the PROM 11, and the like. And a control signal 203 for switching the switch 22.

【0030】一方、デコーダ31は、プロセッサ51か
ら出力されたI/Oアドレス信号501,及びI/Oリ
ードストローブ信号503を入力として、RAM52へ
のリードストローブ信号301,PROM11へのリー
ドストローブ信号302を出力する。
On the other hand, the decoder 31 receives the I / O address signal 501 and the I / O read strobe signal 503 output from the processor 51 as inputs, and outputs the read strobe signal 301 to the RAM 52 and the read strobe signal 302 to the PROM 11. Output.

【0031】これらデコーダの出力に応じてデータの書
き込み又は読み出しが行われるPROM11は、一般的
なプログラマブルリードオンリィメモリである。このP
ROM11は、デコーダ21から出力されるライトスト
ローブ信号202,デコーダ31より出力されるリード
ストローブ信号302,及びスイッチ22をして出力さ
れる制御信号204を受けてデータの記録又は記録デー
タの出力を行う。このPROM11は、スイッチ22を
介し電源41から供給される電力404を受けて書き込
み動作を実行するようになっている。本実施例におい
て、PROM11は、未書き込み状態で全てのビットが
1であり、0ビットを書き込んでゆくことによりデータ
の格納を行う形式のものを採用している。
The PROM 11 in which data is written or read according to the output of these decoders is a general programmable read only memory. This P
The ROM 11 receives the write strobe signal 202 output from the decoder 21, the read strobe signal 302 output from the decoder 31, and the control signal 204 output from the switch 22 to record data or output recorded data. . The PROM 11 receives power 404 supplied from the power supply 41 via the switch 22 and executes a write operation. In this embodiment, the PROM 11 adopts a format in which all bits are 1 in the unwritten state and data is stored by writing 0 bits.

【0032】また、PROM11に併設されたRAM5
2は、一般的なランダムアクセスメモリであり、デコー
ダ21から出力されるライストローブ信号201,及び
デコーダ31から出力されるリードスローブ信号301
を受信して動作し、PROM11に退避させるべきデー
タ等を一時保持する。
Also, the RAM 5 provided in the PROM 11
Reference numeral 2 denotes a general random access memory, which has a write strobe signal 201 output from the decoder 21 and a read strobe signal 301 output from the decoder 31.
Is received and operated, and temporarily stores data to be saved in the PROM 11.

【0033】PROM11と電源41の間に設けられた
スイッチ22は、デコーダ21から出力される制御信号
203に応じて制御信号204をPROM11に入力す
る。このPROM11に入力される制御信号204は、
当該PROM11の動作モードを書き込みモード又は読
み出しモードに択一的に設定するものである。また、ス
イッチ22は、PROM11に供給する電力404を、
PROM11の動作モードに応じ、電源41から通常に
供給される電力402又は書き込み用に供給される電力
403に択一的に切り替えるようになっている。
The switch 22 provided between the PROM 11 and the power supply 41 inputs the control signal 204 to the PROM 11 according to the control signal 203 output from the decoder 21. The control signal 204 input to this PROM 11 is
The operation mode of the PROM 11 is selectively set to the write mode or the read mode. Further, the switch 22 supplies the power 404 supplied to the PROM 11,
Depending on the operation mode of the PROM 11, the electric power 402 normally supplied from the power supply 41 or the electric power 403 supplied for writing is selectively switched.

【0034】このスイッチ22をしてPROM11に電
力を供給する電源41は、外部供給される主電源電力4
01を受け、PROM11の他、データ退避装置の各構
成要素に動作用の電力を供給するものである(結線図示
せず)。また、電源41は、主電源電力401の一部を
充電するバッテリBtを内蔵し、主電源電力が遮断され
た場合には、所定時間に渡りバッテリBtからPROM
11の書き込み動作に必要な電力や他の各装置要素の動
作用電力を提供する機能を備えている。
The power supply 41 for supplying power to the PROM 11 by operating the switch 22 is a main power supply 4 supplied externally.
Upon receiving 01, power for operation is supplied to each component of the data saving device in addition to the PROM 11 (wiring not shown). Further, the power supply 41 has a built-in battery Bt for charging a part of the main power supply power 401, and when the main power supply power is cut off, the battery Bt is connected to the PROM for a predetermined time.
11 has a function of supplying power necessary for the write operation of 11 and power for operating other device elements.

【0035】本実施例において、PROM11及びRA
M52におけるデータ書き込み処理及びデータ読み出し
処理は、以下のように実行される。
In this embodiment, the PROM 11 and RA
The data writing process and the data reading process in M52 are executed as follows.

【0036】プロセッサ51において、PROM11へ
のデータの書き込み命令が実行されると、制御信号線5
00を通じデコーダ21にI/Oアドレス信号501と
I/Oライトストローブ信号502が入力される。この
信号を受信したデコーダ21は、スイッチ22に制御信
号203を入力してPROM11の動作モードを書き込
みモードに設定すると共に、当該PROM11にライト
ストローブ信号202を入力する。これにより、書き込
みアドレスと書き込みデータを指定した書き込み命令が
実行される。書き込み命令の終了後は、スイッチ22に
よりPROM11の書き込みモードが解除されるように
なっている。
In the processor 51, when a data write command to the PROM 11 is executed, the control signal line 5
The I / O address signal 501 and the I / O write strobe signal 502 are input to the decoder 21 through 00. Upon receiving this signal, the decoder 21 inputs the control signal 203 to the switch 22 to set the operation mode of the PROM 11 to the write mode, and also inputs the write strobe signal 202 to the PROM 11. As a result, the write command specifying the write address and the write data is executed. After the write command is completed, the write mode of the PROM 11 is released by the switch 22.

【0037】一方、プロセッサ51において、PROM
11からのデータの読み出し命令が実行されると、制御
信号線500を通じデコーダ31にI/Oアドレス信号
501とI/Oリードストローブ信号503が入力され
る。この信号を受信したデコーダ31は、PROM11
にリードストローブ信号302を入力する。これによ
り、読み出しアドレスを指定した読み出し命令が実行さ
れる。
On the other hand, in the processor 51, the PROM
When a data read command from 11 is executed, the I / O address signal 501 and the I / O read strobe signal 503 are input to the decoder 31 through the control signal line 500. The decoder 31 that receives this signal is
The read strobe signal 302 is input to. As a result, the read command specifying the read address is executed.

【0038】また、プロセッサ51において、RAM5
2へのデータの書き込み命令が実行されると、制御信号
線500を通じデコーダ21にI/Oアドレス信号50
1とI/Oライトストローブ信号502が入力される。
この信号を受信したデコーダ21は、RAM52にライ
トストローブ信号201を入力する。これにより、書き
込みアドレスと書き込みデータを指定した書き込み命令
が実行される。
In the processor 51, the RAM 5
2 is executed, the I / O address signal 50 is sent to the decoder 21 through the control signal line 500.
1 and the I / O write strobe signal 502 are input.
The decoder 21 receiving this signal inputs the write strobe signal 201 to the RAM 52. As a result, the write command specifying the write address and the write data is executed.

【0039】一方、プロセッサ51において、RAM5
2からのデータの読み出し命令が実行されると、制御信
号線500を通じデコーダ31にI/Oアドレス信号5
01とI/Oリードストローブ信号503が入力され
る。この信号を受信したデコーダ31は、RAM52に
リードストローブ信号301を入力する。これにより、
読み出しアドレスを指定した読み出し命令が実行され
る。
On the other hand, in the processor 51, the RAM 5
2 is executed, the I / O address signal 5 is sent to the decoder 31 through the control signal line 500.
01 and the I / O read strobe signal 503 are input. The decoder 31 receiving this signal inputs the read strobe signal 301 to the RAM 52. This allows
A read command specifying a read address is executed.

【0040】上記動作によりPROM11には、所定の
退避情報が書き込まれ、また、読み出される。ここで、
退避情報の書き込み及び読み出しは、データ長の固定さ
れた単位データのやり取りにより実行される。この単位
データの形式を図5に示す。
By the above operation, predetermined save information is written in and read from the PROM 11. here,
Writing and reading of the save information is executed by exchanging unit data having a fixed data length. The format of this unit data is shown in FIG.

【0041】単位データ6は、本来の退避情報62と、
この退避情報を所定のアルゴリズムを介して変換したチ
ェックコード63と、単位情報の処理経過を示す処理コ
ード61とを備えている。本実施例において、処理コー
ド61は1バイト,退避情報62はM−2バイト,チェ
ックコード63は1バイトのデータで構成されるように
なっている。
The unit data 6 includes original save information 62 and
A check code 63 obtained by converting the save information through a predetermined algorithm and a processing code 61 indicating the progress of processing the unit information are provided. In this embodiment, the processing code 61 is composed of 1-byte data, the save information 62 is composed of M-2 bytes, and the check code 63 is composed of 1-byte data.

【0042】処理コード61には、初期コード(FF
h),保持コード(EEh),無効コード(AAh),
完結コード(CCh)及びこれら以外の不良コードがあ
る。初期コード(FFh)は、PROM11の未書き込
み領域を検出するためのコードである(本実施例におい
て、PROM11は未書き込み状態で全てのビットが1
であり、1バイトが示すデータは、全てFFhであ
る)。保持コード(EEh)は、書き込み時の全ての単
位データに与えられるコードである。無効コード(AA
h)は、単位データを読み出した際にデータ誤りが検出
されたことを示すコードである。完結コード(CCh)
は、読み出し済の単位データを示すコードである。
The processing code 61 includes an initial code (FF
h), holding code (EEh), invalid code (AAh),
There are a completion code (CCh) and other bad codes. The initial code (FFh) is a code for detecting an unwritten area of the PROM 11 (in this embodiment, the PROM 11 is in an unwritten state and all bits are 1).
And all the data indicated by 1 byte is FFh). The holding code (EEh) is a code given to all unit data at the time of writing. Invalid code (AA
h) is a code indicating that a data error is detected when the unit data is read. Completion code (CCh)
Is a code indicating the read unit data.

【0043】単位データ6は、上述した処理コード61
の種類と、退避情報に基づくチェックコードの正否との
関係により、図5のように6種類の態様で示される。即
ち、処理コード61が初期コード(FFh)の場合(こ
の場合、PROM11の該当格納箇所は未書き込みであ
るからチェックコードも当然に初期コードと同様に全ビ
ットが1である)は、未書き込みデータ601を成す。
処理コードが保持コード(EEh)であってチェックコ
ードが不正コード(退避情報と符合しないコード)の場
合は、不良データ602を成す。処理コードが保持コー
ド(EEh)であってチェックコードが正規コード(退
避情報と符合するコード)の場合は、保持データ603
を成す。処理コードが無効コード(AAh)の場合は、
不良処理データ604を成す。処理コードが完結コード
(CCh)であってチェックコードが正規コードの場合
は、処理済みコード605を成す。そして、処理コード
が上記以外の場合は、不良データ606を成す。
The unit data 6 is the processing code 61 described above.
5 and six types of check codes based on the evacuation information, as shown in FIG. That is, when the processing code 61 is the initial code (FFh) (in this case, since the corresponding storage location of the PROM 11 is unwritten, the check code naturally has all the bits of 1 like the initial code), the unwritten data Make 601.
If the processing code is the retention code (EEh) and the check code is an invalid code (a code that does not match the save information), defective data 602 is formed. If the processing code is a holding code (EEh) and the check code is a regular code (a code that matches the save information), the holding data 603
To make. If the processing code is an invalid code (AAh),
The defect processing data 604 is formed. When the processing code is the completion code (CCh) and the check code is the regular code, the processed code 605 is formed. If the processing code is other than the above, defective data 606 is formed.

【0044】このうち、未書き込みデータ601,不良
データ602,不良処理データ604,処理済みデータ
605,不良データ606は、退避情報の読み出し処理
にあたり、もはやPROMから読み出すことを要しない
無効データとして扱われ、保持データ603のみが有用
な退避情報を含む単位データであるとして読み出しの対
象となる。
Among them, the unwritten data 601, the defective data 602, the defective processed data 604, the processed data 605, and the defective data 606 are treated as invalid data which is no longer required to be read from the PROM in the process of reading the save information. , The held data 603 is the unit to be read because it is the unit data including the useful save information.

【0045】ここで、PROM11は、未書き込みの状
態で全ビットが1であり、0ビットを書き込んでゆく点
は既に言及したが、これがため、FFhが書き込まれて
いる領域(即ち、未書き込み領域)にEEhを上書きす
ることはもちろん、EEhが書き込まれている領域にA
Ah又はCChを上書きすることはビットの関係上可能
である。
Here, in the PROM 11, it has already been mentioned that all bits are 1 in the unwritten state and 0 bits are written, but for this reason, the area in which FFh is written (that is, the unwritten area). ) Is overwritten with EEh, and A is written in the area where EEh is written.
Overwriting Ah or CCh is possible due to the bit relationship.

【0046】次に、PROM11への単位データ6の書
き込み形式を図6に基づいて説明する。PROM11に
は、その先頭アドレスに最も近い未書き込み領域から順
に単位データが格納されるように処理を行う。即ち、処
理コード1バイト,退避情報M−2バイト,チェックコ
ード1バイトの順で先頭アドレスから順に書き加えられ
る。
Next, the format of writing the unit data 6 to the PROM 11 will be described with reference to FIG. The PROM 11 is processed so that the unit data is stored in order from the unwritten area closest to the start address. That is, the processing code 1 byte, the save information M-2 bytes, and the check code 1 byte are added in order from the head address.

【0047】次に、RAM52の主要なデータマップを
図7に示す。所定のアドレスaには次回に単位データ6
を書き込むべきPROM上のアドレスが格納されるよう
になっている。また、アドレスb〜b+M−1までのM
バイトには、PROM11に書き込むべき単位データ6
を生成し一時的に保持するための領域が確保されてい
る。
Next, FIG. 7 shows a main data map of the RAM 52. The unit data 6 will be stored in the predetermined address a next time.
The address on the PROM in which is written is stored. In addition, M from address b to b + M-1
The byte has unit data 6 to be written in the PROM 11.
An area is reserved for generating and temporarily holding.

【0048】次に、上記実施例の全体動作を図8乃至図
10に基づいて説明する。図8乃至図10に示すフロー
チャートは、実施形態の説明として上述した図3のフロ
ーチャートの要部を更に具体的に示すものであるから、
以下の説明においても適宜図3を参照することとする。
Next, the overall operation of the above embodiment will be described with reference to FIGS. Since the flowcharts shown in FIGS. 8 to 10 more specifically show the main part of the flowchart of FIG. 3 described above for explaining the embodiment,
Also in the following description, FIG. 3 will be referred to as appropriate.

【0049】〔主装置を起動した際に実行される処理〕[Processing executed when the main device is activated]

【0050】以下、主として図8に基づいて説明を加え
る。
Hereinafter, description will be added mainly based on FIG.

【0051】主装置が稼働状態に設定されると、本実施
例によるデータ退避読み出し装置も稼働状態に設定され
る。稼働状態に設定されたプロセッサ51は、読み出す
べき単位データの先頭アドレスを格納するレジスタ(ト
ップアドレスレジスタ)と、当該単位データの先頭アド
レスからのバイト数を格納するレジスタ(ポジションレ
ジスタ)と、当該単位データのチェックコードを格納す
るレジスタ(チェックコードレジスタ)とをそれぞれ確
保し、PROM11に格納された単位データの検証及び
読み出しを実行する。
When the main device is set to the operating state, the data saving / reading device according to this embodiment is also set to the operating state. The processor 51, which is set to the operating state, stores the start address of the unit data to be read (top address register), the register (position register) that stores the number of bytes from the start address of the unit data, and the unit concerned. A register (check code register) for storing a check code of data is secured, and verification and reading of the unit data stored in the PROM 11 are executed.

【0052】まず、プロセッサ51は、トップアドレス
レジスタ及びポジションレジスタにそれぞれ0を設定し
(ステップS31)、PROM11の先頭アドレスから
Mバイトに渡り格納されている単位データ6の初めの1
バイト(即ち、処理コード)を指定する(ステップS3
1)。
First, the processor 51 sets 0 in the top address register and the position register respectively (step S31), and the first 1 of the unit data 6 stored for M bytes from the start address of the PROM 11 is started.
The byte (that is, the processing code) is designated (step S3)
1).

【0053】続いて、プロセッサ51は、現に設定され
ているトップアドレスレジスタの値をRAM52のアド
レスaに格納した後(ステップS32)、トップアドレ
スレジスタの値とポジションレジスタの値を加えたアド
レスから1バイトのデータを読み出す(ステップS3
3)。トップアドレス0,ポジション0の場合に読み出
されるデータは、PROM11の先頭アドレスからMバ
イトに渡り記録されている単位データの処理コードであ
る。
Subsequently, the processor 51 stores the currently set value of the top address register in the address a of the RAM 52 (step S32), and then 1 is added from the address obtained by adding the value of the top address register and the value of the position register. Read byte data (step S3)
3). The data read when the top address is 0 and the position is 0 is the processing code of the unit data recorded for M bytes from the start address of the PROM 11.

【0054】処理コードを読み出したプロセッサ51
は、当該処理コードが保持コード(EEh)か否かを判
断し(ステップS34)、保持コード(EEh)でなけ
れば初期コードか否かを判断する(ステップS35)。
この結果、初期コード(FFh)でもない場合は、トッ
プアドレスレジスタの値にMを加え(ステップS4
7)、次の単位データ6の先頭アドレスを設定する(ス
テップS47)。そして、上述したステップS32から
の処理を繰り返す。即ち、無効データに対しては何等処
理を行わずに、次の単位データの処理に移る。
Processor 51 that has read the processing code
Determines whether the processing code is a holding code (EEh) (step S34), and if it is not a holding code (EEh), determines whether it is an initial code (step S35).
As a result, if it is not the initial code (FFh), M is added to the value of the top address register (step S4).
7), set the start address of the next unit data 6 (step S47). Then, the processing from step S32 described above is repeated. That is, no processing is performed on the invalid data, and the processing for the next unit data is started.

【0055】一方、ステップS34の判断において、読
み出した処理コードが保持コード(EEh)であった場
合は、チェックコードレジスタを初期化すると共に(ス
テップS36)、ポジションレジスタの値を1増加させ
(ステップS37)、トップアドレスレジスタの値とポ
ジションレジスタの値とを加えたPROM11のアドレ
スから1バイトのデータを読み出す(ステップS3
8)。
On the other hand, if the read processing code is the holding code (EEh) in the determination of step S34, the check code register is initialized (step S36) and the value of the position register is incremented by 1 (step S36). S37), 1-byte data is read out from the address of the PROM 11 in which the value of the top address register and the value of the position register are added (step S3).
8).

【0056】そして、ポジションレジスタの値がM−1
か否かを判断することにより、今読み出したデータがチ
ェックコードか否かを判断する(ステップS39)。こ
の結果、チェックコード63でなければ、チェックコー
ドレジスタの値と読み出したデータ値とを一定のチェッ
クコード算出アルゴリズムに通し、新規チェックコード
を算出した後、チェックコードレジスタに格納する(ス
テップS40)。以降、ステップS37からの処理を繰
り返す。ここで、PROM11に格納された単位データ
は、その退避時に上述と同一のアルゴリズムに基づいて
生成されたチェックコード63を伴っている。よって、
単位データが正しく格納され、かつ、正しく読み出され
る場合には、ステップS39でチェックコードを読み出
したことを確認した時点で、チェックコードレジスタに
格納されている値と読み出したチェックコードとが一致
するようになっている。
The value of the position register is M-1.
By determining whether or not it is determined whether or not the data just read is a check code (step S39). As a result, if it is not the check code 63, the value of the check code register and the read data value are passed through a certain check code calculation algorithm to calculate a new check code and then stored in the check code register (step S40). After that, the processing from step S37 is repeated. Here, the unit data stored in the PROM 11 is accompanied by the check code 63 generated based on the same algorithm as described above when the unit data is saved. Therefore,
If the unit data is correctly stored and read correctly, the value stored in the check code register and the read check code match at the time of confirming that the check code is read in step S39. It has become.

【0057】ステップS39において、チェックコード
の読み出しが確認されると、プロセッサ51は、スイッ
チ22を通じPROM11を書き込みモードに設定した
後(ステップS41)、読み出したチェックコードがチ
ェックコードレジスタに格納されている値と等しいか否
かを判断する(ステップS42,S43)。比較結果が
一致すれば当該単位データを有効データとして退避情報
62の内容に応じた処理を実行する(ステップS7、図
3のステップS7に対応)。そして、当該単位データの
処理コード(保持コードEEh)が記録されているアド
レスに完結コードCChを上書きする(ステップS4
4)。これにより、当該データは次回の読み出し時から
は無効データとして扱われ、今回のように装置の起動時
に読み出されることがなくなる(ステップS34)。
When the reading of the check code is confirmed in step S39, the processor 51 sets the PROM 11 in the writing mode through the switch 22 (step S41), and then the read check code is stored in the check code register. It is determined whether it is equal to the value (steps S42 and S43). If the comparison results match, the unit data is treated as valid data and processing corresponding to the contents of the save information 62 is executed (step S7, corresponding to step S7 in FIG. 3). Then, the completion code CCh is overwritten on the address where the processing code (holding code EEh) of the unit data is recorded (step S4).
4). As a result, the data is treated as invalid data from the next read, and will not be read when the device is started like this time (step S34).

【0058】一方、ステップS34の判断において、チ
ェックコードが正しくなかった場合は、当該単位データ
の処理コード(保持コードEEh)が記録されているア
ドレスに無効コードAAhが上書きされる(ステップS
45)。これによっても、当該単位データは、次回の読
み出し時から無効データとして扱われ、装置の起動時に
読み出されることがなくなる(ステップS34)。
On the other hand, if the check code is not correct in the determination of step S34, the invalid code AAh is overwritten on the address where the processing code (holding code EEh) of the unit data is recorded (step S).
45). This also causes the unit data to be treated as invalid data from the next read, and will not be read when the device is activated (step S34).

【0059】このように、ステップS44,45の処理
により、次回の電源投入時には、データの内容チェック
処理(ステップS36〜)が省略され、電源投入時の処
理時間の短縮を図っている。
As described above, by the processing of steps S44 and 45, the data content check processing (from step S36) is omitted at the next power-on, and the processing time at power-on is shortened.

【0060】処理コードの書替が完了すると、プロセッ
サ51は、PROM11の書き込みモードを解除する
(ステップS46)。その後、トップアドレスレジスタ
の値にMを加えると共に、ポジションレジスタの値を初
期化して、次の単位データの1バイト目を指定し、上記
ステップS32からの処理を繰り返す。
When the rewriting of the processing code is completed, the processor 51 releases the write mode of the PROM 11 (step S46). After that, M is added to the value of the top address register, the value of the position register is initialized, the first byte of the next unit data is designated, and the processing from step S32 is repeated.

【0061】また、上述したステップS35において、
読みだした処理コードが初期コードであった場合には、
書き込まれていた単位データを一通り検査して読みだし
アドレスが未書き込み領域に達したことになるので、当
該トップアドレスレジスタの値を保持したまま、主装置
により実行される処理に移行する(図3のステップS1
0)。
In step S35 described above,
If the processing code read is the initial code,
The written unit data is inspected once, and the read address has reached the unwritten area. Therefore, the processing is executed by the main unit while holding the value of the top address register (Fig. Step S1 of 3
0).

【0062】〔主装置の処理中における単位データの生
成処理〕
[Unit Data Generation Processing During Processing of Main Device]

【0063】以下、主に図9に基づいて説明を加える。Hereinafter, description will be added mainly based on FIG.

【0064】主装置による所定の処理が開始されると共
に、プロセッサ51は、RAM52上のアドレスb〜b
+M−1に単位データの格納領域を確保する。また、R
AM52上のアドレスを指定するRAMアドレスレジス
タと、上述のチェックコードレジスタを確保する。
A predetermined process by the main unit is started, and at the same time, the processor 51 determines that the addresses b to b on the RAM 52 are to be processed.
A storage area for unit data is secured at + M-1. Also, R
A RAM address register for designating an address on the AM 52 and the above-mentioned check code register are secured.

【0065】主装置の処理により生じた種々のデータ
は、退避の必要なデータか否かが逐次判断され(ステッ
プS12、図3のステップS12に対応)、必要と判断
された場合に、プロセッサ51による以下の処理が実行
される。
Various data generated by the processing of the main unit are sequentially judged whether or not they are data that needs to be saved (step S12, corresponding to step S12 in FIG. 3), and if it is judged to be necessary, the processor 51 The following processing is executed by.

【0066】まず、プロセッサ51は、チェックコード
レジスタを初期化した後(ステップS51)、RAMア
ドレスレジスタをb+1に設定する(ステップS5
2)。これにより、RAM52上の退避情報格納領域
(b+1〜b+M−2)の1バイト目が指定される。
First, the processor 51 initializes the check code register (step S51) and then sets the RAM address register to b + 1 (step S5).
2). As a result, the first byte of the save information storage area (b + 1 to b + M-2) on the RAM 52 is designated.

【0067】そして、プロセッサ51は、1バイト目の
退避情報を生成し(ステップS53)、RAMアドレス
レジスタで指定されているRAM52上のアドレスに書
き込む。このとき、チェックコードレジスタの値と今R
AM52に書き込んだデータの値とを上述したチェック
コード算出用のアルゴリズムに通し、所定のチェックコ
ードを生成する(ステップS55)。生成したチェック
コードは、チェックコードレジスタに逐次更新する。
Then, the processor 51 generates the save information of the first byte (step S53) and writes it in the address on the RAM 52 designated by the RAM address register. At this time, the value of the check code register and now R
A predetermined check code is generated by passing the value of the data written in the AM 52 through the check code calculation algorithm described above (step S55). The generated check code is sequentially updated in the check code register.

【0068】続いて、プロセッサ51は、RAMアドレ
スレジスタの値を+1増加させ(ステップS56)、M
−2バイト分の退避情報がRAM52上に格納されるま
で、ステップS53からの処理を繰り返す(ステップS
57)。
Subsequently, the processor 51 increments the value of the RAM address register by +1 (step S56), and M
-The processing from step S53 is repeated until the save information of 2 bytes is stored in the RAM 52 (step S53).
57).

【0069】所定の退避情報をRAM52上に格納し終
えると、この時点でチェックコードレジスタに格納され
ている値を現に設定されているRAMアドレス、即ち、
b+M−1バイト目に格納し(ステップS58)、ま
た、処理コードとして保持コードEEhをアドレスbに
格納する(ステップS59)。これにより、RAM52
上に単位データが生成される。
When the predetermined save information has been stored in the RAM 52, the value stored in the check code register at this point is the RAM address currently set, that is,
It is stored in the (b + M-1) th byte (step S58), and the holding code EEh is stored in the address b as a processing code (step S59). As a result, the RAM 52
Unit data is generated on the top.

【0070】そして、プロセッサ51は、主装置の処理
が実行され終了されるのを待つ(ステップS14,S1
5,S17、図3に対応)。ステップS15において主
装置の処理が終了した場合は、先ほどRAM52上に生
成した単位データの処理コード部分に完結コードCCh
を更新し(ステップS61,62)、主装置の処理(図
3のステップS10)に応じてステップS12からの処
理を繰り返し実行する。
Then, the processor 51 waits for the processing of the main device to be executed and ended (steps S14, S1).
5, S17, corresponding to FIG. 3). When the processing of the main device is completed in step S15, the completion code CCh is added to the processing code portion of the unit data generated on the RAM 52.
Is updated (steps S61 and 62), and the processes from step S12 are repeatedly executed according to the process of the main device (step S10 of FIG. 3).

【0071】また、上述したステップS12の判断にお
いて、情報の退避が不要と判断された場合は、そのまま
主装置の処理が継続される(図3のステップS10)。
If it is determined in step S12 that the saving of information is unnecessary, the processing of the main device is continued (step S10 of FIG. 3).

【0072】一方、ステップS17において主装置の処
理中に装置の主電源が遮断されると、電源41に主電源
電圧が供給されなくなり、電源41の出力がバッテリB
tによる電力出力に切り替えられ、図10に示す電源遮
断時のデータ退避処理が実行される。
On the other hand, when the main power supply of the device is cut off during the processing of the main device in step S17, the main power supply voltage is not supplied to the power supply 41 and the output of the power supply 41 is the battery B
The power output is switched to the power output according to t, and the data saving process at the time of power shutdown shown in FIG.

【0073】〔電源遮断時のデータ退避処理〕[Data Saving Process at Power-Off]

【0074】以下、主に図10に基づいて説明を加え
る。
Hereinafter, description will be added mainly based on FIG.

【0075】装置の主電源が遮断されると、プロセッサ
51は、単位データを書き込み又は読み出すべきPRO
M11の領域の先頭アドレスを設定するトップアドレス
レジスタと、単位データの先頭からのバイト数を指定す
るポジションレジスタと、当該単位データのチェックコ
ードを格納するチェックコードレジスタと、RAM52
上に生成されている単位データを読み出すべきアドレス
を指定するRAMアドレスレジスタとを確保する。
When the main power supply of the device is cut off, the processor 51 writes PRO to write or read unit data.
A top address register for setting the start address of the area of M11, a position register for specifying the number of bytes from the start of the unit data, a check code register for storing the check code of the unit data, and a RAM 52
A RAM address register for designating an address to read the unit data generated above is secured.

【0076】まず、プロセッサ51は、RAMアドレス
レジスタの値をbに設定し、アドレスbに格納されてい
るデータ、即ち、処理コードを読み出す(ステップS7
1)。そして、読みだした処理コードが保持コード(E
Eh)であるか否かを判断し(ステップS72)、保持
コード(EEh)でない場合は、退避処理を実行せず
に、電源41の電力出力が停止するまでそのまま待機す
る(ステップS20)。
First, the processor 51 sets the value of the RAM address register to b and reads the data stored at the address b, that is, the processing code (step S7).
1). Then, the read processing code is the holding code (E
Eh) is determined (step S72), and if it is not the holding code (EEh), the evacuation process is not executed and the power supply 41 is kept on standby until the power output is stopped (step S20).

【0077】一方、ステップS72において、読みだし
た処理コードが保持データであった場合は、以下のデー
タ退避処理を実行する。
On the other hand, in step S72, if the read process code is the held data, the following data saving process is executed.

【0078】データ退避処理が開始されると、プロセッ
サ51は、RAM52のアドレスaから次に単位データ
を書き込むべきPROM上のアドレスを取得し、その値
をトップアドレスレジスタにセットする。これにより、
単位データを書き込むべきPROM11の先頭アドレス
が設定される(ステップS73)。続いて、プロセッサ
51は、RAMアドレスレジスタにbをセットすると共
に、ポジションレジスタを0にセットし、単位データの
読み出しを始めるRAM52上のアドレスを設定する
(ステップS74)。
When the data saving process is started, the processor 51 acquires the address on the PROM where the unit data is to be written next from the address a of the RAM 52, and sets the value in the top address register. This allows
The head address of the PROM 11 into which the unit data is to be written is set (step S73). Subsequently, the processor 51 sets b in the RAM address register, sets the position register to 0, and sets an address on the RAM 52 to start reading unit data (step S74).

【0079】そして、プロセッサ51は、PROM11
を書き込みモードに切り替え(ステップS75)、RA
Mアドレスレジスタの値とポジションレジスタの値とを
加えたアドレスに格納されているRAM52上のデータ
を読み出し、当該データをトップアドレスレジスタの値
とポジションレジスタの値とを加えたPROM11上の
アドレスに書き込む。これにより、RAM52上の単位
データがPROM11上の未書き込み領域に1バイトコ
ピーされる(ステップS76)。
Then, the processor 51 uses the PROM 11
To write mode (step S75), RA
The data on the RAM 52 stored at the address obtained by adding the value of the M address register and the value of the position register are read, and the data is written to the address on the PROM 11 obtained by adding the value of the top address register and the value of the position register. . As a result, the unit data on the RAM 52 is copied by 1 byte to the unwritten area on the PROM 11 (step S76).

【0080】続いて、プロセッサ51は、ポジションレ
ジスタの値がM−1に達したか否かを判断し、いまだ達
していなければ、ポジションレジスタの値を+1増加さ
せ、ステップS76からの処理を繰り返し実行する。こ
れにより、RAM52上の単位データがPROM11の
未書き込み領域に徐々にコピーされてゆく。
Subsequently, the processor 51 determines whether or not the value of the position register has reached M-1, and if it has not reached M-1, increases the value of the position register by +1 and repeats the processing from step S76. Run. As a result, the unit data on the RAM 52 is gradually copied to the unwritten area of the PROM 11.

【0081】そして、ポジションレジスタがM−1に達
し、Mバイトの単位データを全てコピーし終えると(ス
テップS77)、プロセッサ51は、PROM11の書
き込みモードを解除し、元の動作モードに復帰させる
(ステップS79)。
When the position register reaches M-1 and copying of all the M-byte unit data is completed (step S77), the processor 51 releases the write mode of the PROM 11 and restores the original operation mode ( Step S79).

【0082】続いて、プロセッサ51は、以下の手順
で、今書き込んだ単位データの検証処理を実行する。
Subsequently, the processor 51 executes the verification process of the unit data just written, in the following procedure.

【0083】プロセッサ51は、ポジションレジスタの
値を0に戻した後、トップアドレスレジスタの値を加
え、今PROM11に書き込んだばかりの単位データ6
の先頭アドレスを指定し(ステップS80)、PROM
11からデータを読み出す(ステップS81)。
The processor 51 resets the value of the position register to 0, adds the value of the top address register, and adds the unit data 6 just written in the PROM 11.
The start address of the PROM (step S80)
Data is read from 11 (step S81).

【0084】そして、読み出したデータが保持コード
(EEh)になっているか検証し(ステップS82)、
保持コード(EEh)であれば、続けて格納されている
退避情報の正否を検証する。この退避情報の検証処理
は、上述した図8のステップS36〜S43とほぼ同様
に実行されれば良いが(ステップS83)、ステップS
43の処理は省略するものとする。そして、チェックコ
ードの検証処理で得られたチェックコードの正否を判断
し(ステップS84)、正規コードであれば、PROM
11上に保持データ603が確実に記録されているか
ら、そのまま電源41の電力が停止するまで待機する
(ステップS20)。
Then, it is verified whether the read data is the holding code (EEh) (step S82),
If it is a holding code (EEh), the correctness of the saved information stored subsequently is verified. This save information verification processing may be executed in substantially the same manner as steps S36 to S43 of FIG. 8 described above (step S83), but step S83.
The process of 43 is omitted. Then, the correctness of the check code obtained in the check code verification process is judged (step S84).
Since the held data 603 is surely recorded on the storage device 11, the process waits until the power of the power supply 41 is stopped (step S20).

【0085】一方、ステップS84の判断において退避
情報から導かれたチェックコードが正規コードでない場
合、及び、ステップS82の処理において、読みだした
処理コードが保持コードでなかった場合は、無効なデー
タが検出されたことになるので、PROMのトップアド
レスレジスタの値にMを加え、次の単位データを書き込
むべき未書き込み領域にPROM11の先頭アドレスを
設定する(ステップS85)。そして、RAM52上の
単位データを再度PROM11にコピーするため、上述
したステップS74からの処理を繰り返し実行する。こ
の再コピーの処理は、PROM11のビット不良を回避
する措置であるから、現実には何度も繰り返されること
はない。
On the other hand, if the check code derived from the saved information is not a legitimate code in the determination of step S84, and if the read process code is not the holding code in the process of step S82, invalid data is detected. Since it has been detected, M is added to the value of the top address register of the PROM, and the head address of the PROM 11 is set in the unwritten area where the next unit data is to be written (step S85). Then, in order to copy the unit data on the RAM 52 to the PROM 11 again, the processing from step S74 described above is repeatedly executed. This recopying process is a measure for avoiding a bit defect in the PROM 11, and therefore is not repeated many times in reality.

【0086】このように、本実施形態によれば、単位デ
ータを、PROMに既に退避されている単位データの格
納領域と重ならない格納領域に退避させるように単位デ
ータの退避先アドレスを設定するので、データ退避用の
不揮発性メモリとして安価なPROMを採用することが
でき、装置のコスト低減を図ることができる。また、従
来例のようにデータ退避時に不揮発性メモリの内容を消
去する処理を必要としないので、データ退避処理を速や
かに終了することができ、補助電源の小規模化による更
なるコスト低減を図ることができる。また、PROMに
は退避されたデータの履歴がそのまま残されるので、こ
れらのデータに基づいた装置の異常診断も可能となる。
As described above, according to the present embodiment, the unit data save destination address is set so as to save the unit data in a storage area that does not overlap with the unit data storage area already saved in the PROM. An inexpensive PROM can be adopted as the nonvolatile memory for saving data, and the cost of the device can be reduced. Further, unlike the conventional example, since the process of erasing the contents of the nonvolatile memory at the time of saving data is not required, the data saving process can be completed promptly, and the cost can be further reduced by downsizing the auxiliary power supply. be able to. Further, since the history of the saved data is left as it is in the PROM, it becomes possible to diagnose the abnormality of the device based on these data.

【0087】また、退避先のアドレスは、単位データを
PROMの先頭アドレスに最も近い格納領域に退避させ
るように設定するので、単位データをPROMの先頭ア
ドレスから詰めて格納することで無駄なく活用すること
ができ、PROMの記憶容量を有効に活用することがで
きる。
Since the save destination address is set so that the unit data is saved in the storage area closest to the head address of the PROM, the unit data can be used efficiently by storing the unit data from the head address of the PROM. Therefore, the storage capacity of the PROM can be effectively utilized.

【0088】更に、PROMに退避されたデータを読み
出すと共に当該データに完結コードを付加し、この完結
コードが付加されたデータは読み出さないこととしたの
で、以前に退避されたデータがそのまま残されていて
も、起動時に必要な単位データだけを迅速に読み出すこ
とができ、退避データの読みだし処理にかかる時間が長
時間になることを防止することができる。
Further, since the data saved in the PROM is read and the completion code is added to the data and the data added with the completion code is not read, the data saved previously is left as it is. However, it is possible to quickly read only the unit data required at the time of activation, and it is possible to prevent the time required for the read processing of the saved data from becoming long.

【0089】これに加え、データをPROMに退避させ
た後、当該データを電源遮断前に読み出して該データの
正否を確認し、データ誤りがある場合には格納領域をず
らしてRAMに存するデータをPROMに再退避させる
ようにしたので、信頼性の高いデータ退避処理を実現す
ることができる。
In addition to this, after saving the data in the PROM, the data is read before the power is turned off to check the correctness of the data. If there is a data error, the storage area is shifted and the data existing in the RAM is deleted. Since the data is saved again in the PROM, highly reliable data saving processing can be realized.

【0090】また、データ誤りのあるデータに無効を示
すコードを付加し、この無効を示すコードが付加された
データは読み出さないこととしたので、退避データの読
みだし処理にかかる時間をより短縮することができる。
Further, since the code indicating invalidity is added to the data having the data error and the data to which the code indicating the invalidity is added is not read, the time required for the read processing of the saved data is further shortened. be able to.

【0091】[0091]

【発明の効果】本発明は、以上のように構成され機能す
るので、これによると、定常動作においてデータの退避
が必要か否かを判断し、退避が必要なデータを予め揮発
性メモリに保持しておき、電源遮断時には、揮発性メモ
リのデータを、不揮発性メモリに既に退避されているデ
ータの格納領域と重ならない格納領域に退避させるよう
に単位データの退避先アドレスを設定するので、電源遮
断時には、最小限の情報を書き込む処理のみを行えば良
く、不揮発性メモリ中のデータの消去が必要な従来例に
比べ、大幅な退避処理の時間短縮を実現することがで
き、また、この間の電力を供給する補助電源の規模も縮
小することができる。更に、退避情報を検索し単位デー
タの有効性を識別して処理するので、以前の情報が残さ
れていても差し支えなく、データ消去が行えないPRO
Mを不揮発性メモリとして使用できるようになる。すな
わち、データ退避用の不揮発性メモリとして安価なPR
OMを採用することができ、装置のコスト低減を図るこ
とができる。また、従来例のようにデータ退避時に不揮
発性メモリの内容を消去する処理を必要としないので、
データ退避処理を速やかに終了することができ、補助電
源の小規模化による更なるコスト低減を図ることができ
る。また、不揮発性メモリには退避されたデータの履歴
がそのまま残されるので、これらのデータに基づいた装
置の異常診断も可能となる。
Since the present invention is constructed and functions as described above, according to this , the data is saved in the steady operation.
Data that needs to be saved beforehand.
Volatile memory and keep it in a volatile memory when the power is cut off.
Re of data, so set the save destination address of the unit data so as to retract the storage region which does not overlap with the storage area of the data already saved in the nonvolatile memory, power supply shielding
At the time of disconnection, only the process of writing the minimum amount of information should be performed.
For example, it is necessary to erase the data in the non-volatile memory.
Compared to this, it is possible to realize a significant reduction in the time for evacuation
In addition, the scale of the auxiliary power supply that supplies power during this time is also reduced.
Can be reduced. Furthermore, the evacuation information is searched and the unit data
Data is identified and processed so that previous information is retained.
PRO that can be erased without any problem even if it is
M can be used as a non-volatile memory. sand
That is, it is an inexpensive PR as a non-volatile memory for saving data.
OM can be adopted, and the cost of the device can be reduced. Further, unlike the conventional example, the process of erasing the contents of the nonvolatile memory at the time of saving data is not required,
The data saving process can be ended promptly, and the cost can be further reduced by downsizing the auxiliary power supply. Further, since the history of the saved data is left as it is in the non-volatile memory, it becomes possible to diagnose the abnormality of the device based on these data.

【0092】請求項2記載の発明では、退避先のアドレ
スは、データを不揮発性メモリの先頭アドレスに最も近
い格納領域に退避させるように設定するので、データを
不揮発性メモリの先頭アドレスから詰めて格納すること
で、無駄なく活用することができ、不揮発性メモリの記
憶容量を有効に活用することができる。
According to the second aspect of the present invention, the save destination address is set so that the data is saved in the storage area closest to the start address of the non-volatile memory. Therefore, the data is packed from the start address of the non-volatile memory. By storing it, it can be utilized without waste, and the storage capacity of the non-volatile memory can be effectively utilized.

【0093】請求項3記載の発明では、不揮発性メモリ
に退避されたデータを読み出すと共に当該データに無効
を示すコードを付加し、この無効を示すコードが付加さ
れたデータは読み出さないこととしたので、以前に退避
されたデータがそのまま残されていても、起動時に必要
なデータだけを迅速に読み出すことができ、退避データ
の読みだし処理にかかる時間が長時間になることを防止
することができる。
According to the third aspect of the invention, the data saved in the non-volatile memory is read, a code indicating invalidity is added to the data, and the data to which the code indicating invalidity is added is not read. Even if the previously saved data is left as it is, only the data required at startup can be quickly read out, and it is possible to prevent the time required for the read processing of the saved data from becoming long. .

【0094】請求項4記載の発明では、データを不揮発
性メモリに退避させた後、当該データを電源切断前に読
み出して該データの正否を確認し、データ誤りがある場
合には格納領域をずらして揮発性メモリに存するデータ
を不揮発性メモリに再退避させるようにしたので、信頼
性の高いデータ退避処理を実現することができる。
According to the fourth aspect of the invention, after saving the data in the non-volatile memory, the data is read before the power is turned off to check the correctness of the data. If there is a data error, the storage area is shifted. Since the data existing in the volatile memory is saved again in the non-volatile memory, highly reliable data saving processing can be realized.

【0095】請求項5記載の発明では、データ誤りのあ
るデータに無効を示すコードを付加し、この無効を示す
コードが付加されたデータは読み出さないこととしたの
で、退避データの読みだし処理にかかる時間をより短縮
することができる、という従来にない優れたデータ退避
読み出し方法を提供することができる。
According to the fifth aspect of the present invention, a code indicating invalidity is added to the data having a data error, and the data to which the code indicating the invalidity is added is not read out. It is possible to provide an unprecedented excellent data saving / reading method that can further reduce the time.

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

【図1】本発明の一実施形態を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】単位データの構成を示す構成図である。FIG. 2 is a configuration diagram showing a configuration of unit data.

【図3】図1に示す実施形態の全体動作を説明するフロ
ーチャートである。
FIG. 3 is a flowchart illustrating the overall operation of the embodiment shown in FIG.

【図4】本発明の一実施例を示すブロック図である。FIG. 4 is a block diagram showing an embodiment of the present invention.

【図5】単位データの構成と種類を示す説明図である。FIG. 5 is an explanatory diagram showing the structure and type of unit data.

【図6】PROMへの単位データの格納形式を示す説明
図である。
FIG. 6 is an explanatory diagram showing a storage format of unit data in a PROM.

【図7】RAMへの主要データの格納形式を示す説明図
である。
FIG. 7 is an explanatory diagram showing a storage format of main data in a RAM.

【図8】図4に示す実施例の起動時の処理を示すフロー
チャートである。
FIG. 8 is a flowchart showing a process at the time of startup of the embodiment shown in FIG.

【図9】図4に示す実施例の単位データ生成処理を示す
フローチャートである。
9 is a flowchart showing a unit data generation process of the embodiment shown in FIG.

【図10】図4に示す実施例の単位データ退避処理を示
すフローチャートである。
FIG. 10 is a flowchart showing a unit data saving process of the embodiment shown in FIG.

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

1 不揮発性メモリ 2 書き込み手段 3 読み出し手段 4 補助電源 5 制御手段 6 単位データ 11 PROM 21、31 デコーダ 22 スイッチ 41 電源 51 プロセッサ 52 RAM 61 処理コード 62 退避情報 63 チェックコード 1 Non-volatile memory 2 writing means 3 reading means 4 auxiliary power 5 Control means 6 unit data 11 PROM 21, 31 decoder 22 switch 41 power supply 51 processors 52 RAM 61 Processing code 62 Evacuation information 63 check code

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/16 ─────────────────────────────────────────────────── ─── Continuation of the front page (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 12/16

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 定常動作においてデータの退避が必要か
否かを判断し、退避が必要なデータを予め揮発性メモリ
に保持しておき、装置の電源遮断前に前記揮発性メモリ
上に存するデータを不揮発性メモリに一時退避させ、前
記装置の再起動時に前記不揮発性メモリから前記データ
を再び読み出して使用するためのデータ退避読み出し方
法であって、前記電源遮断前に 前記データを、前記不揮発メモリに既
に退避されているデータの格納領域と重ならない格納領
域に退避させるように前記データの退避先アドレスを設
定し、前記電源遮断前に 前記データを不揮発性メモリに退避さ
せた後、当該データを前記電源遮断前に読み出して該デ
ータの正否を確認し、データ誤りがある場合には前記揮
発性メモリに存するデータを前記不揮発性メモリに再退
避させ、前記再起動時に前記データ誤りのあるデータに無効を示
すコードを付加し前記不揮発性メモリに書込み、この無
効を示すコードが付加され前記不揮発性メモリに書込ま
れたデータは読み出さず、 前記再起動時に前記不揮発性メモリに退避されたデータ
を読み出すと共に当該データに完結を示すコードを付加
し前記不揮発性メモリに書込み、この完結を示すコード
が付加され前記不揮発性メモリに書込まれたデータは読
み出さない ことを特徴としたデータ退避読み出し方法。
1. A method for determining whether or not data needs to be saved in a steady operation, preserving the data that needs to be saved in a volatile memory in advance, and storing the data in the volatile memory before shutting down the power supply of the device. was temporarily saved in the nonvolatile memory, wherein a data saving reading method for use from the nonvolatile memory the data re-read by the at restart of the device, the data before the power shutdown, the non-volatile memory The save destination address of the data is set so that the data is saved in a storage area that does not overlap with the storage area of the data already saved, and the data is saved in the non-volatile memory before the power is cut off. Before the power is cut off, the data is read to check whether the data is correct. By removing, indicates invalid data with the data error at the restart
Add a code to write to the non-volatile memory.
A code indicating the effect is added and written to the nonvolatile memory.
The saved data is not read and the data saved in the non-volatile memory at the time of the restart.
Is read and a code indicating completion is added to the data
Then write to the non-volatile memory and code to indicate this completion
The data written in the nonvolatile memory with the
A data save and read method characterized by not being exposed.
【請求項2】 前記退避先アドレスは、前記データを前
記不揮発性メモリの先頭アドレスに最も近い格納領域に
退避させるように設定することを特徴とした請求項1記
載のデータ退避読み出し方法。
2. The data save / read method according to claim 1, wherein the save destination address is set so that the data is saved in a storage area closest to a start address of the nonvolatile memory.
JP10926396A 1996-04-30 1996-04-30 Data save read method Expired - Fee Related JP3425838B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10926396A JP3425838B2 (en) 1996-04-30 1996-04-30 Data save read method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10926396A JP3425838B2 (en) 1996-04-30 1996-04-30 Data save read method

Publications (2)

Publication Number Publication Date
JPH09297715A JPH09297715A (en) 1997-11-18
JP3425838B2 true JP3425838B2 (en) 2003-07-14

Family

ID=14505746

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10926396A Expired - Fee Related JP3425838B2 (en) 1996-04-30 1996-04-30 Data save read method

Country Status (1)

Country Link
JP (1) JP3425838B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BR112012008687A2 (en) 2009-10-15 2016-04-19 L E Tech Co Ltd microcomputer and method of operating a microcomputer
JP5579257B2 (en) * 2010-03-30 2014-08-27 株式会社エルイーテック Apparatus and method for restoring information in main memory
CN113478494B (en) * 2021-09-07 2021-11-30 成都博恩思医学机器人有限公司 Robot, signal processing method thereof, signal processing system and signal processing device

Also Published As

Publication number Publication date
JPH09297715A (en) 1997-11-18

Similar Documents

Publication Publication Date Title
US7558904B2 (en) Controller, data memory system, data rewriting method, and computer program product
JP4129381B2 (en) Nonvolatile semiconductor memory device
JP2002351685A (en) Data updating method and controller for nonvolatile memory
KR920022093A (en) How to operate a computer system with recoverable basic firmware
JPH06195258A (en) Semiconductor memory
JP4146006B2 (en) Electronic device having flash memory
US6798713B1 (en) Implementing software breakpoints
JP3875139B2 (en) Nonvolatile semiconductor memory device, data write control method thereof, and program
JP4175881B2 (en) Nonvolatile memory storage method and storage device
JP3425838B2 (en) Data save read method
JP2005222202A (en) Data protection method for nonvolatile storage device
JPH07248978A (en) Nonvolatile memory
JP2001117766A (en) Information processor with patch function of mask rom
US20050068842A1 (en) Electronic device, nonvolatile memory and method of overwriting data in nonvolatile memory
JPH11353064A (en) Portable information terminal equipment
JP4031693B2 (en) Nonvolatile memory and data storage device having the same
JP2000010872A (en) Microcomputer with flash memory mixedly mounted, and its debugging method
JP3166659B2 (en) Storage device
JPH07287603A (en) Engine controller
JP3281858B2 (en) Microcomputer evaluation device
JP2003242046A (en) Information processor, and operational method and program for information processor
JPH0820933B2 (en) Data writing method and device
JPH11328039A (en) Device and method for memory control and computer-readable storage medium having stored program
JPH0895869A (en) Memory controller
JP3133710B2 (en) Microcomputer evaluation device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000509

LAPS Cancellation because of no payment of annual fees