JPH08249237A - Erroneous write prevention system for data - Google Patents

Erroneous write prevention system for data

Info

Publication number
JPH08249237A
JPH08249237A JP5469195A JP5469195A JPH08249237A JP H08249237 A JPH08249237 A JP H08249237A JP 5469195 A JP5469195 A JP 5469195A JP 5469195 A JP5469195 A JP 5469195A JP H08249237 A JPH08249237 A JP H08249237A
Authority
JP
Japan
Prior art keywords
write
page
data
storage medium
writing
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.)
Withdrawn
Application number
JP5469195A
Other languages
Japanese (ja)
Inventor
Hiroyuki Niwano
浩之 庭野
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.)
Fujifilm Holdings Corp
Fujifilm Microdevices Co Ltd
Original Assignee
Fujifilm Microdevices Co Ltd
Fuji Photo Film Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujifilm Microdevices Co Ltd, Fuji Photo Film Co Ltd filed Critical Fujifilm Microdevices Co Ltd
Priority to JP5469195A priority Critical patent/JPH08249237A/en
Publication of JPH08249237A publication Critical patent/JPH08249237A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

PURPOSE: To provide an erroneous write prevention system for preventing data from being written in an erroneous area inside a memory. CONSTITUTION: This system is provided with a main memory medium 2 capable of storing the plural data of pages which are the minimum write units of the data, write inhibition flags provided corresponding to the respective pages of the main memory medium 2 and provided with set/reset states whose reset state indicates write inhibition to the respective pages and a write means 1 for performing write to the corresponding page of the main memory medium 2 and turning the writ,e inhibition flag to the set state when the write inhibition flag corresponding to the page is in the reset state and not performing the write to the corresponding page of the main memory medium 2 when the write inhibition flag is in the set state when the instruction for the write to the prescribed page of the main memory medium 2 is given from the outside.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、メモリへのデータ書き
込みに関し、特にメモリ内の誤った領域にデータが書き
込まれるのを防止するための誤書き込み防止システムに
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to writing data in a memory, and more particularly to an erroneous writing prevention system for preventing data from being written in an erroneous area in the memory.

【0002】[0002]

【従来の技術】フラッシュメモリは、ページ単位でデー
タが書き込まれる。ページの大きさは、例えば256バ
イトである。その場合は、256バイトを最小単位とし
て、データの書き込みが行われる。
2. Description of the Related Art In a flash memory, data is written in page units. The size of the page is 256 bytes, for example. In that case, data writing is performed with 256 bytes as the minimum unit.

【0003】1度書き込んだデータは、書き換えたくな
い場合がある。例えば、重要なデータは、消去しない
で、永久的に残しておきたい。そのようなデータを保護
するために、以後その領域への書き込みを禁止する手段
が必要になる。
Data once written may not be rewritten in some cases. For example, you want to keep important data permanently instead of erasing it. In order to protect such data, a means for prohibiting writing to that area is needed thereafter.

【0004】メモリ用ICにおいては、その配線用ピン
の中にライトプロテクト用のピンを設けているものがあ
る。そのピンを通じて、ICに書き込み禁止制御信号を
送れば、ICへの書き込みを禁止することができる。
In some memory ICs, some of the wiring pins have write protect pins. By sending a write inhibit control signal to the IC through the pin, it is possible to inhibit the write to the IC.

【0005】しかし、ICにおいて、不必要にピン数を
増やすと、多数のピンをICパッケージに設けることに
なるので、IC自体が大きくなり、ピンを外部と接続す
るための配線も複雑になる。また、そのようなピンを設
けると、ICのメモリ内に空きページが存在しても、全
てのページにデータ書き込みができなくなってしまう。
したがって、データ記憶中のページのみ書き込み禁止と
し、未記憶のページは書き込み可能とすることができな
い。
However, in the IC, if the number of pins is unnecessarily increased, a large number of pins are provided in the IC package, so that the IC itself becomes large and the wiring for connecting the pins to the outside becomes complicated. Moreover, if such a pin is provided, data cannot be written to all pages even if there are empty pages in the memory of the IC.
Therefore, it is not possible to write-protect only the page in which data is being stored and not allow the unstored page to be writable.

【0006】[0006]

【発明が解決しようとする課題】メモリに記録されてい
るデータを保護するため、ICにライトプロテクト用の
ピンを設けると、ピン数が増えてしまう。また、メモリ
内に空きページが存在しても全てのページが書き込み禁
止になってしまい、保護する必要がない未書き込みのペ
ージについても書き込み禁止になってしまう。
If a pin for write protection is provided on the IC in order to protect the data recorded in the memory, the number of pins will increase. In addition, all pages are write-protected even if there are empty pages in the memory, and write-protection is also performed on unwritten pages that do not need to be protected.

【0007】本発明は、簡便にページ単位の書き込み禁
止を行うことができる誤書き込み防止システムを提供す
ることである。
An object of the present invention is to provide an erroneous write prevention system which can easily perform write protection in page units.

【0008】[0008]

【課題を解決するための手段】本発明のデータの誤書き
込み防止システムは、データの最小書き込み単位である
ページのデータを複数記憶することができる主記憶媒体
と、主記憶媒体の各ページに対応して設けられ、セット
/リセット状態を有し、セット状態が各ページへの書き
込み禁止を示す書き込み禁止フラグと、外部から主記憶
媒体の所定のページへの書き込みが指示されると、該ペ
ージに対応する書き込み禁止フラグがリセット状態であ
るときには、主記憶媒体の対応するページに書き込みを
行って該書き込み禁止フラグをセット状態にし、書き込
み禁止フラグがセット状態であるときには、主記憶媒体
の対応するページに書き込みを行わない書き込み手段と
を有する。
An erroneous data write prevention system of the present invention corresponds to a main storage medium capable of storing a plurality of pages of data, which is the minimum writing unit of data, and each page of the main storage medium. And a set / reset state, the set state is a write-inhibit flag indicating that the page is write-inhibited, and an external instruction to write to a predetermined page of the main storage medium causes the page to be written to the page. When the corresponding write inhibit flag is in the reset state, the corresponding page of the main storage medium is written to set the write inhibit flag, and when the write inhibit flag is in the set state, the corresponding page of the main storage medium is set. And a writing unit that does not perform writing.

