JPH11110983A - Controlling method for the number of times of erasing of flash memory and data processing device using it - Google Patents

Controlling method for the number of times of erasing of flash memory and data processing device using it

Info

Publication number
JPH11110983A
JPH11110983A JP27243997A JP27243997A JPH11110983A JP H11110983 A JPH11110983 A JP H11110983A JP 27243997 A JP27243997 A JP 27243997A JP 27243997 A JP27243997 A JP 27243997A JP H11110983 A JPH11110983 A JP H11110983A
Authority
JP
Japan
Prior art keywords
sector
management
flash memory
data
erasures
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.)
Pending
Application number
JP27243997A
Other languages
Japanese (ja)
Inventor
Kazuya Hayashi
和也 林
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP27243997A priority Critical patent/JPH11110983A/en
Publication of JPH11110983A publication Critical patent/JPH11110983A/en
Pending legal-status Critical Current

Links

Landscapes

  • Read Only Memory (AREA)

Abstract

PROBLEM TO BE SOLVED: To realize a controlling method for the number of times of erasing of a flash memory in which a control information region is preserved even when power failure is caused during rewriting data, a control information region can be reduced, and the situation in which a control sector reaches the pre scribed number of times of erasing quickly can be evaded. SOLUTION: When a controlled object data sector is not yet erased, in all data of first to (n) bites of a control sector, $7F is written in a first bite B1 of the control sector in first erasing of an object data sector with $ FF, and a D7 bit is made '0'. D6-D1 bits of the first bite B1 are made '0' every erasing of 2nd to 7th of an object data sector, $00 is written in the first bite B1 in erasing of 8th in an object data sector, and a D0 bit of the first bite B1 is made '0'. If the control sectors are (n) bites in all, $01 is written in (n)th bites Bn in erasing of (8×n-1)th of an object data sector, a D1 bit of (n)th bite Bn is made '0'. $00 is written in (n)th bites Bn in erasing of (8×n)th of an object data sector, a D0 bit of (n)th bite Bn is made '0'.

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 managing the number of erasures of a flash memory having a limited number of erasures.

【0002】[0002]

【従来の技術】フラッシュメモリは、不揮発性メモリで
あり、消去回数に制限があり、特定単位バイト(以降
「セクタ」)毎に消去が行われる。そして、消去される
ことによりセクタ内のデータはビット単位で値がすべて
“1”となり、書き込み動作はビットの値に対し“1”
から“0”、または、“1”から“1”、または、
“0”から“0”が許される。或いは、 消去されるこ
とによりセクタ内のデータはビット単位で値がすべて
“0”となり、書き込み動作はビットの値に対し“0”
から“1”、または、“1”から“1”、または、
“0”から“0”が許される。
2. Description of the Related Art A flash memory is a non-volatile memory, and has a limited number of erasures. Erasing is performed for each specific unit byte (hereinafter "sector"). Then, by erasing, the data in the sector all have a value of “1” in bit units, and the write operation is performed with “1” for the bit value.
To “0” or “1” to “1”, or
"0" to "0" are allowed. Alternatively, the data in the sector becomes all "0" in bit units by being erased, and the write operation is performed with "0" for the bit value.
To “1” or “1” to “1”, or
"0" to "0" are allowed.

【0003】上述したフラッシュメモリを用いたコンピ
ュータシステムにおいて、信頼性を重視したシステムで
はフラッシュメモリの消去回数の管理を行う。従来にお
いては、図6、図7、図8に示すような消去回数の管理
方法をフラッシュメモリについて行っていた。
In a computer system using the above-mentioned flash memory, in a system where importance is placed on reliability, the number of erasures of the flash memory is managed. Conventionally, a method of managing the number of erasures as shown in FIGS. 6, 7, and 8 has been performed on a flash memory.

【0004】図6は、同一セクタA内にデータ領域と管
理情報領域とを混在させる方法を示す図である。この図
6に示した方法においては、セクタAの消去後に管理情
報領域にインクリメントした消去回数情報を記録する。
FIG. 6 is a diagram showing a method of mixing a data area and a management information area in the same sector A. In the method shown in FIG. 6, after erasing the sector A, the incremented erasure count information is recorded in the management information area.

【0005】図7は、1つのデータセクタAに1つの管
理セクタBを付加する方法を示す図である。データセク
タAはデータ領域と管理情報領域とを有し、セクタBは
管理情報領域のみを有する。セクタAの消去を行う場
合、まず、セクタBを消去し、セクタBの管理情報領域
にインクリメントした消去回数情報を記録する。その
後、セクタAの消去後に管理情報領域にセクタBに記録
した消去回数情報を記録する。
FIG. 7 is a diagram showing a method of adding one management sector B to one data sector A. The data sector A has a data area and a management information area, and the sector B has only a management information area. When erasing sector A, first, sector B is erased and incremented erasure count information is recorded in the management information area of sector B. Then, after the erasure of the sector A, the erasure count information recorded in the sector B is recorded in the management information area.

【0006】図8は、複数のデータセクタに1つの管理
セクタを付加する方法を示す図である。セクタA、セク
タB、セクタCは、それぞれデータ領域と管理情報領域
とを有し、セクタDは、セクタA、セクタB、セクタC
の管理情報領域、および、セクタDの管理情報領域を有
する。
FIG. 8 is a diagram showing a method of adding one management sector to a plurality of data sectors. Sector A, sector B, and sector C each have a data area and a management information area, and sector D includes sector A, sector B, and sector C.
And a management information area of sector D.

【0007】図8において、セクタAの消去を行う場
合、まず、セクタDを消去し、セクタDの管理情報領域
Aにインクリメントした消去回数情報を記録する。そし
て、セクタDの管理情報領域Dにインクリメントした消
去回数情報を記録する。
In FIG. 8, when erasing sector A, first, sector D is erased and incremented erasure count information is recorded in management information area A of sector D. Then, the incremented erase count information is recorded in the management information area D of the sector D.

【0008】その後、セクタAの消去後に管理情報領域
にセクタDに記録した管理情報領域Aの消去回数情報を
記録する。この方法では、セクタDの消去後、または、
管理情報領域にインクリメントした消去回数情報を記録
する前に停電が起こり消去回数情報を記録できなかった
場合、および、セクタAの消去後、または、管理情報領
域にインクリメントした消去回数情報を記録する前に停
電が起こり消去回数情報を記録できなかった場合でも、
セクタA、セクタDの消去回数情報は保存される。な
お、図8に示した方法であれば、データ領域に対する管
理情報領域が大きくなり過ぎるという問題も緩和され
る。
After that, after erasing the sector A, the erasure count information of the management information area A recorded in the sector D is recorded in the management information area. In this method, after erasing sector D, or
A power failure occurs before recording the incremented erasure count information in the management information area, and the erasure count information cannot be recorded. Also, after erasing the sector A, or before recording the incremented erasure count information in the management information area. Even if a power failure occurs and the erase count information cannot be recorded,
The information on the number of times of erasure of the sectors A and D is stored. The method shown in FIG. 8 also alleviates the problem that the management information area for the data area becomes too large.

【0009】この他に、図7において、セクタAに管理
情報領域を形成せず、セクタBのみに管理情報領域を形
成する方式や、図8においてセクタA、セクタB、セク
タCの管理情報領域を形成せず、セクタDのみに管理情
報領域を形成する方式等がある。
[0009] In addition, in FIG. 7, a management information area is formed only in sector B without forming a management information area in sector A, and in FIG. 8, a management information area of sector A, sector B, and sector C is formed. Is not formed, and a management information area is formed only in the sector D.

【0010】[0010]

【発明が解決しようとする課題】しかしながら、上述し
た、図6、図7、図8に示すような消去回数の管理方法
には以下の問題がある。図6に示した方法は、同一セク
タ内にデータ領域と管理情報領域とを混在させる方法で
あり、セクタAの消去後に管理情報領域にインクリメン
トした消去回数情報を記録する。この方法だと、セクタ
Aの消去後、または、管理情報領域にインクリメントし
た消去回数情報を記録する前に停電が起こり消去回数情
報を記録できなかった場合、セクタAに関する消去回数
が不明になってしまうという問題がある。
However, the above-described methods of managing the number of times of erasure as shown in FIGS. 6, 7, and 8 have the following problems. The method shown in FIG. 6 is a method in which a data area and a management information area are mixed in the same sector. After the sector A is erased, incremented erasure count information is recorded in the management information area. According to this method, if a power failure occurs and the erase count information cannot be recorded after erasing the sector A or before recording the incremented erase count information in the management information area, the erase count for the sector A becomes unknown. Problem.

