Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3536359B2 - Control method of flash memory - Google Patents
[go: Go Back, main page]

JP3536359B2 - Control method of flash memory - Google Patents

Control method of flash memory

Info

Publication number
JP3536359B2
JP3536359B2 JP18803394A JP18803394A JP3536359B2 JP 3536359 B2 JP3536359 B2 JP 3536359B2 JP 18803394 A JP18803394 A JP 18803394A JP 18803394 A JP18803394 A JP 18803394A JP 3536359 B2 JP3536359 B2 JP 3536359B2
Authority
JP
Japan
Prior art keywords
block
image
erased
cluster
clusters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP18803394A
Other languages
Japanese (ja)
Other versions
JPH0855056A (en
Inventor
正洋 尾家
弘之 末高
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Original Assignee
Casio Computer 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP18803394A priority Critical patent/JP3536359B2/en
Publication of JPH0855056A publication Critical patent/JPH0855056A/en
Application granted granted Critical
Publication of JP3536359B2 publication Critical patent/JP3536359B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Read Only Memory (AREA)

Description

【発明の詳細な説明】 【0001】 【産業上の利用分野】本発明は、画像の記録メディアと
して使用されるフラッシュメモリの記録方法に関するも
のである。 【0002】 【従来の技術】従来、画像の記録メディアとしてフラッ
シュメモリが使用されている。図8は、このようなフラ
ッシュメモリを使用した電子カメラの概略構成を示すも
ので、映像信号を電気信号に変換するCCD801、ア
ナログ信号をデジタル信号に変換するA/D変換器80
、CCD801を駆動する駆動回路804を制御する
タイミング信号を発生するタイミングゼネレータ80
、デジタル画像信号を符号化/復号化により圧縮/伸
長処理する圧縮/伸長回路805、取り込んだデジタル
画像信号を一時記録するDRAM806、圧縮された映
像信号を格納するフラッシュメモリ807、ROM80
に記録されたプログラムに基づいて動作するととも
に、RAM809をワークRAMとして使用しキー入力
810からの入力に基づいて動作するCPU811
デジタル画像信号に同期信号を付加してデジタルビデオ
信号を生成するシグナル・ジェネレータ812、デジタ
ルビデオ信号を記録するVRAM813、シグナル・ジ
ェネレータ812から出力されたデジタルビデオ信号を
アナログ信号に変換するD/A変換器814、アンプ
15を介して入力されたアナログビデオ信号に基づいて
液晶を駆動して映像を表示するLCD816、CPU
11でシリアル信号に変換された映像信号などを入出力
するインターフェース817からなっている。 【0003】このように構成した電子カメラでは、フラ
ッシュメモリ807への記録時は、まず、キー入力部
10で映像取り込みキーを操作すると、タイミングゼネ
レータ803からのタイミング信号により駆動回路80
を制御し、CCD801より映像を取り込み、A/D
変換器802でアナログ信号をデジタル信号に変換して
デジタル画像信号としてDRAM806に一時記録す
る。そして、このDRAM806に記録した映像信号に
対し色演算処理を行い、映像信号から輝度信号と色信号
を作成し、これら輝度信号と色信号を圧縮/伸長回路
05に転送して輝度信号と色信号をデータ圧縮してフラ
ッシュメモリ807に記録する。 【0004】一方、映像信号の再生時は、キー入力部
10で再生キーを操作すると、フラッシュメモリ807
より所定の圧縮映像信号(圧縮輝度信号と色信号)を読
み出し、圧縮/伸長回路805に転送する。そして、こ
れら輝度信号と色信号を伸長し、シグナル・ジェネレー
812で同期信号を付加してデジタルビデオ信号を生
成し、D/A変換器814、アンプ815を介してLC
816に表示することになる。 【0005】ところで、上述の電子カメラでは、画像デ
ータの圧縮モードとして高圧縮と低圧縮の2種類の圧縮
モードを切り替えて使用できるものがある。このような
圧縮モードを切り替えて使用できるものは、高圧縮モー
ドで記録した場合と低圧縮モードで記録した場合とでそ
れぞれの記録容量の異なり、これら記録容量の異なる画
像データを混在して共通のフラッシュメモリ807に記
録するようになる。 【0006】 【発明が解決しようとする課題】ところが、このように
記録容量の異なる画像データを混在してフラッシュメモ
807に記録するものでは、記録容量の小さい高圧縮
モードによる画像データの記録領域と記録容量の大きい
低圧縮モードによる画像データの記録領域がそれぞれ設
けられるようになっているため、仮に、記録容量の小さ
い高圧縮モードの画像データを何箇所にわたって消去し
ても、これら消去した記録領域には、記録容量の大きい
低圧縮モードによる画像データの記録はできずに、同じ
記録容量の高圧縮モードの画像データの再記録しか行う
ことができず、フラッシュメモリ807の利用効率が著
しく低下するという問題点があった。 【0007】一方、フラッシュメモリ807では、画像
データの消去をブロック単位で行うものがある。このよ
うなブロック消去方式を採用したフラッシュメモリ80
は、記録領域を所定容量の複数のブロックで構成して
おり、例えば、4Mbitの記録容量であれば、1ブロ
ック16Kbitのものが32個で構成される。 【0008】そして、このように構成したフラッシュメ
モリ807では、画像データの容量が1ブロックに1対
1の関係であれば、画像データを消去する場合、対応す
るブロックの内容を消去すればよいが、通常は、記録す
べき画像データの容量は、ブロックのサイズとは無関係
で、ブロック内の所定部分のみを消去したい場合も多々
ある。 【0009】このため、従来では、フラッシュメモリ
07と別に1ブロック分の記録容量を有するDRAMを
用意し、このDRAMに消去したいフラッシュメモリ
07のブロック内の未消去部分を退避し、ブロック内を
消去した後、DRAMに退避していた画像データをフラ
ッシュメモリ807内に書き直すような方法が考えられ
ているが、この方法では、フラッシュメモリ807と別
にDRAMを必要とするとともに、画像データをDRA
Mに退避している際に、メイン電源が何等かの原因でオ
フしたような場合、DRAMの画像データが消えてしま
う虞があり、安定した動作を保証できないという問題点
があった。 【0010】本発明の第1の目的は、フラッシュメモリ
の利用効率を高めることができるフラッシュメモリの制
御方法を提供することにある。また、本発明の第2の目
的は、安定した動作を保証できるフラッシュメモリの制
御方法を提供することにある。 【0011】 【課題を解決するための手段】本発明は、同一の記憶容
量を有するブロックを複数個有し、このうち少なくとも
n個のクラスタをm組有する第1のブロックと、n個の
クラスタを有する第2のブロックをm個有し、前記第1
ブロックの各組を構成する1個のクラスタと前記第2の
ブロックの1個のクラスタにより高圧縮モードの画像デ
ータを記録するとともに、前記第1のブロックの組を構
成するクラスタと前記第2のブロックの総てのクラスタ
により低圧縮モードの画像データを記録するようにした
フラッシュメモリにおいて、消去画像のクラスタが第1
のブロックの各組のいずれかにあって該当する組に消去
画像以外の記録済みクラスタがなければ消去画像のクラ
スタを消去し、消去画像のクラスタが第1のブロックの
各組のいずれかにあって該当する組に消去画像以外の記
録済みクラスタが有り、消去画像を有する第2ブロック
中にも消去画像以外の記録済みクラスタが有れば、第1
のブロックの消去画像以外の記録済みクラスタを他の組
の空クラスタに、第2のブロックの消去画像以外の記録
済みクラスタを他の第2のブロックの空クラスタにそれ
ぞれコピーした後、消去画像のクラスタおよびコピー済
みクラスタを消去するようにしている。 【0012】 【0013】 【0014】 【作用】この結果、本発明によれば、消去画像のクラス
タが第1のブロックの各組のいずれかにあって該当する
組に消去画像以外の記録済みクラスタがなければ消去画
像のクラスタを消去し、また、消去画像のクラスタが第
1のブロックの各組のいずれかにあって該当する組に消
去画像以外の記録済みクラスタが有り、消去画像を有す
る第2ブロック中にも消去画像以外の記録済みクラスタ
が有れば、第1のブロックの消去画像以外の記録済みク
ラスタを他の組の空クラスタにコピーするとともに、第
2のブロックの消去画像以外の記録済みクラスタを他の
第2のブロックの空クラスタにコピーして、消去画像の
クラスタおよびコピー済みクラスタを消去するようにし
たので、高圧縮モードの画像データの消去によっても、
常に低圧縮モードの画像1枚分の空を確保できることに
なる。 【0015】 【0016】 【0017】 【実施例】以下、本発明の実施例を図面に従い説明す
る。 (第1実施例)図1は、本発明の制御方法が適用される
フラッシュメモリの概略構成を示している。この場合、
フラッシュメモリは、1個のPブロックP0と4個のC
ブロックC0〜C3で1つの群を構成し、この1つの群
で、後述する高圧縮モード12枚、低圧縮モード4枚の
画像データを記録できるようにしている。 【0018】ここで、PブロックP0は、図2(a)に
示すように12個のクラスタから構成し、これら12個
のクラスタにコードEP0〜EP11を割り付け、ま
た、CブロックC0〜C3は、それぞれ図2(b)に示
すように3個のクラスタから構成し、これら3個のクラ
スタにコードEC0〜EC2を割り付けるようになって
いる。 【0019】そして、画像データの圧縮モードとして記
録容量の小さい高圧縮モードでは、EP0+EC0、E
P1+EC1、…のようにPブロックP0のクラスタと
CブロックC0〜C3のクラスタの組み合わせで1枚の
画像データを記録し、一方、画像データの圧縮モードと
して記録容量の大きい低圧縮モードでは、PブロックP
0のEP0〜EP2をクラスタコードNP0、EP3〜
EP5をクラスタコードNP1、EP6〜EP8をクラ
スタコードNP2、EP9〜EP11をクラスタコード
NP3と割り付け、CブロックC0〜C3のそれぞれの
EC0〜EC2をコードNCと割り付けるものとする
と、NP0+NC、NP1+NC、…のような組み合わ
せで1枚の画像データを記録するようにして、高圧縮モ
ードと低圧縮モードの記録容量を1対3の関係にしてい
る。 【0020】しかして、いま、図3に示すように1枚目
の画像データを高圧縮モードでP0のEP1とC00の
EC0、2枚目の画像データを低圧縮モードでP0のN
P1とC01のNC、3、4枚目の画像データを高圧縮
モードでP0のEP6とC02のEC0およびP0のE
P7とC02のEC1、そして、5枚目の画像データを
低圧縮モードでP0のNP3とC03のNCにそれぞれ
記録されているものとする。 【0021】この状態から、各圧縮モードの画像を消去
する場合は、図4に示すフローチャートが実行される。
まず、1枚目の高圧縮モードの画像(P0のEP1とC
00のEC0)を消去する場合は、ステップ401で消
去画像が高圧縮モードのものであるか判断する。ここで
は、YESなので、ステップ402に進み、消去画像の
Pクラスタ群がEP0〜EP2か判断する。すると、こ
のステップ402でも、YESなので、ステップ403
に進み、EP0〜EP2の中で消去画像以外に記録済み
Pクラスタがあるか判断する。この場合、NOとなるの
で、ステップ404に進み、消去画像のクラスタを消去
する。これにより、P0のEP0〜EP2とC00がと
もに空き状態となり、低圧縮モードの画像1枚分の空が
確保されることになる。 【0022】次に、2枚目の低圧縮モードの画像(P0
のNP1とC01のNC)を消去する場合は、ステップ
401で消去画像が高圧縮モードのものであるか判断す
る。ここでは、NOなので、ステップ404に進み、消
去画像のクラスタを消去する。これにより、P0のNP
1とC01のNCがともに空き状態となり、再び低圧縮
モードの画像1枚分の空が確保されることになる。 【0023】次に、3枚目の高圧縮モードの画像(P0
のEP6とC02のEC0)を消去する場合は、ステッ
プ401で消去画像が高圧縮モードのものであるか判断
する。ここでは、YESなので、ステップ402に進
み、消去画像のPクラスタ群がEP0〜EP2か判断す
る。すると、ここではNOになるので、ステップ405
に進み、消去画像のPクラスタ群がEP3〜EP5か判
断するが、ここでもNOになるので、ステップ406に
進む。 【0024】ステップ406では、消去画像のPクラス
タ群がEP6〜EP8か判断する。ここでは、YESと
なるので、ステップ407に進み、EP6〜EP8の中
で消去画像以外に記録済みPクラスタがあるか判断す
る。この場合は、NOとなるので、ステップ408に進
み、消去画像のCブロック中に消去画像以外に記録済み
Cクラスタが有るか判断すが、ここでは、YESとなる
ので、ステップ409に進み、消去画像のPクラスタ群
以外に空Pクラスタが有るか判断する。この場合、P0
のEP0〜EP2に空があるので、YESとなり、ステ
ップ410に進み、さらに消去画像のCブロック以外に
空Cクラスタが有るか判断する。この場合も、C00に
空があるので、YESとなり、ステップ411に進む。 【0025】ステップ411では、記録済みPクラスタ
を空Pクラスタにコピーする。ここでは、P0のEP7
のデータをP0のEP1にコピーする。続けて、ステッ
プ412で記録済みCクラスタを空Cクラスタにコピー
する。ここでは、C02のEC1をC00のEC1にコ
ピーする。そして、ステップ413に進み、消去画像の
クラスタとコピー済みクラスタを消去する。これによ
り、P0のEP6〜EP8とC02がともに空き状態と
なり、低圧縮モードの画像1枚分の空が確保されること
になる。 【0026】なお、4枚目の高圧縮モードの画像(P0
のEP7とC02のEC1)および5枚目の低圧縮モー
ドの画像(P0のNP3とC03のNC)の消去につい
ても、上述し3枚目および2枚目の場合と同様の動作が
実行される。 【0027】また、高圧縮モードの画像消去において、
消去画像のPクラスタ群がEP3〜EP5の場合は、ス
テップ401、ステップ402からステップ405、ス
テップ414を介して、また、消去画像のPクラスタ群
がEP9〜EP11の場合は、ステップ401、ステッ
プ402、ステップ405、ステップ406からステッ
プ415を介して、それぞれ上述したと同様の動作が実
行される。また、ステップ408、ステップ409、ス
テップ410でそれぞれNOとなる場合は、コピーをす
るためのクラスタが見付からないということで、ステッ
プ404で、消去画像のクラスタを消去することで処理
を終了する。 【0028】従って、このような第1実施例によれば、
3個のクラスタを4組有するPブロックと、3個のクラ
スタを有するCブロックを4個有するフラッシュメモリ
を用いて高圧縮モードの画像データと低圧縮モードの画
像データを記録する場合、消去画像のクラスタがPブロ
ック各組のいずれかにあって該当する組に消去画像以外
の記録済みクラスタがなければ消去画像のクラスタをそ
のまま消去し、また、消去画像のクラスタがPブロック
の各組のいずれかにあって該当する組に消去画像以外の
記録済みクラスタが有り、消去画像を有するCブロック
中にも消去画像以外の記録済みクラスタが有れば、Pブ
ロックの消去画像以外の記録済みクラスタを他の組の空
クラスタに、Cブロックの消去画像以外の記録済みクラ
スタを他のCブロックの空クラスタにそれぞれコピーし
た後、消去画像のクラスタおよびコピー済みクラスタを
消去するようになるので、高圧縮モードの画像データの
消去によっても、常に低圧縮モードの画像1枚分の空を
確保できるようになり、使用状況にかかわらずフラッシ
ュメモリの利用効率を高めることができる。 【0029】そして、これらブロック1〜32のうち3
1個のブロックをデータ保存用ブロック、残り1のブロ
ックを予備ブロックとする。フラッシュメモリは、ブロ
ック毎にしか消去できないので、データ消去の際に、消
去したいデータを記録しているブロック中の未消去部分
を予備ブロックにコピーし、この後、該当ブロックを消
去し、この消去したブロックを次回の予備ブロックとす
るようにしている。 【0030】図6は、データ保存用ブロックと予備ブロ
ックの動きについて説明するもので、この場合、ブロッ
ク1〜32について、それぞれ1〜32のブロック番号
を付して管理するものとすると、データ保存用ブロック
として登録されるブロックコード(ブロック番号)を格
納する31ブロックのデータ用ブロックコード格納部4
1と予備ブロックとして登録されるブロックコード(ブ
ロック番号)を格納する1ブロックの予備ブロックコー
ド格納部42を有している。 【0031】そして、消去が行われる前は、図6(a)
に示すようにデータ用ブロックコード格納部41に、ブ
ロック1〜31のブロックコードが格納され、予備ブロ
ックコード格納部42に、ブロック32のブロックコー
ドが格納される。 【0032】なお、本実施例では、ブロック1のアドレ
スを「H´00000」(H´は16進であることを示
している。)とし、ブロックサイズを「H´4000」
とするので、ブロック2のアドレスは、「H´0400
0」、ブロック3のアドレスは、「H´08000」、
…ブロック32のアドレスは、「H´7C000」とな
る。 【0033】この状態から、例えば、4番目のブロック
中のデータを消去する場合は、図7に示すフローチャー
トにおいて、まず、ステップ701で「予備ブロックコ
ード−1」、つまり、予備ブロックコードは現在32で
あるので、変数Aは31(=32−1)となる。次い
で、ステップ702で「H´4000(1ブロックのサ
イズ)×A」により予備ブロックアドレス「H´7C0
00」(=H´4000×31)を算出する。 【0034】同様にして、ステップ703で「消去ブロ
ックコード−1」、つまり、消去ブロックコードは4で
あるので、変数Bは3(=4−1)となる。次いで、ス
テップ704で「H´4000(1ブロックのサイズ)
×B」により消去ブロックアドレス「H´0C000
(=H´4000×3)を算出する。 【0035】そして、ステップ705で消去ブロックア
ドレス「H´0C000」で示される消去ブロック4中
の未消去部分データを予備ブロックアドレス「H´7C
000」で示される予備ブロック32にコピーし、ステ
ップ706で予備ブロックコード格納部42の予備ブロ
ックコード32とデータ用ブロックコード格納部41の
消去ブロックコード4を入れ替え、ステップ707で消
去ブロック4をブロック消去する。これにより、図6
(b)に示すように、データ用ブロックコード格納部4
1の4番目のブロックコードが32、予備ブロックコー
ド格納部42がブロックコード4に変更され、4番目の
ブロックの内容が消去されることになる。 【0036】次に、10番目のブロック中のデータを消
去する場合は、上述したと同様にしてステップ701〜
ステップ704で予備ブロックアドレスと消去ブロック
アドレスを設定し、次いで、ステップ705で消去ブロ
ック10中の未消去部分を予備ブロック4にコピーし、
ステップ706で予備ブロックコード格納部42の予備
ブロックコード4とデータ用ブロックコード格納部41
の消去ブロックコード10を入れ替え、ステップ707
で消去ブロック10をブロック消去する。これにより、
図6(c)に示すように、データ用ブロックコード格納
部41の10番目のブロックコードが4、予備ブロック
コード格納部42がブロックコード10に変更され、1
0番目のブロックの内容が消去されることになる。 【0037】従って、このような第2実施例によれば、
ブロック1〜32で構成されるフラッシュメモリにデー
タ保存用ブロックと予備ブロックを設け、データ消去の
際に、消去したいデータを記録しているデータ保存用ブ
ロック中の未消去部分を予備ブロックにコピーし、その
後、消去データを記録するブロックを消去し、データを
消去したブロックを次回の予備ブロックとすることによ
り、ブロック内の所定のデータサイズの消去が可能とな
り、従来のDRAMを用いたものに比べ、画像データが
消えてしまうようなことがなく、安定した動作を保証で
きる。 【0038】 【発明の効果】以上詳述したように本発明によれば、高
圧縮画像データの消去にともない記録済みの高圧縮画像
データを他の領域に移動することで低圧縮画像データを
記録できる領域を確保できる場合には、記録済みの高圧
縮画像データを他の領域に移動するようにしたので、高
圧縮モードの画像データの消去によって、常に低圧縮画
像データの記録領域を確保することができる。 【0039】また、本発明によれば、低圧縮モードの画
像データを消去する際に、クラスタの入れ替えによる再
構築により、常に低圧縮モードの画像1枚分の空が確保
できるようになり、使用状況にかかわらずフラッシュメ
モリの利用効率を高めることができる。 【0040】また、本発明によれば、消去するブロック
の未消去部分のデータを予備ブロックにコピーした後、
当該ブロックを消去するようになるので、ブロック内の
所定のデータサイズの消去が可能となり、従来のDRA
Mを用いたものに比べ、画像データが消えてしまうよう
なことがなく、安定した動作を保証できる。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a flash memory recording method used as an image recording medium. 2. Description of the Related Art Conventionally, flash memories have been used as image recording media. FIG. 8 shows a schematic configuration of an electronic camera using such a flash memory. The CCD 801 converts an image signal into an electric signal, and the A / D converter 80 converts an analog signal into a digital signal.
2. A timing generator 80 for generating a timing signal for controlling a driving circuit 804 for driving the CCD 801
3. A compression / expansion circuit 805 for compressing / expanding a digital image signal by encoding / decoding, a DRAM 806 for temporarily recording a captured digital image signal, a flash memory 807 for storing a compressed video signal, and a ROM 80
Together it operates based on a program recorded in 8, CPU 811 that operates based on input from using RAM 809 as a work RAM key input unit 810,
Signal generator 812 for generating a digital video signal by adding a synchronization signal to a digital image signal, VRAM 813 for recording digital video signals, digital video signals output from the signal di <br/> Enereta 812 into an analog signal D / A converter 814 for conversion, amplifier 8
An LCD 816 for driving a liquid crystal based on an analog video signal input through the LCD 15 to display an image, a CPU 8
An interface 817 for inputting / outputting a video signal or the like converted into a serial signal at 11 is provided. In the electronic camera configured as described above, when recording on the flash memory 807 , first, the key input unit 8
When the video capture key is operated at 10 , the drive circuit 80 is driven by a timing signal from the timing generator 803.
4 and fetches video from CCD 801 and A / D
The converter 802 converts the analog signal into a digital signal and temporarily records the digital signal in the DRAM 806 as a digital image signal. Then, the recorded video signal to DRAM 806 to perform the color processing, to create a luminance signal and a chrominance signal from the video signal, the compression / decompression circuit these luminance signal and the color signal 8
05 and compresses the luminance signal and the chrominance data, and records the data in the flash memory 807 . On the other hand, when reproducing a video signal, the key input unit 8
When the play key is operated at 10 , the flash memory 807
A predetermined compressed video signal (compressed luminance signal and color signal) is read out and transferred to the compression / expansion circuit 805 . Then, the luminance signal and the chrominance signal are expanded, a synchronizing signal is added by a signal generator 812 to generate a digital video signal, and a digital video signal is generated via a D / A converter 814 and an amplifier 815.
D 816 . Some of the above-mentioned electronic cameras can switch between two types of compression modes, high compression and low compression, as a compression mode for image data. The recording modes that can be used by switching between such compression modes are different in the recording capacity between when recording in the high compression mode and when recording in the low compression mode, and image data having different recording capacities are mixed and shared. The data is recorded in the flash memory 807 . [0006] However, in the case of recording image data having different recording capacities in a mixed manner in the flash memory 807 as described above, the recording area of the image data in the high compression mode having a small recording capacity is required. Since the recording area for the image data in the low compression mode having a large recording capacity is provided respectively, even if the image data in the high compression mode having the small recording capacity is erased in any number of places, these erased recording areas are provided. Cannot record image data in the low-compression mode with a large recording capacity, but can only re-record image data in the high-compression mode with the same recording capacity, and the use efficiency of the flash memory 807 is significantly reduced. There was a problem. On the other hand, some flash memories 807 erase image data in blocks. Flash memory 80 adopting such a block erase method
Numeral 7 indicates that the recording area is composed of a plurality of blocks having a predetermined capacity. For example, if the recording capacity is 4 Mbit, 32 blocks each having 16 Kbits per block. In the flash memory 807 configured as described above, if the image data has a one-to-one relationship with one block, when erasing the image data, the contents of the corresponding block may be erased. Usually, the capacity of the image data to be recorded is irrelevant to the size of the block, and there are many cases where it is desired to erase only a predetermined portion in the block. For this reason, the conventional flash memory 8
07 , a DRAM having a recording capacity of one block is prepared, and the flash memory 8 to be erased is stored in this DRAM.
A method of saving the unerased portion in the block No. 07 , erasing the block, and then rewriting the image data saved in the DRAM into the flash memory 807 has been considered. A DRAM is required separately from 807, and image data is stored in a DRA
If the main power supply is turned off for some reason during retreat to M, there is a possibility that image data in the DRAM may be lost, and there is a problem that stable operation cannot be guaranteed. A first object of the present invention is to provide a flash memory control method capable of improving the use efficiency of the flash memory. A second object of the present invention is to provide a flash memory control method capable of guaranteeing a stable operation. According to the present invention, the same storage capacity is used.
Block with multiple volumes, at least
a first block having m clusters of n clusters, and n
The first block having m second blocks having clusters;
One cluster forming each set of blocks and the second
Image data in high compression mode is obtained by one cluster of blocks.
Data and record the first set of blocks.
Clusters to be formed and all clusters of the second block
To record image data in low compression mode
In the flash memory, the cluster of the erased image is the first
Erasing the corresponding set in any of the sets in the block
If there are no recorded clusters other than the image,
And the cluster of the erased image is
In each of the sets, the corresponding
Second block with recorded cluster and erased image
If there are recorded clusters other than the erased image,
Clusters other than the erased image of the block
Record other than the erased image of the second block in the empty cluster of
A completed cluster to an empty cluster of another second block
After each copy, erased image cluster and copied
Only clusters are deleted . As a result, according to the present invention, the class of the erased image is
Data in any of the sets of the first block
If there are no recorded clusters other than the erased image in the
Image clusters, and erased image clusters
Either of the sets in the block 1
There are recorded clusters other than the deleted image, and there is an erased image
Clusters other than the erased image in the second block
If there is, the recorded clips other than the erased image of the first block
Copy the raster to another set of empty clusters,
Clusters other than the erased image of block 2
Copy to the empty cluster of the second block,
Delete clusters and copied clusters
Therefore, erasing image data in high compression mode
The sky for one image in the low compression mode can always be secured. Embodiments of the present invention will be described below with reference to the drawings. (First Embodiment) FIG. 1 shows a schematic configuration of a flash memory to which the control method of the present invention is applied. in this case,
The flash memory has one P block P0 and four C blocks.
One group is composed of the blocks C0 to C3, and this one group can record image data of 12 images in a high compression mode and 4 images in a low compression mode described later. Here, the P block P0 is composed of 12 clusters as shown in FIG. 2A, codes EP0 to EP11 are allocated to these 12 clusters, and C blocks C0 to C3 are As shown in FIG. 2B, each cluster is composed of three clusters, and codes EC0 to EC2 are assigned to these three clusters. In the high compression mode having a small recording capacity as the compression mode of the image data, EP0 + EC0, E0
One image data is recorded by a combination of the cluster of the P block P0 and the cluster of the C blocks C0 to C3 as in P1 + EC1,..., While in the low compression mode with a large recording capacity as the compression mode of the image data, P
0, EP0 to EP2 are converted to cluster codes NP0, EP3 to
If EP5 is assigned to the cluster code NP1, EP6 to EP8 is assigned to the cluster code NP2, EP9 to EP11 is assigned to the cluster code NP3, and EC0 to EC2 of each of the C blocks C0 to C3 are assigned to the code NC, NP0 + NC, NP1 + NC,. By recording one image data in such a combination, the recording capacities of the high compression mode and the low compression mode are in a one-to-three relationship. Now, as shown in FIG. 3, the first image data is EP0 of P0 and EC0 of C00 in the high compression mode, and the second image data is N0 of P0 in the low compression mode.
In the high compression mode, the NC of P1 and C01 and the third and fourth image data are EP6 of P0, EC0 of C02 and E of P0.
It is assumed that EC1 of P7 and C02 and the image data of the fifth sheet are recorded in NP3 of P0 and NC of C03 in the low compression mode, respectively. When erasing an image in each compression mode from this state, the flowchart shown in FIG. 4 is executed.
First, the first high compression mode image (EP1 and C1 of P0)
When erasing (EC0) of 00, it is determined in step 401 whether the erased image is in the high compression mode. Here, since YES is determined, the process proceeds to step 402, where it is determined whether the P cluster group of the erased image is EP0 to EP2. Then, since this step 402 is also YES, step 403 is executed.
To determine whether there is a recorded P cluster other than the erased image in EP0 to EP2. In this case, since the answer is NO, the process proceeds to step 404 to erase the cluster of the erased image. Thereby, both EP0 to EP2 of P0 and C00 are vacant, and the vacancy for one image in the low compression mode is secured. Next, the second image in the low compression mode (P0
NP1 and NC of C01) are to be erased, it is determined in step 401 whether the erased image is in the high compression mode. Here, since it is NO, the process proceeds to step 404, and the cluster of the erased image is erased. Thereby, NP of P0
The NCs 1 and C01 are both empty, and the sky for one image in the low compression mode is secured again. Next, the third image in the high compression mode (P0
When erasing EP0 and EC0 of C02), it is determined in step 401 whether the erased image is in the high compression mode. Here, since YES is determined, the process proceeds to step 402, where it is determined whether the P cluster group of the erased image is EP0 to EP2. Then, here, the answer is NO, so that step 405 is executed.
Then, it is determined whether the P cluster group of the erased image is EP3 to EP5. In step 406, it is determined whether the P cluster group of the erased image is EP6 to EP8. Here, since the answer is YES, the process proceeds to step 407, and it is determined whether there is a recorded P cluster other than the erased image in EP6 to EP8. In this case, the answer is NO, and the process proceeds to step 408, where it is determined whether or not there is a recorded C cluster other than the erased image in the C block of the erased image. It is determined whether there is an empty P cluster other than the P cluster group of the image. In this case, P0
Since there is an empty space in EP0 to EP2, YES is determined, and the process proceeds to step 410, and it is determined whether there is an empty C cluster other than the C block of the erased image. Also in this case, since there is an empty space in C00, the result is YES, and the process proceeds to step 411. In step 411, the recorded P cluster is copied to an empty P cluster. Here, EP7 of P0
Is copied to EP1 of P0. Subsequently, in step 412, the recorded C cluster is copied to the empty C cluster. Here, EC1 of C02 is copied to EC1 of C00. Then, the process proceeds to step 413, where the cluster of the erased image and the copied cluster are erased. As a result, both EP6 to EP8 of P0 and C02 are vacant, and the vacancy for one image in the low compression mode is secured. The fourth image in the high compression mode (P0
The same operation as that of the third and second images described above is performed for erasing the EP7 and EC2 of C02) and the fifth low-compression mode image (NP3 of P0 and NC of C03). . Further, in erasing an image in the high compression mode,
When the P cluster group of the erased image is EP3 to EP5, the process proceeds through steps 401 and 402 to 405 and 414. When the P cluster group of the erased image is EP9 to EP11, the process proceeds to steps 401 and 402. , Steps 405 and 406 to Step 415 perform the same operations as described above. If the determinations in steps 408, 409, and 410 are NO, respectively, it means that a cluster for copying cannot be found, and in step 404, the process ends by deleting the cluster of the erased image. Therefore, according to the first embodiment,
When recording high compression mode image data and low compression mode image data using a P block having four sets of three clusters and a flash memory having four C blocks having three clusters, an erased image is recorded. If the cluster is in any one of the sets of the P blocks and there is no recorded cluster other than the erased image in the corresponding set, the cluster of the erased image is directly erased, and the cluster of the erased image is any of the sets of the P block. If there is a recorded cluster other than the erased image in the corresponding set and there is also a recorded cluster other than the erased image in the C block having the erased image, the recorded clusters other than the erased image in the P block are replaced. In the set of empty clusters, recorded clusters other than the erased image of block C
After copying each static empty cluster of another C block, so I would like to erase the cluster and copied cluster erasing images, by erasing the image data of the high compression mode, one always low compression mode image As a result, it is possible to secure the empty space for the minutes, and it is possible to increase the use efficiency of the flash memory regardless of the use condition. Then, 3 of these blocks 1 to 32
One block is a data storage block, and the remaining one block is a spare block. Since the flash memory can only be erased block by block, when erasing data, copy the unerased part of the block in which the data to be erased is recorded to a spare block, and then erase the block and erase this block. The set block is used as the next spare block. FIG. 6 explains the movement of the data storage block and the spare block. In this case, it is assumed that the blocks 1 to 32 are managed by assigning block numbers 1 to 32 respectively. Data block code storage unit 4 of 31 blocks for storing block codes (block numbers) registered as data blocks
1 and a spare block code storage unit 42 of one block for storing a block code (block number) registered as a spare block. Before the erasure is performed, FIG.
As shown in (1), the block codes of blocks 1 to 31 are stored in the data block code storage unit 41 , and the block code of the block 32 is stored in the spare block code storage unit 42 . In this embodiment, the address of block 1 is "H'00000" (H 'indicates hexadecimal), and the block size is "H'4000".
Therefore, the address of the block 2 is “H′0400
0 ", the address of block 3 is"H'08000",
... The address of the block 32 is “H′7C000”. From this state, when erasing data in the fourth block, for example, in the flowchart shown in FIG. 7, first, in step 701, "spare block code-1", that is, the spare block code is currently 32 Therefore, the variable A is 31 (= 32-1). Next, in step 702, the spare block address “H′7C0” is obtained by “H′4000 (size of one block) × A”.
00 ”(= H′4000 × 31). Similarly, in step 703, "erase block code-1", that is, the erase block code is 4, so that the variable B is 3 (= 4-1). Next, in step 704, "H'4000 (size of one block)
× B ”to erase block address“ H'0C000
(= H'4000 × 3) is calculated. [0035] Then, unerased partial data reserved block address "H'7C the in erase block 4 indicated by the erase block address"H'0C000"in step 705
000 ", the spare block code 32 of the spare block code storage unit 42 and the erase block code 4 of the data block code storage unit 41 are exchanged at step 706, and the erase block 4 is blocked at step 707. to erase. As a result, FIG.
As shown in (b), the data block code storage unit 4
The fourth block code of 1 is changed to 32, the spare block code storage section 42 is changed to block code 4, and the contents of the fourth block are erased. Next, when erasing data in the tenth block, steps 701 to 701 are performed in the same manner as described above.
In step 704, a spare block address and an erase block address are set. Then, in step 705, an unerased portion in the erase block 10 is copied to the spare block 4.
In step 706, the spare block code 4 in the spare block code storage unit 42 and the data block code storage unit 41
Of the erase block code 10 in step 707
Erases the block of the erase block 10. This allows
As shown in FIG. 6C, the tenth block code in the data block code storage unit 41 is changed to 4, and the spare block code storage unit 42 is changed to the block code 10, and
The contents of the 0th block will be erased. Therefore, according to the second embodiment,
A data storage block and a spare block are provided in a flash memory composed of blocks 1 to 32, and when erasing data, an unerased portion of the data storage block in which data to be erased is recorded is copied to the spare block. Then, by erasing the block in which the erased data is to be recorded, and using the block from which the data has been erased as the next spare block, it becomes possible to erase a predetermined data size in the block. Thus, stable operation can be guaranteed without erasing the image data. As described in detail above, according to the present invention, low-compressed image data is recorded by moving recorded high-compressed image data to another area in accordance with erasure of high-compressed image data. When the available area can be secured, the recorded high-compression image data is moved to another area.Therefore, by erasing the image data in the high-compression mode, the recording area for the low-compression image data must always be secured. Can be. Further, according to the present invention, when erasing image data in the low compression mode, it is possible to always secure a space for one image in the low compression mode by reconstructing by exchanging clusters. Regardless of the situation, the use efficiency of the flash memory can be improved. Further, according to the present invention, after copying data of an unerased portion of a block to be erased to a spare block,
Since the block is erased, it becomes possible to erase a predetermined data size in the block, and the conventional DRA
Compared to the case using M, image data does not disappear and stable operation can be guaranteed.

【図面の簡単な説明】 【図1】本発明の第1実施例の制御方法が適用されるフ
ラッシュメモリの概略構成を示す図。 【図2】第1実施例の制御方法が適用されるフラッシュ
メモリを構成するPブロック、Cブロックを示す図。 【図3】第1実施例の制御方法が適用されるフラッシュ
メモリの画像データの記録状態を示す図。 【図4】第1実施例の動作を説明するためのフローチャ
ート。 【図5】本発明の第2実施例の制御方法が適用されるフ
ラッシュメモリの概略構成を示す図。 【図6】第2実施例の制御方法が適用されるフラッシュ
メモリでのデータ保存用ブロックと予備ブロックの動き
を説明するための図。 【図7】第2実施例の動作を説明するためのフローチャ
ート。 【図8】従来のフラッシュメモリを使用したビデオカメ
ラの概略構成を示す図。 【符号の説明】 P0…Pブロック、C0〜C3…Cブロック、1〜32
…ブロック、41…データ用ブロックコード格納部、4
2…予備ブロックコード格納部。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram showing a schematic configuration of a flash memory to which a control method according to a first embodiment of the present invention is applied. FIG. 2 is a diagram showing P blocks and C blocks constituting a flash memory to which the control method of the first embodiment is applied. FIG. 3 is a diagram showing a recording state of image data in a flash memory to which the control method of the first embodiment is applied. FIG. 4 is a flowchart for explaining the operation of the first embodiment. FIG. 5 is a diagram showing a schematic configuration of a flash memory to which a control method according to a second embodiment of the present invention is applied; FIG. 6 is a diagram for explaining the movement of a data storage block and a spare block in a flash memory to which the control method of the second embodiment is applied. FIG. 7 is a flowchart for explaining the operation of the second embodiment. FIG. 8 is a diagram showing a schematic configuration of a video camera using a conventional flash memory. [Description of References] P0 ... P block, C0 to C3 ... C block, 1 to 32
... Block, 41 ... Data block code storage unit, 4
2. Reserve block code storage unit.

フロントページの続き (56)参考文献 特開 平2−104078(JP,A) 特開 平2−122784(JP,A) 特開 平2−226977(JP,A) 特開 平3−27455(JP,A) 特開 昭64−41042(JP,A) 特開 平5−313989(JP,A) 特開 平6−95955(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 12/00 - 12/06 G11C 16/02 H04N 5/76,5/80 - 5/907 Continuation of front page (56) References JP-A-2-104078 (JP, A) JP-A-2-122784 (JP, A) JP-A-2-226977 (JP, A) JP-A-3-27455 (JP) JP-A-64-41042 (JP, A) JP-A-5-313989 (JP, A) JP-A-6-95955 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB G06F 12/00-12/06 G11C 16/02 H04N 5 / 76,5 / 80-5/907

Claims (1)

(57)【特許請求の範囲】 【請求項1】 同一の記憶容量を有するブロックを複数
個有し、このうち少なくともn個のクラスタをm組有す
る第1のブロックと、n個のクラスタを有する第2のブ
ロックをm個有し、前記第1ブロックの各組を構成する
1個のクラスタと前記第2のブロックの1個のクラスタ
により高圧縮モードの画像データを記録するとともに、
前記第1のブロックの組を構成するクラスタと前記第2
のブロックの総てのクラスタにより低圧縮モードの画像
データを記録するようにしたフラッシュメモリにおい
て、 消去画像のクラスタが第1のブロックの各組のいずれか
にあって該当する組に消去画像以外の記録済みクラスタ
がなければ消去画像のクラスタを消去し、 消去画像のクラスタが第1のブロックの各組のいずれか
にあって該当する組に消去画像以外の記録済みクラスタ
が有り、消去画像を有する第2ブロック中にも消去画像
以外の記録済みクラスタが有れば、第1のブロックの消
去画像以外の記録済みクラスタを他の組の空クラスタ
に、第2のブロックの消去画像以外の記録済みクラスタ
を他の第2のブロックの空クラスタにそれぞれコピーし
た後、消去画像のクラスタおよびコピー済みクラスタを
消去することを特徴とするフラッシュメモリの制御方
法。
(57) Claims 1. A plurality of blocks having the same storage capacity, a first block having m sets of at least n clusters, and a first block having n clusters While having m number of second blocks, image data in a high compression mode is recorded by one cluster constituting each set of the first block and one cluster of the second block,
A cluster forming the set of the first block and the second
In the flash memory in which the image data in the low compression mode is recorded by all the clusters of the block, the cluster of the erased image is in any one of the sets of the first block and the corresponding set other than the erased image is included in the corresponding set. If there is no recorded cluster, the cluster of the erased image is erased, and the cluster of the erased image is in any one of the sets of the first block, and the corresponding set has a recorded cluster other than the erased image and has the erased image. If there are recorded clusters other than the erased image in the second block, the recorded clusters other than the erased image of the first block are replaced with empty clusters of another set, and the recorded clusters other than the erased image of the second block are recorded. After copying the clusters to the empty clusters of the other second block, the clusters of the erased image and the copied clusters are erased. Control method of Sshumemori.
JP18803394A 1994-08-10 1994-08-10 Control method of flash memory Expired - Lifetime JP3536359B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18803394A JP3536359B2 (en) 1994-08-10 1994-08-10 Control method of flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18803394A JP3536359B2 (en) 1994-08-10 1994-08-10 Control method of flash memory

Publications (2)

Publication Number Publication Date
JPH0855056A JPH0855056A (en) 1996-02-27
JP3536359B2 true JP3536359B2 (en) 2004-06-07

Family

ID=16216496

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18803394A Expired - Lifetime JP3536359B2 (en) 1994-08-10 1994-08-10 Control method of flash memory

Country Status (1)

Country Link
JP (1) JP3536359B2 (en)

Also Published As

Publication number Publication date
JPH0855056A (en) 1996-02-27

Similar Documents

Publication Publication Date Title
JPH04145596A (en) Memory card and data management system therefor
JPH0591452A (en) Electronic still camera and reproducing device therefor
JPH03117080A (en) Video signal processor
JPH0937205A (en) Electronic still camera
US6356306B1 (en) Digital camera capable of converting a progressive scan signal into an interlace scan signal
US6661452B1 (en) Digital camera capable of decreasing a required memory capacity
US7512324B2 (en) Data recording apparatus, reproduction apparatus, recording/reproduction method, and imaging apparatus
JP3536359B2 (en) Control method of flash memory
US20010012061A1 (en) Signal processing method for digital still cameras
JPH02193236A (en) Storage management system for memory card
CN120113228A (en) Image management method, chip, image transmission method and electronic device
US6771313B1 (en) Electronic image recording apparatus and data memorizing method therefor
JP3000606B2 (en) Data processing device
JP2892806B2 (en) Electronic still camera
JP3102565B2 (en) Memory card storage management method
JP3621835B2 (en) Playback device for electronic still camera
JP3557359B2 (en) Image signal playback device
JP2005333437A (en) Imaging equipment
JP3290141B2 (en) Video coding device
JP3255639B2 (en) Image playback device
KR100300301B1 (en) Data storage
JPH043541A (en) Picture/audio data reproducing device
JP3046832B2 (en) Electronic still camera system and memory unit
JP3291778B2 (en) Memory device
JPH08205070A (en) Electronic still camera

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20031219

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20040205

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040308

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090326

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090326

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100326

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110326

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110326

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120326

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130326

Year of fee payment: 9