JP3271935B2 - Control system - Google Patents

Control system

Info

Publication number
JP3271935B2
JP3271935B2 JP28179197A JP28179197A JP3271935B2 JP 3271935 B2 JP3271935 B2 JP 3271935B2 JP 28179197 A JP28179197 A JP 28179197A JP 28179197 A JP28179197 A JP 28179197A JP 3271935 B2 JP3271935 B2 JP 3271935B2
Authority
JP
Japan
Prior art keywords
data
unit
storage
sector
written
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP28179197A
Other languages
Japanese (ja)
Other versions
JPH11120085A (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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP28179197A priority Critical patent/JP3271935B2/en
Publication of JPH11120085A publication Critical patent/JPH11120085A/en
Application granted granted Critical
Publication of JP3271935B2 publication Critical patent/JP3271935B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)
  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、制御機器の設定を
示す設定データや制御状態を示す状態データなどのデー
タを記憶するフラッシュメモリを備えた制御システムに
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control system having a flash memory for storing data such as setting data indicating the setting of a control device and status data indicating a control state.

【0002】[0002]

【従来の技術】この種の制御システムとしては、例えば
照明器具の制御に用いられるものがあり、この制御シス
テムでは、ある操作に対してどの照明器具をどの程度の
出力レベルで点灯させるかといった設定データや、照明
器具の出力レベルや出力切換までのタイマ時間などの照
明器具の状態を示す状態データを記憶する必要があっ
た。ところで、設定データや状態データなどの記憶デー
タが停電発生時に失われると、停電復帰後に制御システ
ムの設定や制御状態の再現が行えなくなるため、従来の
制御システムでは設定データや状態データなどのデータ
を不揮発性メモリに記憶させていた。
2. Description of the Related Art As a control system of this kind, for example, there is a control system used for controlling lighting equipment. In this control system, a setting such as which lighting equipment is turned on at a certain operation and at what output level is performed. It is necessary to store data and status data indicating the status of the lighting equipment, such as the output level of the lighting equipment and the timer time until output switching. By the way, if stored data such as setting data and status data is lost when a power failure occurs, it will not be possible to set the control system and reproduce the control state after the power failure is recovered. It was stored in a non-volatile memory.

【0003】近年、不揮発性メモリとしてはフラッシュ
メモリが主流になりつつあるが、フラッシュメモリで
は、特定のアドレスにデータを書き込む際に、既に同じ
アドレスにデータが書き込まれている場合、そのデータ
の値によっては、先ずそのデータを消去しなければ新し
いデータを書き込むことができなかった。しかも、フラ
ッシュメモリでは、メモリ空間が一定の記憶消去単位た
る複数のセクタに分割されており、データの消去操作が
バイト単位では行えず、セクタ単位でしか行えなかっ
た。
[0003] In recent years, flash memories have become the mainstream of non-volatile memories. When data is written to a specific address in a flash memory, if the data has already been written to the same address, the value of the data is In some cases, new data cannot be written without first erasing the data. In addition, in the flash memory, the memory space is divided into a plurality of sectors as a fixed storage / erasing unit, and data erasing operation cannot be performed in byte units, but only in sector units.

【0004】そのため、フラッシュメモリに記憶するデ
ータの書換え管理を行う場合、RAMやE2 PROMの
ように特定のデータをメモリ中の特定のアドレスで管理
すると、1バイトのデータを書き換えるだけでも、その
データが任意に変化する場合は、2回に1回の割合で、
既に書き込まれたデータを消去した後に新たなデータを
書き込まなければならず、セクタ単位でデータを退避
し、このセクタのデータを消去した後に、退避したデー
タをこのセクタに再び書き込む必要があり、データの書
き込みに多くの時間を要するため時間的にもロスが発生
し、しかもセクタの書換え回数が増加するので、フラッ
シュメモリの寿命が短くなるという問題もあった。
Therefore, when rewriting management of data stored in the flash memory is performed, if specific data is managed at a specific address in the memory, such as a RAM or an E 2 PROM, even if only one byte of data is rewritten, the data is not rewritten. If the data changes arbitrarily, once every two times
It is necessary to write new data after erasing already written data, save the data in sector units, and after erasing the data in this sector, write the saved data back to this sector. This requires a lot of time to write data into the flash memory, resulting in a loss in time. In addition, since the number of times of rewriting of the sector is increased, the life of the flash memory is shortened.

【0005】そこで、フラッシュメモリを記憶媒体とし
てデータの書換え管理を行う場合、ある特定のデータを
更新する時は、フラッシュメモリに書き込まれた古いデ
ータに新しいデータを上書きするのではなく、フラッシ
ュメモリの未使用領域に新しいデータを書き込み、フラ
ッシュメモリへのデータの書込みや読出しを行うインタ
ーフェース部のプログラムで古いデータへのポインタを
破棄して、新しいデータへのポインタを記憶する。
Therefore, when performing data rewrite management using a flash memory as a storage medium, when updating certain data, it is not necessary to overwrite old data written in the flash memory with new data, but to update the flash memory. New data is written in the unused area, and the pointer to the old data is discarded by the program of the interface unit that writes and reads the data to and from the flash memory, and the pointer to the new data is stored.

【0006】また、フラッシュメモリに新しいデータを
書き込む際に、セクタ中の未使用領域が無くなった場合
は、書き写し元のセクタ中でポインタが繋がっている有
効なデータのみを、別の未使用のセクタに書き写し、書
き写し元のセクタ中でポインタの繋がっていない不要な
データは破棄して、書き込み先のセクタに未使用領域を
捻出する(以下、この動作をガーベッジコレクトとい
う)ことにより、セクタ中の未使用領域が無くなって
も、データの記憶を続けることができる。尚、書き写し
元のセクタのデータは消去して、未使用のセクタに再生
する。
When the unused area in the sector is exhausted when writing new data to the flash memory, only valid data to which a pointer is connected in the original sector to be copied is transferred to another unused sector. Unnecessary data in the source sector to which the pointer is not connected is discarded, and an unused area is created in the write destination sector (hereinafter, this operation is referred to as garbage collect). Even if the used area is exhausted, data can be stored continuously. It should be noted that the data in the original sector to be copied is erased and reproduced in an unused sector.

【0007】例えば、図9(a)に示すように、3個の
データA,B,Cが、セクタXの記憶単位たるブロック
1,3,2に夫々記憶されている状態で、データAを更
新する場合、図9(b)に示すように、インターフェー
ス部(図示せず)は、新しいデータAをセクタXの未使
用のブロック4に書き込み、ブロック1に記憶された古
いデータAへのポインタを破棄して、ブロック4に記憶
された新しいデータAへのポインタをポインタテーブル
に記憶する。
For example, as shown in FIG. 9A, in a state where three data A, B, and C are stored in blocks 1, 3, and 2 which are storage units of a sector X, the data A is stored. When updating, as shown in FIG. 9B, the interface unit (not shown) writes the new data A to the unused block 4 of the sector X, and pointers to the old data A stored in the block 1. Is discarded, and the pointer to the new data A stored in the block 4 is stored in the pointer table.

【0008】さらに、3個のデータA,B,Cが、セク
タXのブロック4,3,2に夫々記憶されている状態
で、データA,Cを更新する場合、図9(c)に示すよ
うに、インターフェース部は、新しいデータA,Cをセ
クタXの未使用のブロック5,6に書き込み、古いデー
タA,Cへのポインタを破棄して、新しいデータA,C
へのポインタをポインタテーブルに記憶する。
FIG. 9C shows a case where the data A and C are updated in a state where the three data A, B and C are stored in the blocks 4, 3 and 2 of the sector X, respectively. As described above, the interface unit writes the new data A and C into the unused blocks 5 and 6 of the sector X, discards the pointers to the old data A and C, and
Is stored in the pointer table.

【0009】その後、データCを更新する場合、セクタ
Xの全てのブロック1〜6には新旧のデータが書き込ま
れ、セクタXの未使用領域がなくなっているので、図9
(d)に示すように、インターフェース部は、セクタX
のブロック1〜6の内、ポインタの繋がっているブロッ
ク5,3,6のデータA,B,Cを未使用のセクタYの
ブロック1,2,3に書き写し、ポインタの繋がってい
ないブロック1,2,4の不要なデータを破棄して、セ
クタYに未使用のブロック4〜6を捻出する。この時、
インターフェース部は、書き写し元のセクタXのデータ
を消去し、未使用のセクタに再生する。
Thereafter, when the data C is updated, new and old data are written in all the blocks 1 to 6 of the sector X, and the unused area of the sector X is lost.
As shown in (d), the interface unit is provided for the sector X.
Of the blocks A, B, and C to which the pointers are connected, are copied to the blocks 1, 2, and 3 of the unused sector Y, and the blocks 1 and 6 to which the pointers are not connected. Unused data 2 and 4 are discarded, and unused blocks 4 to 6 are provided in sector Y. At this time,
The interface unit erases the data of the sector X to be copied and reproduces the data in an unused sector.