【0011】また、図7に示した方法は、1つのデータ
セクタに1つの管理セクタを付加する方法であり、セク
タAはデータ領域と管理情報領域を有し、セクタBは管
理情報領域のみを有する。セクタAの消去を行う場合、
まず、セクタBを消去し、セクタBの管理情報領域にイ
ンクリメントした消去回数情報を記録する。その後、セ
クタAの消去後に管理情報領域にセクタBに記録した消
去回数情報を記録する。
The method shown in FIG. 7 is a method of adding one management sector to one data sector. Sector A has a data area and a management information area, and sector B has only a management information area. Have. When erasing sector A,
First, the sector B is erased, and the incremented erase count information is recorded in the management information area of the sector B. Then, after the erasure of the sector A, the erasure count information recorded in the sector B is recorded in the management information area.

【0012】この方法だと、セクタBの消去後、また
は、管理情報領域にインクリメントした消去回数情報を
記録する前に停電が起こり消去回数情報を記録できなか
った場合、および、セクタAの消去後、または、管理情
報領域にインクリメントした消去回数情報を記録する前
に停電が起こり消去回数情報を記録できなかった場合で
も、セクタA、セクタBの消去回数情報は保存される
が、データ領域に対する管理情報領域が大きくなり過ぎ
るという問題がある。
According to this method, after a power failure occurs and the erase count information cannot be recorded after erasing the sector B or before recording the incremented erase count information in the management information area, and after erasing the sector A, Alternatively, even if a power failure occurs and the erase count information cannot be recorded before the incremented erase count information is recorded in the management information area, the erase count information of the sector A and the sector B is stored, but the management of the data area is performed. There is a problem that the information area becomes too large.

【0013】また、図8に示した方法は、複数のデータ
セクタに1つの管理セクタを付加する方法であり、セク
タA、セクタB、セクタCはデータ領域と管理情報領域
とを有し、セクタDはセクタA、セクタB、セクタCの
管理情報領域及びセクタDの管理情報領域を有する。
The method shown in FIG. 8 is a method of adding one management sector to a plurality of data sectors. Sectors A, B, and C have a data area and a management information area. D has a management information area of sector A, sector B and sector C and a management information area of sector D.

【0014】セクタAの消去を行う場合、まず、セクタ
Dを消去し、セクタDの管理情報領域Aにインクリメン
トした消去回数情報を記録し、セクタDの管理情報領域
Dにインクリメントした消去回数情報を記録する。その
後、セクタAの消去後に管理情報領域にセクタDに記録
した管理情報領域Aの消去回数情報を記録する。
When erasing sector A, first, sector D is erased, incremented erase count information is recorded in management information area A of sector D, and incremented erase count information is written in management information area D of sector D. Record. After that, after erasing the sector A, the erasure count information of the management information area A recorded in the sector D is recorded in the management information area.

【0015】この方法では、セクタDの消去後、また
は、管理情報領域にインクリメントした消去回数情報を
記録する前に停電が起こり消去回数情報を記録できなか
った場合、および、セクタAの消去後、または、管理情
報領域にインクリメントした消去回数情報を記録する前
に停電が起こり消去回数情報を記録できなかった場合で
も、セクタA、セクタDの消去回数情報は保存される。
なお、データ領域に対する管理情報領域が大きくなり過
ぎるという問題も緩和される。
In this method, after a power failure occurs and the erase count information cannot be recorded after erasing the sector D or before recording the incremented erase count information in the management information area, and after erasing the sector A, Alternatively, even if a power failure occurs before the incremented erase count information is recorded in the management information area and the erase count information cannot be recorded, the erase count information of the sectors A and D is stored.
Note that the problem that the management information area for the data area becomes too large is also alleviated.

【0016】しかし、この方法をとると、セクタA、セ
クタB、セクタCに比べ、セクタDは早く規定消去回数
に達してしまうという問題がある。
However, this method has a problem that the sector D reaches the specified number of times of erasure earlier than the sectors A, B and C.

【0017】また、図7において、セクタAに管理情報
領域を形成せず、セクタBのみに管理情報領域を有する
方式、図8においてセクタA、セクタB、セクタCに管
理情報を形成せず、セクタDのみに管理情報を持つ方式
等については、図6、図7、図8に示した例で問題とな
ったデータ書き換え中の停電発生時に管理情報領域が保
存されないという問題や、データ領域に対して管理情報
領域が巨大化してしまうという問題、データセクタに比
べ管理セクタが早く規定消去回数に達してしまうという
問題が同様に発生する。
In FIG. 7, a management information area is not formed in sector A and a management information area is formed only in sector B. In FIG. 8, management information is not formed in sector A, sector B and sector C. As for the system having management information only in the sector D, the problem shown in FIGS. 6, 7 and 8 is that the management information area is not saved when a power failure occurs during data rewriting. On the other hand, the problem that the management information area is enlarged and the problem that the management sector reaches the specified number of times of erasure earlier than the data sector similarly occur.

【0018】以上のように従来方式では、データ書き換
え中の停電発生時に管理情報領域が保存されないという
問題や、データ領域に対して管理情報領域が巨大化して
しまう問題、データセクタに比べ管理セクタが早く規定
消去回数に達してしまうという問題があった。
As described above, in the conventional method, the problem that the management information area is not preserved when a power failure occurs during data rewriting, the problem that the management information area becomes large relative to the data area, and that the management sector is smaller than the data sector. There has been a problem that the specified number of erasures is reached quickly.

【0019】本発明の目的は、データ書き換え中の停電
発生時でも管理情報領域が保存され、データ領域に対し
て管理情報領域を縮小することができ、データセクタに
比べ管理セクタが早く規定消去回数に達してしまうとい
う事態を回避可能なフラッシュメモリの消去回数管理方
法及びそれを用いたデータ処理装置を実現することであ
る。
An object of the present invention is to save the management information area even when a power failure occurs during data rewriting, to reduce the management information area with respect to the data area, and to reduce the number of erasures by the management sector faster than the data sector. It is an object of the present invention to realize a flash memory erasure count management method and a data processing device using the same, which can avoid the situation where the number of flash memory reaches the limit.

【0020】[0020]

【課題を解決するための手段】[Means for Solving the Problems]

(1)上記目的を達成するため、本発明は、次のように
構成される。すなわち、消去回数に制限があり、特定単
位バイトであるセクタ毎に消去を行い、消去されること
によりセクタ内のデータはビット単位で値がすべて
“1”になり、書き込み動作はビットの値に対し“1”
から“0”、“1”から“1”、“0”から“0”が許
される不揮発性メモリであるフラッシュメモリの消去回
数管理方法において、複数のセクタに対して、単一のセ
クタを管理セクタとして割り当て、この管理セクタを、
管理する複数のセクタのそれぞれに対応した領域に分割
し、管理対象セクタが消去される毎に、管理セクタ内の
上記管理対象セクタに対応する領域の複数バイトの中の
連続するビットに順次“0”を書き込んで消去回数をカ
ウントしていくことにより、消去回数に制限があるフラ
ッシュメモリの寿命を管理する。
(1) In order to achieve the above object, the present invention is configured as follows. That is, the number of erasures is limited, and erasing is performed for each sector which is a specific unit byte. By erasing, all the data in the sector are set to “1” in bit units, and the writing operation is performed in accordance with the bit value. "1" for
In the method of managing the number of times of erasing of a flash memory which is a nonvolatile memory that allows “0” to “0”, “1” to “1”, and “0” to “0”, a single sector is managed for a plurality of sectors. Assigned as a sector, this management sector,
Each of the plurality of sectors to be managed is divided into areas respectively corresponding to the plurality of sectors to be managed, and each time a management target sector is erased, “0” is sequentially set to consecutive bits in a plurality of bytes of the area corresponding to the management target sector in the management sector. By writing "" and counting the number of erasures, the life of the flash memory having a limited number of erasures is managed.

