JP2010079758A - Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer - Google Patents

Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer Download PDF

Info

Publication number
JP2010079758A
JP2010079758A JP2008249387A JP2008249387A JP2010079758A JP 2010079758 A JP2010079758 A JP 2010079758A JP 2008249387 A JP2008249387 A JP 2008249387A JP 2008249387 A JP2008249387 A JP 2008249387A JP 2010079758 A JP2010079758 A JP 2010079758A
Authority
JP
Japan
Prior art keywords
control flow
nonvolatile memory
interrupted
memory
rewrite
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008249387A
Other languages
Japanese (ja)
Inventor
Kohei Uesugi
晃平 上杉
Yu Ito
裕 伊藤
Takeaki Moto
剛明 本
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 Corp
Original Assignee
Panasonic Corp
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 Panasonic Corp filed Critical Panasonic Corp
Priority to JP2008249387A priority Critical patent/JP2010079758A/en
Publication of JP2010079758A publication Critical patent/JP2010079758A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Read Only Memory (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To automatically interrupt automatic rewriting processing of a nonvolatile memory within a predetermined time. <P>SOLUTION: In the nonvolatile memory 100, a rewriting control unit 120 executes a control flow comprising a plurality of divided control flows to control rewriting of a memory array 130 according to results of decoding a command input from the outside by a command decoding unit 110. The rewriting control unit 120 interrupts the control flow for each time when one divided control flow is completed, and makes the memory array 130 readable. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、書き換え可能な不揮発性メモリの自動書き換えを中断して読み出し動作を可能とする技術に関するものである。具体的には、自動書き換えを中断するための構成を内蔵した不揮発性メモリに関し、さらにCPUと不揮発性メモリとを集積化し、不揮発性メモリの自動書き換えを中断する構成を内蔵したマイクロコンピュータに関するものである。   The present invention relates to a technique that enables a read operation by interrupting automatic rewriting of a rewritable nonvolatile memory. Specifically, the present invention relates to a non-volatile memory with a built-in configuration for interrupting automatic rewriting, and further relates to a microcomputer with a built-in configuration for interrupting automatic rewriting of non-volatile memory by integrating a CPU and a non-volatile memory. is there.

書き換え可能な不揮発性メモリには、自動書き換え機能およびその中断機能を有するものがある(特許文献1参照)。   Some rewritable nonvolatile memories have an automatic rewriting function and an interruption function thereof (see Patent Document 1).

それは、自動消去中に保留信号がアクティブになると消去を中断し、保留信号が非活動であるときに所定の状態により消去を再開するものである。
特許第3415172号
It suspends erasure when a hold signal becomes active during automatic erasure, and resumes erasure according to a predetermined state when the hold signal is inactive.
Japanese Patent No. 3415172

しかしながら、上記のような不揮発性メモリでは消去を中断するには、中断を指示するコマンドを不揮発性メモリに入力し、保留信号をアクティブにする必要がある。近年の組み込み用とのアプリケーションでは、数ms単位からなる一連の処理(タスク)を切り替えながら機器の制御を行うタスク管理方式が多く採用されている。その一方で不揮発性メモリの書き換え(消去および書き込み)は一般的に数msから数秒かかるため、あるタスク中に不揮発性メモリの書き換えが発生しても、そのタスク中に書き換えが完了しない。また、書き換え中には不揮発性メモリの内容を読み出すことができないため、不揮発性メモリに格納された次のタスク用のプログラムを実行できず、タスクの切り替えが阻害されてしまう。これを解決するためには、専用のタイマを用いて時間を計測し、所望の時間で不揮発性メモリの書き換えを中断するために、中断を指示するコマンドを入力する必要がある。   However, in the nonvolatile memory as described above, in order to interrupt the erasure, it is necessary to input a command instructing the interruption to the nonvolatile memory and activate the hold signal. In recent applications for embedding, a task management method is often employed in which a device is controlled while switching a series of processing (tasks) in units of several ms. On the other hand, since rewriting (erasing and writing) of the nonvolatile memory generally takes several milliseconds to several seconds, even if the nonvolatile memory is rewritten during a certain task, the rewriting is not completed during the task. Further, since the contents of the nonvolatile memory cannot be read during rewriting, the program for the next task stored in the nonvolatile memory cannot be executed, and task switching is hindered. In order to solve this, it is necessary to input a command for instructing interruption in order to measure time using a dedicated timer and interrupt rewriting of the nonvolatile memory at a desired time.

本発明は、上記の点に鑑み、不揮発性メモリの書き換え処理が所定の時間内に自動で中断できるようにすることを目的とする。   In view of the above points, an object of the present invention is to enable a nonvolatile memory rewrite process to be automatically interrupted within a predetermined time.

上記課題を解決するために、本発明の不揮発性メモリの自動書き換え中断方法は、不揮発性メモリを書き換えるための所定の制御フローを複数個の分割制御フローから構成し、複数個の分割制御フローの1つが完了する度に制御フローの実行を中断することにより不揮発性メモリの書き換えを中断し、不揮発性メモリを読み出し可能な状態とする。   In order to solve the above-described problem, the non-volatile memory automatic rewrite interruption method of the present invention comprises a predetermined control flow for rewriting a non-volatile memory comprising a plurality of division control flows, By interrupting the execution of the control flow every time one is completed, the rewriting of the non-volatile memory is interrupted to make the non-volatile memory readable.

これにより、分割制御フローが完了する度に書き換えのための制御フローを中断するので、自動で不揮発性メモリの書き換え処理を中断することができる。   Thus, the rewrite control flow is interrupted every time the division control flow is completed, so that the rewrite processing of the nonvolatile memory can be automatically interrupted.

上記本発明の不揮発性メモリの自動書き換え中断方法においては、不揮発性メモリの書き換えを中断した状態から不揮発性メモリの書き換えを再開するために必要な再開情報を記憶し、制御フローとして、再開情報から決定される所定の分割制御フローを実行し、所定の分割制御フローが完了すると制御フローの実行を中断するとともに、再開情報を更新記憶することが好ましい。   In the non-volatile memory automatic rewrite interruption method of the present invention, the resumption information necessary for resuming the rewrite of the non-volatile memory from the state where the rewrite of the non-volatile memory is interrupted is stored, and from the resumption information as a control flow It is preferable that the predetermined divided control flow to be determined is executed, and when the predetermined divided control flow is completed, the execution of the control flow is interrupted and the restart information is updated and stored.

これにより、不揮発性メモリの書き換え処理を自動で中断した後、その状態から再開することができる。   Thereby, after the rewriting process of the nonvolatile memory is automatically interrupted, it can be resumed from that state.

上記本発明の不揮発性メモリの自動書き換え中断方法においては、制御フローでは、まずタイマによる時間計測を開始し、分割制御フローが完了する度に時間超過の有無を確認し、超過していない場合には次の分割制御フローを実行し、超過している場合には制御フローの実行を中断することが好ましい。   In the non-volatile memory automatic rewrite interruption method of the present invention described above, in the control flow, first, time measurement by a timer is started, and when the divided control flow is completed, whether or not the time is exceeded is checked. Preferably executes the next divided control flow and interrupts the execution of the control flow if it is exceeded.

これにより、分割制御フローが完了する度にタイマの時間超過の有無を確認し書き換え制御を中断するか継続するかを決定するので、書き換え処理の中断までの時間を、より所望の時間に近付けることができる。   As a result, each time the division control flow is completed, it is checked whether or not the timer has been exceeded, and it is determined whether or not the rewrite control is interrupted, so that the time until the rewrite processing is interrupted is made closer to the desired time. Can do.

本発明の不揮発性メモリは、書き換え可能な不揮発性メモリであって、複数のメモリセルから構成されるメモリアレイと、不揮発性メモリ外部から入力されるコマンドを解読するコマンド解読部と、コマンド解読部の解読結果により、所定の制御フローに従いメモリアレイを書き換える書き換え制御部と、を備え、制御フローは、複数個の分割制御フローから構成され、複数個の分割制御フローの1つが完了する度に制御フローの実行を中断することによりメモリアレイの書き換えを中断し、メモリアレイを読み出し可能な状態とするように構成されている。   A nonvolatile memory according to the present invention is a rewritable nonvolatile memory, a memory array composed of a plurality of memory cells, a command decoding unit for decoding a command input from the outside of the nonvolatile memory, and a command decoding unit A rewrite control unit that rewrites the memory array according to a predetermined control flow according to the result of decoding, and the control flow is composed of a plurality of division control flows, and is controlled each time one of the plurality of division control flows is completed. By interrupting the execution of the flow, rewriting of the memory array is interrupted so that the memory array can be read.

これにより、分割制御フローが完了する度に書き換えのための制御フローを中断するので、自動で不揮発性メモリの書き換え処理を中断することができる。   Thus, the rewrite control flow is interrupted every time the division control flow is completed, so that the rewrite processing of the nonvolatile memory can be automatically interrupted.

上記本発明の不揮発性メモリにおいては、書き換え制御部は、メモリアレイの書き換えを中断した状態からメモリアレイの書き換えを再開するために必要な再開情報を記憶する再開情報保持部を備え、制御フローとして、再開情報保持部が保持する再開情報から決定される所定の分割制御フローを実行し、所定の分割制御フローが完了すると制御フローの実行を中断するとともに、再開情報を再開情報保持部に更新記憶するように構成されていることが好ましい。   In the above-described nonvolatile memory of the present invention, the rewrite control unit includes a resumption information holding unit that stores resumption information necessary for resuming rewriting of the memory array from a state where rewriting of the memory array is interrupted. The predetermined division control flow determined from the resumption information held by the resumption information holding unit is executed, and when the predetermined division control flow is completed, the execution of the control flow is interrupted and the resumption information is updated and stored in the resumption information holding unit It is preferable that it is comprised.

これにより、不揮発性メモリの書き換え処理を自動で中断した後、その状態から再開することができる。   Thereby, after the rewriting process of the nonvolatile memory is automatically interrupted, it can be resumed from that state.

上記本発明の不揮発性メモリにおいては、時間を計測し所定の時間を超過したことを検出するタイマを備え、制御フローでは、まずタイマの時間計測を開始し、分割制御フローが完了する度にタイマの時間超過の有無を確認し、超過していない場合には次の分割制御フローを実行し、超過している場合には制御フローの実行を中断するように構成されていることが好ましい。   The non-volatile memory of the present invention includes a timer that measures time and detects that a predetermined time has been exceeded. In the control flow, the timer time measurement is first started, and each time the divided control flow is completed, the timer is started. It is preferable to check whether or not the time is exceeded and execute the next divided control flow if the time is not exceeded, and interrupt the execution of the control flow if the time is exceeded.

これにより、分割制御フローが完了する度にタイマの時間超過の有無を確認し書き換え制御を中断するか継続するかを決定するので、書き換え処理の中断までの時間を、より所望の時間に近付けることができる。   As a result, each time the division control flow is completed, it is checked whether or not the timer has been exceeded, and it is determined whether or not the rewrite control is interrupted, so that the time until the rewrite processing is interrupted is made closer to the desired time. Can do.

本発明のマイクロコンピュータは、書き換え可能な不揮発性メモリと、不揮発性メモリを所定の制御フローに従い書き換え制御するCPUとを備えたマイクロコンピュータであって、制御フローは、複数個の分割制御フローから構成され、複数個の分割制御フローの1つが完了する度に制御フローの実行を中断することにより不揮発性メモリの書き換えを中断し、不揮発性メモリを読み出し可能な状態とするように構成されている。   The microcomputer of the present invention is a microcomputer including a rewritable nonvolatile memory and a CPU for rewriting and controlling the nonvolatile memory according to a predetermined control flow, and the control flow is composed of a plurality of divided control flows. Then, every time one of the plurality of divided control flows is completed, the execution of the control flow is interrupted to interrupt the rewriting of the nonvolatile memory so that the nonvolatile memory can be read.

これにより、分割制御フローが完了する度に書き換えのための制御フローを中断するので、自動で不揮発性メモリの書き換え処理を中断することができる。   Thus, the rewrite control flow is interrupted every time the division control flow is completed, so that the rewrite processing of the nonvolatile memory can be automatically interrupted.

上記本発明のマイクロコンピュータによれば、不揮発性メモリの書き換えを中断した状態から不揮発性メモリの書き換えを再開するために必要な再開情報を記憶する再開情報保持部を備え、制御フローとして再開情報保持部が保持する再開情報から決定される所定の分割制御フローを実行し、所定の分割制御フローが完了すると制御フローの実行を中断するとともに、再開情報を再開情報保持部に更新記憶するように構成されていることが好ましい。   According to the microcomputer of the present invention, the resumption information holding unit for storing resumption information necessary for resuming the rewriting of the nonvolatile memory from the state where the rewriting of the non-volatile memory is suspended is provided, and the resumption information is held as a control flow. Configured to execute a predetermined division control flow determined from the resumption information held by the unit, interrupt execution of the control flow when the predetermined division control flow is completed, and update and store the resumption information in the resumption information holding unit It is preferable that

これにより、不揮発性メモリの書き換え処理を自動で中断した後、その状態から再開することができる。   Thereby, after the rewriting process of the nonvolatile memory is automatically interrupted, it can be resumed from that state.

上記本発明のマイクロコンピュータにおいては、時間を計測し所定の時間を超過したことを検出するタイマを備え、制御フローでは、まずタイマの時間計測を開始し、分割制御フローが完了する度にタイマの時間超過の有無を確認し、超過していない場合には次の分割制御フローを実行し、超過している場合には制御フローの実行を中断するように構成されていることが好ましい。   The microcomputer according to the present invention includes a timer that measures time and detects that a predetermined time has been exceeded. In the control flow, the timer time measurement is started first, and the timer is started each time the divided control flow is completed. It is preferable to check whether or not the time is exceeded, and execute the next divided control flow if the time is not exceeded, and interrupt the execution of the control flow if the time is exceeded.

これにより、分割制御フローが完了する度にタイマの時間超過の有無を確認し書き換え制御を中断するか継続するかを決定するので、書き換え処理の中断までの時間を、より所望の時間に近付けることができる。   As a result, each time the division control flow is completed, it is checked whether or not the timer has been exceeded, and it is determined whether or not the rewrite control is interrupted, so that the time until the rewrite processing is interrupted is made closer to the desired time. Can do.

本発明によると、不揮発性メモリの書き換え処理を所定の時間内に自動で中断して読み出し動作を可能とできる。   According to the present invention, the rewriting process of the nonvolatile memory can be automatically interrupted within a predetermined time to enable the reading operation.

以下、本発明の実施の形態について、図面を参照しながら説明する。なお、以下の各実施の形態において、他の実施の形態と同様の機能を有する構成要素については同一の符号を付して説明を省略する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following embodiments, constituent elements having the same functions as those of the other embodiments are denoted by the same reference numerals and description thereof is omitted.

《実施の形態1》
図1は、本発明の実施の形態1に係るフラッシュメモリ100(不揮発性メモリ)の構成を示すブロック図である。
Embodiment 1
FIG. 1 is a block diagram showing a configuration of a flash memory 100 (nonvolatile memory) according to Embodiment 1 of the present invention.

フラッシュメモリ100は、コマンドデコード部110(コマンド解読部)、書き換え制御部120、メモリアレイ130、および出力制御部140を備えている。また、書き換え制御部120は、再開情報保持部150を備えている。   The flash memory 100 includes a command decoding unit 110 (command decoding unit), a rewrite control unit 120, a memory array 130, and an output control unit 140. In addition, the rewrite control unit 120 includes a restart information holding unit 150.

コマンドデコード部110は、フラッシュメモリ100の外部からアドレス入力B100、データ入出力B110、ライトイネーブル信号S100、リードイネーブル信号S110が入力されている。   The command decode unit 110 receives an address input B100, a data input / output B110, a write enable signal S100, and a read enable signal S110 from outside the flash memory 100.

コマンドデコード部110は、リードイネーブル信号S110に“1”が入力されると、リードアクセスと認識し書き換えアドレスバスB120にアドレス入力B100の値を出力するとともに、コマンド信号B140にリードアクセスを示す値を出力する。コマンドデコード部110は、ライトイネーブル信号S100に“1”が入力されると、そのときのアドレス入力B100とデータ入出力B110との組み合わせをコマンドと認識してコマンドを解読し、解読結果を書き換えアドレスバスB120上の書き換えアドレス、書き込みデータバスB130上の書き込みデータ、コマンド信号B140として書き換え制御部120に出力する。   When “1” is input to the read enable signal S110, the command decoding unit 110 recognizes that the read access is performed, outputs the value of the address input B100 to the rewrite address bus B120, and sets a value indicating the read access to the command signal B140. Output. When “1” is input to the write enable signal S100, the command decoding unit 110 recognizes the combination of the address input B100 and the data input / output B110 at that time as a command, decodes the command, and rewrites the decoded result to the rewritten address. The rewrite address on the bus B120, the write data on the write data bus B130, and the command signal B140 are output to the rewrite control unit 120.

書き換え制御部120は、書き換えアドレスバスB120、書き込みデータバスB130およびコマンド信号B140から、各コマンドに応じた所定の制御フロー(後述)に従いアレイ制御信号B150を順次出力し、メモリアレイ130の読み出し、書き込み、消去を制御するとともに、コマンド実行状態を状態信号B160に出力する。   The rewrite control unit 120 sequentially outputs an array control signal B150 from the rewrite address bus B120, the write data bus B130, and the command signal B140 according to a predetermined control flow (described later) corresponding to each command, and reads and writes the memory array 130. In addition to controlling the erasure, the command execution state is output to the state signal B160.

ここでは、説明を簡単にするために、状態信号B160は4ビットでコマンド正常終了の場合には“1H”(“H”は16進表記であることを示す。)を、コマンド異常終了の場合には、“2H“を、コマンド実行中の場合には、”4H“を、コマンド中断終了の場合には”8H“を、上記何れにも該当しない場合には”0H“を出力するものとする。   Here, in order to simplify the description, the status signal B160 is 4 bits and indicates “1H” (“H” indicates hexadecimal notation) when the command ends normally, and when the command ends abnormally. “2H”, “4H” when the command is being executed, “8H” when the command is terminated, and “0H” when none of the above is output. To do.

また、書き換え制御部120は、所定の制御フローに従い、再開情報保持部150への書き込みおよび読み出しを行う。   Further, the rewrite control unit 120 performs writing and reading to the restart information holding unit 150 according to a predetermined control flow.

再開情報保持部150は、コマンド再開時に実行する分割制御フローを示すデータ(再開情報)を格納、保持する。初期状態において、再開情報保持部150は、“0H”を保持しているものとする。   The resumption information holding unit 150 stores and holds data (resumption information) indicating the division control flow executed when the command is resumed. In the initial state, it is assumed that the restart information holding unit 150 holds “0H”.

メモリアレイ130は複数のメモリセルを備え、アレイ制御信号B150に応じて、該当するメモリセルの読み出し、書き込み、消去を行い、アレイ制御信号B150がメモリアレイ130に格納されるデータの読み出しを指示した場合には、該当するメモリセルのデータを読み出しデータバスB170に出力する。   The memory array 130 includes a plurality of memory cells, and reads, writes, and erases the corresponding memory cells according to the array control signal B150, and the array control signal B150 instructs to read data stored in the memory array 130. In this case, the data of the corresponding memory cell is read and output to the data bus B170.

出力制御部140は、フラッシュメモリ100の外部から入力されるリードイネーブル信号S110に“1”が入力されると、書き換え制御部120が出力する状態信号B160が“0H”の場合には、読み出しデータバスB170の値をデータ入出力B110に出力し、状態信号B160が“0H”以外の場合には、状態信号B160の値をデータ入出力B110に出力する。   When “1” is input to the read enable signal S110 input from the outside of the flash memory 100, the output control unit 140 reads the read data when the status signal B160 output from the rewrite control unit 120 is “0H”. The value of the bus B170 is output to the data input / output B110. When the status signal B160 is other than “0H”, the value of the status signal B160 is output to the data input / output B110.

―動作―
まず、上記のように構成されたフラッシュメモリ100に対し、外部デバイス(図示せず)がメモリアレイ130に格納されたデータを読み出す動作について説明する。
―Operation―
First, an operation in which an external device (not shown) reads data stored in the memory array 130 from the flash memory 100 configured as described above will be described.

外部デバイスは、フラッシュメモリ100に格納されたデータを読み出すために、アドレス入力B100に所望のアドレス、例えばアドレス“100H”を出力し、さらにリードイネーブル信号S110を値“1”にする。   In order to read the data stored in the flash memory 100, the external device outputs a desired address, for example, address “100H” to the address input B100, and sets the read enable signal S110 to the value “1”.

コマンドデコード部110は、リードイネーブル信号S110が“1”であることから、リードアクセスと認識し書き換えアドレスバスB120にアドレス入力B100の値を出力するとともに、コマンド信号B140にはリードアクセスを示す値を出力する。   Since the read enable signal S110 is “1”, the command decoding unit 110 recognizes the read access and outputs the value of the address input B100 to the rewrite address bus B120, and the command signal B140 receives a value indicating the read access. Output.

書き換え制御部120は、コマンド信号B140にリードアクセスを示す値が入力されるため、書き換えアドレスバスB120が示すアドレスに対してメモリアレイ130からデータを読み出すために必要な信号をアレイ制御信号B150に順次出力するとともに、コマンド実行ではないため、状態信号B160に“0H”を出力する。   Since the value indicating read access is input to the command signal B140, the rewrite control unit 120 sequentially supplies signals necessary for reading data from the memory array 130 to the array control signal B150 for the address indicated by the rewrite address bus B120. Since the command is not executed, “0H” is output to the status signal B160.

メモリアレイ130は、アレイ制御信号B150に従い、指定のアドレスに該当するメモリセルのデータを読み出しデータバスB170に出力する。   The memory array 130 reads the data of the memory cell corresponding to the specified address and outputs it to the data bus B170 in accordance with the array control signal B150.

出力制御部140は、状態信号B160が“0H”のため、読み出しデータバスB170の値をデータ入出力B110に出力する。   Since the status signal B160 is “0H”, the output control unit 140 outputs the value of the read data bus B170 to the data input / output B110.

このようにして、外部デバイスはデータ入出力B110から所望のアドレスに格納されたフラッシュメモリ100のデータを読み出すことができる。   In this way, the external device can read the data in the flash memory 100 stored at a desired address from the data input / output B110.

次に外部デバイスが、フラッシュメモリ100に所望のコマンド、ここでは消去コマンドを発行する動作について説明する。   Next, an operation in which an external device issues a desired command, here an erase command, to the flash memory 100 will be described.

外部デバイスは、ライトイネーブル信号S100を値“1”にして、アドレス入力B100およびデータ入出力B110に消去コマンドを示す組み合わせを順次入力する。   The external device sets the write enable signal S100 to the value “1” and sequentially inputs combinations indicating the erase command to the address input B100 and the data input / output B110.

コマンドデコード部110は、ライトイネーブル信号S100が“1”であることから、アドレス入力B100とデータ入出力B110との組み合わせをコマンドと認識して解読し、コマンドの解読結果が消去コマンドであることから、書き換えアドレスバスB120に該当アドレスを、コマンド信号B140に消去コマンドを示す値をそれぞれ出力する。   The command decoding unit 110 recognizes and decodes the combination of the address input B100 and the data input / output B110 as a command because the write enable signal S100 is “1”, and the decoding result of the command is an erase command. The corresponding address is output to the rewrite address bus B120, and the value indicating the erase command is output to the command signal B140.

書き換え制御部120は、コマンド信号B140の値を受けて、メモリアレイ130の該当アドレスのメモリセルを消去するための所定の制御フローに従い、アレイ制御信号B150を順次出力するとともに、状態信号B160にコマンド実行中であることを示す“4H”を出力する。   The rewrite control unit 120 receives the value of the command signal B140, sequentially outputs the array control signal B150 in accordance with a predetermined control flow for erasing the memory cell at the corresponding address in the memory array 130, and sends a command to the status signal B160. “4H” indicating that the program is being executed is output.

メモリアレイ130は、アレイ制御信号B150に従い、当アドレスに相当するメモリセルの消去および、該当するメモリセルが消去されたか否かを確認するベリファイを行う。 Memory array 130 in accordance with an array control signal B150, erasing and memory cell corresponding to the skilled address, perform verification of the corresponding memory cell to confirm whether or not it is erased.

このとき、外部デバイスがフラッシュメモリ100に対してリードイネーブル信号S110を値“1”にしてリードアクセスを行うと、出力制御部140は、状態信号B160が“4H”のため、データ入出力B110に“4H”を出力する。   At this time, when the external device performs read access to the flash memory 100 with the read enable signal S110 set to the value “1”, the output control unit 140 transfers the data input / output B110 to the data input / output B110 because the status signal B160 is “4H”. Outputs “4H”.

このようにして、外部デバイスはコマンド発行後にリードアクセスを行うことで、コマンド実行中であることを示す“4H”をデータ入出力B110から読み出すことができる。   In this way, the external device can read “4H” indicating that the command is being executed from the data input / output B 110 by performing read access after issuing the command.

同様に、コマンド正常終了、コマンド異常終了、コマンド中断の各状態についても、データ入出力B110から読み出すことができる。   Similarly, the command normal end, command abnormal end, and command interrupt states can also be read from the data input / output B110.

次に、外部デバイスが消去コマンドを発行した場合に、書き換え制御部120が実行する制御フローについて、図2を用いて詳細に説明する。   Next, a control flow executed by the rewrite control unit 120 when an external device issues an erase command will be described in detail with reference to FIG.

図2は、書き換え制御部120が消去コマンドを実行する場合の制御フローを示すフローチャートである。   FIG. 2 is a flowchart showing a control flow when the rewrite control unit 120 executes an erase command.

消去コマンドの制御フローは、メモリアレイ130に格納されたデータが消去されたか否かを確認するベリファイ(Verify)と、メモリアレイ130に消去パルスを印加する消去(Erase)の2つに分類できる。ここで、消去パルスの印加は通常3ms単位で行うとものとし、さらにここでは1ms単位のパルスに3分割して1回目消去(Erase1)、2回目消去(Erase2)、3回目消去(Erase3)の3つの分割制御フローを実行するものとする。また、上記4つの分割制御フローに対して、ベリファイは“0H“、1回目消去(Erase1)は”1H“、2回目消去(Erase2)は”2H“、3回目消去(Erase3)は”3H“を割り当てて、次に実行する分割制御フローを示すデータ(再開情報)を再開情報保持部150に格納するものとする。   The control flow of the erasure command can be classified into two types, verify that verifies whether or not the data stored in the memory array 130 has been erased and erasure that applies an erase pulse to the memory array 130 (Erase). Here, it is assumed that the application of the erase pulse is usually performed in units of 3 ms, and further here, the pulse is divided into 1 ms units and divided into three for the first erase (Erase 1), the second erase (Erase 2), and the third erase (Erase 3). It is assumed that three division control flows are executed. For the above four divided control flows, the verify is “0H”, the first erase (Erase1) is “1H”, the second erase (Erase2) is “2H”, and the third erase (Erase3) is “3H”. , And data (resumption information) indicating the division control flow to be executed next is stored in the resumption information holding unit 150.

初期状態において、書き換え制御部120にコマンド信号B140から消去コマンドを示す信号が入力されると、書き換え制御部120は再開情報保持部150から次に実行する分割制御フローを示すデータ(再開情報)を読み出す(A)。   In an initial state, when a signal indicating an erasure command is input from the command signal B 140 to the rewrite control unit 120, the rewrite control unit 120 receives data (resume information) indicating a division control flow to be executed next from the restart information holding unit 150. Read (A).

初期状態において再開情報保持部150は“0H”を保持しているため、ベリファイ実行フローに分岐する(B0)。   Since the restart information holding unit 150 holds “0H” in the initial state, the process branches to the verification execution flow (B0).

次に書き換え制御部120は、メモリアレイ130に対してベリファイ用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力する(C0)。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for setting the voltage for verification to the memory array 130 as the array control signal B150 (C0).

次に書き換え制御部120は、メモリアレイ130の該当アドレスが消去状態か否かを確認(ベリファイ)するため、読み出しに必要な制御信号をアレイ制御信号B150に順次出力し、メモリアレイ130が出力するデータを読み出しデータバスB170から順次読み出す(D0)。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for reading to the array control signal B150 in order to confirm (verify) whether or not the corresponding address of the memory array 130 is in the erased state, and the memory array 130 outputs it. Data is sequentially read from the data bus B170 (D0).

次に、書き換え制御部120は、上記ベリファイ結果を判定する(E0)。以下、ベリファイ結果がフェイルの場合について説明する。   Next, the rewrite control unit 120 determines the verification result (E0). Hereinafter, a case where the verification result is fail will be described.

書き換え制御部120はフェイルの結果を受けて、次に実行する分割制御フローが1回目消去(Erase1)であることを示す“1H”を再開情報保持部150に格納する(F4)。   In response to the fail result, the rewrite control unit 120 stores “1H” indicating that the next division control flow to be executed is the first erase (Erase1) in the restart information holding unit 150 (F4).

次に、書き換え制御部120は、読み出し(Read)用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力し(G)、制御フローを終了する。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for setting a voltage for reading (G) to the array control signal B150 (G), and the control flow is ended.

このとき、消去コマンドは、ベリファイのみ実行して中断したことになる。その一方でメモリアレイ130は、読み出し用の電圧設定となっているため、外部デバイスはリードイネーブル信号S110の値を“1”とすることで、フラッシュメモリ100からデータを読み出すことができる。   At this time, the erase command is interrupted by executing only verification. On the other hand, since the memory array 130 has a voltage setting for reading, the external device can read data from the flash memory 100 by setting the value of the read enable signal S110 to “1”.

次に、上記の消去コマンドが中断した状態で、再び消去コマンドが入力された場合の動作について説明する。   Next, the operation when the erase command is input again while the erase command is interrupted will be described.

再度、消去コマンドが入力されると、書き換え制御部120は再開情報保持部150が格納するデータを読み出す(A)。上記のように、再開情報保持部150はデータ“1H”を格納しているため、1回目消去(Erase1)フローに分岐する(B0)(B1)。   When the erase command is input again, the rewrite control unit 120 reads the data stored in the restart information holding unit 150 (A). As described above, since the restart information holding unit 150 stores the data “1H”, the process branches to the first erase (Erase1) flow (B0) (B1).

次に書き換え制御部120は、消去(Erase)用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力する(C1)。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for setting an erase voltage to the array control signal B150 (C1).

次に書き換え制御部120は、メモリアレイ130に対して分割消去パルスの1回目を印加するために必要な制御信号をアレイ制御信号B150に順次出力する(D1)。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for applying the first divided erase pulse to the memory array 130 as the array control signal B150 (D1).

次に書き換え制御部120は、次に実行する分割制御フローが2回目消去(Erase2)であることを示す“2H”を再開情報保持部150に格納する(F1)。   Next, the rewrite control unit 120 stores “2H” indicating that the next division control flow to be executed is the second erasure (Erase2) in the restart information holding unit 150 (F1).

次に、書き換え制御部120は、メモリアレイ130に対して読み出し用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力し(G)、制御フローを終了する。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for setting a voltage for reading to the memory array 130 to the array control signal B150 (G), and ends the control flow.

このとき、消去コマンドは1回目消去(Erase1)フローのみ実行して中断したことになる。その一方でメモリアレイ130は、読み出し用の電圧設定となっているため、外部デバイス(図示せず)はリードイネーブル信号S110の値を“1”とすることで、フラッシュメモリ100からデータを読み出すことができる。   At this time, the erase command is interrupted by executing only the first erase (Erase1) flow. On the other hand, since the memory array 130 is set to read voltage, an external device (not shown) reads data from the flash memory 100 by setting the value of the read enable signal S110 to “1”. Can do.

同様にして、分割消去パルスの3回目まで実行すると、書き換え制御部120は次に実行する分割制御フローがベリファイであることを示す“0H”を再開情報保持部150に格納する(F0)ため、コマンド再開時には再びベリファイから実行される。   Similarly, when the divided erasing pulse is executed up to the third time, the rewrite control unit 120 stores “0H” indicating that the divided control flow to be executed next is verification in the restart information holding unit 150 (F0). When the command resumes, it is executed again from verify.

以上のように、ベリファイと消去パルスの印加を繰り返し、ベリファイがパスすると、書き換え制御部120は初期値である“0H”を再開情報保持部150に格納する(F0)。   As described above, when the verify and erase pulse application are repeated and the verification passes, the rewrite control unit 120 stores “0H”, which is the initial value, in the restart information holding unit 150 (F0).

このように、消去コマンドの制御フローを分割し、分割された個々のフローが完了する度に消去コマンドの実行を中断し、フラッシュメモリ100のデータ読み出しを可能とすることで、アプリケーション上でフラッシュメモリ100の消去処理をタスク管理に埋め込むことが容易となる。   In this way, the control flow of the erase command is divided, the execution of the erase command is interrupted each time the divided individual flows are completed, and the data can be read from the flash memory 100. It becomes easy to embed 100 erasure processes in task management.

《実施の形態2》
図3は、本発明の実施の形態2に係るフラッシュメモリ200の構成を示すブロック図である。同図に示すように、フラッシュメモリ200は、実施の形態1のフラッシュメモリ100の構成に加え、タイマ260を備えている。
<< Embodiment 2 >>
FIG. 3 is a block diagram showing a configuration of the flash memory 200 according to Embodiment 2 of the present invention. As shown in the figure, the flash memory 200 includes a timer 260 in addition to the configuration of the flash memory 100 of the first embodiment.

タイマ260は、タイマ起動信号S220が“1”になると時間計測を開始し、“0”になると時間計測を完了し、計測値をクリアする。また計測値がオーバーフローするとオーバーフロー信号S230に“1”を出力する。ここでは、説明を簡単にするためにタイマ260の周期は1msとする。   The timer 260 starts time measurement when the timer activation signal S220 becomes “1”, and completes time measurement and clears the measurement value when it becomes “0”. When the measured value overflows, “1” is output to the overflow signal S230. Here, in order to simplify the description, the period of the timer 260 is 1 ms.

書き換え制御部220は、実施の形態1の書き換え制御部120の機能に加えて、タイマ起動信号S220によりタイマ260の起動を制御できるとともに、オーバーフロー信号S230により、タイマ260のオーバーフローを検知できる。   In addition to the function of the rewrite control unit 120 of the first embodiment, the rewrite control unit 220 can control the start of the timer 260 by the timer start signal S220 and can detect the overflow of the timer 260 by the overflow signal S230.

―動作―
上記のように構成されたフラッシュメモリ200に対し、外部デバイス(図示せず)がメモリアレイ130に格納されたデータを読み出す動作および、外部デバイスが、フラッシュメモリ200に所望のコマンド、ここでは消去コマンドを発行する動作の概要については、実施の形態1と同様であるので説明を省略する。
―Operation―
An operation in which an external device (not shown) reads data stored in the memory array 130 from the flash memory 200 configured as described above, and an external device performs a desired command, here an erase command, to the flash memory 200. Since the outline of the operation for issuing is the same as in the first embodiment, description thereof is omitted.

次に、外部デバイスが消去コマンドを発行した場合の、書き換え制御部120が実行する制御フローについて、図4を用いて詳細に説明する。   Next, a control flow executed by the rewrite control unit 120 when an external device issues an erase command will be described in detail with reference to FIG.

図4は、書き換え制御部220が消去コマンドを実行する場合の制御フローを示すフローチャートである。同図に示すように、実施の形態1に係るフローチャートから、書き換え制御部220がタイマ起動信号S220に“1”を出力して、タイマ260の時間計測を開始する処理(TS)および、書き換え制御部220がオーバーフロー信号S230により、タイマ260のオーバーフローを判定する処理(TC)が追加されている。   FIG. 4 is a flowchart showing a control flow when the rewrite control unit 220 executes an erase command. As shown in the figure, from the flowchart according to the first embodiment, the rewrite control unit 220 outputs “1” to the timer activation signal S220 and starts the time measurement of the timer 260 (TS), and the rewrite control A process (TC) for determining the overflow of the timer 260 by the overflow signal S230 by the unit 220 is added.

消去コマンドの制御フローは、メモリアレイ130に格納されたデータが消去されたか否かを確認するベリファイと、メモリアレイ130に消去パルスを印加する消去の2つに分類できる。ここで、ベリファイ処理には0.5msかかるものとする。また、消去パルスの印加は通常3ms単位で行うとものとし、さらにここでは1ms単位のパルスに3分割して1回目消去(Erase1)、2回目消去(Erase2)、3回目消去(Erase3)の3つの分割制御フローを実行するものとする。また、上記4つの分割制御フローに対して、ベリファイは“0H“、1回目消去(Erase1)は”1H“、2回目消去(Erase2)は”2H“、3回目消去(Erase3)は”3H“を割り当てて、次に実行する分割制御フローを示すデータ(再開情報)を再開情報保持部150に格納するものとする。   The control flow of the erase command can be classified into two types: verify for confirming whether or not the data stored in the memory array 130 has been erased, and erase for applying an erase pulse to the memory array 130. Here, it is assumed that the verify process takes 0.5 ms. In addition, it is assumed that the application of the erase pulse is normally performed in units of 3 ms, and here, the pulse is divided into 3 units of 1 ms, and the first erase (Erase 1), the second erase (Erase 2), and the third erase (Erase 3) 3 Assume that one split control flow is executed. For the above four divided control flows, the verify is “0H”, the first erase (Erase1) is “1H”, the second erase (Erase2) is “2H”, and the third erase (Erase3) is “3H”. , And data (resumption information) indicating the division control flow to be executed next is stored in the resumption information holding unit 150.

初期状態において、書き換え制御部120にコマンド信号B140から消去コマンドを示す信号が入力されると、書き換え制御部220はタイマ起動信号S220に“1”を出力して、タイマ260の時間計測を開始する(TS)。   In the initial state, when a signal indicating an erase command is input from the command signal B140 to the rewrite control unit 120, the rewrite control unit 220 outputs “1” to the timer activation signal S220 and starts measuring the time of the timer 260. (TS).

次に書き換え制御部220は再開情報保持部150から次に実行する分割制御フローを示すデータ(再開情報)を読み出す(A)。   Next, the rewrite control unit 220 reads data (resumption information) indicating the division control flow to be executed next from the resumption information holding unit 150 (A).

初期状態において再開情報保持部150は“0H”を保持しているため、ベリファイ実行フローに分岐する(B0)。   Since the restart information holding unit 150 holds “0H” in the initial state, the process branches to the verification execution flow (B0).

次に書き換え制御部220は、メモリアレイ130に対してベリファイ用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力する(C0)。   Next, the rewrite control unit 220 sequentially outputs a control signal necessary for setting a voltage for verification to the memory array 130 as an array control signal B150 (C0).

次に書き換え制御部120は、メモリアレイ130の該当アドレスが消去状態か否かを確認(ベリファイ)するため、読み出しに必要な制御信号をアレイ制御信号B150に順次出力し、メモリアレイ130が出力するデータを読み出しデータバスB150から順次読み出す(D0)。   Next, the rewrite control unit 120 sequentially outputs a control signal necessary for reading to the array control signal B150 in order to confirm (verify) whether or not the corresponding address of the memory array 130 is in the erased state, and the memory array 130 outputs it. Data is read sequentially from the data bus B150 (D0).

次に、書き換え制御部220は、上記ベリファイ結果を判定する(E0)。以下、ベリファイ結果がフェイルの場合について説明する。   Next, the rewrite control unit 220 determines the verification result (E0). Hereinafter, a case where the verification result is fail will be described.

書き換え制御部220はフェイルの結果を受けて、次に実行する分割制御フローが1回目消去(Erase1)であることを示す“1H”を再開情報保持部150に格納する(F4)。   In response to the fail result, the rewrite control unit 220 stores “1H” indicating that the next division control flow to be executed is the first erase (Erase1) in the restart information holding unit 150 (F4).

次に、書き換え制御部220は、読み出し用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力する(G)。   Next, the rewrite control unit 220 sequentially outputs a control signal necessary for setting a voltage for reading to the array control signal B150 (G).

次に、書き換え制御部220は、オーバーフロー信号S230により、タイマ260のオーバーフローを判定する(TC)。このとき、ベリファイ動作に係る処理時間は0.5msのためオーバーフロー信号S230は“0”となり、書き換え制御部220は次の分割制御フローを継続して実行するため、再開情報保持部150が格納するデータを読み出す(A)。上記のように、再開情報保持部150はデータ“1H”を格納しているため、1回目消去(Erase1)フローに分岐する(B0)(B1)。   Next, the rewrite control unit 220 determines the overflow of the timer 260 based on the overflow signal S230 (TC). At this time, since the processing time related to the verify operation is 0.5 ms, the overflow signal S230 becomes “0”, and the rewrite control unit 220 continuously executes the next division control flow. Read data (A). As described above, since the restart information holding unit 150 stores the data “1H”, the process branches to the first erase (Erase1) flow (B0) (B1).

次に書き換え制御部220は、消去用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力する(C1)。   Next, the rewrite control unit 220 sequentially outputs control signals necessary for setting the voltage for erasure to the array control signal B150 (C1).

次に書き換え制御部220は、メモリアレイ130に対して分割消去パルスの1回目を印加するために必要な制御信号をアレイ制御信号B150に順次出力する(D1)。   Next, the rewrite control unit 220 sequentially outputs a control signal necessary for applying the first divided erase pulse to the memory array 130 as the array control signal B150 (D1).

次に書き換え制御部220は、次に実行する分割制御フローが2回目消去(Erase2)であることを示す“2H”を再開情報保持部150に格納する(F1)。   Next, the rewrite control unit 220 stores “2H” indicating that the next division control flow to be executed is the second erasure (Erase2) in the restart information holding unit 150 (F1).

次に、書き換え制御部220は、メモリアレイ130に対して読み出し用の電圧設定を行うために必要な制御信号をアレイ制御信号B150に順次出力する(G)。   Next, the rewrite control unit 220 sequentially outputs a control signal necessary for setting a read voltage to the memory array 130 as an array control signal B150 (G).

次に、書き換え制御部220は、オーバーフロー信号S230により、タイマ260のオーバーフローを判定する(TC)。このとき、ベリファイ動作に係る処理時間0.5msに加えて、分割消去の1回目が実施され合計1.5msの時間が経過しているため、オーバーフロー信号S230は“1”となり制御フローを終了する。   Next, the rewrite control unit 220 determines the overflow of the timer 260 based on the overflow signal S230 (TC). At this time, in addition to the processing time of 0.5 ms related to the verify operation, the first divided erasure is performed and a total time of 1.5 ms has elapsed, so the overflow signal S230 becomes “1” and the control flow ends. .

このとき、消去コマンドはベリファイフローおよび1回目消去(Erase1)フローのみ実行して中断したことになる。   At this time, the erase command is interrupted by executing only the verify flow and the first erase (Erase1) flow.

このように、消去コマンドの制御フローを分割し、分割された個々のフローが完了する度に所定の時間を超えて処理が実行されているかを確認し、所定の時間を超えて処理が行われている場合には消去コマンドの実行を中断することで、コマンド発行からコマンド中断までの時間を均一化することができるため、アプリケーション上でフラッシュメモリ100の書き換え処理をタスク管理に埋め込むことがさらに容易となる。   In this way, the control flow of the erasure command is divided, and each time the divided individual flows are completed, it is checked whether the process has been executed for a predetermined time, and the process has been executed for a predetermined time. In this case, by interrupting the execution of the erase command, the time from the command issuance to the command interruption can be made uniform, so that the rewriting process of the flash memory 100 can be embedded in the task management on the application. It becomes.

《実施の形態3》
図5は、本発明の実施の形態3に係るマイクロコンピュータ300の構成を示すブロック図である。マイクロコンピュータ300は、CPU310(Central Processing Unit)、内蔵フラッシュメモリ320(不揮発性メモリ)、内蔵ROM330(Read Only Memory)、内蔵RAM(Random Access memory)(再開情報保持部)を備えている。
<< Embodiment 3 >>
FIG. 5 is a block diagram showing the configuration of the microcomputer 300 according to Embodiment 3 of the present invention. The microcomputer 300 includes a CPU 310 (Central Processing Unit), a built-in flash memory 320 (nonvolatile memory), a built-in ROM 330 (Read Only Memory), and a built-in RAM (Random Access memory) (resumption information holding unit).

CPU310は、内蔵フラッシュメモリ320および内蔵ROM330から命令コードを読み出して解読し、命令を実行することにより、各種制御を行うようになっている。命令コードの読み出しは、アドレスバスB300に、読み出す命令コードが格納されている領域のアドレスを出力し、さらにリードイネーブル信号S300の値を“1”にすることによって行われる。読み出された命令コードはデータバスB310を介してCPU310に読み込まれる。   The CPU 310 performs various controls by reading out and decoding the instruction code from the built-in flash memory 320 and the built-in ROM 330 and executing the instruction. Reading of the instruction code is performed by outputting the address of the area where the instruction code to be read is stored to the address bus B300 and setting the value of the read enable signal S300 to “1”. The read instruction code is read into the CPU 310 via the data bus B310.

内蔵フラッシュメモリ320は、メモリアレイ(図示せず)に命令コードおよびその他のデータを記憶しており、リードイネーブル信号S300が値“1”である場合、アドレスバスB300に出力されているアドレスによって指定されるメモリ領域に格納されている命令コードやその他のデータをデータバスB310に出力するようになっている。   The built-in flash memory 320 stores an instruction code and other data in a memory array (not shown). When the read enable signal S300 is “1”, it is designated by an address output to the address bus B300. The instruction code and other data stored in the memory area are output to the data bus B310.

内蔵フラッシュメモリ320は、メモリアレイに格納するデータを消去、書き込みするための制御に用いる制御レジスタ350を備えている。CPU310が、後述する所定の制御フローに従い制御レジスタ350の値を順次書き換えることにより、内蔵フラッシュメモリ320のメモリアレイに対して消去、書き込みを行うことができる。制御レジスタ350は、ライトイネーブル信号S300の値が“1”である場合、アドレスバスB300に出力されているアドレスによって指定されレジスタに、データバスB310に出力されている値を格納保持するようになっている。   The built-in flash memory 320 includes a control register 350 used for control for erasing and writing data stored in the memory array. The CPU 310 can erase and write to the memory array of the built-in flash memory 320 by sequentially rewriting the value of the control register 350 in accordance with a predetermined control flow to be described later. When the value of the write enable signal S300 is “1”, the control register 350 stores and holds the value output to the data bus B310 in the register specified by the address output to the address bus B300. ing.

内蔵ROM330は、内蔵フラッシュメモリ320の書き換えを行うためのプログラムを構成する命令コードおよびその他データを記憶しており、リードイネーブル信号S300が値“1”である場合、アドレスバスB300に出力されているアドレスによって指定されるメモリ領域に格納されている命令コードやその他のデータをデータバスB310に出力するようになっている。   The built-in ROM 330 stores an instruction code and other data constituting a program for rewriting the built-in flash memory 320. When the read enable signal S300 has a value “1”, the built-in ROM 330 is output to the address bus B300. The instruction code and other data stored in the memory area designated by the address are output to the data bus B310.

内蔵RAM340は、命令コードおよびその他データを記憶しており、リードイネーブル信号S310が値“1”である場合、アドレスバスB300に出力されているアドレスによって指定されるメモリ領域に格納されている命令コードやその他データのデータをデータバスB310に出力するようになっている。また、内蔵RAM340は、ライトイネーブル信号S300が値“1”である場合、アドレスバスB300に出力されているアドレスによって指定されるメモリ領域に、データバスB310に出力されている値を格納保持するようになっている。   The internal RAM 340 stores an instruction code and other data. When the read enable signal S310 is “1”, the instruction code stored in the memory area specified by the address output to the address bus B300 is stored. And other data are output to the data bus B310. Further, when the write enable signal S300 is “1”, the built-in RAM 340 stores and holds the value output to the data bus B310 in the memory area specified by the address output to the address bus B300. It has become.

また、内蔵RAMの所定のアドレスには、次に実行する分割制御フローを格納保持しており、初期状態は“0”が格納されているものとする。   Further, it is assumed that the division control flow to be executed next is stored and held at a predetermined address of the built-in RAM, and “0” is stored in the initial state.

―動作―
まず、上記のように構成されたマイクロコンピュータ300におけるCPU310が、内蔵ROM330に格納された内蔵フラッシュメモリ320のデータを書き換えるためのプログラムを実行する動作について説明する。
―Operation―
First, an operation in which the CPU 310 in the microcomputer 300 configured as described above executes a program for rewriting data in the internal flash memory 320 stored in the internal ROM 330 will be described.

CPU310は、内蔵ROM330から命令コードを読み出すために、アドレスバスB300に、内蔵ROM330に該当するアドレス、例えばアドレス“300H”を出力し、さらにリードイネーブル信号S310を値“1”にする。そしてデータバスB310から命令コードを読み出して解読し、命令を実行する。   In order to read out the instruction code from the built-in ROM 330, the CPU 310 outputs an address corresponding to the built-in ROM 330, for example, the address “300H” to the address bus B300, and further sets the read enable signal S310 to the value “1”. Then, the instruction code is read from the data bus B310, decoded, and the instruction is executed.

次にCPU310は、後述する所定の制御フローに従い制御レジスタ350の値を順次書き換えるために、アドレスバスB300に、制御レジスタ350に該当するアドレス、例えばアドレス“200H”を出力するとともに、ライトイネーブル信号S300を値“1”にし、さらにデータバスB310に所定のデータを出力する。   Next, the CPU 310 outputs an address corresponding to the control register 350, for example, the address “200H”, to the address bus B300 in order to sequentially rewrite the value of the control register 350 in accordance with a predetermined control flow to be described later, and the write enable signal S300. Is set to the value “1”, and predetermined data is output to the data bus B310.

このようにして、CPU310が、内蔵ROM330に格納された内蔵フラッシュメモリ320のデータを書き換えるためのプログラムを実行し、フラッシュメモリ320のデータを書き換えることができる。   In this way, the CPU 310 can execute the program for rewriting the data in the built-in flash memory 320 stored in the built-in ROM 330 to rewrite the data in the flash memory 320.

次に、CPU310が、内蔵ROM330に格納された内蔵フラッシュメモリ320のデータを書き換えるためのプログラムを実行する動作について、図2を用いて詳細に説明する。   Next, an operation in which the CPU 310 executes a program for rewriting data in the internal flash memory 320 stored in the internal ROM 330 will be described in detail with reference to FIG.

図2は、CPU310がフラッシュメモリ320の消去を実行する場合の制御フローを示すフローチャートであり、実施の形態1における書き換え制御部120が消去コマンドを実行する場合の制御フローと全く同じであるが、制御フローを実現するプログラムが内蔵ROM330に格納されており、このプログラムをCPU310が実行する点で大きく異なる。また、実施の形態1では書き換え制御部120がアレイ制御信号B150を出力してメモリアレイ130の消去を実現していたが、本実施例ではCPU310が制御レジスタ350を書き換えることで内蔵フラッシュメモリ320のデータを消去する。   FIG. 2 is a flowchart showing a control flow when the CPU 310 executes erasure of the flash memory 320, and is exactly the same as the control flow when the rewrite control unit 120 executes the erase command in the first embodiment. A program for realizing the control flow is stored in the built-in ROM 330, and is greatly different in that the CPU 310 executes the program. In the first embodiment, the rewrite control unit 120 outputs the array control signal B150 to erase the memory array 130. However, in this embodiment, the CPU 310 rewrites the control register 350 so that the built-in flash memory 320 is rewritten. Erase the data.

消去の制御フローは、内蔵フラッシュメモリ320に格納されたデータが消去されたか否かを確認するベリファイと、内蔵フラッシュメモリ320に消去パルスを印加する消去の2つに分類できる。ここで、消去パルスの印加は通常3ms単位で行うとものとし、さらにここでは1ms単位のパルスに3分割して1回目消去(Erase1)、2回目消去(Erase2)、3回目消去(Erase3)の3つの分割制御フローを実行するものとする。また、上記4つの分割制御フローに対して、ベリファイは“0H“、1回目消去(Erase1)は”1H“、2回目消去(Erase2)は”2H“、3回目消去(Erase3)は”3H“を割り当てて、次に実行する分割制御フローを示すデータ(再開情報)を内蔵RAM340の所定のアドレスに格納するものとする。   The control flow of erasure can be classified into two types: verify for confirming whether or not the data stored in the built-in flash memory 320 has been erased, and erase for applying an erase pulse to the built-in flash memory 320. Here, it is assumed that the application of the erase pulse is usually performed in units of 3 ms, and further here, the pulse is divided into 1 ms units and divided into three for the first erase (Erase 1), the second erase (Erase 2), and the third erase (Erase 3). It is assumed that three division control flows are executed. For the above four divided control flows, the verify is “0H”, the first erase (Erase1) is “1H”, the second erase (Erase2) is “2H”, and the third erase (Erase3) is “3H”. , And data (resume information) indicating the division control flow to be executed next is stored at a predetermined address in the built-in RAM 340.

CPU310が、内蔵ROM330に格納される消去プログラムを読み出し、実行すると、まずCPU310は内蔵RAM340から、次に実行する分割制御フローを示すデータ(再開情報)を読み出す(A)。   When the CPU 310 reads and executes the erase program stored in the built-in ROM 330, the CPU 310 first reads data (resumption information) indicating the division control flow to be executed next from the built-in RAM 340 (A).

初期状態において内蔵RAM340は“0H”を保持しているため、CPU310はベリファイ実行フローに分岐する(B0)。   Since the internal RAM 340 holds “0H” in the initial state, the CPU 310 branches to the verification execution flow (B0).

次にCPU310は、内蔵フラッシュメモリ320に対してベリファイ用の電圧設定を行うために必要な制御レジスタ350の設定を順次行う(C0)。   Next, the CPU 310 sequentially sets the control register 350 necessary for setting the voltage for verification in the built-in flash memory 320 (C0).

次にCPU310は、内蔵フラッシュメモリ320の該当するメモリセルが消去状態か否かを確認(ベリファイ)するため、アドレスバスB300に該当アドレスを出力するとともに、リードイネーブル信号S310の値を“1”にして内蔵フラッシュメモリ320の該当するメモリセルのデータをデータバスB310から順次読み出す(D0)。   Next, the CPU 310 outputs the corresponding address to the address bus B300 and sets the value of the read enable signal S310 to “1” in order to confirm (verify) whether or not the corresponding memory cell of the built-in flash memory 320 is in the erased state. Then, the data of the corresponding memory cell of the built-in flash memory 320 is sequentially read from the data bus B310 (D0).

次に、CPU310は、上記ベリファイ結果を判定する(E0)。以下、ベリファイ結果がフェイルの場合について説明する。   Next, the CPU 310 determines the verification result (E0). Hereinafter, a case where the verification result is fail will be described.

CPU310はフェイルの結果を受けて、次に実行する分割制御フローが1回目消去(Erase1)であることを示す“1H”を内蔵RAM340に格納する(F4)。   In response to the fail result, the CPU 310 stores “1H” indicating that the next division control flow to be executed is the first erase (Erase1) in the internal RAM 340 (F4).

次に、CPU310は、内蔵フラッシュメモリ320に対して読み出し用の電圧設定を行うために必要な制御レジスタの設定を順次行い(G)、制御フローを終了する。   Next, the CPU 310 sequentially sets control registers necessary for setting a voltage for reading in the built-in flash memory 320 (G), and ends the control flow.

このとき、消去処理は、ベリファイのみ実行して中断したことになる。その一方で内蔵フラッシュメモリ320は、読み出し用の電圧設定となっているため、CPU310はアドレスバスB300に内蔵フラッシュメモリ320のアドレスを出力しリードイネーブル信号S110の値を“1”とすることで、内蔵フラッシュメモリ320からデータを読み出すことができる。   At this time, the erasing process is interrupted by executing only the verification. On the other hand, since the built-in flash memory 320 is set to a voltage for reading, the CPU 310 outputs the address of the built-in flash memory 320 to the address bus B300 and sets the value of the read enable signal S110 to “1”. Data can be read from the built-in flash memory 320.

次に、上記の消去処理が中断した状態で、再び消去処理を実行する動作について説明する。   Next, an operation for executing the erasing process again in a state where the erasing process is interrupted will be described.

再度、CPU310が、内蔵ROM330に格納される消去プログラムを読み出し、実行すると、CPU310は内蔵RAM340が格納する再開情報データを読み出す(A)。上記のように、内蔵RAM340は再開情報データとして“1H”を格納しているため、1回目消去(Erase1)フローに分岐する(B0)(B1)。   When the CPU 310 again reads and executes the erase program stored in the built-in ROM 330, the CPU 310 reads the resume information data stored in the built-in RAM 340 (A). As described above, since the built-in RAM 340 stores “1H” as the restart information data, it branches to the first erase (Erase1) flow (B0) (B1).

次にCPU310は、消去用の電圧設定を行うために必要な制御レジスタ350の設定を順次行う(C1)。   Next, the CPU 310 sequentially sets the control register 350 necessary for setting the voltage for erasure (C1).

次にCPU310は、内蔵フラッシュメモリ320に対して分割消去パルスの1回目を印加するために必要な制御レジスタ350の設定を順次行う(D1)。   Next, the CPU 310 sequentially sets the control register 350 necessary for applying the first divided erase pulse to the built-in flash memory 320 (D1).

次にCPU310は、次に実行する分割制御フローが2回目消去(Erase2)であることを示す “2H”を内蔵RAM340に格納する(F1)。   Next, the CPU 310 stores “2H” in the built-in RAM 340 indicating that the division control flow to be executed next is the second erase (Erase2) (F1).

次に、CPU310は、内蔵フラッシュメモリ320に対して読み出し用の電圧設定を行うために必要な制御レジスタ350の設定を順次行い(G)、制御フローを終了する。   Next, the CPU 310 sequentially sets the control register 350 necessary for setting the voltage for reading in the built-in flash memory 320 (G), and ends the control flow.

このとき、1回目消去(Erase1)フローのみ実行して中断したことになる。その一方で内蔵フラッシュメモリ320は、読み出し用の電圧設定となっているため、CPU310はリードイネーブル信号S310の値を“1”とすることで、内蔵フラッシュメモリ320からデータを読み出すことができる。   At this time, only the first erase (Erase1) flow is executed and interrupted. On the other hand, since the built-in flash memory 320 has a voltage setting for reading, the CPU 310 can read data from the built-in flash memory 320 by setting the value of the read enable signal S310 to “1”.

同様にして、分割消去パルスの3回目まで実行すると、CPU310は次に実行する分割制御フローがベリファイであることを示す“0H”を内蔵RAM340に格納する(F0)ため、消去処理再開時には再びベリファイから実行される。   Similarly, when the divided erase pulse is executed up to the third time, the CPU 310 stores “0H” in the built-in RAM 340 indicating that the divided control flow to be executed next is verification (F0). Is executed from.

以上のように、ベリファイと消去パルスの印加を繰り返し、ベリファイがパスすると、CPU310は初期値である“0H”を内蔵RAM340に格納する(F0)。   As described above, when verify and erase pulse application are repeated and the verify passes, the CPU 310 stores the initial value “0H” in the internal RAM 340 (F0).

このように、書き換え処理の制御フローを分割し、分割された個々のフローが完了する度に消去処理の実行を中断し、内蔵フラッシュメモリ320のデータ読み出しを可能とすることで、アプリケーション上で内蔵フラッシュメモリ320の書き換え処理をタスク管理に埋め込むことが容易となる。   In this way, the control flow of the rewrite process is divided, the execution of the erasure process is interrupted each time the divided individual flows are completed, and data can be read from the built-in flash memory 320. It becomes easy to embed rewrite processing of the flash memory 320 in task management.

《実施の形態4》
図6は、本発明の実施の形態4に係るマイクロコンピュータ400の構成を示すブロック図である。同図に示すように、マイクロコンピュータ400は、実施の形態3のマイクロコンピュータ300の構成に加え、タイマ460を備えている。
<< Embodiment 4 >>
FIG. 6 is a block diagram showing a configuration of microcomputer 400 according to the fourth embodiment of the present invention. As shown in the figure, the microcomputer 400 includes a timer 460 in addition to the configuration of the microcomputer 300 of the third embodiment.

タイマ460は、タイマ起動信号S420が“1”になると時間計測を開始し、“0”になると時間計測を完了し、計測値をクリアする。また、計測値がオーバーフローするとオーバーフロー信号S430に“1”を出力する。ここでは説明を簡単にするためにタイマ460の周期は1msとする。   The timer 460 starts time measurement when the timer activation signal S420 becomes “1”, completes time measurement when the timer activation signal S420 becomes “0”, and clears the measurement value. When the measured value overflows, “1” is output to the overflow signal S430. Here, in order to simplify the description, the period of the timer 460 is 1 ms.

CPU410は実施の形態3のCPU310の機能に加えて、タイマ起動信号S420によりタイマ460の起動を制御できるとともに、オーバーフロー信号S430により、タイマ460のオーバーフローを検知できる。   In addition to the function of CPU 310 of the third embodiment, CPU 410 can control the start of timer 460 by timer start signal S420 and can detect the overflow of timer 460 by overflow signal S430.

―動作―
上記のように構成されたマイクロコンピュータ400におけるCPU410が、内蔵ROM330に格納された内蔵フラッシュメモリ320のデータを書き換えるためのプログラムを実行する動作の概要については、実施の形態3と同様であるので説明を省略する。
―Operation―
The outline of the operation in which the CPU 410 in the microcomputer 400 configured as described above executes a program for rewriting data in the built-in flash memory 320 stored in the built-in ROM 330 is the same as that in the third embodiment, and thus will be described. Is omitted.

次に、CPU410が、内蔵ROM330に格納された内蔵フラッシュメモリ320のデータを書き換えるためのプログラムを実行する動作について、図4を用いて詳細に説明する。   Next, an operation in which the CPU 410 executes a program for rewriting data in the internal flash memory 320 stored in the internal ROM 330 will be described in detail with reference to FIG.

図4は、CPU410がフラッシュメモリ320の消去を実行する場合の制御フローを示すフローチャートである。同図に示すように、実施の形態3に係るフローチャートから、CPU410がタイマ起動信号S420に“1”を出力して、タイマ460の時間計測を開始する処理(TS)および、CPU410がオーバーフロー信号S430により、タイマ460のオーバーフローを判定する処理(TC)が追加されている。   FIG. 4 is a flowchart showing a control flow when the CPU 410 executes erasure of the flash memory 320. As shown in the figure, from the flowchart according to the third embodiment, the CPU 410 outputs “1” to the timer activation signal S420 to start the time measurement of the timer 460, and the CPU 410 detects the overflow signal S430. Thus, a process (TC) for determining the overflow of the timer 460 is added.

消去の制御フローは、内蔵フラッシュメモリ320に格納されたデータが消去されたか否かを確認するベリファイと、内蔵フラッシュメモリ320に消去パルスを印加する消去の2つに分類できる。ここで、ベリファイ処理には0.5msかかるものとする。また、消去パルスの印加は通常3ms単位で行うとものとし、さらにここでは1ms単位のパルスに3分割して1回目消去(Erase1)、2回目消去(Erase2)、3回目消去(Erase3)の3つの分割制御フローを実行するものとする。また、上記4つの分割制御フローに対して、ベリファイは“0H“、1回目消去(Erase1)は”1H“、2回目消去(Erase2)は”2H“、3回目消去(Erase3)は”3H“を割り当てて、次に実行する分割制御フローを示すデータ(再開情報)を内蔵RAM340に格納するものとする。   The control flow of erasure can be classified into two types: verify for confirming whether or not the data stored in the built-in flash memory 320 has been erased, and erase for applying an erase pulse to the built-in flash memory 320. Here, it is assumed that the verify process takes 0.5 ms. In addition, it is assumed that the application of the erase pulse is normally performed in units of 3 ms, and here, the pulse is divided into 3 units of 1 ms, and the first erase (Erase 1), the second erase (Erase 2), and the third erase (Erase 3) 3 Assume that one split control flow is executed. For the above four divided control flows, the verify is “0H”, the first erase (Erase1) is “1H”, the second erase (Erase2) is “2H”, and the third erase (Erase3) is “3H”. , And data (restart information) indicating the division control flow to be executed next is stored in the built-in RAM 340.

CPU410が、内蔵ROM330に格納される消去プログラムを読み出し、実行すると、まずCPU410はタイマ起動信号S420に値“1”を出力して、タイマ460の時間計測を開始する(TS)。   When the CPU 410 reads and executes the erase program stored in the built-in ROM 330, the CPU 410 first outputs a value “1” to the timer activation signal S420 and starts measuring the time of the timer 460 (TS).

次にCPU410は、内蔵RAM340から次に実行する分割制御フローを示すデータ(再開情報)を読み出す(A)。   Next, the CPU 410 reads data (resumption information) indicating the next division control flow to be executed from the built-in RAM 340 (A).

初期状態において内蔵RAMは“0H”を保持しているため、CPU310はベリファイ実行フローに分岐する(B0)。   Since the built-in RAM holds “0H” in the initial state, the CPU 310 branches to the verify execution flow (B0).

次にCPU410は、内蔵フラッシュメモリ320に対してベリファイ用の電圧設定を行うために必要な制御レジスタ350の設定を順次行う(C0)。   Next, the CPU 410 sequentially sets the control register 350 necessary for setting the voltage for verification in the built-in flash memory 320 (C0).

次に内蔵フラッシュメモリ320の該当メモリセルが消去状態か否かを確認(ベリファイ)するため、アドレスバスB300に該当アドレスを出力するとともに、リードイネーブル信号S310の値を“1”にして内蔵フラッシュメモリ320の該当アドレスのデータをデータバスB310から順次読み出す(D0)。   Next, in order to confirm (verify) whether or not the corresponding memory cell of the built-in flash memory 320 is in the erased state, the corresponding address is output to the address bus B300 and the value of the read enable signal S310 is set to “1”. The data of the corresponding address 320 is sequentially read from the data bus B310 (D0).

次に、CPU410は、上記ベリファイ結果を判定する(E0)。以下、ベリファイ結果がフェイルの場合について説明する。   Next, the CPU 410 determines the verification result (E0). Hereinafter, a case where the verification result is fail will be described.

CPU410はフェイルの結果を受けて、次に実行する分割制御フローが1回目消去(Erase1)であることを示す“1H”を内蔵RAM340に格納する(F4)。   In response to the fail result, the CPU 410 stores “1H” indicating that the next division control flow to be executed is the first erase (Erase1) in the internal RAM 340 (F4).

次に、CPU410は、内蔵フラッシュメモリに対して読み出し用の電圧設定を行うために必要な制御レジスタの設定を順次行う(G)。   Next, the CPU 410 sequentially sets the control registers necessary for setting the read voltage for the built-in flash memory (G).

次にCPU410は、オーバーフロー信号S430により、タイマ460のオーバーフローを判定する(TC)。このときベリファイ動作に係る処理時間は0.5msのためオーバーフロー信号S430は“0”となり、CPU410は次の分割制御フローを継続して実行するため、内蔵RAM340が格納する再開情報を読み出す(A)。上記のように、内蔵RAM340はデータ“1H”を格納しているため、1回目消去(Erase1)フローに分岐する(B0)(B1)。   Next, the CPU 410 determines the overflow of the timer 460 based on the overflow signal S430 (TC). At this time, since the processing time related to the verify operation is 0.5 ms, the overflow signal S430 becomes “0”, and the CPU 410 continuously executes the next division control flow, so the resumption information stored in the internal RAM 340 is read (A). . As described above, since the internal RAM 340 stores the data “1H”, the process branches to the first erase (Erase1) flow (B0) (B1).

次にCPU410は、消去用の電圧設定を行うために必要な制御レジスタ350の設定を順次行う(C1)。   Next, the CPU 410 sequentially sets the control register 350 necessary for setting the voltage for erasure (C1).

次にCPU410は、内蔵フラッシュメモリ320に対して分割消去パルスの1回目を印加するために必要な制御レジスタ350の設定を順次行う(D1)。   Next, the CPU 410 sequentially sets the control register 350 necessary for applying the first divided erase pulse to the built-in flash memory 320 (D1).

次にCPU410は、次に実行する分割制御フローが2回目消去(Erase2)であることを示す“2H”を内蔵RAM340に格納する(F1)。   Next, the CPU 410 stores “2H” in the built-in RAM 340 indicating that the division control flow to be executed next is the second erase (Erase2) (F1).

次に、CPU410は、内蔵フラッシュメモリ320に対して読み出し用の電圧設定を行うために必要な制御レジスタ350の設定を順次行う(G)。   Next, the CPU 410 sequentially sets the control register 350 necessary for setting the read voltage for the built-in flash memory 320 (G).

次に、CPU410は、オーバーフロー信号S430により、タイマ460のオーバーフローを判定する(TC)。このとき、ベリファイ動作に係る時間0.5msに加えて、分割消去の1回目が実施され合計1.5msの時間が経過しているため、オーバーフロー信号S430は“1”となり制御フローを終了する。このとき、消去処理はベリファイフローおよび1回目消去(Erase1)フローのみ実行して中断したことになる。   Next, the CPU 410 determines the overflow of the timer 460 based on the overflow signal S430 (TC). At this time, in addition to the time of 0.5 ms related to the verify operation, the first divided erase is performed and the total time of 1.5 ms has elapsed, so the overflow signal S430 becomes “1” and the control flow is ended. At this time, the erase process is interrupted by executing only the verify flow and the first erase (Erase1) flow.

このように、書き換え処理の制御フローを分割し、分割された個々のフローが完了する度に所定の時間を超えて処理が実行されているかを確認し、所定の時間を超えて処理が行われている場合には消去処理の実行を中断することで、書き換え処理開始から処理中断までの時間を均一化することができるため、アプリケーション上で内蔵フラッシュメモリ320の書き換え処理をタスク管理に埋め込むことがさらに容易となる。   In this way, the control flow of the rewriting process is divided, and each time the divided individual flows are completed, it is confirmed whether the process has been executed over a predetermined time, and the process is performed over the predetermined time. In such a case, by interrupting the execution of the erasure process, the time from the start of the rewrite process to the process interruption can be made uniform. It becomes easier.

《実施の形態5》
本発明の実施の形態5では、実施の形態1または実施の形態2のフラッシュメモリのいずれかをエアコンシステムに搭載している。
<< Embodiment 5 >>
In the fifth embodiment of the present invention, either the flash memory of the first embodiment or the second embodiment is mounted on the air conditioner system.

図7は、本発明の実施の形態5に係るエアコンシステムの構成を示すブロック図である。   FIG. 7 is a block diagram showing a configuration of an air conditioner system according to Embodiment 5 of the present invention.

上記エアコンシステムは、リモコン510と室内機520とから構成される。室内機520は、マイクロコンピュータ530と、受光素子580と、オペアンプ590と、LCD(液晶表示)パネルと、スピーカなどを備えている。マイクロコンピュータ530は、フラッシュメモリ540とCPU550とを備えている。フラッシュメモリ540は、実施の形態1または2で説明したいずれかのフラッシュメモリである。   The air conditioner system includes a remote controller 510 and an indoor unit 520. The indoor unit 520 includes a microcomputer 530, a light receiving element 580, an operational amplifier 590, an LCD (liquid crystal display) panel, a speaker, and the like. The microcomputer 530 includes a flash memory 540 and a CPU 550. The flash memory 540 is any of the flash memories described in the first or second embodiment.

フラッシュメモリ540とCPU550とは、アドレスバスB500、データバスB510、ライトイネーブル信号S500、リードイネーブル信号S510を介して接続されている。   The flash memory 540 and the CPU 550 are connected via an address bus B500, a data bus B510, a write enable signal S500, and a read enable signal S510.

リモコン510は、マイクロコンピュータ560と、LED570と、LCDパネルと、図示しないキーパッド等を備えており、ユーザがキーパッドを用いて行った操作に対する信号をマイクロコンピュータ560で受け、LED570により室内機520に伝送する。   The remote controller 510 includes a microcomputer 560, an LED 570, an LCD panel, and a keypad (not shown). The microcomputer 560 receives a signal for an operation performed by the user using the keypad, and the indoor unit 520 is received by the LED 570. Transmit to.

CPU550は、フラッシュメモリ540に格納された命令コードを読み出し、解読、実行し、数ms単位でタスクを切替えながらエアコンシステムの各種制御を行うものとする。   The CPU 550 reads out, decodes and executes an instruction code stored in the flash memory 540, and performs various controls of the air conditioner system while switching tasks in units of several ms.

また、CPU550は、受光素子580およびオペアンプ590を通じて、上記リモコン510の操作に対応する信号を受けて、フラッシュメモリ540の所定の領域に対してデータの書き込みコマンドを発行する。書き込みデータには、具体的には、電源オン/オフの状態、温度設定、冷房/暖房の状態、ファン(FAN)の回転数、上下ルーバの角度、などがある。   In addition, the CPU 550 receives a signal corresponding to the operation of the remote controller 510 through the light receiving element 580 and the operational amplifier 590 and issues a data write command to a predetermined area of the flash memory 540. Specifically, the write data includes a power on / off state, a temperature setting, a cooling / heating state, a fan (FAN) rotation speed, an upper and lower louver angle, and the like.

さらにCPU550は、フラッシュメモリ540の所定の領域が、上記書き込みデータで埋め尽くされた場合には、フラッシュメモリ540に対して消去コマンドを発行する。   Further, the CPU 550 issues an erase command to the flash memory 540 when a predetermined area of the flash memory 540 is filled with the write data.

フラッシュメモリ540は、命令コードおよび上記の種種のデータを格納しており、リードイネーブル信号S510が値“1”である場合、アドレスバスB500に出力されているアドレスによって指定されるメモリ領域に格納されている命令コードやその他のデータをデータバスB510に出力する。また、ライトイネーブル信号S520が値“1”である場合、アドレスバスB500の値とデータバスB510の値との組み合わせをコマンドと認識してコマンドを解読し、書き込み、消去動作を実行する。CPU550が発行する書き込みコマンドを受けて、書き込み動作を実施し、新たなデータを格納する。   The flash memory 540 stores the instruction code and the various types of data described above. When the read enable signal S510 has a value “1”, the flash memory 540 stores the instruction code and the data in the memory area specified by the address output to the address bus B500. Output instruction code and other data to the data bus B510. When the write enable signal S520 is “1”, the combination of the value of the address bus B500 and the value of the data bus B510 is recognized as a command, the command is decoded, and write and erase operations are executed. In response to a write command issued by the CPU 550, a write operation is performed and new data is stored.

フラッシュメモリの消去コマンドの実行は、実施の形態1および実施の形態2にあるように、分割された制御フローを実施する度に消去動作を中断し、読み出し可能状態とするため、CPU550は、消去コマンドを発行した後も所定の時間以内にフラッシュメモリ540に格納された命令コードを読み出すことが可能となるため、数ms単位でタスクを切替えながら、エアコンシステムの各種制御を行うことができる。
《その他の実施の形態》
なお、本発明を上記の実施の形態に基づいて説明してきたが、本発明は、上記の実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。
In the execution of the erase command of the flash memory, as in the first and second embodiments, the CPU 550 erases the erase operation by interrupting the erase operation every time the divided control flow is executed. Since it is possible to read out the instruction code stored in the flash memory 540 within a predetermined time even after issuing the command, various controls of the air conditioner system can be performed while switching tasks in units of several ms.
<< Other Embodiments >>
Although the present invention has been described based on the above embodiment, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the gist of the present invention. Of course.

(1)上記の各装置は、具体的には、マイクロプロセッサ、ROM、RAM、ハードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコンピュータシステムである。上記RAMまたは上記ハードディスクユニットには、コンピュータプログラムが記憶されている。上記マイクロプロセッサが、上記コンピュータプログラムに従って動作することにより、各装置は、その機能を達成する。ここで、コンピュータプログラムは、所定の機能を達成するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて構成されたものである。   (1) Each of the above devices is specifically a computer system including a microprocessor, ROM, RAM, a hard disk unit, a display unit, a keyboard, a mouse, and the like. A computer program is stored in the RAM or the hard disk unit. Each device achieves its function by the microprocessor operating according to the computer program. Here, the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.

(2)上記の各装置を構成する構成要素の一部または全部は、1個のシステムLSI(Large Scale Integration:大規模集積回路)から構成されているとしてもよい。システムLSIは、複数の構成部を1個のチップ上に集積して製造された超多機能LSIであり、具体的には、マイクロプロセッサ、ROM、RAMなどを含んで構成されるコンピュータシステムである。上記RAMには、コンピュータプログラムが記憶されている。上記マイクロプロセッサが、上記コンピュータプログラムに従って動作することにより、システムLSIは、その機能を達成する。これらは個別に1チップ化されても良いし、一部または全てを含むように1チップ化されても良い。   (2) A part or all of the components constituting each of the above devices may be configured by one system LSI (Large Scale Integration). The system LSI is an ultra-multifunctional LSI manufactured by integrating a plurality of components on a single chip, and specifically, a computer system including a microprocessor, ROM, RAM, and the like. . A computer program is stored in the RAM. The system LSI achieves its functions by the microprocessor operating according to the computer program. These may be individually made into one chip, or may be made into one chip so as to include a part or all of them.

また、ここでは、システムLSIとしたが、集積度の違いにより、IC、システムLSI、スーパーLSI、ウルトラLSIと呼称されることもある。   Although the system LSI is used here, it may be referred to as an IC, a system LSI, a super LSI, or an ultra LSI depending on the degree of integration.

また、集積回路化の手法はLSIに限るものではなく、専用回路または汎用プロセサで実現してもよい。LSI製造後に、プログラムすることが可能なFPGA(Field Programmable Gate Array)や、LSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサを利用しても良い。   Further, the method of circuit integration is not limited to LSI's, and implementation using dedicated circuitry or general purpose processors is also possible. An FPGA (Field Programmable Gate Array) that can be programmed after manufacturing the LSI, or a reconfigurable processor that can reconfigure the connection and setting of circuit cells inside the LSI may be used.

さらには、半導体技術の進歩または派生する別技術によりLSIに置き換わる集積回路化の技術が登場すれば、当然、その技術を用いて機能ブロックの集積化を行ってもよい。バイオ技術の適用等が可能性としてありえる。   Furthermore, if integrated circuit technology comes out to replace LSI's as a result of the advancement of semiconductor technology or a derivative other technology, it is naturally also possible to carry out function block integration using this technology. Biotechnology can be applied.

(3)上記の各装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしてもよい。上記ICカードまたは上記モジュールは、マイクロプロセッサ、ROM、RAM、などから構成されるコンピュータシステムである。上記ICカードまたは上記モジュールは、上記の超多機能LSIを含むとしてもよい。マイクロプロセッサが、コンピュータプログラムに従って動作することにより、上記ICカードまたは上記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしてもよい。   (3) A part or all of the components constituting each of the above devices may be configured as an IC card that can be attached to and detached from each device or a single module. The IC card or the module is a computer system including a microprocessor, a ROM, a RAM, and the like. The IC card or the module may include the super multifunctional LSI. The IC card or the module achieves its function by the microprocessor operating according to the computer program. This IC card or this module may have tamper resistance.

(4)本発明は、上記に示す方法であるとしてもよい。また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしてもよいし、上記コンピュータプログラムからなるデジタル信号であるとしてもよい。   (4) The present invention may be the method described above. In addition, the present invention may be a computer program that realizes these methods by a computer, or may be a digital signal composed of the computer program.

また、本発明は、上記コンピュータプログラムまたは上記デジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD―ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu-Ray Disk)、半導体メモリなど、に記録したものとしてもよい。また、これらの記録媒体に記録されている上記コンピュータプログラムまたは上記デジタル信号であるとしてもよい。   The present invention also provides a computer-readable recording medium such as a flexible disk, hard disk, CD-ROM, MO, DVD, DVD-ROM, DVD-RAM, BD (Blu-Ray Disk). ), Recorded in a semiconductor memory or the like. Further, the present invention may be the computer program or the digital signal recorded on these recording media.