【0010】ところで、フラッシュメモリに書き込まれ
た記憶内容に対して、その記憶内容を識別するためのコ
ードや、その記憶内容の有効/無効を示す情報を付加す
ることにより、停電発生後の復帰時に、フラッシュメモ
リの記憶内容を識別して読み出すことができる。
[0010] By the way, by adding a code for identifying the stored contents and information indicating the validity / invalidity of the stored contents to the stored contents written in the flash memory, when returning after a power failure occurs, , The storage contents of the flash memory can be identified and read.

【0011】[0011]

【発明が解決しようとする課題】上記構成の制御システ
ムでは、フラッシュメモリに既に書き込まれたある特定
のデータを更新する際に、セクタ中の未使用領域が無く
なり、ガーベッジコレクトを行う間に停電が発生した場
合、停電の発生したタイミングによっては、書き写し元
のセクタと書込み先のセクタのどちらが有効なデータか
インターフェース部が判別できないという問題があっ
た。
In the control system having the above-mentioned configuration, when updating certain data already written in the flash memory, an unused area in a sector disappears, and a power failure occurs during garbage collection. When this occurs, there is a problem that it is not possible to determine which of the source sector and the destination sector is valid data depending on the timing of the power failure.

【0012】また、フラッシュメモリに既に書き込まれ
たある特定のデータを更新する際に、セクタ中の未使用
領域に新しいデータを書き込んでいる途中で停電が発生
した場合、停電の発生したタイミングによっては、新し
く書き込まれたデータと古いデータのどちらが有効なデ
ータかインターフェース部が判別できないという問題も
あった。
Further, when updating certain data already written in the flash memory, if a power failure occurs while new data is being written to an unused area in a sector, depending on the timing of the power failure, Another problem is that the interface unit cannot determine which of the newly written data and the old data is valid data.

【0013】さらに、停電などの緊急時に、フラッシュ
メモリにデータを退避する際、セクタ中の未使用領域が
なくなり、ガーベッジコレクトが行われると、データの
書き写しに時間がかかるため、時間的にデータの退避が
間に合わない場合があるという問題もあった。また、セ
クタ中の未使用領域が無くなり、別の未使用のセクタに
データを書き写す場合、セクタの寿命を伸ばすために
は、各セクタをできるだけ均等に使用するのが好ましい
が、停電等が発生すると、各セクタの使用回数が判らな
くなるため、各セクタを均等に使用することができない
という問題もあった。
Furthermore, when data is saved to the flash memory in an emergency such as a power outage, there is no unused area in the sector, and if garbage collection is performed, it takes time to copy the data. There was also a problem that evacuation might not be in time. In addition, when unused areas in a sector are lost and data is written to another unused sector, it is preferable to use each sector as evenly as possible in order to extend the life of the sector. In addition, since the number of times of use of each sector cannot be determined, there is a problem that each sector cannot be used evenly.

【0014】また更に、システムに電源を投入した際
に、フラッシュメモリが、出荷直後のデータの未確定な
状態か、或いは、初期化されており、停電復帰後で既に
データが記憶されている状態なのかを見分けることがで
きないという問題もあった。本発明は上記問題点に鑑み
て為されたものであり、その目的とするところは、記憶
消去単位毎に書込状態を容易に判別できる制御システム
を提供することにある。
Furthermore, when the power is turned on to the system, the flash memory is in an undetermined state of data immediately after shipment or has been initialized, and a state in which data has already been stored after recovery from power failure. There was also a problem that it was impossible to tell what it was. The present invention has been made in view of the above problems, and an object of the present invention is to provide a control system that can easily determine a writing state for each memory erasing unit.

【0015】請求項2の発明の目的は、上記目的に加え
て、記憶データの記憶単位毎に書込状態を容易に判別で
きる制御システムを提供することにある。請求項3の発
明の目的は、上記目的に加えて、緊急時に確実にデータ
を退避させることのできる制御システムを提供すること
にある。請求項4の発明の目的は、上記目的に加えて、
フラッシュメモリの長寿命化を図った制御システムを提
供することにある。
It is another object of the present invention to provide a control system which can easily determine a writing state for each storage unit of storage data in addition to the above-mentioned objects. A third object of the present invention is to provide a control system capable of reliably saving data in an emergency in addition to the above objects. The object of the invention of claim 4 is, in addition to the above object,
An object of the present invention is to provide a control system for extending the life of a flash memory.

【0016】請求項5の発明の目的は、上記目的に加え
て、フラッシュメモリが初期化済か否かを容易に判別で
きる制御システムを提供することにある。
Another object of the present invention is to provide a control system which can easily determine whether or not a flash memory has been initialized.

【0017】[0017]

【課題を解決するための手段】上記目的を達成するため
に、メモリ空間が複数の記憶消去単位に分割され、記憶
消去単位毎にデータが消去される電気的に書換可能なフ
ラッシュメモリと、フラッシュメモリへのデータの書込
みや読出しを行うインターフェース部とを備え、記憶消
去単位毎にデータの書込状態を示す書込状態情報を記憶
する第1の書込状態記憶領域をフラッシュメモリに設
け、インターフェース部は、何れかの記憶消去単位へデ
ータを書き込む際に当該記憶消去単位中に空き領域が無
くなった場合、当該記憶消去単位中の有効なデータのみ
を別の未使用の記憶消去単位に書き写すと共に、記憶消
去単位毎のデータの書込開始時点、書込完了時点、書き
写し先の記憶消去単位のデータを有効にする時点、書き
写し元の記憶消去単位のデータを使用済みにする時点に
おいて、それぞれ、第1の書込状態記憶領域の書込状態
情報を更新しているので、インターフェース部は、第1
の書込状態記憶領域に書き込まれた書込状態情報から、
対応する記憶消去単位の現在の書込状態を把握すること
ができる。
In order to achieve the above object, an electrically rewritable flash memory in which a memory space is divided into a plurality of storage erasure units and data is erased for each storage erasure unit, An interface unit for writing and reading data to and from a memory, wherein a first write state storage area for storing write state information indicating a data write state for each storage erase unit is provided in the flash memory; The unit writes only valid data in the storage erasing unit to another unused storage erasing unit when there is no free space in the storage erasing unit when writing data to any of the storage erasing units. , Data write start time, write completion time,
At the time when the data of the memory
At the point when the data of the memory erase unit of the copy source is used
Since the write state information in the first write state storage area is updated, the interface unit
From the write state information written in the write state storage area of
The current writing state of the corresponding storage erasure unit can be grasped.

【0018】請求項2の発明では、請求項1の発明にお
いて、記憶消去単位に、データが書き込まれる複数の記
憶単位と、記憶単位毎のデータの書込状態を示す書込状
態情報を記憶する第2の書込状態記憶領域とを設け、イ
ンターフェース部は、記憶単位毎のデータの書込状態が
変化すると、第2の書込状態記憶領域の書込状態情報を
更新しているので、インターフェース部は、第2の書込
状態記憶領域に書き込まれた書込状態情報から、各記憶
単位へのデータの書込状態を把握できる。
According to a second aspect of the present invention, in the first aspect of the present invention, a plurality of storage units to which data is written and write state information indicating a data write state of each storage unit are stored in the storage erase unit. A second write state storage area, and the interface unit updates the write state information of the second write state storage area when the data write state of each storage unit changes. The unit can grasp the write state of data to each storage unit from the write state information written in the second write state storage area.

【0019】請求項3の発明では、請求項1又は2の発
明において、インターフェース部にデータの書込みや読
出しを指示する指示データを出力するアプリケーション
部を備え、アプリケーション部からの指示データに緊急
時を示す緊急コードが含まれる場合、インターフェース
部は通常時に書き込む記憶消去単位とは別の未使用の緊
急書込み用記憶消去単位にデータを書き込んでいる。緊
急時にデータを退避させる際に、記憶消去単位中の空き
領域が無くなり、ガーベッジコレクトを行った場合、デ
ータの書き込みが間に合わなくなる可能性があるが、緊
急時には未使用の緊急書込み用記憶消去単位にデータを
退避させているので、データの書込みが間に合わなくな
るような事態を防止できる。
According to a third aspect of the present invention, in the first or the second aspect of the present invention, the interface unit further includes an application unit for outputting instruction data for instructing data writing and reading, and the emergency response to the instruction data from the application unit is provided. When the emergency code shown is included, the interface unit writes data in an unused emergency write storage / erasure unit different from the storage erase unit normally written. When data is evacuated in an emergency, there is no free space in the memory erasure unit, and if garbage collection is performed, data may not be able to be written in time. Since the data is saved, it is possible to prevent a situation in which data writing cannot be performed in time.

【0020】請求項4の発明では、請求項1乃至3の発
明において、記憶消去単位毎に該記憶消去単位の使用回
数を記憶するカウンタ領域を設け、記憶消去単位のデー
タが消去される毎に、カウンタ領域に記憶された使用回
数がカウントアップされて、カウンタ領域に書き込まれ
ているので、インターフェース部は、カウンタ領域に書
き込まれた使用回数から、記憶消去単位の使用回数を把
握できる。
According to a fourth aspect of the present invention, in the first to third aspects of the present invention, a counter area for storing the number of times of use of the storage erasure unit is provided for each storage erasure unit. Since the number of uses stored in the counter area is counted up and written in the counter area, the interface unit can grasp the number of uses of the storage erase unit from the number of uses written in the counter area.