【0021】(2)また、消去回数に制限があり、特定
単位バイトであるセクタ毎に消去を行い、消去されるこ
とによりセクタ内のデータはビット単位で値がすべて
“0”になり、書き込み動作はビットの値に対し“0”
から“1”、“1”から“1”、“0”から“0”が許
される不揮発性メモリであるフラッシュメモリの消去回
数管理方法において、複数のセクタに対して、単一のセ
クタを管理セクタとして割り当て、この管理セクタを、
管理する複数のセクタのそれぞれに対応した領域に分割
し、管理対象セクタが消去される毎に、管理セクタ内の
上記管理対象セクタに対応する領域の複数バイトの中の
連続するビットに順次“0”を書き込んで消去回数をカ
ウントしていくことにより、消去回数に制限があるフラ
ッシュメモリの寿命を管理する。
(2) Further, the number of erasures is limited, and erasing is performed for each sector which is a specific unit byte. By erasing, the data in the sector becomes all "0" in bit units, and the data is written. Operation is “0” for the bit value
In the method of managing the number of erasures of a flash memory which is a non-volatile memory which allows “1” to “1”, “1” to “1”, and “0” to “0”, a single sector is managed for a plurality of sectors. Assigned as a sector, this management sector,
Each of the plurality of sectors to be managed is divided into areas respectively corresponding to the plurality of sectors to be managed, and each time a management target sector is erased, “0” is sequentially set to consecutive bits in a plurality of bytes of the area corresponding to the management target sector in the management sector. By writing "" and counting the number of erasures, the life of the flash memory having a limited number of erasures is managed.

【0022】(3)好ましくは、上記(1)又は(2)
において、複数のセクタの集まりであるクラスタに対し
て、上記管理セクタを1つ割り当て、この管理セクタ内
に設けられた消去回数を管理するセクタの個数分の消去
回数カウンタの特定のアドレスを定期的に読み出し、そ
のアドレスにおけるデータを所定の特定データと比較
し、消去回数が規定消去回数に達したかどうかを判断す
ることにより、消去回数に制限があるフラッシュメモリ
の寿命を管理する。
(3) Preferably, the above (1) or (2)
In the above, one management sector is allocated to a cluster which is a group of a plurality of sectors, and a specific address of an erasure frequency counter for the number of sectors for managing the number of erasures provided in the management sector is periodically assigned. Then, the data at the address is compared with predetermined specific data, and it is determined whether or not the number of erasures has reached a specified number of erasures.

【0023】(4)また、好ましくは、上記(3)にお
いて、上記クラスタの状態を示すクラスタ情報エリアを
備え、このクラスタ情報エリアにクラスタ内の各セクタ
の消去情報と、クラスタ全体に関する情報を記録してお
くことにより、クラスタ情報エリアの読み出し動作のみ
によりクラスタ内の情報を取得する。
(4) Preferably, in the above (3), a cluster information area indicating the state of the cluster is provided, and erase information of each sector in the cluster and information on the entire cluster are recorded in the cluster information area. By doing so, the information in the cluster is obtained only by the read operation of the cluster information area.

【0024】(5)また、好ましくは、上記(1)、
(2)又は(3)において、管理セクタの特定のアドレ
スに特定のデータパターンを書込んでおくことにより、
その特定データパターンが書き換えられたことを検出す
ることにより、上記管理セクタが初期化されたことを検
出する。
(5) Preferably, the above (1),
In (2) or (3), by writing a specific data pattern at a specific address of the management sector,
By detecting that the specific data pattern has been rewritten, it is detected that the management sector has been initialized.

【0025】(6)また、MPUと、主記憶手段と、消
去回数に制限があり、特定単位バイトであるセクタ毎に
消去を行い、消去されることによりセクタ内のデータは
ビット単位で値がすべて“1”になり、書き込み動作は
ビットの値に対し“1”から“0”、“1”から
“1”、“0”から“0”が許される不揮発性メモリで
あるフラッシュメモリとを有するデータ処理装置におい
て、上記フラッシュメモリは、上記複数のセクタに対し
て、割り当てられる単一のセクタである管理セクタを有
し、この管理セクタは、管理する複数のセクタのそれぞ
れに対応した領域に分割し、管理対象セクタが消去され
る毎に、管理セクタ内の上記管理対象セクタに対応する
領域の複数バイトの中の連続するビットに順次“0”を
書き込んで消去回数をカウントしていくことにより、消
去回数に制限があるフラッシュメモリの寿命を管理す
る。
(6) The MPU, the main storage means, and the number of erasures are limited, and erasing is performed for each sector, which is a specific unit byte. All become "1", and the write operation is performed on a flash memory, which is a nonvolatile memory that allows "1" to "0", "1" to "1", and "0" to "0" for bit values. In the data processing device, the flash memory has a management sector which is a single sector allocated to the plurality of sectors, and the management sector is located in an area corresponding to each of the plurality of sectors to be managed. Each time a sector to be managed is erased, “0” is sequentially written to consecutive bits in a plurality of bytes of an area corresponding to the sector to be managed in the managed sector to control the number of erases. By going to cement, to manage the life of the flash memory with limited number of erasures.

【0026】(7)また、MPUと、主記憶手段と、消
去回数に制限があり、特定単位バイトであるセクタ毎に
消去を行い、消去されることによりセクタ内のデータは
ビット単位で値がすべて“0”になり、書き込み動作は
ビットの値に対し“0”から“1”、“1”から
“1”、“0”から“0”が許される不揮発性メモリで
あるフラッシュメモリとを有するデータ処理装置におい
て、上記フラッシュメモリは、上記複数のセクタに対し
て、割り当てられる単一のセクタである管理セクタを有
し、この管理セクタは、管理する複数のセクタのそれぞ
れに対応した領域に分割し、管理対象セクタが消去され
る毎に、管理セクタ内の上記管理対象セクタに対応する
領域の複数バイトの中の連続するビットに順次“0”を
書き込んで消去回数をカウントしていくことにより、消
去回数に制限があるフラッシュメモリの寿命を管理す
る。
(7) The MPU, the main storage means, and the number of erasures are limited, and erasure is performed for each sector which is a specific unit byte. All become "0", and the write operation is performed on a flash memory, which is a nonvolatile memory that allows "0" to "1", "1" to "1", and "0" to "0" for bit values. In the data processing device, the flash memory has a management sector which is a single sector allocated to the plurality of sectors, and the management sector is located in an area corresponding to each of the plurality of sectors to be managed. Each time a sector to be managed is erased, “0” is sequentially written to consecutive bits in a plurality of bytes of an area corresponding to the sector to be managed in the managed sector to control the number of erases. By going to cement, to manage the life of the flash memory with limited number of erasures.

【0027】(8)好ましくは、上記(6)又は(7)
において、上記フラッシュメモリは、複数のセクタの集
まりであるクラスタに対して、上記管理セクタを1つ割
り当て、この管理セクタ内に消去回数を管理するセクタ
の個数分の消去回数カウンタを有し、この消去カウンタ
の特定のアドレスを定期的に読み出し、そのアドレスに
おけるデータを所定の特定データと比較し、消去回数が
規定消去回数に達したかどうかを判断することにより、
消去回数に制限があるフラッシュメモリの寿命を管理す
る。
(8) Preferably, the above (6) or (7)
, The flash memory has one management sector assigned to a cluster which is a group of a plurality of sectors, and has a number of erase counters equal to the number of sectors for managing the number of erases in the management sector. By periodically reading a specific address of the erase counter, comparing data at that address with predetermined specific data, and determining whether the number of erases has reached a specified number of erases,
Manages the life of a flash memory with a limited number of erases.

【0028】(9)また、好ましくは、上記(8)にお
いて、上記フラッシュメモリは、上記クラスタの状態を
示すクラスタ情報エリアを備え、このクラスタ情報エリ
アにクラスタ内の各セクタの消去情報と、クラスタ全体
に関する情報を記録しておくことにより、クラスタ情報
エリアの読み出し動作のみによりクラスタ内の情報を取
得する。
(9) Preferably, in the above (8), the flash memory includes a cluster information area indicating a state of the cluster, and the cluster information area includes erase information of each sector in the cluster, By recording information on the whole, information in the cluster is obtained only by the read operation of the cluster information area.