【0009】また、本発明のデータの誤書き込み防止シ
ステムは、データの最小書き込み単位であるページのデ
ータを複数記憶することができる記憶媒体と、主記憶媒
体の各ページに対応して設けられ、各ページの一部のデ
ータを記憶するための判定用記憶媒体と、主記憶媒体の
各ページに対応して設けられ、セット/リセット状態を
有し、セット状態が各ページへの書き込み禁止を示す書
き込み禁止フラグと、書き込み禁止フラグをセット状態
にするための書き込み禁止手段と、外部から主記憶媒体
の所定のページへの書き込みが指示されると、書き込み
禁止フラグがリセット状態であるときには、主記憶媒体
の対応するページに書き込みを行い該書き込みを行った
データの一部を該ページに対応する判定用記憶媒体に書
き込み、書き込み禁止フラグがセット状態であるときに
は、主記憶媒体の対応するページに書き込みを行わない
書き込み手段と、外部からページの一部書き込みが指示
されると、該一部書き込みデータと判定用記憶媒体に記
憶されているデータが同じか否かを判断し、同じである
ときには対応するページの書き込み禁止フラグをリセッ
ト状態にする書き込み禁止解除手段とを有する。
Further, the data erroneous writing prevention system of the present invention is provided corresponding to each page of the main storage medium and a storage medium capable of storing a plurality of pages of data, which is the minimum unit of writing data. A determination storage medium for storing a part of data on each page and a main storage medium are provided corresponding to each page and have a set / reset state, and the set state indicates write prohibition to each page. When the write-inhibit flag is in the reset state when the write-inhibit flag, the write-inhibit means for setting the write-inhibit flag to the set state, and the external instruction to write to a predetermined page of the main storage medium, Writing to a corresponding page of the medium and writing a part of the written data to the determination storage medium corresponding to the page, and writing When the stop flag is in the set state, a writing unit that does not write to the corresponding page of the main storage medium, and when a part of the page is instructed from the outside, the partial write data and the determination storage medium are stored. It is determined whether or not the written data is the same, and when they are the same, a write-protection canceling unit that sets the write-protection flag of the corresponding page to the reset state.

【0010】[0010]

【作用】主記憶媒体の所定のページにデータを書き込む
と、自動的に対応するページの書き込み禁止フラグがセ
ット状態になり、以後、主記憶媒体の該ページへの書き
込みが禁止される。
When data is written to a predetermined page of the main storage medium, the write inhibit flag of the corresponding page is automatically set to the set state, and thereafter writing to the page of the main storage medium is prohibited.

【0011】また、主記憶媒体の所定のページへの書き
込みが禁止されている場合には、該ページに記憶されて
いるデータの所定の一部を外部から同じページに書き込
み指示することにより該ページへの書き込み禁止を解除
することができる。
If writing to a predetermined page of the main storage medium is prohibited, a predetermined part of the data stored in the page is externally instructed to be written to the same page. You can remove the write-protection to.

【0012】[0012]

【実施例】図1は、本発明の実施例による誤書き込み防
止システムの構成を示すブロック図である。
1 is a block diagram showing the construction of an erroneous write prevention system according to an embodiment of the present invention.

【0013】ホスト6は、メモリIC5に対して、IC
ピンを通じてデータの書き込みまたは読み出しを指示す
ることができる。ホスト6は、例えばパソコン、ワープ
ロ、ゲーム機、POS等である。メモリIC5は、デー
タを記憶することができるメモリ素子を含むICチップ
である。ただし、メモリIC5は、ICチップに限ら
ず、メモリカードとして構成することもできる。
The host 6 compares the memory IC 5 with the IC
It is possible to instruct writing or reading of data through the pin. The host 6 is, for example, a personal computer, word processor, game machine, POS, or the like. The memory IC5 is an IC chip including a memory element capable of storing data. However, the memory IC 5 is not limited to an IC chip and can be configured as a memory card.

【0014】メモリIC5は、制御部1、メインメモリ
2、判定用メモリ3およびレジスタ4を有する。制御部
1は、ホスト6から送られてくるコマンドに応じて、メ
インメモリ2、判定用メモリ3およびレジスタ4を制御
する。
The memory IC 5 has a control unit 1, a main memory 2, a judgment memory 3 and a register 4. The control unit 1 controls the main memory 2, the judgment memory 3 and the register 4 according to the command sent from the host 6.

【0015】メインメモリ2は、フラッシュメモリ、E
EPROM等の不揮発性メモリであり、ページ単位で書
き込みを行うことができる。ページの大きさは、例えば
256バイトや512バイトである。ページは、通常、
ブロックやセクタ等とも呼ばれる。ホスト6は、メイン
メモリ2にデータを書き込んだり、データを読み出した
りすることができる。メインメモリ2は、ページ単位で
書き込みが行われる。また、ページ単位でデータの書き
込み禁止または書き込み可能が設定される。
The main memory 2 is a flash memory, E
It is a non-volatile memory such as an EPROM and can be written in page units. The size of the page is, for example, 256 bytes or 512 bytes. The page is usually
It is also called a block or sector. The host 6 can write data in and read data from the main memory 2. The main memory 2 is written in page units. In addition, write protection or writability of data is set in page units.

【0016】判定用メモリ3は、メインメモリ2と同様
な不揮発性メモリである。それに対し、レジスタ4は、
不揮発性でも揮発性でもよい。好ましくは、アクセス速
度が早い揮発性のSRAMやDRAMがよい。判定用メ
モリ3は、メインメモリ2の各ページが書き込み禁止か
否かを判断するためのデータ等を記憶するためのメモリ
である。
The judgment memory 3 is a non-volatile memory similar to the main memory 2. On the other hand, register 4
It may be non-volatile or volatile. A volatile SRAM or DRAM having a high access speed is preferable. The determination memory 3 is a memory for storing data for determining whether each page of the main memory 2 is write-protected.