【0021】請求項5の発明では、請求項1乃至4の発
明において、フラッシュメモリが初期化済みか否かを示
す初期化済コードを記憶する初期化済コード領域をフラ
ッシュメモリに設け、インターフェース部が、フラッシ
ュメモリの初期化時及び記憶消去単位のデータの消去時
に、初期化済コードを初期化済コード領域へ書き込んで
いるので、インターフェース部は、初期化済コード領域
に書き込まれた初期化済コードからフラッシュメモリが
初期化済か否かを把握することができる。
According to a fifth aspect of the present invention, in the first to fourth aspects of the present invention, an initialized code area for storing an initialized code indicating whether or not the flash memory has been initialized is provided in the flash memory. Writes the initialized code in the initialized code area when the flash memory is initialized and when erasing data in the storage erasing unit, the interface unit is initialized in the initialized code area. It is possible to determine from the code whether the flash memory has been initialized.

【0022】[0022]

【発明の実施の形態】本実施形態の制御システムの概略
構成図を図1に示す。この制御システムは、照明器具の
点灯状態を制御する照明制御装置10と、どの操作に対
してどの照明器具をどのような出力レベルで点灯させる
かといった設定データを後述するメモリ部13に設定す
る設定装置11と、通信線12を介して照明制御装置1
0及び設定装置11に接続され、照明制御装置10から
送信された照明器具の点灯出力や出力切換までのタイマ
時間などの状態データや、設定装置11によって設定さ
れた設定データなどのデータを記憶するメモリ部13と
から構成される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows a schematic configuration diagram of a control system according to the present embodiment. The control system includes a lighting control device 10 for controlling a lighting state of a lighting fixture and a setting for setting setting data such as which lighting fixture is to be turned on at what output level for which operation in a memory unit 13 described later. Lighting control device 1 via device 11 and communication line 12
0 and connected to the setting device 11 to store state data such as a lighting output of the lighting fixture and a timer time until output switching transmitted from the lighting control device 10 and data such as setting data set by the setting device 11. And a memory unit 13.

【0023】メモリ部13は、照明制御装置10や設定
装置11との間で通信線12を介して信号を授受する伝
送処理部14と、停電などによる電源供給の停止を検出
する停電検出部15と、伝送処理部14を介して受信し
た信号や停電検出部15の検出信号に基づいて後述する
フラッシュメモリ18へのデータの書込みや読出しを指
示する指示データを出力するアプリケーション部16
と、アプリケーション部16から入力された指示データ
に基づいてフラッシュメモリ18へのデータの書き込み
やデータの読み込みを行うインターフェース部17と、
インターフェース部17によって設定データや状態デー
タ等のデータの書込みや読出しが行われる電気的に書換
可能なフラッシュメモリ18とから構成される。
The memory unit 13 includes a transmission processing unit 14 for exchanging signals with the illumination control device 10 and the setting device 11 via the communication line 12 and a power failure detection unit 15 for detecting a stop of power supply due to a power failure or the like. And an application unit 16 that outputs instruction data for instructing writing and reading of data to and from a flash memory 18, which will be described later, based on a signal received via the transmission processing unit 14 and a detection signal of the power failure detection unit 15.
An interface unit 17 for writing data to and reading data from the flash memory 18 based on the instruction data input from the application unit 16;
It comprises an electrically rewritable flash memory 18 in which data such as setting data and status data is written and read by the interface unit 17.

【0024】フラッシュメモリ18のメモリ空間は、図
2に示すように、例えば10個の記憶消去単位たるセク
タ(Secta) 190…に分割されており、プログラムを記
憶するためのプログラム記憶用セクタ190と、設定デ
ータや状態データなどのデータを記憶するためのデータ
記憶用セクタ191…とが設けられている。データ記憶
用のセクタ191…には、64Kバイトの容量のセクタ
191…と、8Kバイトの容量のセクタ198,199
が設けられており、64Kバイトのセクタ191…には
設定データが記憶され、8Kバイトのセクタ198,1
9には状態データが記憶されている
As shown in FIG. 2, the memory space of the flash memory 18 is divided into, for example, ten sectors (Secta) 19 0, which are storage erasure units, and a program storage sector 19 for storing a program. 0, and data storage sectors 19 1 for storing data such as setting data and status data. The data storage sector 19 1 ... includes a sector 19 1 ... capacity of 64K bytes, sectors 19 8 a capacity of 8K bytes, 19 9 and is provided, set in the sector 19 1 ... 64K bytes of Data is stored in an 8 Kbyte sector 19 8 , 1
The state data 9 is stored in 9 .

【0025】設定データが書き込まれるセクタ193
管理部20とデータ部27とからなり、データ部27は
最大256バイトのデータを夫々記憶することのできる
254個の記憶単位たるブロック(Block) 281 ,28
2 …28254 から構成される。一方、管理部20は第1
の書込状態記憶領域たるセクタ管理部21と、各ブロッ
ク281 ,282 …28254 に夫々対応して設けられた
第2の書込状態記憶領域たるインデックス241 ,24
2 …24254 とからなり、セクタ管理部21には、この
セクタ193 がどの内容のデータに使用されるかを示す
内容コードCODE1 と、このセクタ193 へのデータ
の書込状態(セクタの使用状態)を示す書込状態情報た
るセクタ状態データ23とが書き込まれる。また、各イ
ンデックス241 ,242 …24254 には、対応するブ
ロック281 ,282 …28254にどのようなデータが
記憶されているかを示す内容コードCODE2 と、対応
するブロック281 ,282 …28254 へのデータの書
込状態(ブロックの使用状態)を示す書込状態情報たる
ブロック状態データ26とが書き込まれる。さらに、各
セクタ190 …の空き領域には、フラッシュメモリ18
が初期化済か否かを示す初期化済コードが書き込まれる
初期化済コード領域や、各セクタの使用回数が書き込ま
れるカウンタ領域が設けられている。また、状態データ
が書き込まれるセクタ198 には、16バイトのデータ
を記憶できる508個のブロック28 1 ,282 …28
508 と、各ブロックに対応して設けられた508個のイ
ンデックス241 ,242 …24508 とが設けられてい
る。尚、ブロック281 …及びインデックス241 …以
外の構成は上述のセクタ193 と同様であるので、その
説明は省略する。
Sector 19 to which setting data is writtenThreeIs
It comprises a management unit 20 and a data unit 27, and the data unit 27
Up to 256 bytes of data can be stored respectively
Block of 254 storage units (Block) 281, 28
Two… 28254Consists of On the other hand, the management unit 20
The sector management unit 21, which is a write state storage area for the
K281, 28Two… 28254Provided for each
Index 24 as second write state storage area1, 24
Two… 24254And the sector management unit 21
Sector 19ThreeIndicates what content is used for the data
Content code CODE1And this sector 19ThreeData to
Status information indicating the write status (sector use status) of the
The sector status data 23 is written. In addition,
Index 241, 24Two… 24254Has the corresponding
Lock 281, 28Two… 28254What data is
Content code CODE indicating whether it is storedTwoAnd corresponding
Block 281, 28Two… 28254Writing data to
Status information indicating the write status (block use status)
The block status data 26 is written. In addition, each
Sector 190.. Are stored in the flash memory 18.
Initialized code is written to indicate whether or not is already initialized
Writes the initialized code area and the number of times each sector has been used
A counter area is provided. Also, state data
Sector 19 to which is written8Contains 16 bytes of data
508 blocks 28 that can store 1, 28Two… 28
508And 508 insets provided for each block.
Index 241, 24Two… 24508And is provided
You. Block 281… And index 241... after
The outer configuration is the same as the sector 19 described above.ThreeIs the same as
Description is omitted.

【0026】また、インターフェース部17では、フラ
ッシュメモリ18へのデータの書込み先を管理するため
に、データの内容コードCODE1 ,CODE2 と、こ
のデータが書き込まれるセクタ及びブロックとの対応関
係を示すデータ位置検索表(表1)と、各セクタの使用
状態(使用中、未使用)及び各セクタの最終使用ブロッ
クの番号を示すセクタ状態・最終使用ブロック一覧表
(表2)とを設けている。例えば、表1より内容コード
CODE1 =1,2に対して1〜3のいずれかの番号の
セクタ191 〜193 が割り当てられ、内容コードCO
DE1 =3に対して8,9のいずれかの番号のセクタ1
8 ,199 が割り当てられる。そして、内容コードC
ODE2 に対してブロック281 …のいずれかが割り当
てられる。したがって、インターフェース部17は、表
1から指定された内容コードCODE1 ,CODE2
データがどのセクタのどのブロックに記憶されているか
を容易に検索できる。また、インターフェース部17
は、表2から使用中のセクタとその最終使用ブロックの
番号とを読み込み、データを書き込む際に、次に使用で
きるブロックの番号を決めることができる。
The interface section 17 shows the correspondence between the data content codes CODE 1 and CODE 2 and the sectors and blocks to which the data is written in order to manage the data write destination in the flash memory 18. A data position search table (Table 1) and a sector status / last used block list (Table 2) indicating the use state (in use or unused) of each sector and the number of the last used block of each sector are provided. . For example, according to Table 1, sectors 191 to 193 having any one of numbers 1 to 3 are assigned to the content codes CODE 1 = 1 and 2, and the content code CO
Sector 1 of any of numbers 8 and 9 for DE 1 = 3
9 8, 19 9 are assigned. And the content code C
One of the blocks 28 1 ... Is assigned to the ODE 2 . Therefore, the interface unit 17 can easily retrieve the data of the content codes CODE 1 and CODE 2 designated from Table 1 in which block of which sector. Also, the interface unit 17
Can read the sector in use and the number of the last used block from Table 2 and determine the next available block number when writing data.