また、本発明は、上記コンピュータプログラムまたは上記デジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしてもよい。   In the present invention, the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, a data broadcast, or the like.

また、上記プログラムまたは上記デジタル信号を上記記録媒体に記録して移送することにより、または上記プログラムまたは上記デジタル信号を上記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしてもよい。   In addition, the program or the digital signal is recorded on the recording medium and transferred, or the program or the digital signal is transferred via the network or the like, and is executed by another independent computer system. It is good.

(5)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよい。   (5) The above embodiment and the above modifications may be combined.

本発明に係る不揮発性メモリの自動書き換え中断方法と不揮発性メモリおよびマイクロコンピュータは、不揮発性メモリの書き換え処理が所定の時間内に自動で中断できるという効果を有し、例えば、エアコンシステムにおける温度設定データなどのように次々と変更されるデータを記録していく必要のあるシステムに有用である。   The nonvolatile memory automatic rewrite interruption method, nonvolatile memory, and microcomputer according to the present invention have the effect that the nonvolatile memory rewrite process can be automatically interrupted within a predetermined time, for example, temperature setting in an air conditioner system This is useful for systems that need to record data that changes one after another, such as data.

本発明の実施の形態1に係るフラッシュメモリ100の構成を示すブロック図である。1 is a block diagram showing a configuration of a flash memory 100 according to Embodiment 1 of the present invention. 本発明の実施の形態1に係る書き換え制御部120が消去コマンドを実行する場合の制御フローを示すフローチャートである。It is a flowchart which shows the control flow in case the rewriting control part 120 which concerns on Embodiment 1 of this invention performs an erasure | elimination command. 本発明の実施の形態2に係るフラッシュメモリ200の構成を示すブロック図である。It is a block diagram which shows the structure of the flash memory 200 concerning Embodiment 2 of this invention. 本発明の実施の形態2に係る書き換え制御部220が消去コマンドを実行する場合の制御フローを示すフローチャートである。It is a flowchart which shows the control flow in case the rewriting control part 220 which concerns on Embodiment 2 of this invention performs an erasure | elimination command. 本発明の実施の形態3に係るマイクロコンピュータ300の構成を示すブロック図である。It is a block diagram which shows the structure of the microcomputer 300 which concerns on Embodiment 3 of this invention. 本発明の実施の形態4に係るマイクロコンピュータ400の構成を示すブロック図である。It is a block diagram which shows the structure of the microcomputer 400 which concerns on Embodiment 4 of this invention. 本発明の実施の形態5に係るエアコンシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the air conditioning system which concerns on Embodiment 5 of this invention.