【0029】(10)また、好ましくは、上記(6)、
(7)又は(8)において、管理セクタの特定のアドレ
スに特定のデータパターンを書込んでおくことにより、
その特定データパターンが書き換えられたことを検出す
ることにより、上記管理セクタが初期化されたことを検
出する。
(10) Preferably, the above (6),
In (7) or (8), by writing a specific data pattern at a specific address of the management sector,
By detecting that the specific data pattern has been rewritten, it is detected that the management sector has been initialized.

【0030】本発明のフラッシュメモリの消去回数管理
方法及びそれを用いたデータ処理装置では、フラッシュ
メモリの書き込み動作がビットの値に対し“1”から
“0”、または、“1”から“1”、または、“0”か
ら“0”が可能であるということに着目し、管理セクタ
内の管理対象セクタに割り当てた複数バイトの中の最下
位バイトから最上位バイトへ、バイトデータ内では最下
位ビット(以降「LSB」)から最上位ビット(以降
「MSB」)、または、MSBからLSBに向かって管
理対象セクタの消去に対し“0”が書き込まれている次
のビットに“0”を書き込んで消去回数をカウントして
いく。
In the flash memory erase number management method and the data processing apparatus using the same according to the present invention, the write operation of the flash memory is performed by changing the bit value from "1" to "0" or from "1" to "1". Or from “0” to “0” is possible, and from the least significant byte to the most significant byte in a plurality of bytes allocated to the management target sector in the management sector, and from the least significant byte in the byte data. From the lower bit (hereinafter “LSB”) to the most significant bit (hereinafter “MSB”), or “0” to the next bit where “0” is written from the MSB to the LSB for erasure of the management target sector Writing and erasing are counted.

【0031】これにより、データ書き換え中の停電発生
時でも管理情報領域が保存され、データ領域に対する管
理情報領域を最少にし、かつ、データセクタに比べ管理
セクタが早く規定消去回数に達してしまうことのないフ
ラッシュメモリの消去回数管理方法の実現が可能とな
る。
As a result, even when a power failure occurs during data rewriting, the management information area is preserved, the management information area for the data area is minimized, and the management sector reaches the specified erase count earlier than the data sector. It is possible to implement a flash memory erasure count management method that does not have any.

【0032】[0032]

【発明の実施の形態】次に、本発明の実施形態について
添付図面を参照して説明する。図1は、本発明の一実施
形態であるフラッシュメモリの消去回数管理方法を示す
図である。この図1は、フラッシュメモリ内の各セクタ
(特定単位バイト)は、通常のデータを格納するデータ
セクタと、複数のデータセクタの消去回数を管理する1
つの管理セクタとに分けられており、その場合における
消去回数増加による管理セクタ内データの変化を示した
ものである。
Next, embodiments of the present invention will be described with reference to the accompanying drawings. FIG. 1 is a diagram showing a flash memory erasure count management method according to an embodiment of the present invention. In FIG. 1, each sector (specific unit byte) in the flash memory manages a data sector for storing normal data and the number of erases of a plurality of data sectors.
It is divided into one management sector, and shows a change in data in the management sector due to an increase in the number of erasures in that case.

【0033】また、管理セクタは、管理する複数のデー
タセクタのそれぞれに対応した領域、つまり、第1バイ
トB1〜第nバイトBnに分割されている。このフラッ
シュメモリは、消去されることによりセクタ内1のデー
タはビット単位で値がすべて“1”になり、書き込み動
作はビットの値に対し“1”から“0”、または、
“1”から“1”、または、“0”から“0”が許され
るものである。
The management sector is divided into areas corresponding to a plurality of data sectors to be managed, ie, a first byte B1 to an n-th byte Bn. In this flash memory, the value of all the data in sector 1 is changed to "1" in bit units by erasing, and the writing operation is performed by changing the bit value from "1" to "0" or
"1" to "1" or "0" to "0" are permitted.

【0034】消去回数管理開始後、管理対象のデータセ
クタの消去が1度もないときは、管理セクタの第1バイ
トから第nバイトまでのデータは、すべて$FFであ
る。管理対象のデータセクタに1度目の消去を行った場
合、管理セクタの第1バイトB1のD7ビットを“0”
にするため、第1バイトB1に$7Fを書き込む。
If the data sector to be managed has never been erased after the start of the management of the number of erasures, the data from the first byte to the n-th byte of the management sector are all $ FF. When the first erasure is performed on the data sector to be managed, the D7 bit of the first byte B1 of the management sector is set to “0”.
$ 7F is written to the first byte B1.

【0035】次に、管理対象のデータセクタに2度目の
消去を行った場合、管理セクタの第1バイトB1のD6
ビットを“0”にするため、第1バイトB1に$3Fを
書き込む。管理対象のデータセクタに3度目〜7度目の
消去を行う毎に、管理セクタの第1バイトB1のD5〜
D1ビットを“0”とする。そして、管理対象のデータ
セクタに8度目の消去を行った場合、管理セクタの第1
バイトB1のD0ビットを“0”にするため第1バイト
B1に$00を書き込む。
Next, when the data sector to be managed is erased for the second time, D6 of the first byte B1 of the management sector is deleted.
To set the bit to “0”, $ 3F is written to the first byte B1. Every time the third to seventh erasure is performed on the data sector to be managed, D5 to D5 of the first byte B1 of the management sector are used.
The D1 bit is set to “0”. When the data sector to be managed is erased for the eighth time, the first sector of the management sector is deleted.
$ 00 is written to the first byte B1 to set the D0 bit of the byte B1 to "0".

【0036】次に、管理対象のデータセクタに9度目の
消去を行った場合、管理セクタの第2バイトB2のD7
ビットを“0”にするため第2バイトB2に$7Fを書
き込む。
Next, when the data sector to be managed is erased for the ninth time, D7 of the second byte B2 of the management sector is deleted.
$ 7F is written to the second byte B2 to set the bit to "0".

【0037】そして、管理セクタが全部でnバイトであ
れば、管理対象のデータセクタに(8×n−1)度目の
消去を行った場合、管理セクタの第nバイトBnのD1
ビットを“0”にするため第nバイトBnに$01を書
き込む。また、管理対象のデータセクタに8×n度目の
消去を行った場合、管理セクタの第nバイトBnのD0
ビットを“0”にするため第nバイトBnに$00を書
き込む。このように、管理対象のデータセクタの消去が
行われる毎に管理セクタ内のデータの“0”を増やす方
法でカウントする。
If the management sector is n bytes in total, and the (8 × n-1) -th erasure is performed on the data sector to be managed, the D1 of the nth byte Bn of the management sector is obtained.
$ 01 is written to the n-th byte Bn to set the bit to "0". When the data sector to be managed is erased for the 8 × n times, the data sector D0 of the n-th byte Bn of the management sector is erased.
$ 00 is written to the n-th byte Bn to set the bit to "0". In this way, every time the data sector to be managed is erased, the data sector is counted by a method of increasing “0” of the data in the management sector.

【0038】つまり、管理セクタ内の管理対象セクタに
割り当てた複数バイトの中の最下位バイトから最上位バ
イトへ、バイトデータ内では最下位ビット(LSB)か
ら最上位ビット(MSB)、または、MSBからLSB
に向かって管理対象セクタの消去に対し“0”が書き込
まれている次のビットに“0”を書き込んで消去回数を
カウントしていく。
That is, from the least significant byte to the most significant byte in the plurality of bytes allocated to the management target sector in the management sector, and from the least significant bit (LSB) to the most significant bit (MSB) or MSB in the byte data. From LSB
Then, “0” is written to the next bit in which “0” is written for erasure of the management target sector, and the number of erasures is counted.

【0039】これにより、データ書き換え中の停電発生
時でも管理情報領域が保存され、データ領域に対して管
理情報領域を縮小することができ、データセクタに比べ
管理セクタが早く規定消去回数に達してしまうという事
態を回避可能なフラッシュメモリの消去回数管理方法を
実現することができる。
As a result, even when a power failure occurs during data rewriting, the management information area is preserved, the management information area can be reduced with respect to the data area, and the management sector reaches the specified erase count earlier than the data sector. Thus, it is possible to realize a method of managing the number of times of erasing of the flash memory, which can avoid the situation of being erased.