【0027】[0027]

【表1】 [Table 1]

【0028】[0028]

【表2】 [Table 2]

【0029】インターフェース部17がフラッシュメモ
リ18に書き込むデータの内容コードCODE1 ,CO
DE2 とその内容の関係を表3に示す。フラッシュメモ
リ18に書き込むデータとしては、図3(a)〜(i)
に示すように、最大256個の負荷y(y=1〜25
6)と最大16個の拡張負荷z(z=1〜16)とを所
定のパターンで点灯させるためのパターンx登録データ
1 (x=1〜72)や、各パターンにおける負荷yの
調光レベルを設定するためのパターンxレベルデータD
2 (x=1〜72)や、負荷y(y=1〜256)及び
拡張負荷z(z=1〜16)を所定のグループ毎に一括
してオン・オフさせるためのグループg登録データD3
(g=1〜127)などの設定データと、各グループ毎
のオン・オフ状態を示すグループオンオフ状態データD
4 や、各グループ毎に一時点灯や遅れ消灯などのタイマ
ー動作中か否かを示すグループタイマ状態データD
5 や、各負荷y(y=1〜128,129〜256)毎
にタイマ動作中か否かを示す負荷タイマ状態データ(前
半)D6 、負荷タイマ状態データ(後半)D7 や、各拡
張負荷z(z=1〜16)毎にタイマ動作中か否かを示
す拡張負荷タイマ状態データD8 や、各拡張負荷zの現
在の調光レベルを示す拡張負荷レベル状態データD 9
どの状態データとがある。
The interface unit 17 is a flash memo
Code CODE of data to be written to the memory 181, CO
DETwoTable 3 shows the relationship between and the contents. Flash memo
3A to 3I are data to be written to the file 18.
As shown in the figure, a maximum of 256 loads y (y = 1 to 25)
6) and up to 16 extended loads z (z = 1 to 16)
Pattern x registration data for lighting in a fixed pattern
D1(X = 1 to 72) and the load y in each pattern
Pattern x level data D for setting dimming level
Two(X = 1 to 72), load y (y = 1 to 256) and
Expanded load z (z = 1 to 16) collectively for each predetermined group
G registration data D for turning on and offThree
Setting data such as (g = 1 to 127) and each group
Group on / off state data D indicating the on / off state of
FourAnd timers for turning on or delaying off lights for each group
-Group timer status data D indicating whether or not operation is in progress
FiveOr for each load y (y = 1 to 128, 129 to 256)
Indicates the load timer status data (previous
Half) D6, Load timer status data (second half) D7And each extension
Indicates whether or not the timer is operating for each tension load z (z = 1 to 16)
Extended load timer status data D8And the current
Extended load level status data D indicating the current dimming level 9What
Which has state data.

【0030】ここで、表3に示すように、各パターンx
登録データD1 (x=1〜72)には内容コードCOD
1 =1、CODE2 =1〜72が夫々割り当てられ、
各パターンxレベルデータD2 (x=1〜72)には内
容コードCODE1 =1、CODE2 =73〜144が
夫々割り当てられている。また、各グループg登録デー
タD3 (g=1〜127)には内容コードCODE1
2、CODE2 =1〜127が夫々割り当てられてい
る。そして、状態データD4 〜D9 には内容コードCO
DE1 =3が割り当てられ、グループオンオフ状態デー
タD4 、グループタイマ状態データD5 、負荷タイマ状
態データ(前半)D6 、負荷タイマ状態データ(後半)
7 、拡張負荷タイマ状態データD8 、拡張負荷レベル
状態データD9 には夫々内容コードCODE2 =1〜6
が割り当てられている。このように、フラッシュメモリ
18に書き込まれるデータは、それぞれ、データの種別
を示す内容コードCODE1 ,CODE2 に対応してお
り、アプリケーション部16は、これらのデータを一ま
とまりにしてフラッシュメモリ18に書き込むよう、イ
ンターフェース部17に指令データを出力する。
Here, as shown in Table 3, each pattern x
The registration data D 1 (x = 1 to 72) contains the content code COD
E 1 = 1 and CODE 2 = 1 to 72 are respectively assigned,
Content codes CODE 1 = 1 and CODE 2 = 73 to 144 are assigned to each pattern x-level data D 2 (x = 1 to 72), respectively. Each group g registration data D 3 (g = 1 to 127) has a content code CODE 1 =
2, CODE 2 = 1 to 127 are assigned respectively. The status data D 4 to D 9 include the content code CO
DE 1 = 3 is assigned, group on / off state data D 4 , group timer state data D 5 , load timer state data (first half) D 6 , load timer state data (second half)
D 7 , extended load timer status data D 8 , and extended load level status data D 9 include content codes CODE 2 = 1 to 6, respectively.
Is assigned. As described above, the data written to the flash memory 18 corresponds to the content codes CODE 1 and CODE 2 indicating the types of data, respectively, and the application unit 16 collectively stores these data in the flash memory 18. The command data is output to the interface unit 17 so as to be written.

【0031】[0031]

【表3】 [Table 3]

【0032】以下に、この制御システムの動作を、図4
のフローチャートに従って説明する。システム起動時、
インターフェース部17は、フラッシュメモリ18が初
期化済か否かを判断する(ステップ50)。フラッシュ
メモリ18のセクタの初期化済コード領域に初期化済コ
ードが書き込まれていない場合、インターフェース部1
7は、フラッシュメモリ18が初期化されていないと判
断し、アプリケーション部16からの指示データを待機
する(ステップ52)。一方、フラッシュメモリ18の
セクタの初期化済コード記憶領域に初期化済コードが書
き込まれていれば、インターフェース部17はフラッシ
ュメモリ18が既に初期化されていると判断し、フラッ
シュメモリ18に書き込まれたデータから上述のデータ
位置検索表等を作成し(ステップ51)、アプリケーシ
ョン部16からの指示データを待機する(ステップ5
2)。
The operation of this control system will now be described with reference to FIG.
This will be described according to the flowchart of FIG. At system startup,
The interface unit 17 determines whether the flash memory 18 has been initialized (step 50). If the initialized code the initialized coding region of the sector in the flash memory 18 is not written, the interface unit 1
7 determines that the flash memory 18 has not been initialized, and waits for instruction data from the application unit 16 (step 52). On the other hand, if the initialized code has been written in the initialized code storage area of the sector of the flash memory 18, the interface unit 17 determines that the flash memory 18 has already been initialized, and writes the data to the flash memory 18. The above-described data position search table and the like are created from the data (step 51), and instruction data from the application unit 16 is waited for (step 5).
2).

【0033】ステップ53で、インターフェース部17
にアプリケーション部16からフラッシュメモリ18の
状態(初期化済か否か)を確認する指示データが入力さ
れると、インターフェース部17はアプリケーション部
16にフラッシュメモリ18が初期化済か否かを示すデ
ータを返送し(ステップ54)、アプリケーション部1
6からの次の指示データを待機する(ステップ52)。
In step 53, the interface unit 17
When instruction data for confirming the state of the flash memory 18 (whether the flash memory 18 has been initialized) is input from the application unit 16 to the interface unit 17, the interface unit 17 sends to the application unit 16 data indicating whether the flash memory 18 has been initialized. Is returned (step 54), and the application unit 1
Wait for the next instruction data from step 6 (step 52).

【0034】アプリケーション部16は、フラッシュメ
モリ18が初期化済か否かを確認した後に、フラッシュ
メモリ18が初期化されていなければ、フラッシュメモ
リ18を初期化する指示データをインターフェース部1
7に出力する。ステップ53で、インターフェース部1
7は、アプリケーション部16からフラッシュメモリ1
8を初期化する指示データを受け取ると、フラッシュメ
モリ18のデータ領域を全消去してフラッシュメモリ1
8を初期化し(ステップ55)、デフォルトの記憶先を
割り当てて(ステップ56)、上述のデータ位置検索表
等を作成し(ステップ57)、フラッシュメモリ18の
初期化済コード領域に初期化済コードを書き込み(ステ
ップ58)、アプリケーション部16からの次の指示デ
ータを待機する(ステップ52)。
After confirming whether or not the flash memory 18 has been initialized, the application unit 16 sends instruction data for initializing the flash memory 18 to the interface unit 1 if the flash memory 18 has not been initialized.
7 is output. In step 53, the interface unit 1
7 is the flash memory 1 from the application unit 16
When the instruction data for initializing the flash memory 18 is received, the entire data area of the flash memory 18 is erased and the flash memory 1 is erased.
8 is initialized (step 55), a default storage destination is allocated (step 56), and the above-described data position search table and the like are created (step 57), and the initialized code is stored in the initialized code area of the flash memory 18. (Step 58), and waits for the next instruction data from the application unit 16 (step 52).