【0017】図2は、メインメモリ2のメモリマップを
示す図である。メインメモリ2は、複数のページP0,
P1,P2,・・・に領域分割されている。各ページ
は、例えば256バイトのページデータ10を記憶す
る。先頭バイト11は、ページデータ10中における先
頭の1バイトのデータであり、ページ書き込み禁止を解
除する際に使われる鍵となるデータである。詳細は、後
に説明する。
FIG. 2 is a diagram showing a memory map of the main memory 2. The main memory 2 has a plurality of pages P0,
The area is divided into P1, P2, .... Each page stores, for example, 256 bytes of page data 10. The first byte 11 is the first 1-byte data in the page data 10, and is the key data used when releasing the page write inhibition. Details will be described later.

【0018】図3は、判定用メモリ3のメモリマップを
示す図である。判定用メモリ3は、メインメモリ2の各
ページP0,P1,P2,・・・に対応して、先頭バイ
ト21と禁止フラグ22を記憶する。先頭バイト21
は、1バイト(8ビット)であり、禁止フラグ22は、
1ビットである。先頭バイト21は、図2のメインメモ
リ2の先頭バイト11と同じデータである。ホスト6が
ページデータの書き込みを指示すると、メインメモリ2
にページデータが書き込まれ、それと同時にそのページ
データの先頭データが判定用メモリ3に書き込まれる。
FIG. 3 is a diagram showing a memory map of the judgment memory 3. The determination memory 3 stores a head byte 21 and a prohibition flag 22 corresponding to each page P0, P1, P2, ... Of the main memory 2. First byte 21
Is 1 byte (8 bits), and the prohibition flag 22 is
It is 1 bit. The head byte 21 is the same data as the head byte 11 of the main memory 2 of FIG. When the host 6 instructs writing of page data, the main memory 2
The page data is written in, and at the same time, the top data of the page data is written in the determination memory 3.

【0019】禁止フラグは、各ページP0,P1,P
2,・・・が書き込み禁止であるか否かの設定を示すフ
ラグであり、最低1ビットあれば足りる。禁止フラグが
セット=“1”)されていれば、メインメモリ2の対応
するページに書き込みを行うことができない。それに対
し、禁止フラグがリセット(=“0”)されていれば、
メインメモリ2の対応するページに書き込みを行うこと
ができる。初期時においては、メインメモリ2の全ての
ページが未書き込みの状態であり、全てのページの禁止
フラグ22がリセットされている。
The prohibition flag is for each page P0, P1, P
2, ... Are flags indicating whether or not the write is prohibited, and at least one bit is sufficient. If the prohibition flag is set = “1”), the corresponding page in the main memory 2 cannot be written. On the other hand, if the prohibition flag is reset (= "0"),
The corresponding page of the main memory 2 can be written. At the initial stage, all the pages of the main memory 2 are in the unwritten state, and the inhibition flags 22 of all the pages are reset.

【0020】図1を参照して、ホスト6によるデータ書
き込み方法を説明する。ホスト6は、ページアドレスと
ページデータをページ書き込みのコマンドと共にメモリ
IC5に送出する。メモリIC5の制御部1は、ページ
アドレスにより特定されるページの禁止フラグ22(図
3)がセット状態かリセット状態かによって異なる処理
を行う。禁止フラグ22がリセット状態であるときに
は、メインメモリ2の対応するページが未書き込みの状
態であることを示し、禁止フラグ22がセット状態であ
るときには、メインメモリ2の対応するページが既に書
き込まれている状態であることを示す。
A data writing method by the host 6 will be described with reference to FIG. The host 6 sends the page address and page data to the memory IC 5 together with a page write command. The control unit 1 of the memory IC 5 performs different processing depending on whether the inhibition flag 22 (FIG. 3) of the page specified by the page address is in the set state or the reset state. When the prohibition flag 22 is in the reset state, it indicates that the corresponding page in the main memory 2 is in the unwritten state, and when the prohibition flag 22 is in the set state, the corresponding page in the main memory 2 has already been written. It indicates that there is a state.

【0021】初期時は、禁止フラグ22がリセット状態
である。ホスト6からメインメモリ2にページ書き込み
が指示されると、指定されたページアドレスにページ書
き込みを行う。それと同時に、そのページデータの先頭
データを判定用メモリ3に書き込み、禁止フラグ22
(図3)をセットする。禁止フラグがセットされると、
以後はそのページに書き込みを行うことはできない。
Initially, the prohibition flag 22 is in a reset state. When page writing is instructed from the host 6 to the main memory 2, page writing is performed at the designated page address. At the same time, the top data of the page data is written in the determination memory 3 and the prohibition flag 22
(Fig. 3). When the prohibit flag is set,
After that, the page cannot be written.

【0022】以上のように、メインメモリ2にページ書
き込みを行うと、以後そのページに書き込みを行うこと
はできず、書き込まれたページデータを保護することが
できる。ホスト6は、ページ書き込みのコマンドをメモ
リIC5に送出するだけで、ページ書き込みと同時に、
自動的に書き込み禁止を設定することができるので、ホ
スト6は、別に書き込みを禁止するための、特別の操作
を必要としない。
As described above, when a page is written in the main memory 2, the page cannot be written thereafter, and the written page data can be protected. The host 6 simply sends a page write command to the memory IC 5, and simultaneously with the page write,
Since the write protection can be set automatically, the host 6 does not need any special operation for separately prohibiting the write.

【0023】ページ書き込みが禁止されているページに
再書き込みを行いたい場合には、ホスト6は、一旦、書
き込み禁止の解除操作を行う必要がある。禁止フラグ2
2は、書き込み禁止の解除操作を行うことによりリセッ
トされる。禁止フラグ22がリセットされた後は、上記
の書き込み操作を行うことにより、そのページにデータ
書き込みを行うことができる。
When it is desired to rewrite a page in which page writing is prohibited, the host 6 needs to once perform a write prohibiting cancel operation. Prohibition flag 2
2 is reset by performing a write-protection release operation. After the prohibition flag 22 is reset, data can be written to the page by performing the above write operation.