【0040】つまり、本発明の一実施形態によれば、管
理対象セクタが消去される毎に、管理セクタ内の管理対
象セクタに対応する領域の複数バイトの中の連続するビ
ットに順次“0”を書き込んで消去回数をカウントす
る。管理セクタでのデータ更新は1バイトのデータ書き
込みであり、従来のように管理セクタでのデータ更新に
管理セクタの消去動作が必要ない。したがって、停電が
起こり消去回数情報を記録できずデータセクタに関する
消去回数が不明になってしまうという問題は発生しな
い。
That is, according to the embodiment of the present invention, every time the management target sector is erased, “0” is sequentially set to consecutive bits in a plurality of bytes of the area corresponding to the management target sector in the management sector. Is written and the number of erases is counted. The data update in the management sector is 1-byte data write, and the data update in the management sector does not require the erase operation of the management sector as in the related art. Therefore, there is no problem that the power failure occurs and the erase count information cannot be recorded and the erase count for the data sector becomes unknown.

【0041】また、管理セクタは複数のデータセクタの
管理情報をもつことが可能であるため、データ領域に対
する管理情報領域が大きくなり過ぎるという問題も発生
しない。また、管理セクタは消去動作を必要としないた
め、管理セクタがデータセクタより早く規定消去回数に
達してしまうという問題も発生しない。
Further, since the management sector can have management information of a plurality of data sectors, the problem that the management information area for the data area becomes too large does not occur. Further, since the management sector does not require an erasing operation, there is no problem that the management sector reaches the specified number of times of erasure earlier than the data sector.

【0042】図2は、本発明を、32セクタ、16Mビ
ットのデータ容量をもつフラッシュメモリに適用した場
合の構成を示したものである。図2において、1セクタ
当たりのデータ容量は64kバイトであり、10万回が
規定消去回数とする。セクタSA0からセクタSA6
(クラスタ)を命令コードやデータの格納を行うデータ
セクタとし、セクタSA7を、図1に示した、データセ
クタの消去回数等の管理情報を格納する管理セクタとす
る。
FIG. 2 shows a configuration in which the present invention is applied to a flash memory having a data capacity of 32 sectors and 16 M bits. In FIG. 2, the data capacity per sector is 64 Kbytes, and 100,000 times is the specified number of erasures. Sectors SA0 to SA6
(Cluster) is a data sector for storing instruction codes and data, and sector SA7 is a management sector for storing management information such as the number of data sector erasures shown in FIG.

【0043】同様に、セクタSA8からセクタSA14
(クラスタ)を命令コードやデータの格納を行うデータ
セクタとし、セクタSA15を、上記データセクタの消
去回数等の管理情報を格納する管理セクタとする。
Similarly, sectors SA8 to SA14
(Cluster) is a data sector for storing instruction codes and data, and sector SA15 is a management sector for storing management information such as the number of times of erasure of the data sector.

【0044】また、セクタSA16からセクタSA22
(クラスタ)を命令コードやデータの格納を行うデータ
セクタとし、セクタSA23を、上記データセクタの消
去回数等の管理情報を格納する管理セクタとする。さら
に、セクタSA24からセクタSA30(クラスタ)を
命令コードやデータの格納を行うデータセクタとし、セ
クタSA31を、上記データセクタの消去回数等の管理
情報を格納する管理セクタとする。
The sectors SA16 to SA22
(Cluster) is a data sector for storing instruction codes and data, and sector SA23 is a management sector for storing management information such as the number of times the data sector has been erased. Further, the sectors SA24 to SA30 (cluster) are data sectors for storing instruction codes and data, and the sector SA31 is a management sector for storing management information such as the number of erasures of the data sector.

【0045】図3は、図2に示した管理セクタSA7内
の構成を示したものであり、相対アドレス$0000か
ら$1FFFのSA0消去回数情報エリア(消去回数カ
ウンタ)は、データセクタSA0の消去回数情報を格納
する。同様に、相対アドレス$2000から$3FFF
のSA1消去回数情報エリアは、データセクタSA1の
消去回数情報を格納する。
FIG. 3 shows the configuration of the management sector SA7 shown in FIG. 2. The SA0 erase count information area (erase count counter) of the relative address $ 0000 to $ 1FFF contains the erase of the data sector SA0. Stores frequency information. Similarly, relative address $ 2000 to $ 3FFFF
The SA1 erase count information area stores the erase count information of the data sector SA1.

【0046】また、相対アドレス$4000から$5F
FFのSA2消去回数情報エリアは、データセクタSA
2の消去回数情報を格納する。そして、相対アドレス$
6000から$7FFFのSA3消去回数情報エリア
は、データセクタSA3の消去回数情報を格納する。ま
た、相対アドレス$8000から$9FFFのSA4消
去回数情報エリアは、データセクタSA4の消去回数情
報を格納する。そして、相対アドレス$A000から$
BFFFのSA5消去回数情報エリアは、データセクタ
SA5の消去回数情報を格納する。
Also, the relative address $ 4000 to $ 5F
The FF SA2 erase count information area includes the data sector SA.
2 is stored. And the relative address $
The SA3 erase count information area of 6000 to $ 7FFF stores the erase count information of the data sector SA3. The SA4 erase count information area of the relative address $ 8000 to $ 9FFF stores the erase count information of the data sector SA4. Then, relative address {from A000}
The SA5 erase count information area of the BFFF stores the erase count information of the data sector SA5.

【0047】また、相対アドレス$C000から$DF
FFのSA6消去回数情報エリアは、データセクタSA
6の消去回数情報を格納する。相対アドレス$E000
から$FFFFの空きエリアSAE(クラスタ情報エリ
ア)は、特定のデータパターンを書き込んでおき、この
管理セクタが消去されていないことを示す。つまり、こ
の管理セクタが消去された場合には、先に書き込まれた
特定のデータパターンでは無くなるので、上記特定デー
タパターンが書き込まれているか否かにより、この管理
セクタが消去されたか否かを判断することができる。そ
れぞれの消去回数情報エリアは、それぞれ8kバイトの
容量をもち、図1に示す消去回数管理方法により消去回
数を管理する。
Further, the relative address $ C000 to $ DF
The FF SA6 erase count information area includes the data sector SA.
6 is stored. Relative address $ E000
The empty area SAE (cluster information area) from $ FFFF to #FFFF has a specific data pattern written therein, and indicates that this management sector has not been erased. In other words, when this management sector is erased, it is no longer the specific data pattern previously written, so whether or not this management sector has been erased is determined by whether or not the specific data pattern has been written. can do. Each erase count information area has a capacity of 8 kbytes, and manages the erase count by the erase count management method shown in FIG.

【0048】図1に示す消去回数管理方法では、8kバ
イトの容量があると、8×1024×8=65536回
のカウントが可能となる。フラッシュメモリのデバイス
で規定されている消去回数が10万回であるが、信頼性
確保のためマージンを持たせ消去回数を5万回とするな
ら、65536回は、十分なカウント量である。
In the method of managing the number of erasures shown in FIG. 1, if there is a capacity of 8 kbytes, counting can be performed 8 × 1024 × 8 = 65536 times. The number of erasures specified in the flash memory device is 100,000. However, if the number of erasures is 50,000 by providing a margin for securing reliability, 65536 is a sufficient count.

【0049】このように、図1に示した消去回数管理方
法を、図2、図3に示すフラッシュメモリの使用構成に
適用することにより、フラッシュメモリの容量の87.
5%をデータエリアにすることが可能となる(例えば、
データセクタSA0〜SA6に対して、一つの管理セク
タSA7となっているので、(SA0〜7)/(SA0
〜SA8)=0.875)。したがって、図7に示した
従来例のように、1つのデータセクタに1つの管理セク
タをもつ構成(フラッシュメモリ容量の50%がデータ
セクタ)に比べ、管理セクタの容量を低減することが可
能であり、コストが安いシステムの構築が可能となる。
As described above, the method of managing the number of times of erasing shown in FIG. 1 is applied to the usage configuration of the flash memory shown in FIGS.
It is possible to make 5% a data area (for example,
Since one management sector SA7 is provided for the data sectors SA0 to SA6, (SA0 to 7) / (SA0
-SA8) = 0.875). Therefore, it is possible to reduce the capacity of the management sector as compared with a configuration in which one data sector has one management sector (50% of the flash memory capacity is a data sector) as in the conventional example shown in FIG. Yes, a low-cost system can be constructed.

