JP2641996B2 - Data retention method - Google Patents

Data retention method

Info

Publication number
JP2641996B2
JP2641996B2 JP3057389A JP5738991A JP2641996B2 JP 2641996 B2 JP2641996 B2 JP 2641996B2 JP 3057389 A JP3057389 A JP 3057389A JP 5738991 A JP5738991 A JP 5738991A JP 2641996 B2 JP2641996 B2 JP 2641996B2
Authority
JP
Japan
Prior art keywords
data
recording area
information recording
write
information
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
JP3057389A
Other languages
Japanese (ja)
Other versions
JPH04293139A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP3057389A priority Critical patent/JP2641996B2/en
Publication of JPH04293139A publication Critical patent/JPH04293139A/en
Application granted granted Critical
Publication of JP2641996B2 publication Critical patent/JP2641996B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Hardware Redundancy (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明はデ−タ保持方法に係わ
り、特に電源が切断されてもデ−タをEEPROM又は
バッテリ−バックアップされたRAM等のメモリに保持
しておき、電源投入時に該メモリに保持されているデ−
タを用いて機器を制御するマイクロプロセッサを備えた
装置のデ−タ保持方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data holding method, and more particularly, to holding data in a memory such as an EEPROM or a battery-backed-up RAM even when the power is turned off. Data held in memory
The present invention relates to a data holding method for an apparatus provided with a microprocessor for controlling a device using a data.

【0002】[0002]

【従来の技術】マイクロプロセッサで制御される機器、
特に情報機器においては、制御情報・稼動状況等をEE
PROM又はバッテリ−バックアップされたRAMに書
き込み、保持しておき、その情報を基に機器の制御を行
なうものがある。書き込まれた情報は変化しないものも
あるが、機器の稼動状況により、あるいは操作により随
時変更されるものがある。
2. Description of the Related Art Devices controlled by a microprocessor,
In particular, in the case of information equipment, EE
In some cases, the data is written and stored in a PROM or a RAM backed up by a battery, and the device is controlled based on the information. Some of the written information does not change, but some of the information changes at any time depending on the operation status of the device or by operation.

【0003】EEPROM又はバッテリ−バックアップ
されたRAMに書き込まれる情報は機器制御の上で重要
な要素となり、このため、一部の装置では、単に情報を
書き込み、保持するだけでなく、(1) 同じ情報を複数の
箇所に書き込み、(2) 例えば装置電源投入時に複数の箇
所に保持されている情報を読出し、比較して保持情報の
誤りを検出するようになっている。又、検出のみでな
く、多数決等の方法により保持情報の誤りを訂正するも
のもある。
[0003] Information written to an EEPROM or a battery-backed RAM is an important factor in controlling equipment, and therefore, in some devices, not only writing and holding information but also (1) Information is written in a plurality of locations, and (2) information held in the plurality of locations is read out, for example, when the apparatus is powered on, and an error in the held information is detected by comparison. There is also a method of correcting an error in held information by a method such as a majority decision in addition to detection.

【0004】[0004]

【発明が解決しようとする課題】一般に、マイクロプロ
セッサによるメモリアクセスはシ−ケンシャルにより行
なわれる。しかし、一部の電源制御機能又はリセット制
御機能を備えた装置を除いては、マイクロプロセッサの
動作に関係なく、電源切断、リセットが行われてしま
う。このため、プロセッサがEEPROM又はバッテリ
−バックアップされたRAMに情報書き込みを行なって
いる途中で電源切断又はリセットが行われてしまうこと
がある。このとき、以下のような問題が生じる。すなわ
ち、(1) 機器の稼動状況を記録する複数桁のカウンタが
あった場合全桁分の書き込みが完了せず、カウンタ値の
誤差となる。例えば、図9(a)に示すように、カウン
タ値を199から200に変更する時、上位桁から順に
書き込むものとすると、最上位桁に「2」の書き込みが
完了した時点で電源が切断されてしまうと、カウンタ値
は299となってしまう。又、下位桁から順に書き込む
とすると、下2桁「00」の書き込みが完了した時点で
電源が切断されてしまうと、カウンタ値は「100」に
戻ってしまう。
Generally, memory access by a microprocessor is performed sequentially. However, except for a device having a power control function or a reset control function, the power is turned off and reset regardless of the operation of the microprocessor. For this reason, the power may be turned off or reset while the processor is writing information to the EEPROM or the battery-backed RAM. At this time, the following problem occurs. That is, (1) when there is a multi-digit counter for recording the operation status of the device, writing of all digits is not completed, resulting in an error in the counter value. For example, as shown in FIG. 9A, when the counter value is changed from 199 to 200, if the writing is performed in order from the upper digit, the power is turned off when the writing of “2” to the uppermost digit is completed. In this case, the counter value becomes 299. Also, if writing is performed in order from the lower digit, if the power is turned off when the writing of the lower two digits “00” is completed, the counter value returns to “100”.

【0005】(2) 複数箇所に同じ情報を書き込む時、全
ての書き込み箇所への書き込みが完了せず、電源投入時
の保持情報の読出しチェックの時に、デ−タの誤りとな
ってしまう。例えば、図9(b)に示すように、制御情報
値「9」を「0」に変更する場合、3つの書き込み箇所
(第1〜第3格納場所M1〜M3)があるとき、第1の
書き込み箇所M1に「1」を書き込んだ直後に電源が切
断されてしまうと、次の電源投入時の情報チェックで第
1の書き込み箇所M1の値が「0」、第2、第3の書き
込み箇所M2,M3の値が「9」で一致しないため、デ
−タのエラ−となってしまう。
(2) When the same information is written in a plurality of locations, writing to all the written locations is not completed, resulting in data errors at the time of checking the reading of the held information at power-on. For example, as shown in FIG. 9B, when the control information value “9” is changed to “0”, when there are three write locations (first to third storage locations M1 to M3), the first If the power is turned off immediately after writing “1” to the write location M1, the value of the first write location M1 is “0” and the second and third write locations are checked at the next power-on information check. Since the values of M2 and M3 do not match at "9", data errors occur.

【0006】更に、多数決でデ−タの修復を実施する
と、変更前の値「9」に修復されてしまう。又、前記
(1)のような多数桁カウンタの場合には、やはりカウン
タ値の誤差となってしまう。
Further, when data is restored by majority decision, the data is restored to the value "9" before the change. Also,
In the case of a multi-digit counter as in (1), an error also occurs in the counter value.

【0007】以上から本発明の目的は、機器制御用のマ
イクロプロセッサがEEPROM又はバッテリ−バック
アップされたRAMへの情報書き込みシ−ケンスを行な
っている最中に、装置がリセットされ又は電源が切断さ
れても、EEPROM又はバッテリ−バックアップされ
たRAMに書き込まれるデ−タに誤りが生じないように
できるデ−タ保持方法を提供することである。
Accordingly, it is an object of the present invention to provide a device which is reset or turned off while a microprocessor for controlling a device is performing a sequence of writing information to an EEPROM or a battery-backed RAM. It is still another object of the present invention to provide a data holding method capable of preventing an error from occurring in data written in an EEPROM or a battery-backed RAM.

【0008】本発明の別の目的は、装置がリセットされ
又は電源が切断されても、EEPROM又はバッテリ−
バックアップされたRAMに書き込まれるデ−タに誤り
が生じないように、ハ−ドウェアの追加を必要とせず、
ソフトウェアのみで対応できるデ−タ保持方法を提供す
る。
Another object of the present invention is to provide an EEPROM or battery that is capable of resetting or powering down the device.
No additional hardware is required to prevent errors in the data written to the backed-up RAM,
A data holding method that can be handled only by software is provided.

【0009】[0009]

【課題を解決するための手段】図1は本発明の原理説明
図である。11はEEPROM又はバッテリ−バックア
ップされたRAM等の保持デ−タ格納用のメモリ、12
はマイクロプロセッサ(MPU)である。
FIG. 1 is a diagram illustrating the principle of the present invention. Reference numeral 11 denotes a memory for storing retained data such as an EEPROM or a battery-backed RAM;
Is a microprocessor (MPU).

【0010】メモリ11において、11aは保持デ−タ
を格納するための保持デ−タ格納領域、11bは格納領
域へのデ−タ書き込み・修復を行なうための情報記録領
域である。マイクロプロセッサ12において、12aは
電源投入時又はリセット解除時に情報記録領域11bの
内容がクリアされているか判断すると共に、クリアされ
ていない場合、チェックデ−タを用いて情報記録領域に
おけるデ−タの正当性をチェックする情報記録領域内容
判別部、12bは情報記録領域のデ−タがクリアされて
おらず、しかも、データが正当の場合、情報記録領域の
保持デ−タを格納領域11aへ書き込んで修復を行なう
保持デ−タ修復部である。
In the memory 11, reference numeral 11a denotes a holding data storage area for storing holding data, and 11b denotes an information recording area for writing and restoring data in the storage area. In the microprocessor 12, when power is turned on or reset is released, the microprocessor 12 determines whether or not the contents of the information recording area 11b have been cleared, and clears the information.
If not, use the check data to store
Information recording area contents for checking validity of data in
The discriminating unit 12b determines that the data in the information recording area has been cleared.
If the data is valid and the data is valid, it is a holding data restoring unit that writes the holding data in the information recording area to the storage area 11a and restores it.

【0011】[0011]

【作用】電源が切断されてもデ−タを保持するメモリ内
に、保持デ−タ格納領域11aとは別に、該格納領域へ
のデ−タの書き込み・修復を行なうための情報記録領域
11bを設け、(1)情報記録領域11bへ格納領域の保
持デ−タ書き込みアドレスと保持デ−タを書き込んだ
後、デ−タの正当性をチェックするためのチェックデ−
タを書き込み、(2)しかる後、格納領域11aへ保持デ
−タの書き込みを行ない、(3)格納領域11aへ保持デ
−タを書き込んだ後、(4)情報記録領域11bのチェッ
クデ−タをクリアし、(5)ついで、チェックデ−タ以外
のデ−タをクリアする。そして、電源投入時又はリセッ
ト解除時に、マイクロプロセッサ12の情報記録領域内
容判別部12aは情報記録領域11bを参照し、情報記
録領域のデ−タがクリアされていない場合には、チェッ
クデ−タを用いて情報記録領域におけるデ−タの正当性
をチェックし、正当ならば、保持デ−タ修復部12bは
情報記録領域に記憶されている保持デ−タを格納領域1
1aへ書き込み、保持デ−タの書き込み処理終了後に情
報記録領域11bのデ−タをクリアする。
In the memory for holding data even when the power is turned off, an information recording area 11b for writing and restoring data in the storage area separately from the held data storage area 11a. (1) The storage area is stored in the information recording area 11b.
The data holding address and the holding data are written.
Then, check data for checking the validity of the data
(2) After a while, the stored data is stored in the storage area 11a.
And (3) storing the data in the storage area 11a.
(4) Check the information recording area 11b.
Clear the data (5) Then, except for the check data
Clear the data of Then, when turning on the power or resetting
At the time of reset, the information recording area of the microprocessor 12
The content determination unit 12a refers to the information recording area 11b and
If the data in the recording area has not been cleared,
Validity of data in information recording area using data
Is checked, and if valid, the held data restoring unit 12b
The stored data stored in the information recording area is stored in the storage area 1
1a, the information is written after the write processing of the held data is completed.
The data in the information recording area 11b is cleared.

【0012】[0012]

【実施例】全体の構成 図2は本発明に係わる実施例構成図であり、カット紙レ
−ザプリンタ機構部を制御するプリンタ制御装置に適用
した場合である。尚、プリンタの制御自体は本発明とは
関係しないので、その制御方法及び制御情報の詳細は省
略する。
EXAMPLES overall configuration diagram 2 shows an embodiment diagram according to the present invention, cut Kamire - it is applied to a printer control unit for controlling The printer mechanism unit. Since the control of the printer itself is not related to the present invention, the details of the control method and control information are omitted.

【0013】11はバッテリ−バックアップされた8ビ
ットCMOSスタティック構成のRAMであり、後述す
るように機器の制御情報や稼動状況等(以下「制御情
報」という)を格納するための保持デ−タ格納領域と該
格納領域へのデ−タ書き込み・修復を行なうための情報
記録領域を有している。12はプリンタ制御を実行する
と共に、本発明に係わる後述する制御情報(保持デー
タ)の格納処理及び修復処理を行なう8ビットマイクロ
プロセッサである。13は制御プログラムを記憶する8
ビット構成のEPROM、14は機構部制御要素/外部
インタフェ−スとの間の入出力ポ−トとタイマ−を含む
I/O−LSIである。
Reference numeral 11 denotes a battery-backed RAM of an 8-bit CMOS static configuration, which stores stored data for storing device control information and operation status (hereinafter referred to as "control information") as described later. It has an area and an information recording area for writing and restoring data in the storage area. Reference numeral 12 denotes an 8-bit microprocessor that executes printer control and performs a storage process and a restoration process of control information (holding data) described later according to the present invention. 13 stores a control program 8
The bit-structured EPROM 14 is an I / O-LSI including an input / output port between the mechanism control element / external interface and a timer.

【0014】15、16はそれぞれRAM11及びRO
M13、I/O−LSI14のチップセレクト信号*C
Sを制御するRAM−CS制御回路、CS制御回路であ
る。17は+3.0Vのリチウム電池、18は電源Vcc
の電圧を監視する電源制御回路であり、通常Vccは+5
Vであるが2.5V以下になるとマイクロプロセッサ
(MPU)12とRAM−CS制御回路15に*RES
ET信号を発行し、RAM−CS制御回路15とRAM
11に供給する電源VccRAMをVccから電池17に切
り換える。
Reference numerals 15 and 16 denote RAM 11 and RO, respectively.
M13, I / O-LSI14 chip select signal * C
A RAM-CS control circuit and a CS control circuit for controlling S. 17 is a + 3.0V lithium battery, 18 is a power supply Vcc
Is a power supply control circuit that monitors the voltage of Vcc.
V, but when the voltage falls below 2.5 V, the microprocessor (MPU) 12 and the RAM-CS control circuit 15 send * RES
ET signal is issued, and the RAM-CS control circuit 15 and the RAM
The power supply VccRAM supplied to the power supply 11 is switched from Vcc to the battery 17.

【0015】RAM−CS制御回路15は、RAM11
のチップセレクト信号*CSを制御し、電源制御回路1
8が*RESET信号を発行している時は、*CSの電
圧をRAM11の電源VccRAMと同じ電圧にする。こ
の時、RAM11は低消費電力モ−ドとなり、電源Vcc
が切断されている間も書き込まれているデ−タを保持す
る。
The RAM-CS control circuit 15 includes a RAM 11
Power supply control circuit 1 by controlling the chip select signal * CS of
When 8 is issuing the * RESET signal, the voltage of * CS is set to the same voltage as the power supply VccRAM of the RAM 11. At this time, the RAM 11 enters the low power consumption mode, and the power supply Vcc
Holds the written data even while is disconnected.

【0016】アドレス配置とRAMメモリマップ 図3はマイクロプロセッサ(MPU)12から見た周辺
回路のアドレス配置及びRAMのメモリ割付けの説明図
であり、RAM11には、保持デ−タ格納領域11aと
情報記録領域11bとMPUワ−クエリア11cが設け
られている。
Address arrangement and RAM memory map FIG. 3 is an explanatory view of the address arrangement of peripheral circuits and the memory allocation of the RAM as viewed from the microprocessor (MPU) 12. The RAM 11 has a holding data storage area 11a and information. A recording area 11b and an MPU work area 11c are provided.

【0017】MPUワ−クエリア11cは、マイクロプ
ロセッサ12がプリンタ機構制御を行なう上で必要なデ
−タレジスタ領域とスタック領域であり、マイクロプロ
セッサのリセットが解除された直後にクリアされる($
00が書き込まれる)。保持デ−タ格納領域11aは制
御情報(保持データ)を格納するものであり、第1〜第
3制御情報格納領域11a-1,11a-2,11a-3を備え、それぞ
れの領域11a-1,11a-2,11a-3には、全く同一の制御情報
が書き込まれるようになっている。情報記録領域11b
は保持デ−タ格納領域11aへのデ−タ書き込み・修復
を行なうためのものであり、8バイトで構成されてい
る。第1〜第3制御情報格納領域11a-1,11a-2,11a-3と
情報記録領域11bは、上位からの初期化コマンドによ
り予めROM13に定義されている初期値が書き込まれ
る(領域初期化)。
The MPU work area 11c is a data register area and a stack area necessary for the microprocessor 12 to control the printer mechanism, and is cleared immediately after the reset of the microprocessor is released (リ セ ッ ト).
00 is written). The held data storage area 11a stores control information (held data), and includes first to third control information storage areas 11a-1, 11a-2, and 11a-3. , 11a-2 and 11a-3 are written with exactly the same control information. Information recording area 11b
Is for writing and restoring data in the held data storage area 11a, and is composed of 8 bytes. In the first to third control information storage areas 11a-1, 11a-2, 11a-3 and the information recording area 11b, an initial value previously defined in the ROM 13 is written by an initialization command from a higher order (area initialization). ).