【0024】次に、上記のページ書き込みの禁止を解除
する方法を説明する。解除は、ホスト6の誤制御やユー
ザの誤操作により、容易に行われては困る。明らかな解
除意思を持った上での解除操作を行ったときのみ、解除
されることが望ましい。したがって、操作がやや複雑で
あっても、明確な解除意思を持ってのみ行われる操作が
必要である。
Next, a method for canceling the above-mentioned page write inhibition will be described. It is troublesome that the release is easily performed due to erroneous control of the host 6 or erroneous operation by the user. It is desirable to be released only when the release operation is performed with a clear release intention. Therefore, even if the operation is slightly complicated, it is necessary to perform the operation only with a clear intention to cancel.

【0025】ホスト6は、以下の操作を行うことによ
り、書き込み禁止を解除することができる。
The host 6 can release the write protection by performing the following operation.

【0026】(1)解除したいページの先頭バイトの読
み出しコマンドをメモリIC5に送出する。読み出しコ
マンドを送出することにより、ホスト6は、禁止フラグ
22の状態にかかわらず、指定したページの先頭バイト
11をメモリIC5から受け取ることができる。この先
頭バイト11は、メインメモリ2から読み出されるデー
タである。
(1) A read command for the first byte of the page to be released is sent to the memory IC5. By sending the read command, the host 6 can receive the first byte 11 of the specified page from the memory IC 5 regardless of the state of the prohibition flag 22. The first byte 11 is data read from the main memory 2.

【0027】(2)読み出した先頭バイトそのものを再
び書き込むため、バイト書き込みコマンドをメモリIC
5に送出する。制御部1は、コマンドを受け取り、受け
取ったコマンドがページ書き込みかバイト書き込みかを
判断する。ページ書き込みであれば、前述の通り、禁止
フラグ22に応じてメインメモリ2にページ書き込みを
行う。バイト書き込みのときは、メインメモリ2には書
き込まず、判定用メモリ3に記憶されている先頭バイト
21との比較を行う。先頭バイト21は、判定用メモリ
3からレジスタ4に複写され、レジスタ4において比較
される。先頭レジスタ21は、メインメモリ2の対応す
るページの先頭バイト11と同じデータである。したが
って、上記の操作によりメインメモリ2から読み出した
先頭バイト11は、レジスタ4の先頭バイト21と一致
する。一致したときには、制御部1が禁止フラグ22を
リセットし、書き込み禁止を解除する。以後は、そのペ
ージへの書き込みは可能になる。一致しないときには、
上記の操作を行わなかったときか、または誤操作のとき
であるので、禁止フラグ22のリセットを行わずに、禁
止フラグ22の状態を維持する。
(2) Since the read head byte itself is written again, a byte write command is issued to the memory IC.
5 The control unit 1 receives the command and determines whether the received command is a page write or a byte write. For page writing, page writing is performed in the main memory 2 in accordance with the prohibition flag 22, as described above. At the time of byte writing, the data is not written in the main memory 2 and is compared with the leading byte 21 stored in the judgment memory 3. The first byte 21 is copied from the judgment memory 3 to the register 4 and compared in the register 4. The head register 21 is the same data as the head byte 11 of the corresponding page of the main memory 2. Therefore, the leading byte 11 read from the main memory 2 by the above operation matches the leading byte 21 of the register 4. When they match, the control unit 1 resets the prohibition flag 22 to release the write prohibition. After that, writing to the page becomes possible. If they don't match,
Since the above operation has not been performed or the operation has been performed by mistake, the prohibition flag 22 is not reset and the state of the prohibition flag 22 is maintained.

【0028】次に、以上の動作を行うための制御部1の
処理手順を示す。図4は、制御部1が行うメインルーチ
ンの処理を示すフローチャートである。ステップSA1
では、ホスト6から供給されるコマンドを受け付ける。
ステップSA2では、受け付けたコマンドの種類の判別
する。読み出しコマンドであれば、ステップSA3に進
み、読み出し処理を行う。書き込みコマンドであれば、
ステップSA4に進み、書き込み処理を行う。読み出し
処理と書き込み処理の詳細は、後に説明する。コマンド
がその他のコマンドであれば、ステップSA5へ進み、
データ消去等のその他の処理を行う。以上のコマンドに
応じた処理が終了すると、ステップSA1に戻り、コマ
ンドに応じた処理を繰り返す。
Next, a processing procedure of the control unit 1 for performing the above operation will be shown. FIG. 4 is a flowchart showing the processing of the main routine performed by the control unit 1. Step SA1
Then, the command supplied from the host 6 is accepted.
In step SA2, the type of the received command is determined. If it is a read command, the process proceeds to step SA3 to perform a read process. If it is a write command,
In step SA4, the writing process is performed. Details of the read processing and the write processing will be described later. If the command is any other command, go to Step SA5,
Other processing such as data deletion is performed. When the processing according to the above command is completed, the process returns to step SA1 and the processing according to the command is repeated.

【0029】図5は、図4のステップSA3の読み出し
処理の詳細を示すフローチャートである。ステップSB
1では、ホスト6から供給されたコマンドがバイト読み
出しのコマンドかまたはページ読み出しのコマンドかを
チェックする。バイト読み出しのコマンドであれば、ス
テップSB2へ進み、ページ読み出しのコマンドであれ
ば、ステップSB4へ進む。
FIG. 5 is a flow chart showing details of the read processing in step SA3 of FIG. Step SB
At 1, it is checked whether the command supplied from the host 6 is a byte read command or a page read command. If the command is a byte read command, the process proceeds to step SB2. If the command is a page read command, the process proceeds to step SB4.

【0030】ステップSB2では、バイト読み出しのコ
マンドに従い、コマンドと共にホスト6から供給される
ページアドレスが示すページの先頭バイト11をメイン
メモリ2から読み出す。
In step SB2, the head byte 11 of the page indicated by the page address supplied from the host 6 together with the command is read from the main memory 2 in accordance with the byte read command.