【0050】図4は、本発明の一実施形態において、消
去回数情報エリアSAに記憶された消去回数が規定消去
回数に達したか否かを調べる方法を示す図である。消去
回数情報エリアSAの容量は64kバイトであり、規定
消去回数を5万回とする。図1に示す消去回数管理方法
を用いると、消去回数が5万回を超えるのは相対アドレ
ス$186Bのデータが、$7Fになった場合である。
FIG. 4 is a diagram showing a method for checking whether or not the number of erasures stored in the erasure number information area SA has reached a prescribed number of erasures in one embodiment of the present invention. The capacity of the erasure count information area SA is 64 kbytes, and the prescribed erasure count is 50,000 times. When the erasing frequency management method shown in FIG. 1 is used, the erasing frequency exceeds 50,000 times when the data of the relative address $ 186B becomes $ 7F.

【0051】つまり、相対アドレス$186Bのデータ
が$FFの場合、消去回数が5万回に達していない。相
対アドレス$186Bのデータが$FF以外の場合、消
去回数が5万回に達したと判断できる。
That is, when the data at the relative address $ 186B is $ FF, the number of erases has not reached 50,000 times. If the data of the relative address $ 186B is other than $ FF, it can be determined that the number of erasures has reached 50,000.

【0052】よって、監視タスクにより、ある特定の周
期でこのアドレスのデータを読み込み、読み込んだデー
タが$FFかそれ以外かを調べることにより、管理対象
セクタの消去回数が規定消去回数に達したかを確認する
ことができる。これにより、管理対象セクタの消去回数
が規定消去回数に達した場合、交代セクタへのデータの
移動等の処理をすることが可能となる。
Thus, the monitoring task reads the data at this address at a specific cycle and checks whether the read data is $ FF or any other data, so that the number of erases of the management target sector has reached the specified number of erases. Can be confirmed. As a result, when the number of erasures of the management target sector has reached the specified number of erasures, it becomes possible to perform processing such as moving data to a replacement sector.

【0053】図5は、本発明の一実施形態と従来技術と
の、停電時におけるデータ消失の可能性について比較す
る図である。図5において、データセクタの消去に2m
s、データの書き込みに1バイトあたり2μs、1セク
タ分は131ms必要とするものとする。
FIG. 5 is a diagram for comparing the embodiment of the present invention and the prior art with respect to the possibility of data loss during a power failure. In FIG. 5, 2 m is used to erase the data sector.
s, 2 μs per byte is required for writing data, and 131 ms is required for one sector.

【0054】データセクタの消去回数を管理しているの
で、従来技術において、データセクタの書き換えを行う
場合は、データセクタの消去に2μs、データセクタの
書き込みに131ms、管理セクタの消去に2μs、管
理セクタへの管理情報の書き込みに131ms必要とな
る。
Since the number of erasures of the data sector is managed, in the prior art, when rewriting the data sector, it takes 2 μs to erase the data sector, 131 ms to write the data sector, and 2 μs to erase the management sector. It takes 131 ms to write the management information to the sector.

【0055】これに対し、本発明による消去回数管理方
法では、データセクタの消去に2μs、データセクタの
書き込みに131ms、管理セクタへの書き込みに2μ
s必要である。本発明の場合は、管理セクタの消去が不
要であるとともに、データセクタの消去回数を、管理セ
クタ内のデータの“0”を増加していく方法であるの
で、管理セクタへの書き込みが、従来技術に比較して、
大幅に短縮されている。
On the other hand, in the erase count management method according to the present invention, 2 μs is used for erasing the data sector, 131 ms is used for writing the data sector, and 2 μs is used for writing the management sector.
s is required. In the case of the present invention, the erasing of the management sector is not necessary, and the number of erasures of the data sector is a method of increasing “0” of the data in the management sector. Compared to technology,
It has been greatly shortened.

【0056】従来技術においては、管理情報の更新に1
33ms必要であり、この間に停電が発生した場合、管
理セクタの情報は消滅、または、不完全な情報になり使
用できない。
In the prior art, the management information is updated by 1
It takes 33 ms, and if a power failure occurs during this time, the information of the management sector disappears or becomes incomplete and cannot be used.

【0057】これに対して、本発明による消去回数管理
方法では、管理情報の更新には2μsの時間ですむた
め、この間に停電が発生しても、停電予告割り込みから
電源が落ちるまで数百μs必要であるため、管理セクタ
の情報が不完全な情報になることはない。
On the other hand, in the erase count management method according to the present invention, the update of the management information requires only 2 μs. Therefore, even if a power failure occurs during this time, it takes several hundred μs until the power is turned off from the power failure warning interrupt. Since it is necessary, the information of the management sector does not become incomplete information.

【0058】本発明の他の実施形態としては、MPU
と、主記憶装置とを有し、上述した消去回数管理方法に
より管理されるフラッシュメモリを使用するデータ処理
装置がある。このデータ処理装置によれば、データ書き
換え中の停電発生時でも管理情報領域が保存され、デー
タ領域に対して管理情報領域を縮小することができ、デ
ータセクタに比べ管理セクタが早く規定消去回数に達し
てしまうという事態を回避可能であるので、処理したデ
ータ等の信頼性の高いデータ処理装置を実現することが
できる。
As another embodiment of the present invention, the MPU
And a main storage device, and uses a flash memory managed by the above-described erase count management method. According to this data processing device, even when a power failure occurs during data rewriting, the management information area can be saved, and the management information area can be reduced with respect to the data area. Since such a situation can be avoided, a highly reliable data processing device for processed data and the like can be realized.

【0059】なお、上述した例におけるフラッシュメモ
リは、消去されることによりセクタ内のデータはビット
単位で値がすべて“1”になり、書き込み動作はビット
の値に対し“1”から“0”、または、“1”から
“1”、または、“0”から“0”が許されるものであ
るが、他の例のフラッシュメモリでも適用可能である。
In the flash memory of the above-described example, the data in the sector is changed to "1" in bit units by erasing, and the writing operation is changed from "1" to "0" for the bit value. Or "1" to "1" or "0" to "0" is permitted, but the present invention is also applicable to other examples of flash memory.

【0060】つまり、消去されることによりセクタ内の
データはビット単位で値がすべて“0”になり、書き込
み動作はビットの値に対し“0”から“1”、または、
“1”から“1”、または、“0”から“0”が許され
るフラッシュメモリにも適用可能である。
That is, as a result of erasure, the data in the sector all have a value of “0” in bit units, and the write operation is performed by changing the bit value from “0” to “1” or
The present invention is also applicable to a flash memory in which “1” to “1” or “0” to “0” is permitted.

【0061】[0061]

【発明の効果】本発明は、以上説明したように構成され
ているため、次のような効果がある。消去回数に制限が
あるフラッシュメモリの消去回数管理方法及びそれを用
いたデータ処理装置において、管理セクタ内の管理対象
セクタに割り当てた複数バイトの中の最下位バイトから
最上位バイトへ、バイトデータ内では最下位ビット(L
SB)から最上位ビット(MSB)、または、MSBか
らLSBに向かって管理対象セクタの消去に対し“0”
が書き込まれている次のビットに“0”を書き込んで消
去回数をカウントして、フラッシュメモリの消去回数を
管理する。したがって、データ書き換え中の停電発生時
でも管理情報領域が保存され、データ領域に対する管理
情報領域を最少にし、かつ、データセクタに比べ管理セ
クタが早く規定消去回数に達してしまうことのないフラ
ッシュメモリの消去回数管理方方法及びそれを用いたデ
ータ処理装置を実現することができる。
Since the present invention is configured as described above, it has the following effects. In a method for managing the number of times of erasing of a flash memory having a limited number of times of erasing and a data processing device using the same, in the byte data from the least significant byte to the most significant byte among a plurality of bytes allocated to a management target sector in a management sector Then, the least significant bit (L
SB) to the most significant bit (MSB) or “0” for erasure of the management target sector from the MSB to the LSB
"0" is written to the next bit in which is written, and the number of erasures is counted to manage the number of erasures of the flash memory. Therefore, even when a power failure occurs during data rewriting, the management information area is preserved, the management information area for the data area is minimized, and the management sector does not reach the specified erase count earlier than the data sector. It is possible to realize a method of managing the number of times of erasing and a data processing device using the method.

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

【図1】本発明の一実施形態であるフラッシュメモリの
消去回数管理方法を示す図である。
FIG. 1 is a diagram illustrating a method of managing the number of erasures of a flash memory according to an embodiment of the present invention.