【0018】第1〜第3制御情報格納領域 第1〜第3制御情報格納領域11a-1,11a-2,11a-3は、そ
れぞれ図4に示すように、プリンタの稼動時間・定期交
換部品の寿命管理等の記憶のために16個の3バイトカ
ウンタ部A〜Pと、プリンタの画像記録等のパラメ−タ
を記憶するための16個の1バイト制御情報部A〜Pを
有し、制御情報の書き込みは連続した3バイトまたは1
バイト単位で行なわれる。
First to third control information storage areas The first to third control information storage areas 11a-1, 11a-2, and 11a-3 are, as shown in FIG. It has 16 3-byte counters A to P for storing the life management of the printer and 16 1-byte control information A to P for storing parameters such as image recording of the printer. Writing of control information is consecutive 3 bytes or 1
Performed in byte units.

【0019】情報記録領域 情報記録領域11bには、以下のデ−タ (1) 第1〜第3制御情報格納領域11a-1,11a-2,11a-3の
先頭からのオフセット値(オフセットアドレス)である
書き込みアドレスWAD、 (2) 書き込み単位のバイト数(書き込みバイト数)BY
T、 (3) 書き込みデ−タ(保持デ−タ)DT1〜DT5 (4) 書き込み処理情報のチェックサム値(チェックデ-
タ)CKD が書き込まれる。本実施例では、3バイト単位書き込み
と1バイト単位書き込みが混在するため、書き込み処理
情報に書き込み単位のバイト数を示す「書き込みバイト
数」BYTを含んでいる。しかし、書き込み単位を必ず
3バイト単位に固定するか、あるいは1バイト単位書き
込み、3バイト単位書き込みそれぞれに書き込み処理情
報の情報記録領域を設ける場合には、この「書き込みバ
イト数」BYTは不要になる。
The information in the recording area information recording area 11b, the following de - data (1) the offset value from the first to the top of the third control information storage area 11a-1,11a-2,11a-3 (offset address ), The write address WAD, (2) the number of bytes in the write unit (the number of write bytes) BY
T, (3) Write data (hold data) DT1 to DT5 (4) Checksum value of write processing information (check data
C) CKD is written. In this embodiment, since the 3-byte unit write and the 1-byte unit write are mixed, the write processing information includes the "write byte number" BYT indicating the number of bytes of the write unit. However, when the write unit is always fixed to the 3-byte unit, or when the 1-byte unit write and the 3-byte unit write are each provided with the information recording area of the write processing information, the “write byte number” BYT is unnecessary. .