【0031】ステップSB3では、読み出した先頭バイ
ト11をホスト6に送出し、処理を終了する。ホスト6
は、この後、受け取った先頭バイト11をバイト書き込
みすることにより、そのページの書き込み禁止を解除す
ることができる。
At step SB3, the read head byte 11 is sent to the host 6 and the process is terminated. Host 6
After that, the write protection of the page can be released by writing the received first byte 11 in bytes.

【0032】ステップSB4では、ページ読み出しのコ
マンドに従い、コマンドと共にホスト6から供給される
ページアドレスが示すページのページデータをメインメ
モリ2から読み出す。
In step SB4, the page data of the page indicated by the page address supplied from the host 6 together with the command is read from the main memory 2 in accordance with the page read command.

【0033】ステップSB5では、読み出したページデ
ータをホスト6に送出し、処理を終了する。なお、以上
の読み出し処理は、メインメモリ2がページ読み出しと
バイト読み出しの両方を行うことができる場合である。
メインメモリ2がページ読み出ししかできない場合に
は、ページ読み出しを行い、ページデータの先頭の1バ
イトのみを取り出して、バイト読み出しに代えることが
できる。
At step SB5, the read page data is sent to the host 6 and the process is terminated. The above read processing is performed when the main memory 2 can perform both page read and byte read.
If the main memory 2 can only read pages, page reading can be performed, and only the first 1 byte of the page data can be taken out and replaced with byte reading.

【0034】図6は、図4のステップSA4の書き込み
処理の詳細を示すフローチャートである。ステップSC
1では、ホスト6から供給されたコマンドがバイト書き
込みのコマンドかページ書き込みのコマンドかをチェッ
クする。バイト書き込みのコマンドであれば、ステップ
SC3へ進み、ページ書き込みのコマンドであれば、ス
テップSC2へ進む。コマンドを判断する場合、コマン
ド自体がバイト書き込み用とページ書き込み用に分かれ
ている場合には、コマンドにより判断することができ
る。コマンド自体が同じ場合には、コマンドに続くデー
タが1ページ(例えば256バイト)分あればページ書
き込みコマンドであり、データが1バイト分しかなけれ
ばバイト書き込みコマンドである。データの終わりに
は、データの終了を示すコマンドが付与される。
FIG. 6 is a flow chart showing details of the write processing in step SA4 of FIG. Step SC
At 1, it is checked whether the command supplied from the host 6 is a byte write command or a page write command. If the command is a byte write command, the process proceeds to step SC3. If the command is a page write command, the process proceeds to step SC2. When determining a command, if the command itself is divided into byte writing and page writing, it can be determined by the command. When the commands themselves are the same, if the data following the command is one page (for example, 256 bytes), it is a page write command, and if the data is only one byte, it is a byte write command. A command indicating the end of data is attached to the end of the data.

【0035】ステップSC2では、ページ書き込みのコ
マンドに従い、コマンドと共にホスト6から供給される
ページアドレスが示すメインメモリ2のページにページ
データを書き込むための処理を行い、処理を終了する。
ページ書き込み処理の詳細は、後に説明する。
In step SC2, according to the page write command, a process for writing the page data to the page of the main memory 2 indicated by the page address supplied from the host 6 together with the command is performed, and the process ends.
Details of the page writing process will be described later.

【0036】ステップSC3では、バイト書き込みのコ
マンドに従い、バイト書き込みの処理を行い、処理を終
了する。バイト書き込みの処理は、実際にメインメモリ
2への書き込みは行わず、書き込み禁止を解除するため
の処理である。詳細は、後に説明する。
At step SC3, a byte write process is performed in accordance with the byte write command, and the process ends. The byte write process is a process for releasing the write protection without actually writing to the main memory 2. Details will be described later.

【0037】図7は、図6のステップSC2のページ書
き込み処理の詳細を示すフローチャートである。ステッ
プSD1では、ページアドレスが示すページの禁止フラ
グ22を判定用メモリ3から読み出す。
FIG. 7 is a flow chart showing details of the page write processing in step SC2 of FIG. In step SD1, the inhibition flag 22 of the page indicated by the page address is read from the determination memory 3.

【0038】ステップSD2では、読み出した禁止フラ
グ22がセット状態かリセット状態かをチェックする。
禁止フラグ22がリセット状態であれば、書き込み禁止
が解除されているので、ステップSD3へ進み、書き込
みの処理を開始する。
At step SD2, it is checked whether the read prohibition flag 22 is in the set state or the reset state.
If the prohibition flag 22 is in the reset state, it means that the write prohibition has been released, and the process advances to step SD3 to start the writing process.

【0039】ステップSD3では、ホスト6からコマン
ドと共に供給されるページデータをメインメモリ2の対
応するページに書き込む。ステップSD4では、メイン
メモリ2に書き込んだページデータの先頭の1バイトと
同じ1バイトデータを対応するページの判定用メモリ3
に先頭バイト21として書き込む。
At step SD3, the page data supplied together with the command from the host 6 is written in the corresponding page of the main memory 2. In step SD4, the same 1-byte data as the first 1 byte of the page data written in the main memory 2 is used as the determination memory 3 for the corresponding page.
To the first byte 21.

【0040】ステップSD5では、判定用メモリ3内の
対応するページの禁止フラグ22をセットし、処理を終
了する。禁止フラグ22をセットすることにより、以後
そのページへの書き込みは禁止される。以上のように、
禁止フラグ22は、メインメモリ2にページ書き込みを
行うことにより自動的にセットされる。
At step SD5, the inhibition flag 22 of the corresponding page in the determination memory 3 is set, and the process is terminated. By setting the prohibition flag 22, writing to that page is prohibited thereafter. As mentioned above,
The prohibition flag 22 is automatically set by writing a page in the main memory 2.