符号の説明Explanation of symbols

100 フラッシュメモリ
110 コマンドデコード部
120 書き換え制御部
130 メモリアレイ
140 出力制御部
150 再開情報保持部
200 フラッシュメモリ
220 書き換え制御部
260 タイマ
300 マイクロコンピュータ
310 CPU
320 フラッシュメモリ
330 ROM
340 RAM
350 制御レジスタ
400 マイクロコンピュータ
410 CPU
460 タイマ
510 リモコン
520 室内機
530 マイクロコンピュータ
540 フラッシュメモリ
550 CPU
B100 アドレス入力
B110 データ入出力
B120 書き換えアドレスバス
B130 書き込みデータバス
B140 コマンド信号
B150 アレイ制御信号
B160 状態信号
B170 読み出しデータバス
B300 アドレスバス
B310 データバス
B500 アドレスバス
B510 データバス
S100 ライトイネーブル
S110 リードイネーブル
S220 タイマ起動信号
S230 オーバーフロー信号
S300 ライトイネーブル
S310 リードイネーブル
S420 タイマ起動信号
S430 オーバーフロー信号
S500 ライトイネーブル
S510 リードイネーブル
DESCRIPTION OF SYMBOLS 100 Flash memory 110 Command decoding part 120 Rewrite control part 130 Memory array 140 Output control part 150 Restart information holding part 200 Flash memory 220 Rewrite control part 260 Timer 300 Microcomputer 310 CPU
320 Flash memory 330 ROM
340 RAM
350 Control register 400 Microcomputer 410 CPU
460 Timer 510 Remote control 520 Indoor unit 530 Microcomputer 540 Flash memory 550 CPU
B100 Address input B110 Data input / output B120 Rewrite address bus B130 Write data bus B140 Command signal B150 Array control signal B160 Status signal B170 Read data bus B300 Address bus B310 Data bus B500 Address bus B510 Data bus S100 Write enable S110 Read enable S220 Timer start Signal S230 Overflow signal S300 Write enable S310 Read enable S420 Timer start signal S430 Overflow signal S500 Write enable S510 Read enable