【0020】全体の動作 (a) 保持デ-タの書き込み制御 RAM11の第1〜第3制御情報格納領域11a-1,11a-2,
11a-3のカウンタ部Bに3バイトデ−タ$012345
を書き込む場合について説明する。
Overall operation (a) Write control of retained data First to third control information storage areas 11a-1, 11a-2,
3-byte data in the counter part B of 11a-3 is $ 012345
Will be described.

【0021】(1) 初期時、情報記録領域11bの全ての
デ−タに初期値として$00が書き込まれている(クリ
アされている状態)。
(1) Initially, $ 00 is written as an initial value to all data in the information recording area 11b (cleared state).

【0022】(2) かかる状態で、情報記録領域11bの
デ−タ書き込み領域に書き込みデ−タ(保持デ−タ)
$012345」を書き込む。 (3) ついで、情報記録領域11bに、書き込みアドレス
(制御情報格納領域11a-1,11a-2,11a-3の先頭からのオフ
セットアドレス「$03」)及び書き込みバイト数($
03)を書き込む。
(2) In such a state, write data (hold data) is written to the data write area of the information recording area 11b.
Write “ $ 012345 ”. (3) Next, the write address is stored in the information recording area 11b.
(Offset address “$ 03” from the head of the control information storage areas 11a-1, 11a-2, and 11a-3) and the number of write bytes ($
03) is written.