【0035】このように、アプリケーション部16は、
フラッシュメモリ18の初期化済コード領域に書き込ま
れた初期化済コードに基づいて、フラッシュメモリ18
が初期化済か否かを判断し、フラッシュメモリ18が初
期化されていない場合は、インターフェース部17がア
プリケーション部16からの指示データに基づいてフラ
ッシュメモリ18を初期化しているので、フラッシュメ
モリ18が初期化されていない状態で、デフォルトの記
憶先割当を行って、書込エラーが発生したり、初期化さ
れていないフラッシュメモリ18からデータ位置検索表
等を作成しようとして誤動作したり、初期化済のフラッ
シュメモリ18を誤って初期化したりすることがない。
As described above, the application unit 16
Based on the initialized code written in the initialized code area of the flash memory 18, the flash memory 18
It is determined whether or not the flash memory 18 has been initialized. If the flash memory 18 has not been initialized, the interface unit 17 has initialized the flash memory 18 based on the instruction data from the application unit 16. Is not initialized, a default storage destination is assigned, a write error occurs, a malfunction occurs when an attempt is made to create a data position search table or the like from the uninitialized flash memory 18, or the initialization is performed. The used flash memory 18 will not be initialized by mistake.

【0036】また、ユーザが設定装置11を操作して、
例えばパターン72登録データの設定を行うと、伝送処
理部14が、設定装置11から通信線12を介して送信
されたパターン72登録データを受信し、アプリケーシ
ョン部16にパターン72登録データを出力する。アプ
リケーション部16は、伝送処理部14からパターン7
2登録データが入力されると、このデータがパターン7
2登録データであることを示す内容コードCODE1
1、CODE2 =72をパターン72登録データに付加
した信号を指示データとしてインターフェース部17に
出力し、書込み依頼を行う。
Further, the user operates the setting device 11 to
For example, when setting the pattern 72 registration data, the transmission processing unit 14 receives the pattern 72 registration data transmitted from the setting device 11 via the communication line 12 and outputs the pattern 72 registration data to the application unit 16. The application unit 16 transmits the pattern 7 from the transmission processing unit 14.
2 When the registration data is input, the data
2 Content code CODE 1 indicating registration data =
1. A signal in which CODE 2 = 72 is added to the pattern 72 registration data is output to the interface unit 17 as instruction data, and a write request is made.

【0037】ステップ53で、インターフェース部17
にアプリケーション部16から書込み依頼の指示データ
が入力されると、インターフェース部17は、内容コー
ド(CODE1 =1、CODE2 =72)及びデータ位
置検索表等から、パターン72登録データの書込み先の
セクタ及びブロックを選択し(ステップ59)、書込み
先のセクタに空きブロックがあるか否かを判断する(ス
テップ60)。
In step 53, the interface unit 17
When the write request instruction data is input from the application unit 16 to the interface unit 17, the interface unit 17 determines the write destination of the pattern 72 registration data from the content code (CODE 1 = 1, CODE 2 = 72) and the data position search table. A sector and a block are selected (step 59), and it is determined whether or not there is an empty block in the write destination sector (step 60).

【0038】ここで、書込み先のセクタに空きブロック
がある場合、インターフェース部17は、図5のフロー
チャートに示すフラッシュメモリ書込のサブルーチンを
実行し(ステップ62)、アプリケーション部16から
の次の指示データを待機する(ステップ52)。以下、
フラッシュメモリ書込時の動作について図5及び図6を
参照して説明する。新データの書込開始前の時点では
(図6の時刻t1 )、旧データが書き込まれたブロック
に対応するインデックスに、運用中( RUNNING ) を示す
ブロック状態データ(例えば、1000)が書き込まれ、新
データを書き込むブロックに対応するインデックスに、
消去( ERASED )を示すブロック状態データ(例えば、11
11)が書き込まれており、新データが書き込まれるブロ
ックにはデータが全く記憶されていない。したがって、
この時点で停電が発生すると、運用中を示すブロック状
態データが書き込まれた旧データのブロックが有効とな
り、復電時には旧データを使用する。
If there is an empty block in the write destination sector, the interface unit 17 executes the flash memory writing subroutine shown in the flowchart of FIG. 5 (step 62), and the next instruction from the application unit 16 is issued. It waits for data (step 52). Less than,
The operation at the time of writing to the flash memory will be described with reference to FIGS. At the point in time before the start of writing of new data (time t 1 in FIG. 6), block status data (for example, 1000) indicating “running” (RUNNING) is written in the index corresponding to the block in which the old data has been written. , The index corresponding to the block to write new data to,
Block status data indicating erasure (ERASED) (for example, 11
11) is written, and no data is stored in the block to which new data is written. Therefore,
If a power failure occurs at this point, the old data block in which the block status data indicating the operation is being written becomes valid, and the old data is used when the power is restored.

【0039】フラッシュメモリ書込のサブルーチンで
は、インターフェース部17は、新データを書き込むブ
ロックに対応するインデックスに、新データの内容を示
す内容コードと、書込中( WRITING ) であることを示す
ブロック状態データ(例えば、1110)とを書き込む(ス
テップ65)。この時点(図6の時刻t2 )では、旧デ
ータが書き込まれたブロックに対応するインデックス
に、運用中を示すブロック状態データが書き込まれ、新
データを書き込むブロックに対応するインデックスに、
書込中を示すブロック状態データが書き込まれており、
新データが書き込まれるブロックのデータは確定してい
ない。したがって、この時点で停電が発生すると、運用
中を示すブロック状態データが書き込まれた旧データの
ブロックが有効となり、復電時には旧データを使用す
る。
In the flash memory writing subroutine, the interface unit 17 stores, in the index corresponding to the block in which the new data is to be written, a content code indicating the content of the new data and a block state indicating that writing is in progress (WRITING). Data (for example, 1110) is written (step 65). At this time (time t 2 in FIG. 6), the block status data indicating the operation is written in the index corresponding to the block in which the old data is written, and the index corresponding to the block in which the new data is written is
Block status data indicating that writing is in progress has been written,
The data of the block to which the new data is to be written has not been determined. Therefore, if a power failure occurs at this time, the old data block in which the block status data indicating the operation is being written becomes valid, and the old data is used when the power is restored.

【0040】その後、インターフェース部17は、新デ
ータを書き込むブロックに新しいデータを書き込み(ス
テップ66)、このブロックに対応するインデックスに
書込完了( WROTE ) を示すブロック状態データ(例え
ば、1100)を書き込む(ステップ67)。この時点(図
6の時刻t3 )では、旧データが書き込まれたブロック
に対応するインデックスに、運用中を示すブロック状態
データが書き込まれ、新データが書き込まれたブロック
に対応するインデックスに書込完了を示すブロック状態
データが書き込まれており、新データが書き込まれたブ
ロックのデータが確定している。したがって、この時点
で停電が発生すると、書込完了を示すブロック状態デー
タが書き込まれた新データのブロックが有効となり、復
電時には新データを使用する。
Thereafter, the interface unit 17 writes new data in the block in which the new data is to be written (step 66), and writes block status data (for example, 1100) indicating write completion (WROTE) in the index corresponding to this block. (Step 67). At this time (time t 3 in FIG. 6), the block status data indicating the operation is written in the index corresponding to the block in which the old data is written, and is written in the index corresponding to the block in which the new data is written. The block status data indicating completion is written, and the data of the block in which the new data has been written is determined. Therefore, if a power failure occurs at this time, the new data block in which the block status data indicating the completion of writing is written becomes valid, and the new data is used when the power is restored.

【0041】次に、インターフェース部17は、旧デー
タがあるか否かを判断し(ステップ68)、旧データが
ある場合は、旧データが書き込まれたブロックに対応す
るインデックスに使用済( USED )を示すブロック状態デ
ータ(例えば、0000) を書き込む(ステップ69)。こ
の時点(図6の時刻t4 )では、旧データが書き込まれ
たブロックに対応するインデックスに、使用済を示すブ
ロック状態データが書き込まれ、新データが書き込まれ
たブロックに対応するインデックスに書込完了を示すブ
ロック状態データが書き込まれており、旧データが書き
込まれたブロックのデータが消失し、新データが書き込
まれたブロックのデータが確定している。したがって、
この時点で停電が発生すると、書込完了を示すブロック
状態データが書き込まれた新データのブロックが有効と
なり、復電時には新データを使用する。その後、インタ
ーフェース部17は、新データを書き込んだブロックに
対応するインデックスに運用中を示すブロック状態デー
タを書き込む(ステップ70)。一方、旧データが無い
場合、ステップ70に移行して、インターフェース部1
7は、新データを書き込んだブロックに対応するインデ
ックスに運用中を示すブロック状態データを書き込む。
Next, the interface unit 17 determines whether or not there is old data (step 68). If there is old data, it is used (USED) for the index corresponding to the block in which the old data has been written. Is written (step 69). At this time (time t 4 in FIG. 6), the block status data indicating used is written in the index corresponding to the block in which the old data has been written, and the index is written in the index corresponding to the block in which the new data has been written. Block status data indicating completion has been written, data of the block to which old data has been written has disappeared, and data of the block to which new data has been written has been determined. Therefore,
If a power failure occurs at this point, the new data block in which the block status data indicating the write completion is written becomes valid, and the new data is used when the power is restored. After that, the interface unit 17 writes the block status data indicating that it is in operation to the index corresponding to the block in which the new data has been written (step 70). On the other hand, if there is no old data, the process proceeds to step 70 and the interface unit 1
Reference numeral 7 writes block status data indicating that operation is in progress to an index corresponding to the block in which the new data has been written.