Claims (9)

不揮発性メモリを書き換えるための所定の制御フローを複数個の分割制御フローから構成し、前記複数個の分割制御フローの1つが完了する度に前記制御フローの実行を中断することにより前記不揮発性メモリの書き換えを中断し、前記不揮発性メモリを読み出し可能な状態とすることを特徴とする不揮発性メモリの自動書き換え中断方法。   A predetermined control flow for rewriting the nonvolatile memory is composed of a plurality of divided control flows, and the execution of the control flow is interrupted each time one of the plurality of divided control flows is completed. An automatic rewrite interruption method for a nonvolatile memory, wherein the rewrite is interrupted and the nonvolatile memory is made readable. 前記不揮発性メモリの書き換えを中断した状態から前記不揮発性メモリの書き換えを再開するために必要な再開情報を記憶し、前記制御フローとして、前記再開情報から決定される所定の分割制御フローを実行し、前記所定の分割制御フローが完了すると前記制御フローの実行を中断するとともに、前記再開情報を更新記憶することを特徴とする請求項1記載の不揮発性メモリの自動書き換え中断方法。   Stores resumption information necessary to resume rewriting of the nonvolatile memory from a state where rewriting of the nonvolatile memory is interrupted, and executes a predetermined division control flow determined from the resumption information as the control flow. 2. The non-volatile memory automatic rewrite interruption method according to claim 1, wherein when the predetermined divided control flow is completed, the execution of the control flow is interrupted and the restart information is updated and stored. 前記制御フローでは、まずタイマによる時間計測を開始し、前記分割制御フローが完了する度に時間超過の有無を確認し、超過していない場合には次の分割制御フローを実行し、超過している場合には前記制御フローの実行を中断することを特徴とする請求項1または2記載の不揮発性メモリの自動書き換え中断方法。   In the control flow, first, time measurement by a timer is started. Every time the divided control flow is completed, whether or not the time is exceeded is checked. If it does not exceed, the next divided control flow is executed. 3. The non-volatile memory automatic rewrite interruption method according to claim 1, wherein execution of the control flow is interrupted when there is any. 書き換え可能な不揮発性メモリであって、
複数のメモリセルから構成されるメモリアレイと、
不揮発性メモリ外部から入力されるコマンドを解読するコマンド解読部と、
前記コマンド解読部の解読結果により、所定の制御フローに従い前記メモリアレイを書き換える書き換え制御部と、
を備え、
前記制御フローは、複数個の分割制御フローから構成され、
前記複数個の分割制御フローの1つが完了する度に前記制御フローの実行を中断することにより前記メモリアレイの書き換えを中断し、前記メモリアレイを読み出し可能な状態とするように構成されていることを特徴とする不揮発性メモリ。
A rewritable nonvolatile memory,
A memory array composed of a plurality of memory cells;
A command decoding unit for decoding commands input from outside the nonvolatile memory;
A rewrite control unit that rewrites the memory array in accordance with a predetermined control flow according to a decoding result of the command decoding unit;
With
The control flow is composed of a plurality of divided control flows,
Each time the control flow is completed, the execution of the control flow is interrupted to interrupt the rewrite of the memory array, and the memory array can be read. Nonvolatile memory characterized by.
前記書き換え制御部は、前記メモリアレイの書き換えを中断した状態から前記メモリアレイの書き換えを再開するために必要な再開情報を記憶する再開情報保持部を備え、
前記制御フローとして、前記再開情報保持部が保持する再開情報から決定される所定の分割制御フローを実行し、前記所定の分割制御フローが完了すると前記制御フローの実行を中断するとともに、前記再開情報を前記再開情報保持部に更新記憶するように構成されていることを特徴とする請求項4記載の不揮発性メモリ。
The rewrite control unit includes a resumption information holding unit that stores resumption information necessary to resume rewriting of the memory array from a state where rewriting of the memory array is interrupted,
As the control flow, a predetermined division control flow determined from the resumption information held by the resumption information holding unit is executed, and when the predetermined division control flow is completed, the execution of the control flow is interrupted and the resumption information The non-volatile memory according to claim 4, wherein the non-volatile memory is configured to be updated and stored in the restart information holding unit.
時間を計測し所定の時間を超過したことを検出するタイマを備え、
前記制御フローでは、まず前記タイマの時間計測を開始し、前記分割制御フローが完了する度に前記タイマの時間超過の有無を確認し、超過していない場合には次の分割制御フローを実行し、超過している場合には前記制御フローの実行を中断するように構成されていることを特徴とする請求項4または5記載の不揮発性メモリ。
It has a timer that measures the time and detects that the specified time has been exceeded.
In the control flow, first, time measurement of the timer is started, and whenever the division control flow is completed, it is checked whether or not the timer has been exceeded. If not, the next division control flow is executed. 6. The non-volatile memory according to claim 4, wherein execution of the control flow is interrupted if the control flow is exceeded.
書き換え可能な不揮発性メモリと、
前記不揮発性メモリを所定の制御フローに従い書き換え制御するCPUとを備えたマイクロコンピュータであって、
前記制御フローは、複数個の分割制御フローから構成され、
前記複数個の分割制御フローの1つが完了する度に制御フローの実行を中断することにより前記不揮発性メモリの書き換えを中断し、前記不揮発性メモリを読み出し可能な状態とするように構成されていることを特徴とするマイクロコンピュータ。
Rewritable nonvolatile memory,
A microcomputer including a CPU that rewrites and controls the nonvolatile memory according to a predetermined control flow,
The control flow is composed of a plurality of divided control flows,
Each time one of the plurality of divided control flows is completed, the execution of the control flow is interrupted to interrupt the rewriting of the nonvolatile memory so that the nonvolatile memory can be read. A microcomputer characterized by that.
前記不揮発性メモリの書き換えを中断した状態から前記不揮発性メモリの書き換えを再開するために必要な再開情報を記憶する再開情報保持部を備え、
前記制御フローとして前記再開情報保持部が保持する再開情報から決定される所定の分割制御フローを実行し、前記所定の分割制御フローが完了すると前記制御フローの実行を中断するとともに、前記再開情報を前記再開情報保持部に更新記憶するように構成されていることを特徴とする請求項7記載のマイクロコンピュータ。
A resumption information holding unit that stores resumption information necessary to resume rewriting of the nonvolatile memory from a state where rewriting of the nonvolatile memory is interrupted,
As the control flow, a predetermined division control flow determined from the resumption information held by the resumption information holding unit is executed. When the predetermined division control flow is completed, the execution of the control flow is interrupted, and the resumption information is 8. The microcomputer according to claim 7, wherein the microcomputer is configured to be updated and stored in the restart information holding unit.
時間を計測し所定の時間を超過したことを検出するタイマを備え、
前記制御フローでは、まず前記タイマの時間計測を開始し、前記分割制御フローが完了する度に前記タイマの時間超過の有無を確認し、超過していない場合には次の分割制御フローを実行し、超過している場合には前記制御フローの実行を中断するように構成されていることを特徴とする請求項7または8記載のマイクロコンピュータ。
It has a timer that measures the time and detects that the specified time has been exceeded.
In the control flow, first, time measurement of the timer is started, and whenever the division control flow is completed, it is checked whether or not the timer has been exceeded. If not, the next division control flow is executed. 9. The microcomputer according to claim 7, wherein the microcomputer is configured to suspend execution of the control flow when it exceeds.
JP2008249387A 2008-09-29 2008-09-29 Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer Pending JP2010079758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008249387A JP2010079758A (en) 2008-09-29 2008-09-29 Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008249387A JP2010079758A (en) 2008-09-29 2008-09-29 Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer

Publications (1)

Publication Number Publication Date
JP2010079758A true JP2010079758A (en) 2010-04-08

Family

ID=42210101

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008249387A Pending JP2010079758A (en) 2008-09-29 2008-09-29 Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer

Country Status (1)

Country Link
JP (1) JP2010079758A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010250932A (en) * 2009-04-14 2010-11-04 John Rudelic Method for writing to and erasing non-volatile memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010250932A (en) * 2009-04-14 2010-11-04 John Rudelic Method for writing to and erasing non-volatile memory

Similar Documents

Publication Publication Date Title
JP5115826B2 (en) Apparatus and method for reducing peak power consumption during common operation of multi-NAND flash memory devices
JP4536742B2 (en) Arithmetic processing apparatus and method for flash memory according to priority
KR100673027B1 (en) Non-volatile memory device capable of compensating read margin reduced due to hot temperature stress
KR20040075051A (en) Flash memory access using a plurality of command cycles
JP2008192266A (en) Memory controller
JPH10161988A (en) Microcomputer having flash eeprom built in
JP2007140733A (en) Semiconductor processor and semiconductor integrated circuit
JP4829370B1 (en) MEMORY CONTROL DEVICE, MEMORY DEVICE, AND STOP CONTROL METHOD
JP2005071303A (en) Program starting device
JP2008034089A (en) Flash memory device, program method, and memory system
KR100874955B1 (en) Semiconductor memory device and its VeriFi control method
JP2010079758A (en) Method of interrupting automatic rewriting of nonvolatile memory, nonvolatile memory and microcomputer
JP2008077794A (en) Information processor and disk drive control method
JP2008251056A (en) Semiconductor storage device and rewriting control method of semiconductor storage device
JP2008084288A (en) Memory controller
US20170161224A1 (en) Apparatus and methods for in-application programming of flash-based programable logic devices
JP2015162215A (en) semiconductor device
JP2009223435A (en) Data storage method and device, and program
JP2011081641A (en) Memory controller
JP2012022475A (en) Data processing device, semiconductor device and control method
JP2005078489A (en) Microcontroller and its control method
JP2009093270A (en) Computer system and startup method therefor
JPH06222986A (en) Memory controller
JP2006252278A (en) Microcomputer
JP2019008642A (en) Semiconductor device, and flash memory control method

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20110124

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20110228