【図2】本発明を32セクタ、16Mビットのフラッシ
ュメモリに適用した場合の説明図である。
FIG. 2 is an explanatory diagram when the present invention is applied to a 32 sector, 16 Mbit flash memory.

【図3】図2の管理セクタSA7内の概略構成図であ
る。
FIG. 3 is a schematic configuration diagram of a management sector SA7 in FIG. 2;

【図4】消去回数情報エリアSAに記憶された消去回数
が規定回数に達したか否かを調べる方法に説明図であ
る。
FIG. 4 is a diagram illustrating a method of checking whether the number of erasures stored in an erasure number information area SA has reached a specified number.

【図5】本発明の一実施形態と従来技術との、停電時に
おけるデータ消失の可能性について比較する図である。
FIG. 5 is a diagram comparing an embodiment of the present invention and a conventional technique with respect to a possibility of data loss at the time of a power failure.

【図6】従来技術の一例を示す図である。FIG. 6 is a diagram showing an example of a conventional technique.

【図7】従来技術の他の例を示す図である。FIG. 7 is a diagram showing another example of the related art.

【図8】従来技術のさらに他の例を示す図である。FIG. 8 is a diagram showing still another example of the related art.

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

B1〜Bn 第1バイト〜第nバイト SA 消去回数情報エリア SA0〜SA6、SA8〜SA14 データセクタ SA16〜SA22、SA24〜SA30 データセク
タ SA7、SA15、SA23、SA31 管理セクタ
B1 to Bn 1st byte to nth byte SA Erase count information area SA0 to SA6, SA8 to SA14 Data sector SA16 to SA22, SA24 to SA30 Data sector SA7, SA15, SA23, SA31 Management sector

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】消去回数に制限があり、特定単位バイトで
あるセクタ毎に消去を行い、消去されることによりセク
タ内のデータはビット単位で値がすべて“1”になり、
書き込み動作はビットの値に対し“1”から“0”、
“1”から“1”、“0”から“0”が許される不揮発
性メモリであるフラッシュメモリの消去回数管理方法に
おいて、 複数のセクタに対して、単一のセクタを管理セクタとし
て割り当て、この管理セクタを、管理する複数のセクタ
のそれぞれに対応した領域に分割し、管理対象セクタが
消去される毎に、管理セクタ内の上記管理対象セクタに
対応する領域の複数バイトの中の連続するビットに順次
“0”を書き込んで消去回数をカウントしていくことに
より、消去回数に制限があるフラッシュメモリの寿命を
管理することを特徴とするフラッシュメモリの消去回数
管理方法。
1. The number of erasures is limited, and erasure is performed for each sector which is a specific unit byte. By erasing, all data in a sector become "1" in bit units.
The write operation is performed by changing the bit value from “1” to “0”,
In a method of managing the number of erasures of a flash memory which is a nonvolatile memory that allows “1” to “1” and “0” to “0”, a single sector is assigned as a management sector to a plurality of sectors. The management sector is divided into areas respectively corresponding to the plurality of sectors to be managed, and each time the management target sector is erased, consecutive bits in a plurality of bytes of the area corresponding to the management target sector in the management sector are erased. A method of managing the number of erasures of a flash memory, wherein the number of erasures is counted by sequentially writing "0" to the flash memory to limit the life of a flash memory having a limited number of erasures.
【請求項2】消去回数に制限があり、特定単位バイトで
あるセクタ毎に消去を行い、消去されることによりセク
タ内のデータはビット単位で値がすべて“0”になり、
書き込み動作はビットの値に対し“0”から“1”、
“1”から“1”、“0”から“0”が許される不揮発
性メモリであるフラッシュメモリの消去回数管理方法に
おいて、 複数のセクタに対して、単一のセクタを管理セクタとし
て割り当て、この管理セクタを、管理する複数のセクタ
のそれぞれに対応した領域に分割し、管理対象セクタが
消去される毎に、管理セクタ内の上記管理対象セクタに
対応する領域の複数バイトの中の連続するビットに順次
“0”を書き込んで消去回数をカウントしていくことに
より、消去回数に制限があるフラッシュメモリの寿命を
管理することを特徴とするフラッシュメモリの消去回数
管理方法。
2. The number of erasures is limited, and erasing is performed for each sector which is a specific unit byte. By erasing, all data in the sector become "0" in bit units.
The write operation is performed by changing the bit value from “0” to “1”,
In a method of managing the number of erasures of a flash memory which is a nonvolatile memory that allows “1” to “1” and “0” to “0”, a single sector is assigned as a management sector to a plurality of sectors. The management sector is divided into areas corresponding to the plurality of sectors to be managed, and each time the management target sector is erased, consecutive bits in a plurality of bytes of the area corresponding to the management target sector in the management sector are erased. A method of managing the number of erasures of a flash memory, wherein the number of erasures is counted by sequentially writing "0" to the flash memory to limit the life of a flash memory having a limited number of erasures.
【請求項3】請求項1又は2記載のフラッシュメモリの
消去回数管理方法において、複数のセクタの集まりであ
るクラスタに対して、上記管理セクタを1つ割り当て、
この管理セクタ内に設けられた消去回数を管理するセク
タの個数分の消去回数カウンタの特定のアドレスを定期
的に読み出し、そのアドレスにおけるデータを所定の特
定データと比較し、消去回数が規定消去回数に達したか
どうかを判断することにより、消去回数に制限があるフ
ラッシュメモリの寿命を管理することを特徴とするフラ
ッシュメモリの消去回数管理方法。
3. The method according to claim 1, wherein one management sector is assigned to a cluster which is a group of a plurality of sectors.
A specific address of the erase counter corresponding to the number of sectors for managing the number of erases provided in this management sector is periodically read, and the data at that address is compared with predetermined specific data. A management method for managing the number of erasures of a flash memory, wherein the life of a flash memory having a limitation on the number of erasures is managed by determining whether or not the number of erasures has reached.
【請求項4】請求項3記載のフラッシュメモリの消去回
数管理方法において、上記クラスタの状態を示すクラス
タ情報エリアを備え、このクラスタ情報エリアにクラス
タ内の各セクタの消去情報と、クラスタ全体に関する情
報を記録しておくことにより、クラスタ情報エリアの読
み出し動作のみによりクラスタ内の情報を取得すること
を特徴とするフラッシュメモリの消去回数管理方法。
4. A flash memory erase number management method according to claim 3, further comprising a cluster information area indicating a state of the cluster, wherein the cluster information area includes erase information of each sector in the cluster and information on the entire cluster. A method of managing the number of times of erasure of a flash memory, wherein information in a cluster is obtained only by reading a cluster information area by recording the information.
【請求項5】請求項1、2又は3記載のフラッシュメモ
リの消去回数管理方法において、管理セクタの特定のア
ドレスに特定のデータパターンを書込んでおくことによ
り、その特定データパターンが書き換えられたことを検
出すうことにより、上記管理セクタが初期化されたこと
を検出することを特徴とするフラッシュメモリの消去回
数管理方法。
5. A method according to claim 1, wherein said specific data pattern is rewritten by writing a specific data pattern to a specific address of a management sector. Detecting the fact that the management sector has been initialized by detecting that the management sector has been initialized.
【請求項6】MPUと、主記憶手段と、消去回数に制限
があり、特定単位バイトであるセクタ毎に消去を行い、
消去されることによりセクタ内のデータはビット単位で
値がすべて“1”になり、書き込み動作はビットの値に
対し“1”から“0”、“1”から“1”、“0”から
“0”が許される不揮発性メモリであるフラッシュメモ
リとを有するデータ処理装置において、 上記フラッシュメモリは、上記複数のセクタに対して、
割り当てられる単一のセクタである管理セクタを有し、
この管理セクタは、管理する複数のセクタのそれぞれに
対応した領域に分割し、管理対象セクタが消去される毎
に、管理セクタ内の上記管理対象セクタに対応する領域
の複数バイトの中の連続するビットに順次“0”を書き
込んで消去回数をカウントしていくことにより、消去回
数に制限があるフラッシュメモリの寿命を管理すること
を特徴とするデータ処理装置。
6. An MPU, a main storage means and an erasure count are limited, and erasure is performed for each sector which is a specific unit byte.
By erasing, the data in the sector all have a value of “1” in bit units, and the write operation is performed with respect to the bit value from “1” to “0”, “1” to “1”, and “0”. In a data processing device having a flash memory which is a non-volatile memory where “0” is permitted, the flash memory includes:
Having a management sector that is a single sector assigned;
This management sector is divided into areas respectively corresponding to the plurality of sectors to be managed, and each time the management target sector is erased, a continuous byte in a plurality of bytes of the area corresponding to the management target sector in the management sector is erased. A data processing apparatus for managing the life of a flash memory having a limited number of erases by sequentially writing "0" to bits and counting the number of erases.
【請求項7】MPUと、主記憶手段と、消去回数に制限
があり、特定単位バイトであるセクタ毎に消去を行い、
消去されることによりセクタ内のデータはビット単位で
値がすべて“0”になり、書き込み動作はビットの値に
対し“0”から“1”、“1”から“1”、“0”から
“0”が許される不揮発性メモリであるフラッシュメモ
リとを有するデータ処理装置において、 上記フラッシュメモリは、上記複数のセクタに対して、
割り当てられる単一のセクタである管理セクタを有し、
この管理セクタは、管理する複数のセクタのそれぞれに
対応した領域に分割し、管理対象セクタが消去される毎
に、管理セクタ内の上記管理対象セクタに対応する領域
の複数バイトの中の連続するビットに順次“0”を書き
込んで消去回数をカウントしていくことにより、消去回
数に制限があるフラッシュメモリの寿命を管理すること
を特徴とするデータ処理装置。
7. An MPU, a main storage means, and the number of erasures are limited, and erasing is performed for each sector which is a specific unit byte.
By erasing, the data in the sector becomes all "0" in bit units, and the write operation is performed from "0" to "1", "1" to "1", and "0" to the bit value. In a data processing device having a flash memory which is a non-volatile memory where “0” is permitted, the flash memory includes:
Having a management sector that is a single sector assigned;
This management sector is divided into areas respectively corresponding to the plurality of sectors to be managed, and each time the management target sector is erased, a continuous byte in a plurality of bytes of the area corresponding to the management target sector in the management sector is erased. A data processing apparatus for managing the life of a flash memory having a limited number of erases by sequentially writing "0" to bits and counting the number of erases.
【請求項8】請求項6又は7記載のデータ処理装置にお
いて、上記フラッシュメモリは、複数のセクタの集まり
であるクラスタに対して、上記管理セクタを1つ割り当
て、この管理セクタ内に消去回数を管理するセクタの個
数分の消去回数カウンタを有し、この消去カウンタの特
定のアドレスを定期的に読み出し、そのアドレスにおけ
るデータを所定の特定データと比較し、消去回数が規定
消去回数に達したかどうかを判断することにより、消去
回数に制限があるフラッシュメモリの寿命を管理するこ
とを特徴とするデータ処理装置。
8. The data processing device according to claim 6, wherein the flash memory allocates one management sector to a cluster which is a group of a plurality of sectors, and stores the number of erasures in the management sector. It has erase counters for the number of sectors to be managed, and periodically reads a specific address of the erase counter, compares the data at that address with predetermined specific data, and determines whether the erase count has reached the specified erase count. A data processing device for managing the life of a flash memory having a limited number of erasures by judging whether or not the data is erased.
【請求項9】請求項8記載のデータ処理装置において、
上記フラッシュメモリは、上記クラスタの状態を示すク
ラスタ情報エリアを備え、このクラスタ情報エリアにク
ラスタ内の各セクタの消去情報と、クラスタ全体に関す
る情報を記録しておくことにより、クラスタ情報エリア
の読み出し動作のみによりクラスタ内の情報を取得する
ことを特徴とするデータ処理装置。
9. The data processing apparatus according to claim 8, wherein
The flash memory has a cluster information area indicating the state of the cluster, and erase information of each sector in the cluster and information on the entire cluster are recorded in the cluster information area, so that the read operation of the cluster information area is performed. A data processing device characterized in that information in a cluster is obtained only by using the information.
【請求項10】請求項6、7又は8記載のデータ処理装
置において、管理セクタの特定のアドレスに特定のデー
タパターンを書込んでおくことにより、その特定データ
パターンが書き換えられたことを検出することにより、
上記管理セクタが初期化されたことを検出することを特
徴とするデータ処理装置。
10. A data processing device according to claim 6, wherein a specific data pattern is written in a specific address of a management sector to detect that the specific data pattern has been rewritten. By doing
A data processing device for detecting that the management sector has been initialized.
JP27243997A 1997-10-06 1997-10-06 Controlling method for the number of times of erasing of flash memory and data processing device using it Pending JPH11110983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27243997A JPH11110983A (en) 1997-10-06 1997-10-06 Controlling method for the number of times of erasing of flash memory and data processing device using it

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27243997A JPH11110983A (en) 1997-10-06 1997-10-06 Controlling method for the number of times of erasing of flash memory and data processing device using it