【0042】このように、セクタ中の空きブロックにデ
ータを書き込む際に、インターフェース部17が、新デ
ータを書き込むブロックに対応するインデックスに書込
中、書込完了等の書込状態を示すブロック状態データを
書き込んでいるので、書込中のどの時点で停電が発生し
ても、復電時にどのブロックのデータを最新のデータと
して使用すれば良いか、インターフェース部17がブロ
ック状態データから容易に判別できる。
As described above, when data is written to a free block in a sector, the interface unit 17 is writing to the index corresponding to the block in which new data is to be written, and is a block state indicating a write state such as writing completed. Since data is being written, even if a power failure occurs at any point during writing, the interface unit 17 can easily determine from the block state data which block data should be used as the latest data when the power is restored. it can.

【0043】また、ステップ60で書込み先のセクタに
空きブロックがあるか否かを判断した結果、書込み先の
セクタに空き領域が無ければ、インターフェース部17
は、図7のフローチャートに示すガーベッジコレクトの
サブルーチンを実行した後(ステップ61)、ステップ
62のフラッシュメモリ書込のサブルーチンに移行す
る。
If it is determined in step 60 whether or not there is an empty block in the write destination sector, and there is no empty area in the write destination sector, the interface unit 17
Executes the garbage correct subroutine shown in the flowchart of FIG. 7 (step 61), and then proceeds to the flash memory writing subroutine of step 62.

【0044】ガーベッジコレクトのサブルーチンでは、
先ずインターフェース部17は、フラッシュメモリ18
の未使用のセクタの中から、使用回数が最小のセクタを
書き写し先のセクタ(以下、新セクタという)として選
択する(ステップ71)。この時点では(図8の時刻t
11)、現在使用中のセクタ(以下、旧セクタという)の
セクタ管理部に、運用中( RUNNING ) を示すセクタ状態
データ(例えば、1000)が書き込まれ、新セクタのセク
タ管理部に、消去( ERASED )を示すセクタ状態データ
(例えば、1111)が書き込まれており、新セクタにはデ
ータが全く記憶されていない。したがって、この時点で
停電が発生すると、運用中を示すセクタ状態データが書
き込まれた旧セクタが有効となり、復電時には旧セクタ
を使用する。
In the garbage collect subroutine,
First, the interface unit 17 includes a flash memory 18.
The sector with the least number of uses is selected as a destination sector (hereinafter referred to as a new sector) from among the unused sectors (step 71). At this point (time t in FIG. 8)
11 ) Sector status data (for example, 1000) indicating operation (RUNNING) is written to the sector management unit of the currently used sector (hereinafter, referred to as the old sector), and erase ( ERASED) has been written, and no data is stored in the new sector. Therefore, if a power failure occurs at this time, the old sector in which the sector status data indicating the operation is being written becomes valid, and the old sector is used when the power is restored.

【0045】次に、インターフェース部17は、新セク
タのセクタ管理部に、書き込むデータの内容を示す内容
コードと、書込中( WRITING ) を示すセクタ状態データ
(例えば、1110)を書き込む(ステップ72)。この時
点(図8の時刻t12)では、旧セクタのセクタ管理部に
運用中を示すセクタ状態データが書き込まれ、新セクタ
のセクタ管理部に書込中を示すセクタ状態データが書き
込まれており、新セクタのデータは確定していない。し
たがって、この時点で停電が発生すると、運用中を示す
セクタ状態データが書き込まれた旧セクタが有効とな
り、復電時には旧セクタを使用する。
Next, the interface unit 17 writes the content code indicating the content of the data to be written and the sector status data (for example, 1110) indicating the writing (WRITING) to the sector management unit of the new sector (step 72). ). At this point in time (time t 12 in FIG. 8), the sector status data indicating the operation is written in the sector management unit of the old sector, and the sector status data indicating the writing is written in the sector management unit of the new sector. The data of the new sector has not been determined. Therefore, if a power failure occurs at this time, the old sector in which the sector status data indicating the operation is being written becomes valid, and the old sector is used when the power is restored.

【0046】その後、インターフェース部17は、対応
するインデックスに運用中を示すブロック状態データが
書き込まれたブロックのデータのみを新セクタに書き写
し(ステップ73)、新セクタのセクタ管理部に書込完
了( WROTE ) を示すセクタ状態データ(例えば、1100)
を書き込む(ステップ74)。この時点(図8の時刻t
13)では、旧セクタのセクタ管理部に運用中を示すセク
タ状態データが書き込まれ、新セクタのセクタ管理部に
書込完了を示すブロック状態データが書き込まれてお
り、新セクタのデータが確定している。したがって、こ
の時点で停電が発生すると、書込完了を示すセクタ状態
データが書き込まれた新セクタが有効となり、復電時に
は新セクタを使用する。
Thereafter, the interface unit 17 copies only the data of the block in which the block status data indicating the operation is written in the corresponding index to the new sector (step 73), and completes the writing to the sector management unit of the new sector (step 73). WROTE) Sector status data (eg, 1100)
Is written (step 74). At this time (time t in FIG. 8)
In 13 ), the sector status data indicating the operation is written in the sector management unit of the old sector, and the block status data indicating the completion of writing is written in the sector management unit of the new sector, and the data of the new sector is determined. ing. Therefore, if a power failure occurs at this time, the new sector in which the sector status data indicating the completion of writing is written becomes valid, and the new sector is used when the power is restored.

【0047】次に、インターフェース部17は、旧セク
タのセクタ管理部に使用済( USED )を示すセクタ状態デ
ータ(例えば、0000)を書き込む(ステップ75)。こ
の時点(図8の時刻t14)では、旧セクタのセクタ管理
部に使用済を示すセクタ状態データが書き込まれ、新セ
クタのセクタ管理部に書込完了を示すブロック状態デー
タが書き込まれており、旧セクタのデータが消失し、新
セクタのデータが確定している。したがって、この時点
で停電が発生すると、書込完了を示すセクタ状態データ
が書き込まれた新セクタが有効となり、復電時には新セ
クタを使用する。
Next, the interface unit 17 writes sector status data (for example, 0000) indicating used (USED) to the sector management unit of the old sector (step 75). In this point (time t 14 in FIG. 8), the sector status data indicating a dirty sector management of the old sector is written, and the block status data indicating the completion of writing to the sector management section of the new sector is written , The data of the old sector has been lost, and the data of the new sector has been determined. Therefore, if a power failure occurs at this time, the new sector in which the sector status data indicating the completion of writing is written becomes valid, and the new sector is used when the power is restored.

【0048】さらに、インターフェース部17は、新セ
クタのセクタ管理部に運用中を示すセクタ状態データを
書き込む(ステップ76)。この時点(図8の時刻
15)では、旧セクタのセクタ管理部に使用済を示すセ
クタ状態データが書き込まれ、新セクタのセクタ管理部
に運用中を示すブロック状態データが書き込まれてお
り、旧セクタのデータが消失し、新セクタのデータが確
定している。したがって、この時点で停電が発生する
と、運用中を示すセクタ状態データが書き込まれた新セ
クタが有効となり、復電時には新セクタを使用する。
Further, the interface unit 17 writes sector status data indicating that the sector is in operation to the sector management unit of the new sector (step 76). In this point (time t 15 in FIG. 8), the sector status data indicating a dirty sector management of the old sector is written, and the block state data indicating in operation to the sector management section of the new sector is written, The data of the old sector has been lost, and the data of the new sector has been determined. Therefore, if a power failure occurs at this time, the new sector in which the sector status data indicating that the operation is in progress is valid, and the new sector is used when the power is restored.

【0049】その後、インターフェース部17は、旧セ
クタのカウンタ領域に記憶された使用回数を読み出し
(ステップ77)、旧セクタのデータを消去して(ステ
ップ78)、旧セクタの使用回数に1を加算した値を旧
セクタのカウンタ領域に書き込み(ステップ79)、旧
セクタの初期化済コード領域に初期化済コードを書き込
む(ステップ80)。
Thereafter, the interface unit 17 reads the number of times of use stored in the counter area of the old sector (step 77), deletes the data of the old sector (step 78), and adds 1 to the number of times of use of the old sector. The written value is written to the counter area of the old sector (step 79), and the initialized code is written to the initialized code area of the old sector (step 80).

【0050】このように、セクタ中に空きブロックが無
くなり、ガーベッジコレクトを行う際に、インターフェ
ース部がセクタ管理部に書込中、書込完了等のセクタの
状態を示すセクタ状態データを書き込んでいるので、書
込中のどの時点で停電が発生しても、停電復帰後どのセ
クタのデータを最新のデータとして使用すれば良いか、
インターフェース部が容易に判別できる。
As described above, when there is no free block in the sector and garbage collection is performed, the interface unit writes sector status data indicating the status of the sector, such as writing or completion of writing, to the sector management unit. Therefore, even if a power failure occurs at any point during writing, which sector data should be used as the latest data after the power failure recovery,
The interface can be easily identified.