【0041】ステップSD2において、禁止フラグ22
がセット状態であるときには、そのページへの書き込み
が禁止されていることを示すので、ステップSD6へ進
む。ステップSD6では、そのページへの書き込みが禁
止されているためにページ書き込みが行えなかったこと
を示すエラーコマンドをホスト6に送出し、処理を終了
する。ホスト6は、ページ書き込みコマンドを制御部1
に送出した後、エラーコマンドが返ってきたときには、
ページ書き込みを行うことができなかったと判断するこ
とができる。そのときには、書き込み禁止の解除操作を
行った後に、再びページ書き込みコマンドを送出すれ
ば、書き込みを行うことができる。
In step SD2, the prohibition flag 22
Is set, it indicates that writing to the page is prohibited, and therefore the process proceeds to step SD6. At step SD6, an error command indicating that the page cannot be written because the writing to the page is prohibited is sent to the host 6, and the processing is ended. The host 6 sends the page write command to the control unit 1.
When an error command is returned after sending to
It can be determined that page writing could not be performed. At this time, if the page write command is sent again after the write-inhibit release operation is performed, writing can be performed.

【0042】図8は、図6のステップSC3のバイト書
き込み処理の詳細を示すフローチャートである。ステッ
プSE1では、バイト書き込みのコマンドに従い、コマ
ンドと共にホスト6から供給されるページアドレスが示
すページの先頭バイト21を判定用メモリ3からレジス
タ4に複写記憶する。
FIG. 8 is a flow chart showing details of the byte write process in step SC3 of FIG. In step SE1, the top byte 21 of the page indicated by the page address supplied from the host 6 together with the command is copied and stored in the register 4 from the determination memory 3 in accordance with the byte write command.

【0043】ステップSE2では、レジスタ4に記憶さ
れた先頭バイト21とホスト6からコマンドと共に受け
取った1バイトの書き込みデータを比較する。データが
一致すれば、適正な書き込み禁止解除操作がホスト6か
ら指示されたことを示すので、ステップSE3へ進む。
ステップSE3では、判定用メモリ3に記憶されている
対応するページの禁止フラグ22をリセットし、処理を
終了する。禁止フラグ22がリセットされれば、書き込
み禁止が解除されるので、ホスト6は以後そのページに
書き込みを行うことができる。
In step SE2, the head byte 21 stored in the register 4 and the 1-byte write data received from the host 6 together with the command are compared. If the data match, it indicates that an appropriate write-protection canceling operation has been instructed by the host 6, and the process proceeds to step SE3.
In step SE3, the prohibition flag 22 of the corresponding page stored in the determination memory 3 is reset, and the process ends. When the prohibition flag 22 is reset, the write prohibition is released, and the host 6 can thereafter write to the page.

【0044】ステップSE2において、データが一致し
ないときには、不適正な書き込み禁止解除操作がホスト
6から指示されたことを示すので、ステップSE4へ進
む。ステップSE4では、書き込み禁止を解除できなか
ったことを示すエラーコマンドをホスト6へ送出し、処
理を終了する。
If the data do not match in step SE2, it indicates that an improper write-protection canceling operation has been instructed by the host 6, and the process proceeds to step SE4. At step SE4, an error command indicating that the write protection could not be released is sent to the host 6 and the processing is terminated.

【0045】以上のように、ホスト6は、禁止フラグ2
2の状態に応じてメインメモリ2にページ書き込みを行
うことができる。ページ書き込みを行うと、禁止フラグ
22が自動的にセットされ、そのページは書き込み禁止
になる。これにより、書き込み禁止を指示するための特
別なICピンを増設することなしに、簡便に書き込みを
禁止することができ、書き込んだデータを適切に保護す
ることができる。例えば、ノイズにより書き込みアドレ
スが化けてしまったり、操作ミスで誤ったアドレスを指
定してしまっても、書き換えてはいけない領域に誤って
書き込まれることはない。
As described above, the host 6 uses the prohibition flag 2
The page writing can be performed in the main memory 2 according to the state of No. 2. When a page is written, the prohibition flag 22 is automatically set, and the page is write-protected. As a result, it is possible to easily inhibit the writing without adding a special IC pin for instructing the writing inhibition, and it is possible to appropriately protect the written data. For example, even if the write address is garbled due to noise or the wrong address is specified due to an operation mistake, it will not be erroneously written in the area that should not be rewritten.

【0046】書き込み禁止を解除するには、メインメモ
リ2の対応ページの先頭バイトを読み出し、その先頭バ
イトをそのまま用いて、バイト書き込みを行えばよい。
このような操作を行うように義務付ければ、誤操作によ
り書き込み禁止が解除されることはなく、書き込み禁止
解除の意思をもったときにのみ初めて解除が可能にな
る。
To cancel the write protection, the first byte of the corresponding page of the main memory 2 is read, and the first byte is used as it is for byte writing.
If it is obliged to perform such an operation, the write protection will not be released by an erroneous operation, and the write protection can be released only when the user has the intention to release the write protection.

【0047】ユーザは、既に書き込まれているページデ
ータが消失してしまうことを承知したときのみ、解除操
作を行うことにより、メインメモリ2のデータを有効に
保護することができる。ページ書き込みを行うと、その
ページへの書き込みが禁止されていれば、データ書き込
みは行われず、エラーコマンドがホスト6に返される。
ホスト6は、どうしても書き込みを行いたいときだけ解
除操作をするようにすればよい。
The user can effectively protect the data in the main memory 2 by performing the release operation only when he / she is aware that the page data already written will be lost. When page writing is performed, if writing to the page is prohibited, data writing is not performed and an error command is returned to the host 6.
The host 6 may perform the release operation only when it is absolutely necessary to write.

【0048】なお、ページ書き込みを行えないときは、
必ずしもエラーコマンドを返す必要はない。ホスト6
は、ページ書き込みを行った後に、同じページを読み出
して、書き込みデータと読み出しデータをベリファイす
ることにより、正常に書き込みが行われたか否かを知る
ことができる。
When page writing cannot be performed,
It is not necessary to return the error command. Host 6
After performing page writing, the same page is read and the write data and the read data are verified, so that it is possible to know whether or not the writing is normally performed.