【0023】(4) 又、情報記録領域11bにチェックデ
−タを計算して書き込む。チェックデ−タは「FF」か
ら情報記録領域11bにおける7バイトの16進数値を
桁対応に減算して得られる。図5の場合には、チェック
デ−タは$90となるが、このチェックデ−タは $90=$FF-$03-$03-$01-$23-$45-$00-$00 により得られる。
(4) Also, check data is calculated and written in the information recording area 11b. The check data is obtained by subtracting a 7-byte hexadecimal value in the information recording area 11b from "FF" for each digit. In the case of FIG. 5, the check data is $ 90, but this check data is obtained by $ 90 = $ FF- $ 03- $ 03- $ 01- $ 23- $ 45- $ 00- $ 00.

【0024】(5) 情報記録領域11bへのデ−タの書き
込みが終了すれば、第1制御情報格納領域11a-1のカウ
ンタ部Bに3バイトデ−タを書き込む。すなわち、デ−
タ$01をメモリアドレス$0743に書き込み、デ−
タ$23をメモリアドレス$0744に書き込み、デ−
タ$45をメモリアドレス$0745に書き込む。
(5) When the writing of the data to the information recording area 11b is completed, the 3-byte data is written to the counter B of the first control information storage area 11a-1. That is,
Write data # 01 to memory address $ 0743,
Write data # 23 to memory address $ 0744,
Write data # 45 to memory address $ 0745.