【0051】ところで、停電等により電源供給が停止し
た場合、停電検出部15が電源供給の停止を検出し、ア
プリケーション部16に検出信号を出力する。アプリケ
ーション部16は、停電検出部15から検出信号が入力
されると、緊急書込みを示す緊急コードを付加した指示
データをインターフェース部17に出力し、所定の状態
データを退避させるようにインターフェース部17に書
込み依頼を行う。ステップ53で、インターフェース部
17がアプリケーション部16から緊急コードの付加さ
れた指示データを受け取ると、緊急書込用の未使用のセ
クタを選択して(ステップ63)、このセクタに所定の
状態データを書き込む(ステップ64)。なお停電復帰
後、インターフェース部17が緊急書込用のセクタから
データを一旦読み出すと、インターフェース部17は緊
急書込用のセクタのデータを消去し、このセクタを未使
用の状態にするため、緊急時には常に未使用のセクタに
データを書き込むことができる。したがって、緊急時に
セクタ中の空きブロックがなくなって、ガーベッジコレ
クトを行うということがなく、ガーベッジコレクトによ
る時間遅れによってデータの退避が行えないといった事
態を防止することができる。
When the power supply is stopped due to a power failure or the like, the power failure detection unit 15 detects the stop of the power supply and outputs a detection signal to the application unit 16. When a detection signal is input from the power failure detection unit 15, the application unit 16 outputs instruction data to which an emergency code indicating emergency writing is added to the interface unit 17, and sends the instruction data to the interface unit 17 so as to save predetermined state data. Make a write request. In step 53, when the interface unit 17 receives the instruction data with the emergency code added from the application unit 16, it selects an unused sector for emergency writing (step 63) and stores predetermined state data in this sector. Write (step 64). After the power is restored, once the interface unit 17 once reads data from the emergency write sector, the interface unit 17 erases the data in the emergency write sector and sets this sector to an unused state. Sometimes data can always be written to unused sectors. Therefore, it is possible to prevent a situation in which data cannot be saved due to a time delay due to garbage collection without the occurrence of empty blocks in the sector in an emergency and no garbage collection.

【0052】尚、本実施形態では、本発明の制御システ
ムを照明制御装置に適用しているが、照明以外の空調や
動力などの制御装置に適用しても良いことは言うまでも
ない。
In this embodiment, the control system of the present invention is applied to a lighting control device. However, it goes without saying that the control system may be applied to a control device other than lighting, such as air conditioning and power.

【0053】[0053]

【発明の効果】上述のように、請求項1の発明は、メモ
リ空間が複数の記憶消去単位に分割され、記憶消去単位
毎にデータが消去される電気的に書換可能なフラッシュ
メモリと、フラッシュメモリへのデータの書込みや読出
しを行うインターフェース部とを備え、記憶消去単位毎
にデータの書込状態を示す書込状態情報を記憶する第1
の書込状態記憶領域をフラッシュメモリに設け、インタ
ーフェース部は、何れかの記憶消去単位へデータを書き
込む際に当該記憶消去単位中に空き領域が無くなった場
合、当該記憶消去単位中の有効なデータのみを別の未使
用の記憶消去単位に書き写すと共に、記憶消去単位毎の
データの書込開始時点、書込完了時点、書き写し先の記
憶消去単位のデータを有効にする時点、書き写し元の記
憶消去単位のデータを使用済みにする時点において、そ
れぞれ、第1の書込状態記憶領域の書込状態情報を更新
しているので、インターフェース部は、第1の書込状態
記憶領域に書き込まれた書込状態情報から、対応する記
憶消去単位の現在の書込状態を把握することができる。
したがって、書込中のどの時点で停電が発生しても、書
込状態情報から記憶消去単位のデータが有効か否かを容
易に判断できるという効果がある。
As described above, according to the first aspect of the present invention, there is provided an electrically rewritable flash memory in which a memory space is divided into a plurality of storage erasure units, and data is erased for each storage erasure unit; An interface unit for writing and reading data to and from a memory, and storing first write state information indicating a write state of data for each storage erase unit
Is provided in the flash memory, and when writing data to any one of the storage erasure units, if there is no free space in the storage erasure unit, the interface unit stores the valid data in the storage erasure unit. Is copied to another unused storage erasure unit, and at the same time, the data write start time, write completion time, and copy destination
When the data in the erase unit becomes valid, the copy source
At the time when the data in the erase unit is used,
Since the write state information of the first write state storage area is updated, the interface unit performs the corresponding storage erase from the write state information written in the first write state storage area. The current write state of the unit can be grasped.
Therefore, even if a power failure occurs at any time during writing, it is possible to easily determine whether or not the data of the storage erase unit is valid from the write state information.

【0054】請求項2の発明は、記憶消去単位に、デー
タが書き込まれる複数の記憶単位と、記憶単位毎のデー
タの書込状態を示す書込状態情報を記憶する第2の書込
状態記憶領域とを設け、インターフェース部は、記憶単
位毎のデータの書込状態が変化すると、第2の書込状態
記憶領域の書込状態情報を更新しているので、インター
フェース部は、第2の書込状態記憶領域に書き込まれた
書込状態情報から、各記憶単位へのデータの書込状態を
把握できる。したがって、書込中のどの時点で停電が発
生しても、書込前の古いデータと新たに書き込まれたデ
ータのどちらが有効かを容易に判断できるという効果が
ある。
According to a second aspect of the present invention, there is provided a second write state storage for storing a plurality of storage units into which data is written and write state information indicating a write state of data for each storage unit in a storage erase unit. And the interface unit updates the write state information of the second write state storage area when the write state of the data for each storage unit changes. From the write state information written in the write state storage area, the write state of data to each storage unit can be grasped. Therefore, even if a power failure occurs at any time during writing, it is possible to easily determine which of the old data before writing and the newly written data is valid.

【0055】請求項3の発明は、インターフェース部に
データの書込みや読出しを指示する指示データを出力す
るアプリケーション部を備え、アプリケーション部から
の指示データに緊急時を示す緊急コードが含まれる場
合、インターフェース部は通常時に書き込む記憶消去単
位とは別の未使用の緊急書込み用記憶消去単位にデータ
を書き込んでいる。緊急時にデータを退避させる際に、
記憶消去単位中の空き領域が無くなり、ガーベッジコレ
クトを行った場合、データの書き込みが間に合わなくな
る可能性があるが、未使用の緊急書込み用記憶消去単位
にデータを退避させているので、データの書込みが間に
合わなくなるような事態を防止できるという効果があ
る。
According to a third aspect of the present invention, an interface unit is provided with an application unit for outputting instruction data for instructing data writing and reading, and when the instruction data from the application unit includes an emergency code indicating an emergency, The unit writes data in an unused emergency write storage erase unit different from the memory erase unit normally written. When evacuating data in an emergency,
If there is no free space in the memory erasure unit and garbage collection is performed, data may not be written in time.However, data is saved in an unused emergency write memory erasure unit. This has the effect of preventing a situation in which the user cannot make it in time.

【0056】請求項4の発明は、記憶消去単位毎に該記
憶消去単位の使用回数を記憶するカウンタ領域を設け、
記憶消去単位のデータが消去される毎に、カウンタ領域
に記憶された使用回数がカウントアップされて、カウン
タ領域に書き込まれているので、インターフェース部
は、カウンタ領域に書き込まれた使用回数から、記憶消
去単位の使用回数を把握でき、記憶消去単位を均等に使
用することにより、メモリの寿命を伸ばすことができ
る。
According to a fourth aspect of the present invention, a counter area for storing the number of times of use of the storage erasure unit is provided for each storage erasure unit,
Each time data in the storage erasure unit is erased, the number of times of use stored in the counter area is counted up and written to the counter area. The number of uses of the erase unit can be grasped, and the life of the memory can be extended by using the memory erase unit equally.

【0057】請求項5の発明は、フラッシュメモリが初
期化済みか否かを示す初期化済コードを記憶する初期化
済コード領域をフラッシュメモリに設け、インターフェ
ース部が、フラッシュメモリの初期化時及び記憶消去単
位のデータの消去時に、初期化済コードを初期化済コー
ド領域へ書き込んでいるので、インターフェース部は、
初期化済コード領域に書き込まれた初期化済コードから
フラッシュメモリが初期化済か否かを把握することがで
き、フラッシュメモリへのデータの書き込みが失敗する
のを防止できるという効果がある。
According to a fifth aspect of the present invention, an initialized code area for storing an initialized code indicating whether or not the flash memory has been initialized is provided in the flash memory, and the interface unit is provided when the flash memory is initialized. Since the initialized code is written in the initialized code area at the time of erasing the data of the memory erasing unit, the interface unit
It is possible to know whether or not the flash memory has been initialized from the initialized code written in the initialized code area, and it is possible to prevent the failure of writing data to the flash memory.

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

【図1】本実施形態の制御システムの概略構成図であ
る。
FIG. 1 is a schematic configuration diagram of a control system according to an embodiment.

【図2】同上のフラッシュメモリのメモリマップを示す
図である。
FIG. 2 is a diagram showing a memory map of the flash memory according to the first embodiment;