【0049】また、本実施例では、書き込み禁止を解除
する手段として、判定用メモリ3にメインメモリ2の先
頭バイトを記憶させ、先頭バイトを用いてバイト読み出
しおよびバイト書き込みを行う場合について述べたが、
これはページの先頭バイトである必要はなく、最終デー
タでもよく、複数バイトの任意データでもよい。
Further, in this embodiment, as a means for canceling the write protection, the case where the first byte of the main memory 2 is stored in the judgment memory 3 and the first byte is used for the byte reading and the byte writing has been described. ,
This does not have to be the first byte of the page, but may be the final data or arbitrary data of multiple bytes.

【0050】本実施例は、以上の誤書き込み防止手段を
設けても、メインメモリ2への書き込み回数は増加しな
いので、例えばEEPROMであるメインメモリ2の寿
命を縮めることはない。読み出し回数は、増加するが、
読み出し回数はメインメモリ2の寿命に影響しない、以
上実施例に沿って本発明を説明したが、本発明はこれら
に制限されるものではない。例えば、種々の変更、改
良、組み合わせ等が可能なことは当業者に自明であろ
う。
In the present embodiment, even if the above erroneous writing prevention means is provided, the number of writings to the main memory 2 does not increase, so that the life of the main memory 2 which is an EEPROM, for example, is not shortened. The number of readings increases,
Although the number of times of reading does not affect the life of the main memory 2, the present invention has been described with reference to the embodiments, but the present invention is not limited to these. For example, it will be apparent to those skilled in the art that various modifications, improvements, combinations, and the like can be made.

【0051】[0051]

【発明の効果】以上説明したように、本発明によれば、
主記憶媒体の所定のページにデータを書き込むと、自動
的に該ページへの書き込みが禁止されるので、新たな制
御信号線を設けることなく、簡便に書き込みを禁止し、
データを保護することができる。
As described above, according to the present invention,
When data is written to a predetermined page of the main storage medium, writing to the page is automatically prohibited, so that writing is simply prohibited without providing a new control signal line,
Data can be protected.

【0052】また、あるページに記憶されている所定の
一部データを外部から同じページに書き込み指示するこ
とにより該ページへの書き込み禁止を解除することがで
きるので、誤操作等により解除される可能性は低く、デ
ータの保護を確実なものにすることができる。
Further, it is possible to cancel the write prohibition to the page by externally instructing to write the predetermined partial data stored in the page to the same page, so that there is a possibility that it will be canceled by an erroneous operation or the like. Is low and can ensure data protection.

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

【図1】本発明の実施例による誤書き込み防止システム
の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an erroneous write prevention system according to an embodiment of the present invention.

【図2】メインメモリのメモリマップを示す図である。FIG. 2 is a diagram showing a memory map of a main memory.

【図3】判定用メモリのメモリマップを示す図である。FIG. 3 is a diagram showing a memory map of a determination memory.

【図4】制御部が行うメインルーチンの処理を示すフロ
ーチャートである。
FIG. 4 is a flowchart showing processing of a main routine performed by a control unit.

【図5】図4のステップSA3の読み出し処理の詳細を
示すフローチャートである。
FIG. 5 is a flowchart showing details of a read process in step SA3 of FIG.

【図6】図4のステップSA4の書き込み処理の詳細を
示すフローチャートである。
FIG. 6 is a flowchart showing details of the write processing in step SA4 of FIG.

【図7】図6のステップSC2のページ書き込み処理の
詳細を示すフローチャートである。
FIG. 7 is a flowchart showing details of page write processing in step SC2 of FIG.

【図8】図6のステップSC3のバイト書き込み処理の
詳細を示すフローチャートである。
8 is a flowchart showing details of the byte write process in step SC3 of FIG.

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