【0025】(6) 又、第2制御情報格納領域11a-2のカ
ウンタ部Bに3バイトデ−タを書き込む。すなわち、デ
−タ$01をメモリアドレス$0783に書き込み、デ
−タ$23をメモリアドレス$0784に書き込み、デ
−タ$45をメモリアドレス$0785に書き込む。
(6) Also, 3-byte data is written to the counter section B of the second control information storage area 11a-2. That is, data # 01 is written to memory address $ 0783, data # 23 is written to memory address $ 0784, and data $ 45 is written to memory address $ 0785.

【0026】(7) 更に、第3制御情報格納領域11a-3の
カウンタ部Bに3バイトデ−タを書き込む。すなわち、
デ−タ$01をメモリアドレス$07C3に書き込み、
デ−タ$23をメモリアドレス$07C4に書き込み、
デ−タ$45をメモリアドレス$07C5に書き込む。
(7) Further, 3-byte data is written in the counter section B of the third control information storage area 11a-3. That is,
Data # 01 is written to memory address $ 07C3,
Write data # 23 to memory address $ 07C4,
Data # 45 is written to memory address # 07C5.

【0027】(8) 第1〜第3制御情報格納領域11a-1〜1
1a-3への書き込みが完了すれば、情報記録領域11bの
チェックデ−タCKDをクリアする($00を書き込
む)。 (9) ついで、情報記録領域11bの書き込みアドレスW
ADと書き込みバイト数BYTをクリアする($00を
書き込む)。
(8) First to third control information storage areas 11a-1 to 11a-1
When the writing to 1a-3 is completed, the check data CKD in the information recording area 11b is cleared (write $ 00). (9) Next, the write address W of the information recording area 11b
AD and the number of bytes BYT to be written are cleared ($ 00 is written).

【0028】(10) 最後に、情報記録領域11bの書き
込みデ−タDT1〜DT5をクリアする($00を書き
込む)。以上により、情報記録領域11bの内容は初期
状態に戻り、保持デ−タの書き込み制御は終了する。
(10) Finally, the write data DT1 to DT5 in the information recording area 11b are cleared ($ 00 is written). As described above, the content of the information recording area 11b returns to the initial state, and the writing control of the held data is completed.

【0029】尚、ステップ(4) を終了した時点で情報記
録領域11bには図5に示すように各デ−タが記憶され
る。又、各ステップ(1)〜(10)において情報記録領域1
1bに記憶されるデ−タは図6に示すようになる。従っ
て、上記書き込みシ−ケンス中に電源切断が発生する
と、情報記録領域11bには電源切断が発生した時のス
テップ(1)〜(10)に応じた内容が残る。
When the step (4) is completed, each data is stored in the information recording area 11b as shown in FIG. In each of the steps (1) to (10), the information recording area 1
The data stored in 1b is as shown in FIG. Therefore, when the power is turned off during the write sequence, the contents corresponding to steps (1) to (10) at the time when the power is turned off remain in the information recording area 11b.