Publications (1)

Publication Number Publication Date
JPH11110983A true JPH11110983A (en) 1999-04-23

Family

ID=17513938

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27243997A Pending JPH11110983A (en) 1997-10-06 1997-10-06 Controlling method for the number of times of erasing of flash memory and data processing device using it

Country Status (1)

Country Link
JP (1) JPH11110983A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7551706B2 (en) 2004-12-03 2009-06-23 Kyocera Mita Corporation Counter device and counting method
CN104361907A (en) * 2014-10-10 2015-02-18 宁波三星电气股份有限公司 Counting method of FLASH memory
JP2016133874A (en) * 2015-01-16 2016-07-25 ルネサスエレクトロニクス株式会社 Information processor and flash memory control method
CN110659218A (en) * 2019-08-30 2020-01-07 珠海泰芯半导体有限公司 Wear leveling method suitable for small data volume Flash

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7551706B2 (en) 2004-12-03 2009-06-23 Kyocera Mita Corporation Counter device and counting method
CN104361907A (en) * 2014-10-10 2015-02-18 宁波三星电气股份有限公司 Counting method of FLASH memory
CN104361907B (en) * 2014-10-10 2019-11-22 宁波三星智能电气有限公司 A kind of method of counting of FLASH memory
JP2016133874A (en) * 2015-01-16 2016-07-25 ルネサスエレクトロニクス株式会社 Information processor and flash memory control method
CN110659218A (en) * 2019-08-30 2020-01-07 珠海泰芯半导体有限公司 Wear leveling method suitable for small data volume Flash
CN110659218B (en) * 2019-08-30 2024-01-19 珠海泰芯半导体有限公司 Wear balancing method suitable for small data quantity Flash

Similar Documents

Publication Publication Date Title
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
US5963970A (en) Method and apparatus for tracking erase cycles utilizing active and inactive wear bar blocks having first and second count fields
US5530827A (en) Data management system for programming-limited type semiconductor memory and IC memory card employing data save/erase process with flag assignment
JP3544610B2 (en) Memory device
US6388908B1 (en) Recording system, data recording device, memory device, and data recording method
US6977847B2 (en) Detecting partially erased units in flash devices
KR100531192B1 (en) Non-volatile memory control method
US8041880B2 (en) Flash memory, memory control circuit, microcomputer and memory control method
US20040107377A1 (en) Counter with non-uniform digit base
JPH05282889A (en) Nonvolatile semiconductor memory
JPWO2006129779A1 (en) Semiconductor memory device
JP2011107851A (en) Memory system
KR20040087916A (en) Memory card
EP0708450B1 (en) A semiconductor disk device with a constant data-writing time period
KR19990029196A (en) Semiconductor Memory and Data Management Method
KR100265266B1 (en) Microcomputer comprsing flash eeprom and method of erasing flash eeprom
US6442068B1 (en) Non-volatile memory with functional capability of burst mode read and page mode read during suspension of an operation of electrical alteration
KR100327286B1 (en) Digital audio recorder and player with address backup function
JPH11110983A (en) Controlling method for the number of times of erasing of flash memory and data processing device using it
JPH07114500A (en) Nonvolatile memory device
JPH07153284A (en) Non-volatile semiconductor memory and its control method
JP3924568B2 (en) Data access control method and data access control program in flash memory
JP3826115B2 (en) Storage device, memory management method, and program
JP4710274B2 (en) MEMORY DEVICE, MEMORY DEVICE CONTROL METHOD, AND DATA PROCESSING SYSTEM
JP4661748B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD