JP2544536B2 - Method for determining the presence or absence of data in memory - Google Patents

Method for determining the presence or absence of data in memory

Info

Publication number
JP2544536B2
JP2544536B2 JP3100812A JP10081291A JP2544536B2 JP 2544536 B2 JP2544536 B2 JP 2544536B2 JP 3100812 A JP3100812 A JP 3100812A JP 10081291 A JP10081291 A JP 10081291A JP 2544536 B2 JP2544536 B2 JP 2544536B2
Authority
JP
Japan
Prior art keywords
memory
error
data
read
subroutine
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
Application number
JP3100812A
Other languages
Japanese (ja)
Other versions
JPH04330543A (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.)
Mitsubishi Heavy Industries Ltd
Original Assignee
Mitsubishi Heavy Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Heavy Industries Ltd filed Critical Mitsubishi Heavy Industries Ltd
Priority to JP3100812A priority Critical patent/JP2544536B2/en
Publication of JPH04330543A publication Critical patent/JPH04330543A/en
Application granted granted Critical
Publication of JP2544536B2 publication Critical patent/JP2544536B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime 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 method for judging the presence or absence of data, which is applied to various control devices using a microcomputer.

【0002】[0002]

【従来の技術】マイコンを使った制御装置において、書
換え可能なデータを電源OFFにしても保存したい場合
がある。ディスクがある場合は、ファイルにして保存す
れば良いが、ディスクが無い場合は、バッテリーバック
アップ付RAM・E2 PROM・NV−RAM・コア等
にデータを保存する。この場合、これらのメモリにデー
タが入っているか入っていないか判断するのが難しい。
例えば、データを入れる時に特定のビットパターンをメ
モリに書込み、読出す時に、この特定のビットパターン
になっているかどうかでデータの有無を判断することも
できるが、確実性に欠ける上、もしメモリパリティ等の
メモリチェック機能が有ると、メモリエラーをどう処理
するか難しかった。そのため、ディスクの無いマイコン
制御装置において、書換え可能なデータを電源OFFに
しても保存したい時に、そのデータが有るか無いかは、
人間の判断にまかせたり、データ書込時にスイッチを設
定しておいたり等の面倒な操作が必要であった。
2. Description of the Related Art In a control device using a microcomputer, it is sometimes desired to save rewritable data even when the power is turned off. If you have a disc, you can save it as a file, but if you do not have a disc, RAM / E 2 with battery backup Save data in PROM, NV-RAM, core, etc. In this case, it is difficult to determine whether these memories contain data or not.
For example, when writing data into a memory when writing a specific bit pattern and when reading it, it is possible to judge the presence or absence of data depending on whether or not this specific bit pattern is present. If there is a memory check function such as, it was difficult to handle the memory error. Therefore, if you want to save rewritable data even if the power is turned off in a microcomputer controller without a disk, whether or not there is such data,
Troublesome operations such as leaving it to human judgment and setting switches when writing data were required.

【0003】[0003]

【発明が解決しようとする課題】ディスクの無いマイコ
ンを使った制御装置においては、データをメモリ上に置
くしかない。固定データはROMに入れておけば良い
が、可変データはRAMやE2 ROM等に入れておく。
特に電源をOFFにしても可変データを残して置きたい
場合には、可変データをバッテリーバックアップ付のR
AMやE2 PROM等に入れておき、電源ONの立上げ
時にこの可変データを読みにいけば良い。この時、自己
診断機能が充実していると、メモリパリティチェックや
ECC等のメモリチェック機能が働いて、もし可変デー
タが存在しなかった場合はパリティ等がセットされてい
ないためにメモリエラーとなる。逆にメモリエラーとな
らないように電源ONの立上げ時にパリティ等をセット
しようとしてメモリの書込みを行なうと、もし可変デー
タが存在する場合は可変データが書換えられてしまう。
本発明は、上記のような制御装置において、逆にメモリ
チェック機能を利用して可変データを有効に読出す方法
を提供するものである。
In a control device using a microcomputer without a disk, there is no choice but to put data on a memory. Fixed data can be stored in ROM, but variable data can be stored in RAM or E 2 Put it in ROM etc.
Especially when you want to keep the variable data even if the power is turned off, the variable data can be stored in the R with battery backup.
AM and E 2 It can be stored in a PROM or the like and read this variable data when the power is turned on. At this time, if the self-diagnosis function is enhanced, the memory check function such as the memory parity check and ECC works, and if the variable data does not exist, the parity etc. is not set and a memory error occurs. . On the contrary, if the memory is written in an attempt to set the parity or the like when the power is turned on so as not to cause a memory error, the variable data will be rewritten if the variable data exists.
The present invention, on the contrary, provides a method for effectively reading variable data by utilizing the memory check function in the control device as described above.

【0004】[0004]

【課題を解決するための手段】本発明に係るメモリ内の
データ有無判定方法は、電源OFF時にもデータ保持機
能を備えた書換え可能なメモリ及びこのメモリのエラー
をチェックするメモリチェック手段を有するマイコン使
用の制御装置において、上記メモリの記憶データを読出
しテストサブルーチンにより読出すステップと、このス
テップで読出したデータを上記メモリチェック手段によ
りチェックしてエラーの有無を判定するステップと、こ
のステップによりエラー無しと判定されたときは通常の
制御動作に移行し、エラー有りと判定されたときはエラ
ー割込みを発生するステップと、エラー割込み発生した
際、該エラー割込みが上記読出しテストサブルーチン実
行中に生じたか否かを判定し、読出しテストサブルーチ
ン実行中のエラー割込みであればメモリデータ無しと判
断してメモリエラーを示す信号をリセットした後、上記
読出しテストサブルーチンに戻し、他のエラー割込みで
あれば装置故障と判定するステップとを具備したことを
特徴とする。
In a memory according to the present invention,
The method for determining the presence / absence of data is the data retention
Rewritable memory with function and error of this memory
Using a microcomputer that has a memory check means for checking
The storage data of the memory in the control device for
And the steps to read by the test subroutine and this step.
The data read at the step is read by the memory check means.
Check the status to determine if there is an error.
When it is judged that there is no error in the step of
If it is determined that an error has occurred after shifting to control operation, an error
-A step that generates an interrupt and an error interrupt has occurred
When the error interrupt is
Read test subroutine to determine if it occurred in the row
If there is an error interrupt during execution, it is determined that there is no memory data.
After disconnecting and resetting the signal indicating memory error,
Return to the read test subroutine and use another error interrupt.
If there is a device failure step,
Characterize.

【作用】メモリに可変データが存在しない場合に、これ
を読出すとメモリエラーになる。この場合のメモリエラ
ーとメモリ故障やプログラムの暴走時のメモリエラーと
区別して、可変データの読出しのメモリエラーの場合は
制御装置の故障とせずに復帰させて可変データ受信待
ち、又はROMからのコピー等の処理を行なわなければ
ならない。
[Action] in the memory when the variable data does not exist, becoming an error when you read this. In this case, the memory error is distinguished from the memory error or the memory error at the time of program runaway, and in the case of the memory error of reading the variable data, the controller is restored without the failure and the variable data reception wait or the copy from the ROM. Must be processed.

【0005】そのためには、可変データ読出しテストサ
ブルーチンで試験的に可変データを読出すようにする。
もし可変データが無い場合はメモリエラーとなりメモリ
エラー割り込みを発生させ、その割込処理の中でスタッ
ク上のプログラムカウンタから読出しテストサブルーチ
ン実行中に割込がかかったのかどうかを判断する。読出
しテストサブルーチンから割込がかかった場合は、割込
がかかったことを示すフラグをセットしておきメモリエ
ラーをリセットした後、読出しテストサブルーチンに戻
す。別の箇所から割込がかかった場合は制御装置故障と
すれば良い。
For that purpose, the variable data read test subroutine is used to read the variable data on a trial basis.
If there is no variable data, a memory error occurs and a memory error interrupt is generated, and in the interrupt processing, it is determined whether or not an interrupt has occurred during execution of the read test subroutine from the program counter on the stack. When an interrupt occurs from the read test subroutine, a flag indicating that the interrupt has occurred is set, the memory error is reset, and then the process returns to the read test subroutine. If an interrupt occurs from another location, it may be considered as a control device failure.

【0006】[0006]

【実施例】実施例としてDDC(Direct Digital Contr
ol)装置において、制御ロジックの有無の判断に適用し
た例を図1に示す。制御ロジックは電源OFF時にも消
えないようにバッテリーバックアップ付RAM11に入
れておく。RAM11のパリティチェック回路13はバ
ッテリーバックアップ付RAM11へ書込む時にその回
路13中のパリティRAMへも書込みを行ない(作用
1)、バッテリーバックアップ付RAM11から読出す
時にパリティRAMと比較照合を行なってパリティをチ
ェックする(作用2)。
[Embodiment] As an embodiment, a DDC (Direct Digital Contr
FIG. 1 shows an example applied to the determination of the presence or absence of the control logic in the ol) device. The control logic is stored in the RAM 11 with battery backup so that it will not disappear even when the power is turned off. When writing to the battery backup RAM 11, the parity check circuit 13 of the RAM 11 also writes to the parity RAM in the circuit 13 (action 1). When reading from the battery backup RAM 11, the parity check circuit 13 compares and verifies the parity RAM. Check (action 2).

【0007】一番最初に制御ロジックが存在しない場
合、制御ロジックを読出すとパリティRAMが書込まれ
ていないためパリティのミスマッチが起こりパリティチ
ェック回路がCPUに対して割込をかける(作用3)。
このときメモリの故障やプログラムの暴走によるメモリ
パリティエラーなのか、制御ロジックの読出しによるパ
リティエラーなのかを区別するため、特定のサブルーチ
ンだけで制御ロジックを読出すようにしておく。そうす
ると、割込処理の中でスタック上のプログラムカウンタ
を調べることで、この特定のサブルーチン実行中に割込
がかかったのか否かが判断できる。もし制御ロジック読
出しサブルーチンで割込がかかったのであれば、メモリ
パリティエラーとなったというフラグをセットしてお
き、メモリパリティチェックをリセットし(作用4)、
読出しサブルーチンに戻してやれば良い。この結果制御
ロジックがバッテリーバックアップ付回路上に無いこと
がわかるし、パリティエラーもなくすことができる。逆
に別の箇所のサブルーチンから割込要求がかかった場合
は、メモリの故障等の制御装置の異常と判断することが
できる。
When the control logic does not exist at the very beginning, when the control logic is read, the parity RAM is not written, so that a parity mismatch occurs and the parity check circuit interrupts the CPU (action 3). .
At this time, in order to distinguish between a memory parity error due to a memory failure or a program runaway and a parity error due to a control logic read, the control logic is read only by a specific subroutine. Then, by checking the program counter on the stack during the interrupt processing, it can be determined whether or not an interrupt has occurred during the execution of this particular subroutine. If the control logic read subroutine is interrupted, a flag indicating that a memory parity error has occurred is set, and the memory parity check is reset (action 4).
It is sufficient to return to the reading subroutine. As a result, it can be seen that the control logic is not on the circuit with battery backup, and the parity error can be eliminated. On the other hand, if an interrupt request is issued from a subroutine at another location, it can be determined that the control device is abnormal such as a memory failure.

【0008】制御ロジックがバッテリーバックアップ付
RAMに無い場合は、制御装置は通信経由で制御ロジッ
クが送られて来るのを待てば良い。逆に、有る場合はそ
のまま制御を開始すれば良い。
If the control logic is not in the RAM with battery backup, the control device may wait for the control logic to be sent via communication. On the contrary, if there is, the control may be started as it is.

【0009】[0009]

【発明の効果】従来技術と比べてデータの有無の判断に
メモリチェック機能も利用できるので、判断の信頼性が
向上する。さらに、人間の判断や操作を必要としないの
で、使い易さも向上する。
As compared with the prior art, since the memory check function can be used to judge the presence / absence of data, the reliability of judgment is improved. Furthermore, since human judgment and operation are not required, usability is also improved.

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

【図1】本発明の一実施例の動作説明図。FIG. 1 is an operation explanatory diagram of an embodiment of the present invention.

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

11…RAM、13…パリティチェック回路。 11 ... RAM, 13 ... Parity check circuit.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 電源OFF時にもデータ保持機能を備え
た書換え可能なメモリ及びこのメモリのエラーをチェッ
クするメモリチェック手段を有するマイコン使用の制御
装置において、上記メモリの記憶データを読出しテスト
サブルーチンにより読出すステップと、このステップで
読出したデータを上記メモリチェック手段によりチェッ
クしてエラーの有無を判定するステップと、このステッ
プによりエラー無しと判定されたときは通常の制御動作
に移行し、エラー有りと判定されたときはエラー割込み
を発生するステップと、エラー割込みが上記読出しテス
トサブルーチン実行中に生じたか否かを判定し、読出し
テストサブルーチン実行中のエラー割込みであればメモ
リデータ無しと判断してメモリエラーを示す信号をリセ
ットした後上記読出しテストサブルーチンに戻し、他の
エラー割込みであれば装置故障と判定するステップとを
具備したことを特徴とするメモリ内のデータ有無判定方
1. A data retention function is provided even when the power is turned off.
Rewritable memory and errors in this memory
Control using a microcomputer with memory check means
In the device, read the stored data in the above memory and test
The steps to read by a subroutine and this step
The read data is checked by the memory check means.
To determine if there is an error, and
Normal control operation when it is determined that there is no error by the
When it is determined that there is an error, the error interrupt
And the error interrupt causes the above read test
Read whether or not it occurred during execution of the subroutine
If it is an error interrupt during the execution of the test subroutine, make a memo
It is judged that there is no data, and a signal indicating a memory error is reset.
After returning to the read test subroutine,
If it is an error interrupt
A method for determining the presence / absence of data in a memory characterized by having
Law .
JP3100812A 1991-05-02 1991-05-02 Method for determining the presence or absence of data in memory Expired - Lifetime JP2544536B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3100812A JP2544536B2 (en) 1991-05-02 1991-05-02 Method for determining the presence or absence of data in memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3100812A JP2544536B2 (en) 1991-05-02 1991-05-02 Method for determining the presence or absence of data in memory

Publications (2)

Publication Number Publication Date
JPH04330543A JPH04330543A (en) 1992-11-18
JP2544536B2 true JP2544536B2 (en) 1996-10-16

Family

ID=14283771

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3100812A Expired - Lifetime JP2544536B2 (en) 1991-05-02 1991-05-02 Method for determining the presence or absence of data in memory

Country Status (1)

Country Link
JP (1) JP2544536B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7426505B2 (en) 2001-03-07 2008-09-16 International Business Machines Corporation Method for identifying word patterns in text

Also Published As

Publication number Publication date
JPH04330543A (en) 1992-11-18

Similar Documents

Publication Publication Date Title
JPS6053339B2 (en) Logical unit error recovery method
US20080010567A1 (en) Memory testing
JP2544536B2 (en) Method for determining the presence or absence of data in memory
US5768494A (en) Method of correcting read error in digital data processing system by implementing a predetermind number of data read retrials
JP3115113B2 (en) Data transfer error detector
JPH07182250A (en) Automatic substituting processing system for magnetic disk
US6684344B1 (en) Control unit of external storage, method for substituting defective block, and storage medium wherein control program for substituting defective block has been stored
US6229743B1 (en) Method of a reassign block processing time determination test for storage device
JPS6146864B2 (en)
JPS59148954A (en) Patrolling system of control storage
JP3311776B2 (en) Data transfer check method in disk subsystem
JPH09212429A (en) Monvolatile semiconductor disk drive
JPH0581789A (en) Optical disk device
US7234083B2 (en) System and method for transferring information in a computer system
JP2002073375A (en) Software operation monitoring method in system that contains microcomputer
JPS6343769B2 (en)
JPS6156537B2 (en)
JP3243687B2 (en) Hot swapping system
JPH03191451A (en) Error correction system
JP2735308B2 (en) Disk controller
JPH0644145A (en) Memory error saving system
JPH02245954A (en) Semiconductor storage device
JPH05274223A (en) Cache memory
JPS58223860A (en) Magnetic disk controller
JP2503981B2 (en) Peripheral storage

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19960528