【0030】又、以上は3バイトデ−タを格納領域に書
き込む場合であるが、1バイトデ−タを書き込む場合
も、情報記録領域11bへのデ−タのセット、各格納領
域11a-1〜11a-3への保持デ−タの書き込み、情報記録領
域のデ−タのクリアが行なわれる。図7は情報記録領域
11bヘデ−タがセットされた場合である。但し、第1
〜第3制御情報格納領域11a-1,11a-2,11a-3の制御情報
部Bに1バイトデ−タ$88を書き込む場合である。
The above description is for the case where 3-byte data is written into the storage area. However, when writing 1-byte data, the data is set in the information recording area 11b, and each of the storage areas 11a-1 to 11a is written. -3 is written, and the data in the information recording area is cleared. FIG. 7 shows a case where data is set in the information recording area 11b. However, the first
This is a case where 1-byte data # 88 is written in the control information section B of the third control information storage areas 11a-1, 11a-2, 11a-3.

【0031】(b) 保持デ-タの修復制御 図8は保持デ−タの修復制御の流れ図である。電源投入
後又はリセット解除後、マイクロプロセッサ12及びM
PUワ−クエリア等の初期化をした後(ステップ10
1)、情報記録領域11bの記憶内容がクリアされてい
るかチェックし(ステップ102)、クリアされていれ
ば図6の(1)または(10)の状態であり、保持デ−タの修
復制御を行なう必要はなく、修復制御を終了する。
(B) Restoration Control of Retained Data FIG. 8 is a flowchart of restoring control of retained data. After power-on or reset release, the microprocessor 12 and M
After initializing the PU work area (Step 10)
1) It is checked whether the storage contents of the information recording area 11b have been cleared (step 102). If the storage contents have been cleared, the state is (1) or (10) in FIG. There is no need to perform this, and the restoration control ends.

【0032】しかし、クリアされていないと、図6の
(2)〜(9)の状態にあるため、修復制御を行なう。まず、
情報記録領域11bのデ−タチェック(チェックサムの
照合)を行ない(ステップ103)、チェックサムが正
しければ図6のステップ(4)〜(7)において、即ち第1〜
第3制御情報格納領域11a-1,11a-2,11a-3へ保持デ−タ
を書き込んでいる間に、電源が切断されたものとみなせ
る。この場合、情報記録領域11bには正しい保持デ−
タが記憶されているから、以下の処理により第1〜第3
制御情報格納領域11a-1,11a-2,11a-3の保持デ−タの修
復を行なう。すなわち、
However, if it is not cleared, FIG.
Since the state is (2) to (9), restoration control is performed. First,
Data check (checksum comparison) of the information recording area 11b is performed (step 103). If the checksum is correct, the steps (4) to (7) in FIG.
While writing the held data to the third control information storage areas 11a-1, 11a-2, 11a-3, it can be considered that the power supply has been turned off. In this case, the correct recording data is stored in the information recording area 11b.
Since the data is stored, the first to third
The data held in the control information storage areas 11a-1, 11a-2, and 11a-3 are restored. That is,

【0033】第1制御情報格納領域11a-1に情報記録領
域11bに記憶されている保持デ−タを書き込み(ステ
ップ104)、ついで、第2制御情報格納領域11a-2に
同様に保持デ−タを書き込み(ステップ105)、更
に、第3制御情報格納領域11a-3にも保持デ−タを書き
込む(ステップ106)。
The stored data stored in the information recording area 11b is written in the first control information storage area 11a-1 (step 104), and then the stored data is similarly stored in the second control information storage area 11a-2. The data is written (step 105), and the held data is also written in the third control information storage area 11a-3 (step 106).

【0034】ついで、チェックデ−タをクリアし($0
0)を書き込み(ステップ107)、しかる後、情報記
録領域11bの書き込みアドレスWADと書き込みバイ
ト数BYTをクリアする(ステップ108)。
Next, the check data is cleared ($ 0
0) is written (step 107), and then the write address WAD and the number of write bytes BYT of the information recording area 11b are cleared (step 108).

【0035】そして、最後に、情報記録領域11bの書
き込みデ−タDT1〜DT5をクリアする(ステップ1
09)。一方、ステップ103でチェックサムが正しく
なければ、図6のステップ(2)〜(3)、(8)〜(9)の間に電
源が切断されたものであり、情報記録領域11bの保持
デ-タは正しいという保証はないから、該情報記録領域
の内容をクリアして修復制御を終了する。
Finally, the write data DT1 to DT5 in the information recording area 11b are cleared (step 1).
09). On the other hand, if the checksum is not correct in step 103, it means that the power has been turned off during steps (2) to (3) and (8) to (9) in FIG. Since there is no guarantee that the data is correct, the contents of the information recording area are cleared and the restoration control ends.

【0036】以上、本発明を実施例により説明したが、
本発明は請求の範囲に記載した本発明の主旨に従い種々
の変形が可能であり、本発明はこれらを排除するもので
はない。
The present invention has been described with reference to the embodiments.
The present invention can be variously modified in accordance with the gist of the present invention described in the claims, and the present invention does not exclude these.