【図3】(a)〜(i)は同上のフラッシュメモリに書
込まれるデータを説明する図である。
FIGS. 3A to 3I are diagrams for explaining data written to a flash memory according to the first embodiment;

【図4】同上の動作を示すフローチャートである。FIG. 4 is a flowchart showing the operation of the above.

【図5】同上のデータ書込動作を示すフローチャートで
ある。
FIG. 5 is a flowchart showing a data write operation of the above.

【図6】同上のデータ書込時のブロック状態データの変
更過程を説明する図である。
FIG. 6 is a diagram for explaining a process of changing block state data at the time of writing data in the embodiment.

【図7】同上のガーベッジコレクトを行う際の動作を示
すフローチャートである。
FIG. 7 is a flowchart showing an operation when garbage collection is performed.

【図8】同上のガーベッジコレクトを行う際のセクタ状
態データの変更過程を説明する図である。
FIG. 8 is a diagram illustrating a process of changing sector state data when performing garbage collection according to the first embodiment.

【図9】(a)〜(d)は従来の制御システムでガーベ
ッジコレクトを行う際の動作を説明する図である。
FIGS. 9A to 9D are diagrams illustrating an operation when performing garbage collection in a conventional control system.

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

10 照明制御装置 11 設定装置 14 伝送処理部 16 アプリケーション部 17 インターフェース部 18 フラッシュメモリ Reference Signs List 10 lighting control device 11 setting device 14 transmission processing unit 16 application unit 17 interface unit 18 flash memory

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/16 310 G11C 16/02 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 12/16 310 G11C 16/02

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】メモリ空間が複数の記憶消去単位に分割さ
れ、記憶消去単位毎にデータが消去される電気的に書換
可能なフラッシュメモリと、フラッシュメモリへのデー
タの書込みや読出しを行うインターフェース部とを備
え、記憶消去単位毎にデータの書込状態を示す書込状態
情報を記憶する第1の書込状態記憶領域をフラッシュメ
モリに設け、インタフェース部は、何れかの記憶消去単
位へデータを書き込む際に当該記憶消去単位中に空き領
域が無くなった場合、当該記憶消去単位中の有効なデー
タのみを別の未使用の記憶消去単位に書き写すと共に、
記憶消去単位毎のデータの書込開始時点、書込完了時
点、書き写し先の記憶消去単位のデータを有効にする時
点、書き写し元の記憶消去単位のデータを使用済みにす
る時点において、それぞれ、第1の書込状態記憶領域の
書込状態情報を更新することを特徴とする制御システ
ム。
1. An electrically rewritable flash memory in which a memory space is divided into a plurality of storage erasure units and data is erased in each storage erasure unit, and an interface unit for writing and reading data to and from the flash memory. A first write state storage area for storing write state information indicating a data write state for each storage erase unit is provided in the flash memory, and the interface unit stores the data in one of the storage erase units. If there is no free space in the storage erasure unit when writing, only valid data in the storage erasure unit is copied to another unused storage erasure unit,
At the start of writing data and at the end of writing data for each storage erasure unit
When validating the data of the memory erase unit of the point and the copy destination
The data of the memory erase unit of the
At a certain point in time, the control system updates the write state information in the first write state storage area.
【請求項2】記憶消去単位に、データが書き込まれる複
数の記憶単位と、記憶単位毎のデータの書込状態を示す
書込状態情報を記憶する第2の書込状態記憶領域とを設
け、インターフェース部は、記憶単位毎のデータの書込
状態が変化すると、第2の書込状態記憶領域の書込状態
情報を更新することを特徴とする請求項1記載の制御シ
ステム。
A plurality of storage units to which data is written, and a second write state storage area for storing write state information indicating a write state of data for each storage unit; 2. The control system according to claim 1, wherein the interface unit updates the write state information of the second write state storage area when the data write state of each storage unit changes.
【請求項3】インターフェース部にデータの書込みや読
出しを指示する指示データを出力するアプリケーション
部を備え、アプリケーション部からの指示データに緊急
時を示す緊急コードが含まれる場合、インターフェース
部は通常時に書き込む記憶消去単位とは別の未使用の緊
急書込み用記憶消去単位にデータを書き込むことを特徴
とする請求項1又は2記載の制御システム。
3. An interface unit comprising: an application unit for outputting instruction data for instructing writing and reading of data; and when the instruction data from the application unit includes an emergency code indicating an emergency, the interface unit writes in an ordinary time. 3. The control system according to claim 1, wherein data is written in an unused emergency write storage erase unit different from the storage erase unit.
【請求項4】記憶消去単位毎に該記憶消去単位の使用回
数を記憶するカウンタ領域を設け、記憶消去単位のデー
タが消去される毎に、カウンタ領域に記憶された使用回
数がカウントアップされて、カウンタ領域に書き込まれ
ることを特徴とする請求項1乃至3記載の制御システ
ム。
4. A counter area for storing the number of times of use of the memory erasure unit is provided for each memory erasure unit, and the number of times of use stored in the counter area is counted up every time data of the memory erasure unit is erased. 4. The control system according to claim 1, wherein the data is written in a counter area.
【請求項5】フラッシュメモリが初期化済みか否かを示
す初期化済コードを記憶する初期化済コード領域をフラ
ッシュメモリに設け、インターフェース部が、フラッシ
ュメモリの初期化時及び記憶消去単位のデータの消去時
に、初期化済コードを初期化済コード領域へ書き込むこ
とを特徴とする請求項1乃至4記載の制御システム。
5. An initialized code area for storing an initialized code indicating whether or not the flash memory has been initialized is provided in the flash memory. 5. The control system according to claim 1, wherein when the data is erased, the initialized code is written to the initialized code area.
JP28179197A 1997-10-15 1997-10-15 Control system Expired - Fee Related JP3271935B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28179197A JP3271935B2 (en) 1997-10-15 1997-10-15 Control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28179197A JP3271935B2 (en) 1997-10-15 1997-10-15 Control system

Publications (2)

Publication Number Publication Date
JPH11120085A JPH11120085A (en) 1999-04-30
JP3271935B2 true JP3271935B2 (en) 2002-04-08

Family

ID=17644037

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28179197A Expired - Fee Related JP3271935B2 (en) 1997-10-15 1997-10-15 Control system

Country Status (1)

Country Link
JP (1) JP3271935B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4492025B2 (en) 2002-05-21 2010-06-30 株式会社デンソー Data storage method for electronic control unit
JP2007265496A (en) * 2006-03-28 2007-10-11 Toshiba Corp Ic card, and data managing method of nonvolatile memory
JP5287117B2 (en) * 2008-10-09 2013-09-11 横河電機株式会社 measuring device
JP5695112B2 (en) 2013-03-18 2015-04-01 富士通テン株式会社 Data storage device, data storage method, and in-vehicle control device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05151109A (en) * 1991-11-27 1993-06-18 Nec Corp Main storage data assurance mechanism
JPH08138391A (en) * 1994-11-09 1996-05-31 Hitachi Ltd Flash memory control system
FR2730833B1 (en) * 1995-02-16 1997-03-28 Gemplus Card Int SECURE UPDATE OF EEPROM MEMORY
JP3364356B2 (en) * 1995-03-30 2003-01-08 富士通株式会社 Memory rewriting device
JPH0997218A (en) * 1995-09-28 1997-04-08 Canon Inc Method and device for managing flash rom and computer control equipment
JPH09120376A (en) * 1995-10-25 1997-05-06 Fujitsu Ten Ltd Data processor

Also Published As

Publication number Publication date
JPH11120085A (en) 1999-04-30

Similar Documents

Publication Publication Date Title
JP4268396B2 (en) Non-volatile memory device file management that can be programmed once
KR100644602B1 (en) Method for driving remapping for flash memory and flash memory architecture thereto
JP3906825B2 (en) Computer system, computer system activation method and program
US5832493A (en) Flash file management system
JP5420814B2 (en) Storage system having scheme for invalidating data stored in buffer memory and computing system including the same
JP5336060B2 (en) Nonvolatile memory device and method of operating the same
US6038636A (en) Method and apparatus for reclaiming and defragmenting a flash memory device
JP2006294061A (en) Memory management
JP2006079543A (en) Memory management device
JPWO2005103903A1 (en) Nonvolatile storage system
WO2006098212A1 (en) Memory controller, nonvolatile storage device, nonvolatile storage system and data write method
WO2003056433A1 (en) Memory device and recording/reproducing apparatus using the same
WO2006067923A1 (en) Memory controller, nonvolatile storage, nonvolatile storage system, and memory control method
JPWO2007066720A1 (en) Nonvolatile storage device, data read method, and management table creation method
JPH10133940A (en) Memory device
US6839798B1 (en) Flash memory capable of storing frequently rewritten data
JP3268130B2 (en) Data processing device using flash EEPROM
JP2000222292A (en) Data managing method utilizing flash memory
JPH03224045A (en) Data holding system
KR20010037155A (en) Flash file system
JP4242245B2 (en) Flash ROM control device
JP4175881B2 (en) Nonvolatile memory storage method and storage device
JP3271935B2 (en) Control system
JPH11272569A (en) Data restoration system for outer storage device using flash memory
KR20000039727A (en) Method for approaching flash memory

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020108

LAPS Cancellation because of no payment of annual fees