1 制御部 2 メインメモリ2 3 判定用メモリ 4 レジスタ 5 メモリIC 6 ホスト 10 ページデータ 11,21 先頭バイト 22 書き込み禁止フラグ 1 Control Unit 2 Main Memory 2 3 Judgment Memory 4 Register 5 Memory IC 6 Host 10 Page Data 11, 21 First Byte 22 Write Protect Flag

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 データの最小書き込み単位であるページ
のデータを複数記憶することができる主記憶媒体(2)
と、 前記主記憶媒体の各ページに対応して設けられ、セット
/リセット状態を有し、セット状態が各ページへの書き
込み禁止を示す書き込み禁止フラグ(22)と、 外部から前記主記憶媒体の所定のページへの書き込みが
指示されると、該ページに対応する前記書き込み禁止フ
ラグがリセット状態であるときには、前記主記憶媒体の
対応するページに書き込みを行って該書き込み禁止フラ
グをセット状態にし、書き込み禁止フラグがセット状態
であるときには、前記主記憶媒体の対応するページに書
き込みを行わない書き込み手段(1)とを有するデータ
の誤書き込み防止システム。
1. A main storage medium (2) capable of storing a plurality of page data, which is a minimum data write unit.
A write-prohibition flag (22) provided corresponding to each page of the main storage medium, having a set / reset state, and the set state indicating write-protection to each page; When writing to a predetermined page is instructed, if the write prohibition flag corresponding to the page is in the reset state, writing is performed to the corresponding page of the main storage medium to set the write prohibition flag, An erroneous data write prevention system having a writing means (1) that does not write to the corresponding page of the main storage medium when the write prohibition flag is in the set state.
【請求項2】 データの最小書き込み単位であるページ
のデータを複数記憶することができる記憶媒体(2)
と、 前記主記憶媒体の各ページに対応して設けられ、各ペー
ジの一部のデータを記憶するための判定用記憶媒体
(3)と、 前記主記憶媒体の各ページに対応して設けられ、セット
/リセット状態を有し、セット状態が各ページへの書き
込み禁止を示す書き込み禁止フラグ(22)と、 前記書き込み禁止フラグをセット状態にするための書き
込み禁止手段(1)と、 外部から前記主記憶媒体の所定のページへの書き込みが
指示されると、前記書き込み禁止フラグがリセット状態
であるときには、前記主記憶媒体の対応するページに書
き込みを行い該書き込みを行ったデータの一部を該ペー
ジに対応する前記判定用記憶媒体に書き込み、前記書き
込み禁止フラグがセット状態であるときには、前記主記
憶媒体の対応するページに書き込みを行わない書き込み
手段(1)と、 外部からページの一部書き込みが指示されると、該一部
書き込みデータと前記判定用記憶媒体に記憶されている
データが同じか否かを判断し、同じであるときには対応
するページの前記書き込み禁止フラグをリセット状態に
する書き込み禁止解除手段(1)とを有するデータの誤
書き込み防止システム。
2. A storage medium (2) capable of storing a plurality of page data, which is a minimum data write unit.
And a determination storage medium (3) provided for each page of the main storage medium, for storing a part of the data of each page, and provided for each page of the main storage medium. A write-inhibit flag (22) having a set / reset state, the set-state indicating write-inhibit to each page, and a write-inhibit unit (1) for setting the write-inhibit flag to the set state, When the writing to a predetermined page of the main storage medium is instructed, when the write prohibition flag is in the reset state, the corresponding page of the main storage medium is written and a part of the written data is Write to the determination storage medium corresponding to the page, and when the write-protect flag is set, write to the corresponding page of the main storage medium. When the writing means (1) that does not exist is instructed to write a part of the page from the outside, it is determined whether or not the partially written data and the data stored in the determination storage medium are the same. An erroneous write prevention system for data, which sometimes has a write protect canceling means (1) for setting the write protect flag of a corresponding page to a reset state.
【請求項3】 前記書き込み禁止手段は、前記書き込み
手段が前記記憶媒体の対応するページに書き込みを行う
際に対応するページの前記書き込み禁止フラグをセット
状態にする請求項2記載のデータの誤書き込み防止シス
テム。
3. The erroneous write of data according to claim 2, wherein the write prohibition unit sets the write prohibition flag of a corresponding page to a set state when the write unit writes to a corresponding page of the storage medium. Prevention system.
【請求項4】 データの最小書き込み単位であるページ
のデータを複数記憶することができる記憶媒体へのデー
タ書き込み禁止方法であって、 前記記憶媒体の所定のページへの書き込みを行うと、以
後そのページへの書き込みを禁止する工程を含むデータ
書き込み禁止方法。
4. A method of inhibiting data writing to a storage medium capable of storing a plurality of pages of data, which is the minimum writing unit of data, wherein when a predetermined page of the storage medium is written, A method for inhibiting data writing, including the step of inhibiting writing to a page.
【請求項5】 データの最小書き込み単位であるページ
のデータを複数記憶することができる記憶媒体へのデー
タ書き込み禁止を解除する方法であって、 書き込み禁止を解除したい記憶媒体のページに記憶され
ているデータの一部を同じページに書き込む指示をする
と、該ページへの書き込み禁止を解除する工程を含むデ
ータ書き込み禁止解除方法。
5. A method for canceling the write prohibition of data to a storage medium capable of storing a plurality of page data, which is the minimum write unit of data, which is stored in a page of the storage medium whose write protection is desired to be released. A method for canceling write-protection of data, comprising the step of canceling write-protection to the same page when an instruction to write a part of existing data to the same page is given.
JP5469195A 1995-03-14 1995-03-14 Erroneous write prevention system for data Withdrawn JPH08249237A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5469195A JPH08249237A (en) 1995-03-14 1995-03-14 Erroneous write prevention system for data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5469195A JPH08249237A (en) 1995-03-14 1995-03-14 Erroneous write prevention system for data

Publications (1)

Publication Number Publication Date
JPH08249237A true JPH08249237A (en) 1996-09-27

Family

ID=12977831

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5469195A Withdrawn JPH08249237A (en) 1995-03-14 1995-03-14 Erroneous write prevention system for data

Country Status (1)

Country Link
JP (1) JPH08249237A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008097635A (en) * 1999-02-19 2008-04-24 Mitsubishi Electric Corp Information processing device
JPWO2015063845A1 (en) * 2013-10-28 2017-03-09 富士通株式会社 Data storage device, data storage method, and data storage program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008097635A (en) * 1999-02-19 2008-04-24 Mitsubishi Electric Corp Information processing device
JPWO2015063845A1 (en) * 2013-10-28 2017-03-09 富士通株式会社 Data storage device, data storage method, and data storage program

Similar Documents

Publication Publication Date Title
US5056009A (en) IC memory card incorporating software copy protection
US20050033937A1 (en) Non-volatile data storage system and data storaging method
JP2003187585A (en) Method for detecting partially erased unit in flash device
JP2001014871A (en) Non-volatile semiconductor storage
JP3519954B2 (en) Chip enable signal generation circuit and memory device
JPH04137085A (en) Ic memory card
JP3729638B2 (en) Memory device
US5724544A (en) IC memory card utilizing dual eeproms for image and management data
JP4678083B2 (en) Memory device and memory access restriction method
US5812446A (en) Method and apparatus for the protection of non-volatile memory zones
JP4463378B2 (en) Nonvolatile semiconductor memory device
JP2002015584A (en) Read/protect circuit for non-volatile memory
WO2001061503A1 (en) Nonvolatile memory
JPH08249237A (en) Erroneous write prevention system for data
JP2842442B2 (en) Microcomputer, nonvolatile semiconductor memory device, and method for writing and erasing the same
JPS5894195A (en) One chip microcomputer
JPS58121463A (en) File protecting system
JPH06187520A (en) Ic memory card
JPS6336349A (en) Preventing circuit for memory writing in microprocessor
JP2619671B2 (en) Memory control circuit
JP2798957B2 (en) Portable electronic devices
JPH07281958A (en) Semiconductor disk device with write inhibition function
JP2001135000A (en) Library device
JP2001043140A (en) Memory access control circuit
JPH06103171A (en) Storage

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20020604