【0037】[0037]

【発明の効果】以上本発明によれば、電源が切断されて
もデ−タを保持するメモリ内に保持デ−タの格納領域と
は別に、該格納領域へのデ−タ書き込み・修復を行なう
ための情報記録領域を設け、情報記録領域へ保持デ−タ
を格納した後、格納領域へ該保持デ−タの書き込み処理
を行ない、格納領域へ保持デ−タを書き込んだ後、情報
記録領域の保持デ−タをクリアし、電源投入時又はリセ
ット解除時に情報記録領域を参照し、情報記録領域の保
持デ−タがクリアされていない場合、情報記録領域の保
持デ−タを格納領域へ書き込み、情報記録領域の保持デ
−タの書き込み処理終了後に情報記録領域の保持デ−タ
をクリアするように構成したから、EEPROM又はバ
ッテリ−バックアップされたRAMへの情報書き込みシ
−ケンス中に、リセット又は電源が切断されても、EE
PROM又はバッテリ−バックアップされたRAMに書
き込まれるデ−タに誤りが生じないように修復でき、し
かもハ−ドウェアの追加を必要とせず、ソフトウェアの
みで対応することができる。又、本発明によれば、情報
記録領域に、格納領域の保持デ−タ書き込みアドレスと
保持デ−タを書き込んだ後、デ−タの正当性をチェック
するためのチェックデ−タを書き込み、しかる後、格納
領域へ保持デ−タの書き込みを行ない、格納領域へ保持
デ−タを書き込んだ後、情報記録領域のチェックデ−タ
をクリアし、ついで、チェックデ−タ以外のデ−タをク
リアし、電源投入時又はリセット解除時に情報記録領域
を参照し、情報記録領域のデ−タがクリアされていない
場合には、チェックデ−タを用いて情報記録領域におけ
るデ−タの正当性をチェックし、正当ならば、情報記録
領域に記憶されている保持デ−タを格納領域へ書き込
み、保持デ−タの書き込み処理終了後に情報記録領域の
デ−タをクリアするように構成したから、EEPROM
又はバッテリ−バックアップされたRAMへの情報書き
込みシ−ケンス中に、リセット又は電源が切断されて
も、誤りのない正当なデータを確実にEEPROM又は
バッテリ−バックアップされたRAMに修復することが
できる。又、情報記録領域のデ−タがクリアされずに残
っていても、データに誤りがある場合には該データをE
EPROM又はバッテリ−バックアップされたRAMに
書き込まないようにできる。
As described above, according to the present invention, the data writing / restoring in the storage area for storing the data separately from the storage area for the stored data in the memory for holding the data even when the power is cut off is performed. After providing an information recording area for storing the stored data in the information recording area, writing the retained data in the storage area, writing the retained data in the storage area, and then recording the information. Clear the data held in the area, refer to the information recording area at power-on or reset release, and if the data held in the information recording area is not cleared, store the data held in the information recording area. Since the data stored in the information recording area is cleared after the data is written into the information recording area, the data stored in the information recording area is cleared during the information writing sequence to the EEPROM or the battery-backed RAM. , Tsu even if doors or the power supply is cut off, EE
The data written to the PROM or the battery-backed RAM can be restored so as not to cause an error, and can be dealt with only by software without requiring additional hardware. According to the present invention, the information
In the recording area, an address for writing the retained data in the storage area and
After writing the retained data, check the validity of the data
Write the check data, and then store it.
Writes data to the storage area and stores it in the storage area
After writing the data, check the data in the information recording area.
And then delete data other than the check data.
Information storage area when power is turned on or reset is released
And the data in the information recording area is not cleared
In this case, check data is
Check the validity of the data, and if it is, record the information.
Write the retained data stored in the area to the storage area
After the write processing of the retained data is completed,
Since the data is cleared, the EEPROM
Or write information to battery-backed RAM
Reset or the power is turned off during the
Also, make sure that correct data without errors is
Restoring to battery-backed RAM
it can. Also, the data in the information recording area remains without being cleared.
If there is an error in the data,
EPROM or battery-backed RAM
Can not be written.

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

【図1】図1は本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】本発明の実施例構成図である。FIG. 2 is a configuration diagram of an embodiment of the present invention.

【図3】アドレス配置・RAMメモリ割付け説明図であ
る。
FIG. 3 is an explanatory diagram of address arrangement and RAM memory allocation.

【図4】制御情報格納領域の構成図である。FIG. 4 is a configuration diagram of a control information storage area.

【図5】本発明の情報記録領域の記憶デ−タ説明図であ
る。
FIG. 5 is an explanatory diagram of storage data in an information recording area according to the present invention.

【図6】書き込み制御時の情報記録領域の記憶デ−タ変
遷図である。
FIG. 6 is a transition diagram of storage data in an information recording area during write control.

【図7】1バイトデ−タの場合における情報記録領域の
記憶デ−タ説明図である。
FIG. 7 is an explanatory diagram of storage data in an information recording area in the case of 1-byte data.

【図8】保持デ−タの修復制御の流れ図である。FIG. 8 is a flowchart of control for restoring held data.

【図9】従来の問題点説明図である。FIG. 9 is an explanatory diagram of a conventional problem.

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

11・・保持デ−タ格納用のメモリ 11a・・保持デ−タ格納領域、 11b・・情報記録領域 12・・マイクロプロセッサ(MPU) 12a・・情報記録領域内容判別部 12b・・保持デ−タ修復部 11. Memory for storing held data 11a: held data storage area 11b: information recording area 12: microprocessor (MPU) 12a: information recording area content discriminating unit 12b: held data Restoration section

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 電源切断時にデ−タをメモリに保持して
おき、電源投入時に該メモリに保持されているデ−タを
用いて機器を制御する装置のデ−タ保持方法において、前記メモリ内に保持デ−タの格納領域とは別に、該格納
領域へのデ−タ書き込み及び修復を行なうための情報記
録領域を設け、 情報記録領域に、格納領域の保持デ−タ書き込みアドレ
スと保持デ−タを書き込んだ後、デ−タの正当性をチェ
ックするためのチェックデ−タを書き込み、 しかる後、格納領域へ保持デ−タの書き込みを行ない、 格納領域へ保持デ−タを書き込んだ後、情報記録領域の
チェックデ−タをクリアし、ついで、チェックデ−タ以
外のデ−タをクリアし、 電源投入時又はリセット解除時に情報記録領域を参照
し、情報記録領域のデ−タがクリアされていない場合に
は、チェックデ−タを用いて情報記録領域におけるデ−
タの正当性をチェックし、 正当ならば、情報記録領域に記憶されている保持デ−タ
を格納領域へ書き込み、 保持デ−タの書き込み処理終了後に情報記録領域のデ−
タをクリアすることを特徴とするデ−タ保持方法。
1. A de during power down - holds the data in the memory, de held in the memory when the power is turned - de of the device for controlling the device by using the data - in data holding method, the memory Within the storage area of the stored data
Information writing for writing and repairing data in the area
A recording area is provided, and an address for writing data held in the storage area is provided in the information recording area.
After writing the data and the retained data, check the validity of the data.
Write the check data for writing to the storage area , then write the holding data to the storage area, write the holding data to the storage area , and then write the information recording area.
Clear the check data, then check data
Clear external data and refer to information recording area when power is turned on or reset is released
If the data in the information recording area has not been cleared,
Is to check the data in the information recording area using the check data.
Check the validity of the data , and if valid, hold the data stored in the information recording area.
Is written into the storage area, and after the write processing of the held data is completed, the data in the information recording area is written.
A data holding method characterized by clearing data.
JP3057389A 1991-03-20 1991-03-20 Data retention method Expired - Fee Related JP2641996B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3057389A JP2641996B2 (en) 1991-03-20 1991-03-20 Data retention method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3057389A JP2641996B2 (en) 1991-03-20 1991-03-20 Data retention method

Publications (2)

Publication Number Publication Date
JPH04293139A JPH04293139A (en) 1992-10-16
JP2641996B2 true JP2641996B2 (en) 1997-08-20

Family

ID=13054264

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3057389A Expired - Fee Related JP2641996B2 (en) 1991-03-20 1991-03-20 Data retention method

Country Status (1)

Country Link
JP (1) JP2641996B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4592280B2 (en) * 2003-12-08 2010-12-01 富士通テン株式会社 Data storage
JP5643171B2 (en) * 2011-10-14 2014-12-17 株式会社東海理化電機製作所 Electronic key

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02245954A (en) * 1989-03-20 1990-10-01 Fujitsu Ltd Semiconductor storage device

Also Published As

Publication number Publication date
JPH04293139A (en) 1992-10-16

Similar Documents

Publication Publication Date Title
KR100343377B1 (en) Data writing to non-volatile memory
JP3233079B2 (en) Data processing system and data processing method
KR20030043691A (en) Detecting partially erased units in flash devices
WO2000019317A1 (en) Protection of boot block code while allowing write accesses to the boot block
JP3667920B2 (en) IC card
KR100251381B1 (en) Apparatas and method for initializing of volatile memory
JPS6221143B2 (en)
US20070277028A1 (en) Method and system for recovery from reprogramming failures in nonvolatile memory
JP2641996B2 (en) Data retention method
KR19990027843A (en) Personal computer system with flash ROM control device and control method
JPH10302485A (en) Information processor having flash memory
JP3620478B2 (en) Storage device, data processing system using the storage device, and data read method
JPH0822422A (en) Memory device
JPS5856165A (en) Record update system
US20060181948A1 (en) System and method for detecting and reducing data corruption in a storage device
JP2000122813A (en) Disk array device
JP2003330627A (en) Storage device
JPH10161942A (en) Method, device for storing information, and information processor
JPH0784894A (en) Method for writing nonvolatile memory
JP2003150449A (en) Cellular phone device
JPH09212429A (en) Monvolatile semiconductor disk drive
JP2001331382A (en) Method and device for managing nonvolatile memory
JP3178913B2 (en) Semiconductor file device
JPH02245954A (en) Semiconductor storage device
JPH0689371A (en) Method and system for ic memory card control

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: 19970401

LAPS Cancellation because of no payment of annual fees