JP2008276938A - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
JP2008276938A
JP2008276938A JP2008176658A JP2008176658A JP2008276938A JP 2008276938 A JP2008276938 A JP 2008276938A JP 2008176658 A JP2008176658 A JP 2008176658A JP 2008176658 A JP2008176658 A JP 2008176658A JP 2008276938 A JP2008276938 A JP 2008276938A
Authority
JP
Japan
Prior art keywords
memory
flash memory
microcomputer
data
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2008176658A
Other languages
Japanese (ja)
Inventor
Kiyoshi Matsubara
清 松原
Naoki Yashiki
直樹 屋鋪
Shiro Baba
志朗 馬場
Takashi Ito
高志 伊藤
Hirofumi Mukai
浩文 向井
Narihisa Sato
斉尚 佐藤
Masaaki Terasawa
正明 寺沢
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2008176658A priority Critical patent/JP2008276938A/en
Publication of JP2008276938A publication Critical patent/JP2008276938A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To improve the operability of a flash memory incorporated in a microcomputer. <P>SOLUTION: In this microcomputer, a CPU, an I/O port, the flash memory and a random access memory are constituted in a single semiconductor chip. The flash memory is divided into a plurality of batch erasable storage areas to store a rewritten control program and a transfer control program, and provided with a control register which sets the operating state of erasure/writing, etc. The control register includes a bit for instructing the erasure operation, a bit for instructing the writing operation, a bit for instructing a verifying operation and a bit for specifying the storage area to be objective for the erase, and controlled by the CPU. The CPU executes the transfer control program to transfer the rewriting control program to the random access memory, and further executes the transferred rewriting control program to write prepared data into the flash memory. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、電気的な消去・書込みによって情報を書換え可能な不揮発性のフラッシュメモリを備えたマイクロコンピュータに関する。   The present invention relates to a microcomputer including a nonvolatile flash memory that can rewrite information by electrical erasing / writing.

特開平1−161469号公報には、プログラム可能な不揮発性メモリとしてEPROM(イレーザブル・アンド・プログラマブル・リード・オンリ・メモリ)またはEEPROM(エレクトリカリ・イレーザブル・アンド・プログラマブル・リード・オンリ・メモリ)を単一の半導体チップに搭載したマイクロコンピュータについて記載されている。そのようなマイクロコンピュータにオン・チップ化された不揮発性メモリにはプログラムやデータが保持される。EPROMは紫外線により記憶情報を消去するものであるから、それを実装システムから取り外さなければ書換えを行うことができない。EEPROMは電気的に消去・書込みを行うことができるので、システムに実装された状態でその記憶情報を書換えることができるが、それを構成するメモリセルは、MNOS(メタル・ナイトライド・オキサイド・セミコンダクタ)のような記憶素子のほかに選択トランジスタを必要とするため、EPROMに比べて例えば2.5倍から5倍程度の大きさになり、相対的に大きなチップ占有面積を必要とする。   Japanese Patent Laid-Open No. 1-161469 discloses EPROM (erasable and programmable read-only memory) or EEPROM (electrically erasable and programmable read-only memory) as a programmable nonvolatile memory. A microcomputer mounted on a single semiconductor chip is described. Programs and data are held in such a non-volatile memory on-chip in a microcomputer. Since the EPROM erases stored information by ultraviolet rays, it cannot be rewritten unless it is removed from the mounting system. Since the EEPROM can be electrically erased and written, the stored information can be rewritten in a state where the EEPROM is mounted on the system. However, the memory cell constituting the EEPROM is MNOS (metal nitride oxide. Since a selection transistor is required in addition to a storage element such as a semiconductor, the size is about 2.5 to 5 times that of an EPROM, and a relatively large chip occupation area is required.

特開平2−289997号公報には一括消去型EEPROMについて記載されている。この一括消去型EEPROMは本明細書におけるフラッシュメモリと同意義に把握することができる。フラッシュメモリは、電気的な消去・書込みによって情報を書換え可能であって、EPROMと同様にそのメモリセルを1個のトランジスタで構成することができ、メモリセルの全てを一括して、またはメモリセルのブロックを一括して電気的に消去する機能を持つ。したがって、フラッシュメモリは、システムに実装された状態でそれの記憶情報を書換えることができると共に、その一括消去機能により書換え時間の短縮を図ることができ、さらに、チップ占有面積の低減にも寄与する。   Japanese Patent Laid-Open No. 2-289997 describes a batch erase type EEPROM. This collective erasure type EEPROM can be grasped in the same meaning as the flash memory in this specification. The flash memory can rewrite information by electrical erasing / writing, and its memory cell can be composed of one transistor as in the case of EPROM. All the memory cells can be collectively or memory cells. It has a function to electrically erase all blocks at once. Therefore, the flash memory can rewrite the stored information in the state where it is mounted on the system, and the batch erase function can shorten the rewrite time, and further contributes to the reduction of the chip occupied area. To do.

特開平1−161469号公報JP-A-1-161469 特開平2−289997号公報JP-A-2-289997

本発明者はマイクロコンピュータにフラッシュメモリを搭載することについて検討し、これにより以下の点をみい出した。   The present inventor has studied about mounting a flash memory in a microcomputer, and has found the following points.

(1)マイクロコンピュータの内蔵ROMにはプログラム及びデータが格納される。更にデータには大容量データと小容量データがある。これらプログラム及びデータを書き換える場合、通常前者については数十KB(キロバイト)の大きな単位で、後者については数十B(バイト)の小さな単位で書換が行われる。このとき、フラッシュメモリの消去単位がチップ一括または同一サイズのメモリブロック単位で行われるのでは、プログラム領域にはちょうど良いがデータ領域には消去単位が大きすぎて使いにくかったり、或はその逆のケースも起こり得る。   (1) A program and data are stored in the built-in ROM of the microcomputer. Furthermore, there are large capacity data and small capacity data. When rewriting these programs and data, the former is usually rewritten in a large unit of several tens of KB (kilobytes), and the latter is rewritten in a small unit of several tens of B (bytes). At this time, if the erase unit of the flash memory is performed in a batch of chips or a memory block unit of the same size, it is just right for the program area, but the erase unit is too large for the data area, or vice versa. Cases can also occur.

(2)マイクロコンピュータをシステムに実装した後にフラッシュメモリの保持情報の一部を書換えるような場合には、当該情報を保有している一部のメモリブロックを書換え対象とすればよいが、一括消去可能なメモリブロックの記憶容量が全てのメモリブロックで等しくされているならば、メモリブロックの記憶容量よりも情報量の少ない情報だけを書換えればよい場合にも比較的記憶容量の大きなメモリブロックを一括消去した後に当該メモリブロック全体に対して順次書込みを行わなければならず、実質的に書換えを要しない情報のための書換えに無駄な時間を費やすことになる。   (2) When a part of the information held in the flash memory is rewritten after the microcomputer is mounted on the system, a part of the memory block holding the information may be rewritten. If the memory capacity of the erasable memory block is the same in all memory blocks, a memory block having a relatively large memory capacity even when only information having a smaller information amount than the memory capacity of the memory block needs to be rewritten. After the data is erased all at once, the entire memory block must be sequentially written, and a waste of time is spent on rewriting for information that does not substantially require rewriting.

(3)フッラシュメモリに書き込むべき情報はそのマイクロコンピュータが適用されるシステムにしたがって決定されるが、当該マイクロコンピュータをシステムに実装した状態で最初から全ての情報を書込んでいたのでは非能率的な場合がある。   (3) The information to be written in the flash memory is determined according to the system to which the microcomputer is applied, but it is inefficient to write all the information from the beginning with the microcomputer mounted in the system. There is a case.

(4)マイクロコンピュータの実装状態でフラッシュメモリを書換えるとき、書換対象メモリブロックの一部の情報だけを書換えればよくても、一括消去した後のメモリブロックの全体に書込むべき情報の全てをマイクロコンピュータの外部から順次もらいながら書込みを行っていたのでは、書換対象メモリブロックの一部の情報だけを書換えればよくても、当該メモリブロック全体に書込むべき情報の全てを外部から受け取らなくてはならず、実質的に書換えを要しない情報、すなわち書換え前に内部で保持している情報も重ねて外部から転送されなければならず、メモリブロックの一部書換のための情報転送に無駄がある。   (4) When the flash memory is rewritten with the microcomputer mounted, all the information to be written to the entire memory block after erasing at once, even if only a part of the information in the memory block to be rewritten needs to be rewritten In this case, it is only necessary to rewrite a part of the information in the memory block to be rewritten, but all the information to be written in the entire memory block is received from the outside. Information that does not need to be rewritten, that is, information that is held internally before rewriting must also be transferred from the outside in order to transfer information for partial rewriting of memory blocks. There is waste.

(5)フラッシュメモリを一括消去で書換える時間はその情報記憶形式故にRAM(ランダム・アクセス・メモリ)などのメモリに比べて相当長いため、マイクロコンピュータによる機器制御動作に同期してリアルタイムにフラッシュメモリを書換えることができない。   (5) Since the time for rewriting the flash memory by batch erasure is considerably longer than the memory such as RAM (Random Access Memory) because of its information storage format, the flash memory in real time in synchronization with the device control operation by the microcomputer Cannot be rewritten.

本発明の目的は、使い勝手の良好なフラッシュメモリを内蔵したマイクロコンピュータを提供することにある。更に詳しく言えば、本発明の第1の目的は、内蔵フッラシュメモリに対して行われる最初の情報書込み処理の高効率化を図ることができるマイクロコンピュータを提供することである。本発明の第2の目的は、フラッシュメモリの一部のメモリブロックが保持する情報の一部の書換えに対して、当該メモリブロックを一括消去した後の書込み動作の無駄をなくして、書換え効率を向上させることである。本発明の第3の目的は、メモリブロックの一部書換のために必要な外部からの書込み情報の転送動作の無駄をなくして、書換え効率を向上させることである。本発明の第4の目的は、マイクロコンピュータの制御動作に同期してリアルタイムにフラッシュメモリの保持情報を変更できるようにすることである。   An object of the present invention is to provide a microcomputer having a built-in flash memory that is easy to use. More specifically, a first object of the present invention is to provide a microcomputer capable of improving the efficiency of the first information writing process performed on the built-in flash memory. The second object of the present invention is to rewrite part of the information held in a part of the memory block of the flash memory and eliminate the waste of the write operation after erasing the memory block at once, thereby improving the rewrite efficiency. It is to improve. The third object of the present invention is to improve the rewriting efficiency by eliminating the waste of the transfer operation of the write information from the outside necessary for the partial rewriting of the memory block. A fourth object of the present invention is to make it possible to change information held in a flash memory in real time in synchronization with a control operation of a microcomputer.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

すなわち、単一の半導体チップ上に、中央処理装置と、この中央処理装置によってアクセス可能なRAMと、前記中央処理装置が処理すべき情報を電気的な消去・書込みによって書換え可能な不揮発性のフラッシュメモリとを備えたマイクロコンピュータに対して、前記フラッシュメモリに対する書換えを前記半導体チップの内蔵回路例えば中央処理装置に制御させる第1動作モードと前記半導体チップの外部装置に制御させる第2動作モードとを選択的に指定するための動作モード信号の入力端子を設ける。   That is, on a single semiconductor chip, a central processing unit, a RAM accessible by the central processing unit, and a non-volatile flash in which information to be processed by the central processing unit can be rewritten by electrical erasing / writing A first operation mode in which a microcomputer having a memory controls rewriting to the flash memory by a built-in circuit of the semiconductor chip, for example, a central processing unit, and a second operation mode in which an external device of the semiconductor chip controls An input terminal for an operation mode signal for selectively specifying is provided.

前記第1動作モードの指定に応じて中央処理装置が書換え制御を行うとき、当該中央処理装置が実行すべき書換え制御プログラムはマスクROMに保有させ、或はフラッシュメモリに予め格納しておいた書換制御プログラムをRAMに転送して、これを実行させることができる。   When the central processing unit performs rewrite control in accordance with the designation of the first operation mode, the rewrite control program to be executed by the central processing unit is held in the mask ROM or rewritten in advance in the flash memory. The control program can be transferred to the RAM and executed.

用途に応じてフラッシュメモリに格納すべき情報量がその情報の種類例えばプログラム、データテーブル、制御データなどに応じて相違されることを考慮した場合に、フラッシュメモリの一部のメモリブロックが保持する情報の一部の書換えに対して、当該メモリブロックを一括消去した後の書込み動作の無駄をなくして、書換え効率を向上させるために、前記フラッシュメモリにおける一括消去可能な単位として、相互に記憶容量の相違される複数個のメモリブロックを割当てる。   When considering that the amount of information to be stored in the flash memory according to the application varies depending on the type of information such as a program, data table, control data, etc., some memory blocks of the flash memory hold In order to eliminate the waste of the write operation after batch erasing the memory block and improve the rewrite efficiency for partial rewrite of the information, the storage capacity is mutually stored as a batch erasable unit in the flash memory. A plurality of different memory blocks are allocated.

マイクロコンピュータの内外からフラッシュメモリの書換えを制御する場合に、一括消去すべきメモリブロックを容易に指定できるようにするには、一括消去すべきメモリブロックの指定情報を書換え可能に保持するためのレジスタをフラッシュメモリに内蔵させるとよい。   When controlling the rewriting of flash memory from inside and outside the microcomputer, in order to be able to easily specify the memory block to be erased at once, a register for holding the rewritable memory block designation information Should be built into the flash memory.

内蔵フラッシュメモリが、一括消去可能な単位として相互に記憶容量の相違される複数個のメモリブロックを有するとき、内蔵RAMをメモリブロック書換えのための作業領域もしくはデータバッファ領域として利用可能にするために、内蔵RAMの記憶容量以下に設定されたメモリブロックを設けておく。このとき、メモリブロックの一部書換のために必要な外部からの書込み情報の転送動作の無駄をなくして、書換え効率を向上させるには、前記内蔵RAMよりも記憶容量の小さなメモリブロックの保持情報を内蔵RAMに転送し、転送された情報の全部又は一部をそのRAM上で更新して、その更新された情報で当該メモリブロックを書換えるようにするとよい。また、フラッシュメモリが保持する制御データなどのチューニングを行うような場合に、マイクロコンピュータの制御動作に同期してリアルタイムにフラッシュメモリの保持情報を変更できるようにするには内蔵RAMの特定アドレスの領域を、前記内蔵RAMよりも記憶容量の小さなメモリブロックのアドレスに重なる様に変更配置し、すなわちメモリブロックをアクセスした場合に重なったRAMがアクセスされる様に、変更配置し、そのRAMの特定アドレスで作業を行った後でRAMの配置アドレスを元の状態に復元し、メモリブロックの内容を前記RAMの特定アドレスの情報で書換える処理を行うようにするとよい。   When the built-in flash memory has a plurality of memory blocks having different storage capacities as a unit that can be collectively erased, the built-in RAM can be used as a work area or a data buffer area for rewriting the memory block. A memory block set below the storage capacity of the built-in RAM is provided. At this time, in order to eliminate the waste of the external write information transfer operation necessary for the partial rewrite of the memory block and improve the rewrite efficiency, the retained information of the memory block having a smaller storage capacity than the built-in RAM Is transferred to the built-in RAM, and all or a part of the transferred information is updated on the RAM, and the memory block is rewritten with the updated information. In addition, when tuning the control data held by the flash memory, etc., it is possible to change the information held in the flash memory in real time in synchronization with the control operation of the microcomputer. Is changed and arranged so as to overlap the address of the memory block having a smaller storage capacity than the built-in RAM, that is, when the memory block is accessed, the changed RAM is accessed and the specific address of the RAM is changed. After the operation is performed, the RAM arrangement address may be restored to the original state, and the process of rewriting the contents of the memory block with the information of the specific address of the RAM may be performed.

上記した手段によれば、本発明に係るマイクロコンピュータをシステムに実装する前のような段階で最初にそのフラッシュメモリに情報を書き込むようなときは、第2動作モードを指定することにより、PROMライタのような外部書き込み装置の制御によって能率的に情報の書き込みが行われる。   According to the above means, when information is first written to the flash memory at a stage before the microcomputer according to the present invention is mounted on the system, the PROM writer is designated by designating the second operation mode. Information is efficiently written by the control of the external writing device.

フラッシュメモリにおける一括消去可能な単位として相互に記憶容量の相違される複数個のメモリブロックには夫々の記憶容量に応じて例えばプログラム、データテーブル、制御データなどが書き込まれる。   For example, a program, a data table, and control data are written in a plurality of memory blocks having different storage capacities as batch erasable units in the flash memory according to the respective storage capacities.

システムにマイクロコンピュータを実装した後でフラッシュメモリを書換える場合には、第1動作モードを指定することにより、書換え制御をマイクロコンピュータ内蔵の中央処理装置などに実行させる。このとき、相対的に情報量の大きなデータは相対的に記憶容量の大きなメモリブロックに、相対的に情報量の小さなデータは相対的に記憶容量の小さなメモリブロックに書き込んでおくことができる。すなわち記憶すべき情報量に見合う記憶容量のメモリブロックを利用することができる。したがって、フラッシュメモリの保持情報の一部書換えのために所要のメモリブロックを一括消去しても、実質的に書換えを要しない情報群も併せて消去した後で再び書き戻すと言うような無駄が極力防止される。   When the flash memory is rewritten after the microcomputer is mounted on the system, the rewrite control is executed by the central processing unit or the like built in the microcomputer by designating the first operation mode. At this time, data having a relatively large amount of information can be written in a memory block having a relatively large storage capacity, and data having a relatively small amount of information can be written in a memory block having a relatively small storage capacity. That is, a memory block having a storage capacity corresponding to the amount of information to be stored can be used. Therefore, even if a required memory block is erased at once for partial rewriting of the information held in the flash memory, there is a waste of rewriting it after erasing information groups that do not substantially require rewriting. It is prevented as much as possible.

特に、複数個のメモリブロックのうち内蔵RAMの記憶容量以下に設定されたメモリブロックを設けておくことは、内蔵RAMをメモリブロック書換えのための作業領域若しくはデータバッファ領域として利用可能にする。すなわち、マイクロコンピュータの実装状態でフラッシュメモリを書換えるとき、書換対象メモリブロックの情報を内蔵RAMに転送し、書換えるべき一部の情報だけを外部からもらってそのRAM上で書換を行ってから、フラッシュメモリの書換を行えば、書換え前に内部で保持されている書換を要しない情報を重ねて外部から転送を受けなくても済み、メモリブロックの一部書換のための情報転送の無駄を省く。また、フラッシュメモリの一括消去時間は小メモリブロックに対してもさほど短くならないから、マイクロコンピュータによる制御動作に同期してリアルタイムにフラッシュメモリそれ自体を書換えることはできないが、内蔵RAMをメモリブロック書換えのための作業領域若しくはデータバッファ領域として利用することにより、リアルタイムに書換えたのと同じデータを結果的にメモリブロックに得ることができる。   In particular, the provision of a memory block set below the storage capacity of the built-in RAM among the plurality of memory blocks enables the built-in RAM to be used as a work area or a data buffer area for rewriting the memory block. That is, when the flash memory is rewritten in the mounted state of the microcomputer, the information on the memory block to be rewritten is transferred to the built-in RAM, and only a part of the information to be rewritten is received from the outside and rewritten on the RAM. If the flash memory is rewritten, it is not necessary to superimpose information held inside that does not need to be rewritten before it is transferred from the outside, thus eliminating waste of information transfer for partial rewriting of the memory block. . Also, the flash memory batch erase time is not so short even for small memory blocks, so the flash memory itself cannot be rewritten in real time in synchronization with the control operation by the microcomputer, but the internal RAM is rewritten to the memory block. By using it as a work area or a data buffer area, the same data that has been rewritten in real time can be obtained in the memory block as a result.

本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば下記の通りである。   The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、本発明に係るマイクロコンピュータは第1動作モードと第2動作モードとを有するから、マイクロコンピュータをシステムに実装する前の初期データ、又は初期プログラムなどの比較的大量の情報を、汎用PROMライタなどで能率的に書込むことができる。更に、マイクロコンピュータが実装されたシステムを動作させながらデータのチューニングをする場合、またプログラムのバグ対策、若しくはシステムのバージョンアップに伴うプログラムの変更等、マイクロコンピュータがシステムに実装された状態でデータやプログラムの変更が必要になった時に、マイクロコンピュータを実装システムから取り外すことなくフラッシュメモリを書換えることができる。   That is, since the microcomputer according to the present invention has the first operation mode and the second operation mode, a relatively large amount of information such as initial data or an initial program before mounting the microcomputer in the system is transferred to the general-purpose PROM writer. You can write efficiently. Furthermore, when tuning data while operating a system on which a microcomputer is installed, and when data is stored in a state where the microcomputer is installed in the system, such as program bug countermeasures or program changes associated with system upgrades, etc. When the program needs to be changed, the flash memory can be rewritten without removing the microcomputer from the mounting system.

フラッシュメモリにおける一括消去可能な単位として相互に記憶容量の相違される複数個のメモリブロックを設けておくことにより、相対的に情報量の大きなデータは相対的に記憶容量の大きなメモリブロックに、相対的に情報量の小さなデータは相対的に記憶容量の小さなメモリブロックに書き込んでおくことができ、記憶すべき情報量に見合う記憶容量のメモリブロックを利用することができる。したがって、プログラム領域にはちょうど良いがデータ領域には消去単位が大きすぎて使いにくかったりする事態を防止することができる。また、フラッシュメモリの保持情報の一部書換えのために所要のメモリブロックを一括消去しても、実質的に書換えを要しない情報群も併せて消去した後で再び書き戻すと言うような無駄を極力防止することができる。   By providing a plurality of memory blocks having different storage capacities as a unit that can be collectively erased in a flash memory, relatively large amount of data is relatively transferred to memory blocks having a relatively large storage capacity. In particular, data with a small amount of information can be written in a memory block with a relatively small storage capacity, and a memory block with a storage capacity suitable for the amount of information to be stored can be used. Therefore, it is possible to prevent a situation where the erasing unit is too large for the program area but is difficult to use. In addition, even if a required memory block is erased at once for partial rewriting of information held in the flash memory, information that does not substantially need to be rewritten is erased together and then rewritten again. It can be prevented as much as possible.

複数個のメモリブロックのうち内蔵RAMの記憶容量以下に設定されたメモリブロックを設けておくことにより、内蔵RAMをメモリブロック書換えのための作業領域若しくはデータバッファ領域として利用できるようになる。このような条件の下で、マイクロコンピュータの実装状態でフラッシュメモリを書換えるとき、書換対象メモリブロックの情報を内蔵RAMに転送し、書換えるべき一部の情報だけを外部からもらってそのRAM上で書換を行ってから、フラッシュメモリの書換を行うことにより、書換え前に内部で保持されている書換を要しない情報を重ねて外部から転送を受けなくても済み、メモリブロックの一部書換のための情報転送の無駄を省くことができる。また、フラッシュメモリが保持するデータのチューニングなどに際して、前記内蔵RAMのアドレスを当該フラッシュメモリのメモリブロックのアドレスにオーバラップさせてそのRAM上でチューニングを行い、チューニング結果をフラッシュメモリの該当メモリブロックに転送することにより、マイクロコンピュータによる制御動作に同期してリアルタイムにフラッシュメモリそれ自体を書換えることはできなくても、リアルタイムに書換えたのと同じデータを結果的にメモリブロックに得ることができる。   By providing a memory block set below the storage capacity of the built-in RAM among the plurality of memory blocks, the built-in RAM can be used as a work area or a data buffer area for rewriting the memory block. Under these conditions, when the flash memory is rewritten with the microcomputer mounted, the information on the memory block to be rewritten is transferred to the built-in RAM, and only a part of the information to be rewritten is received from the outside and stored on the RAM. By rewriting the flash memory after rewriting, it is not necessary to superimpose information stored inside that does not need to be rewritten before being rewritten and transferred from the outside. It is possible to eliminate the waste of information transfer. Also, when tuning the data held in the flash memory, the address of the internal RAM is overlapped with the address of the memory block of the flash memory, tuning is performed on the RAM, and the tuning result is stored in the corresponding memory block of the flash memory. By transferring, even if the flash memory itself cannot be rewritten in real time in synchronization with the control operation by the microcomputer, the same data as that rewritten in real time can be obtained in the memory block as a result.

一括消去すべきメモリブロックの指定情報を書換え可能に保持するためのレジスタをフラッシュメモリに内蔵させることにより、一括消去すべきメモリブロックをマイクロコンピュータの内外から同じ様な手順で容易に指定できるようになる。   By incorporating a rewritable register in the flash memory to specify the memory block specification information to be erased in a batch, the memory block to be erased in a batch can be easily designated from the inside and outside of the microcomputer in the same procedure. Become.

上記夫々の効果によって、マイクロコンピュータに内蔵されたフラッシュメモリの使い勝手を向上させることができるという効果を得る。   With the above effects, the usability of the flash memory built in the microcomputer can be improved.

以下本発明に係るマイクロコンピュータを項目を分けて順次説明する。   Hereinafter, the microcomputer according to the present invention will be described in order.

〔1〕全面フラッシュメモリ採用のマイクロコンピュータ
図1には全面フラッシュメモリを採用したマイクロコンピュータの一実施例ブロック図が示される。同図に示されるマイクロコンピュータMCUは、中央処理装置CPU、及びこの中央処理装置CPUが処理すべき情報を電気的な消去・書込みによって書換え可能な不揮発性のフラッシュメモリFMRY、並びにタイマTMR、シリアル・コミュニケーション・インタフェースSCI、ランダム・アクセス・メモリRAM、その他の入出力回路I/Oなどの周辺回路、そして制御回路CONTが、公知の半導体集積回路製造技術によって、シリコンのような単一の半導体チップCHP上に形成されて成る。前記フラッシュメモリFMRYは、電気的な消去・書込みによって情報を書換え可能であって、EPROMと同様にそのメモリセルを1個のトランジスタで構成することができ、更にメモリセルの全てを一括して、またはメモリセルのブロック(メモリブロック)を一括して電気的に消去する機能を持つ。フラッシュメモリFMRYは、一括消去可能な単位として複数個のメモリブロックを有する。図1において、LMBは相対的に記憶容量の大きな大メモリブロックであり、SMBは相対的に記憶容量の小さな小メモリブロックである。小メモリブロックSMBの記憶容量はランダム・アクセス・メモリRAMの記憶容量よりも小さくされる。したがって、ランダム・アクセス・メモリRAMは、小メモリブロックSMBからデータ転送を受けてその情報を一時的に保持することができ、書換えのための作業領域も若しくはデータバッファ領域として利用可能になる。このフラッシュメモリFMRYには所要のデータやプログラムが書き込まれる。尚、フラッシュメモリFMRYの詳細については後述する。
[1] Microcomputer Employing Entire Flash Memory FIG. 1 is a block diagram showing an embodiment of a microcomputer employing an entire flash memory. The microcomputer MCU shown in the figure includes a central processing unit CPU, a non-volatile flash memory FMRY that can rewrite information to be processed by the central processing unit CPU by electrical erasing and writing, a timer TMR, a serial A peripheral circuit such as a communication interface SCI, a random access memory RAM, other input / output circuit I / O, and a control circuit CONT are formed by a known semiconductor integrated circuit manufacturing technique into a single semiconductor chip CHP such as silicon. Formed on top. The flash memory FMRY can rewrite information by electrical erasing / writing, and its memory cell can be composed of a single transistor as in the case of EPROM. Alternatively, the memory cell block (memory block) is electrically erased collectively. The flash memory FMRY has a plurality of memory blocks as a unit that can be collectively erased. In FIG. 1, LMB is a large memory block having a relatively large storage capacity, and SMB is a small memory block having a relatively small storage capacity. The storage capacity of the small memory block SMB is made smaller than the storage capacity of the random access memory RAM. Therefore, the random access memory RAM can receive the data transfer from the small memory block SMB and temporarily hold the information, and the work area for rewriting can be used as the data buffer area. Necessary data and programs are written in the flash memory FMRY. The details of the flash memory FMRY will be described later.

フラッシュメモリFMRYは、マイクロコンピュータMCUがシステムに実装された状態で中央処理装置CPUの制御に基づいてその記憶情報を書換え可能にされると共に、汎用PROMライタのような前記半導体チップCHPの外部装置の制御に基づいてその記憶情報を書換え可能にされる。図においてMODEは、前記フラッシュメモリFMRYを中央処理装置CPUに書換え制御させる第1動作モードと前記外部装置に制御させる第2動作モードとを選択的に指定するための動作モード信号であり、半導体チップCHP上のモード信号入力端子Pmodeに与えられる。   The flash memory FMRY is rewritable on the basis of the control of the central processing unit CPU with the microcomputer MCU mounted on the system, and the external memory of the semiconductor chip CHP such as a general-purpose PROM writer. Based on the control, the stored information can be rewritten. In the figure, MODE is an operation mode signal for selectively designating a first operation mode in which the flash memory FMRY is controlled to be rewritten by the central processing unit CPU and a second operation mode in which the external device is controlled. It is given to the mode signal input terminal Pmode on the CHP.

〔2〕マスクROM,フラッシュメモリ採用のマイクロコンピュータ
図2にはフラッシュメモリと共にマスクROMを採用したマイクロコンピュータの一実施例ブロック図が示される。同図に示されるマイクロコンピュータMCUにおいては、図1のフラッシュメモリFMRYの一部がマスク・リード・オンリ・メモリMASKROMに置換えられている。マスク・リード・オンリ・メモリMASKROMには書換を要しないデータやプログラムが保持されている。図2に示されるフラッシュメモリFMRYは、一括消去可能な単位として前記小メモリブロックSMBを複数個有する。
[2] Microcomputer Employing Mask ROM and Flash Memory FIG. 2 is a block diagram showing an embodiment of a microcomputer employing a mask ROM together with the flash memory. In the microcomputer MCU shown in the figure, a part of the flash memory FMRY of FIG. 1 is replaced with a mask read only memory MASKROM. The mask read only memory MASKROM holds data and programs that do not require rewriting. The flash memory FMRY shown in FIG. 2 has a plurality of the small memory blocks SMB as a unit that can be collectively erased.

〔3〕汎用PROMライタによる情報書き込み
図3には汎用PROMライタによるフラッシュメモリFMRYの書換えに着目したブロック図が示される。同図には前記モード信号MODEの一例としてMD0,MD1,MD2が示される。モード信号MD1乃至MD3は前記制御回路CONTに供給される。制御回路CONTに含まれるデコーダは、特に制限されないが、モード信号MD1乃至MD3を解読して、フラッシュメモリFMRYに対して書き込みを要しない動作モードが指示されているか、又は前記第1動作モード若しくは第2動作モードが指示されているかを判定する。このとき第2動作モードの指示が判断されると、制御回路CONTは、汎用PROMライタPRWとインタフェースされるべきI/Oポートを指定して、内蔵フラッシュメモリFMRYを直接外部の汎用PROMライタPRWでアクセス可能に制御する。すなわち、フラッシュメモリFMRYとの間でデータの入出力を行うためのI/OポートPORTdataと、フラッシュメモリFMRYにアドレス信号を供給するためのI/OポートPORTaddrと、フラッシュメモリFMRYに各種制御信号を供給するためのI/OポートPORTcontとが指定される。更に、汎用PROライタPRWによる書換え制御とは直接関係ない中央処理装置CPU,ランダム・アクセス・メモリRAM,マスク・リード・オンリ・メモリMASKROMなどの内蔵機能ブロックの実質的な動作が抑制される。例えば、図3に例示的に示されるようにデータバスDBUSとアドレスバスABUSの夫々に配置されたスイッチ手段SWITCHを介して前記中央処理装置CPUなどの内蔵機能ブロックとフラッシュメモリFMRYとの接続を切離す。前記スイッチ手段SWITCHは、前記CPUなどの内蔵機能ブロックからデータバスDBUSにデータを出力する回路や、アドレスバスABUSにアドレスを出力する回路に配置された、トライステート(3ステート)形式の出力回路として把握することもできる。このようなトライステート出力回路は、第2動作モードに呼応して高出力インピーダンス状態に制御される。図3の例では汎用PROライタによる書換え制御とは直接関係ない中央処理装置CPU,ランダム・アクセス・メモリRAM,マスク・リード・オンリ・メモリMASKROMなどの内蔵機能ブロックは、スタンバイ信号STBY*(記号*はそれが付された信号がロウ・アクティブ信号であることを意味する)により低消費電力モードにされている。低消費電力モードにおいて前記トライステート出力回路が高出力インピーダンス状態に制御されるなら、モード信号でMD0乃至MD2による第2動作モードの指定に呼応してそれらの機能ブロックに低消費電力モードを設定して、汎用PROライタPRWによる書換え制御とは直接関係ないCPU,RAM,ROMなどの内蔵機能ブロックの実質的な動作を抑制してもよい。
[3] Information writing by general-purpose PROM writer FIG. 3 is a block diagram focusing on rewriting of the flash memory FMRY by the general-purpose PROM writer. In the figure, MD0, MD1, and MD2 are shown as an example of the mode signal MODE. Mode signals MD1 to MD3 are supplied to the control circuit CONT. The decoder included in the control circuit CONT is not particularly limited, but the mode signals MD1 to MD3 are decoded to indicate an operation mode that does not require writing to the flash memory FMRY, or the first operation mode or the first operation mode. 2. It is determined whether the operation mode is instructed. At this time, when the instruction of the second operation mode is determined, the control circuit CONT designates the I / O port to be interfaced with the general-purpose PROM writer PRW, and the internal flash memory FMRY is directly connected to the external general-purpose PROM writer PRW. Control access. That is, I / O port PORTdata for inputting / outputting data to / from the flash memory FMRY, I / O port PORTaddr for supplying an address signal to the flash memory FMRY, and various control signals to the flash memory FMRY. An I / O port PORTcont for supply is designated. Furthermore, substantial operations of built-in functional blocks such as the central processing unit CPU, random access memory RAM, and mask read only memory MASKROM that are not directly related to the rewrite control by the general-purpose PRO writer PRW are suppressed. For example, as shown in FIG. 3, the connection between the built-in functional block such as the central processing unit CPU and the flash memory FMRY is cut off via the switch means SWITCH arranged in the data bus DBUS and the address bus ABUS. Release. The switch means SWITCH is a tri-state (3-state) type output circuit arranged in a circuit that outputs data from a built-in functional block such as the CPU to the data bus DBUS or a circuit that outputs an address to the address bus ABUS. It can also be grasped. Such a tri-state output circuit is controlled to a high output impedance state in response to the second operation mode. In the example of FIG. 3, the built-in functional blocks such as the central processing unit CPU, random access memory RAM, mask read only memory MASKROM, etc., which are not directly related to the rewrite control by the general-purpose PRO writer, have the standby signal STBY * (symbol *). Means that the signal to which it is attached is a low active signal). If the tri-state output circuit is controlled to a high output impedance state in the low power consumption mode, the low power consumption mode is set in those functional blocks in response to the designation of the second operation mode by MD0 to MD2 with the mode signal. Thus, substantial operations of built-in functional blocks such as CPU, RAM, and ROM that are not directly related to the rewrite control by the general-purpose PRO writer PRW may be suppressed.

第2動作モードが設定されるマイクロコンピュータMCUの前記I/OポートPORTdata,PORTaddr,PORTcontは変換ソケットSOCKETを介して汎用PROMライタPRWに結合される。変換ソケットSOCKETは、一方においてI/OポートPORTdata,PORTaddr,PORTcontの端子配置を有し、他方において標準メモリの端子配置を有し、相互に同一機能端子が内部で接続されている。   The I / O ports PORTdata, PORTaddr, and PORTcont of the microcomputer MCU in which the second operation mode is set are coupled to the general-purpose PROM writer PRW via the conversion socket SOCKET. The conversion socket SOCKET has a terminal arrangement of I / O ports PORTdata, PORTaddr, and PORTcont on one side, and a terminal arrangement of a standard memory on the other side, and the same function terminals are mutually connected internally.

〔4〕CPU制御による書き込み制御プログラム
図4にはCPU制御によるフラッシュメモリFMRYの書換えに着目したブロック図が示される。図1のマイクロコンピュータMCUにおいて中央処理装置CPUが実行すべき書換え制御プログラムは予め汎用PROMライタPRWにてフラッシュメモリFMRYに書き込まれている。図2のマイクロコンピュータMCUでは、中央処理装置CPUが実行すべき書換え制御プログラムをマスク・リード・オンリ・メモリMASKROMに保持させておくことができる。前記モード信号MD0乃至MD2によって第1動作モードが指示され、制御回路CONTがこれを認識することにより、中央処理装置CPUは、既にフラッシュメモリFMRYに書き込まれた書き込み制御プログラム、或はマスク・リード・オンリ・メモリMASKROMが保持する書換え制御プログラムにしたがってフラッシュメモリFMRYにデータの書き込みを行っていく。
[4] Write Control Program Under CPU Control FIG. 4 is a block diagram focusing on rewriting of the flash memory FMRY under CPU control. A rewrite control program to be executed by the central processing unit CPU in the microcomputer MCU shown in FIG. 1 is previously written in the flash memory FMRY by the general-purpose PROM writer PRW. In the microcomputer MCU shown in FIG. 2, the rewrite control program to be executed by the central processing unit CPU can be held in the mask read only memory MASKROM. When the first operation mode is instructed by the mode signals MD0 to MD2, and the control circuit CONT recognizes this, the central processing unit CPU can execute the write control program already written in the flash memory FMRY, or the mask read Data is written into the flash memory FMRY in accordance with a rewrite control program held in the only memory MASKROM.

図5には全面フラッシュメモリとされるマイクロコンピュータ(図1参照)のメモリマップが示される。同図においてフラッシュメモリの所定の領域には書換え制御プログラムと、転送制御プログラムが予め書き込まれている。中央処理装置CPUは、第1動作モードが指示されると、転送制御プログラムを実行して書換え制御プログラムをランダム・アクセス・メモリRAMに転送する。転送終了後、中央処理装置CPUの処理は、そのランダム・アクセス・メモリRAM上の書換え制御プログラムの実行に分岐され、これによって、フラッシュメモリFMRYに対する消去並びに書込み(ベリファイを含む)が繰返される。   FIG. 5 shows a memory map of a microcomputer (see FIG. 1) which is a full-scale flash memory. In the figure, a rewrite control program and a transfer control program are written in advance in a predetermined area of the flash memory. When the first operation mode is instructed, the central processing unit CPU executes the transfer control program and transfers the rewrite control program to the random access memory RAM. After the end of the transfer, the processing of the central processing unit CPU branches to the execution of the rewrite control program on the random access memory RAM, whereby erasing and writing (including verification) to the flash memory FMRY are repeated.

図6にはフラッシュメモリと共にマスクROMを有するマイクロコンピュータ(図2参照)のメモリマップが示される。この場合には図5で説明したような転送制御プログラムは不要とされる。中央処理装置CPUは、第1動作モードが指示されると、マスク・リード・オンリ・メモリMASKROMが保持する書換え制御プログラムを順次実行し、これにより、フラッシュメモリFMRYに対する消去並びに書込みが繰返される。   FIG. 6 shows a memory map of a microcomputer (see FIG. 2) having a mask ROM together with a flash memory. In this case, the transfer control program described with reference to FIG. 5 is unnecessary. When the first operation mode is instructed, the central processing unit CPU sequentially executes a rewrite control program held in the mask read only memory MASKROM, whereby erasing and writing to the flash memory FMRY are repeated.

図7には中央処理装置CPUによる消去の一例制御手順が示される。先ず中央処理装置CPUは、前記書換え制御プログラムにしたがって、消去を行うべきアドレス範囲のメモリセルに対してプレライトを行う。これによって消去前のメモリセルの状態は全て書込み状態にそろえられる。次いで、消去対象メモリセルに対して、少しずつ消去を行いながらその都度消去の度合をベリファイし(イレーズ/ベリファイ)、過消去を防止して消去動作を完了する。汎用PROMライタPRWによる消去も同様に行われる。なお、フラッシュメモリの消去シーケンスについては後で詳述する。   FIG. 7 shows an example control procedure of erasure by the central processing unit CPU. First, the central processing unit CPU pre-writes the memory cells in the address range to be erased according to the rewrite control program. As a result, all the states of the memory cells before erasure are made to the written state. Next, the erase target memory cell is erased little by little, and the degree of erase is verified each time (erase / verify) to prevent over-erasure and the erase operation is completed. Erasing by the general-purpose PROM writer PRW is similarly performed. The erase sequence of the flash memory will be described later in detail.

図8には中央処理装置CPUによる書き込みの一例制御手順が示される。先ず中央処理装置CPUは、フラッシュメモリFMRYの書込みスタートアドレスを設定する。次いで、書換え制御プログラムによって指定された周辺回路例えばシリアル・コミュニケーション・インタフェースSCI若しくはI/Oポートを介して、外部から送られるデータを読み込む。このようにして読み込んだデータをフラッシュメモリFMRYに所定時間書き込み、書込んだデータを読出して正常に書き込まれたかをベリファイをする(ライト/ベリファイ)。以下、上記データの読込み、書込み、及びベリファイを書込み終了アドレスまで繰返していく。汎用PROMライタPRWによる書き込みも同様に行われる。但しこの場合には、書き込むべきデータはPROMライタPRWから所定のポートを介して与えられる。なお、フラッシュメモリの書込みシーケンスについては後で詳述する。   FIG. 8 shows an example control procedure of writing by the central processing unit CPU. First, the central processing unit CPU sets a write start address of the flash memory FMRY. Next, data sent from the outside is read via a peripheral circuit designated by the rewrite control program, for example, the serial communication interface SCI or the I / O port. The data thus read is written to the flash memory FMRY for a predetermined time, and the written data is read to verify whether it has been normally written (write / verify). Thereafter, reading, writing and verifying of the data are repeated until the write end address. Writing by the general-purpose PROM writer PRW is similarly performed. However, in this case, the data to be written is given from the PROM writer PRW through a predetermined port. The flash memory write sequence will be described later in detail.

〔5〕汎用PROMライタによる書込みとCPU制御の書込みの使い分け
汎用PROMライタによる書込みは、主にマイクロコンピュータMCUのオンボード前すなわちマイクロコンピュータMCUをシステムに実装する前の初期データ、又は初期プログラムの書込みに適用される。これにより、比較的大量の情報を能率的に書込むことができる。
[5] Use of writing by general-purpose PROM writer and writing by CPU control Writing by general-purpose PROM writer mainly writes the initial data before on-board of the microcomputer MCU, that is, before the microcomputer MCU is installed in the system, or the initial program. Applies to Thereby, a relatively large amount of information can be written efficiently.

CPU制御の書込みは、マイクロコンピュータMCUが実装されたシステム(実装機とも称する)を動作させながらデータのチューニングをする場合、またプログラムのバグ対策、若しくはシステムのバージョンアップに伴うプログラムの変更等、マイクロコンピュータMCUがシステムに実装された状態(オンボード状態)でデータやプログラムの変更が必要になった場合に適用される。これにより、マイクロコンピュータMCUを実装システムから取り外すことなくフラッシュメモリFMRYを書換えることができる。   CPU control writing is performed when data tuning is performed while a system (also referred to as a mounting machine) on which a microcomputer MCU is mounted, or when a program bug countermeasure or program change associated with a system upgrade is performed. This is applied when data or a program needs to be changed while the computer MCU is mounted on the system (on-board state). Thereby, the flash memory FMRY can be rewritten without removing the microcomputer MCU from the mounting system.

〔6〕リアルタイム書換えへの対応
図9にはフラッシュメモリのリアルタイム書換えへの対応手法の一例が示される。フラッシュメモリFMRYは、その記憶形式故に、一括消去単位としてのメモリブロックの記憶容量を小さくしても消去に要する時間は短縮されず、例えば数10msec〜数秒かかる。これにより、マイクロコンピュータMCUが実装されたシステムを動作させながら、フラッシュメモリFMRYが保持する制御データなどをリアルタイムで書換えてデータのチューニングを行うことは難しい。これに対処するため、前記内蔵RAMをメモリブロック書換えのための作業領域若しくはデータバッファ領域として利用する。すなわち、先ず、チューニングされるべきデータを保持する所定の小メモリブロックSMBのデータをランダム・アクセス・メモリRAMの特定アドレスに転送する。次に前記ランダム・アクセス・メモリRAMの特定アドレス領域を所定の小メモリブロックSMBのアドレスにオーバーラップさせる。このようなアドレス配置の変更は、所定の制御ビット若しくはフラグの設定に呼応して、ランダム・アクセス・メモリRAMのデコード論理を切替え可能にしておくことによって実現することができる。そして、制御データなどのチューニングは、所定のメモリブロックSMBのアドレスがオーバーラップされたランダム・アクセス・メモリRAMを用いて行われる。チューニングを完了した後は、ランダム・アクセス・メモリRAMとメモリブロックSMBのアドレスオーバーラップを解除して、ランダム・アクセス・メモリRAMの配置アドレスを元の状態に復元する。最後に、ランダム・アクセス・メモリRAMが保持するチューニングされたデータを用いて、フラッシュメモリのメモリブロックSMBを書換える。これにより、マイクロコンピュータMCUが実装されたシステムを動作させながら、フラッシュメモリが保持する制御データなどをリアルタイムで書換えたとのと同じデータを、結果的にメモリブロックSMBに得ることができる。
[6] Correspondence to real-time rewriting FIG. 9 shows an example of a technique for dealing with real-time rewriting of a flash memory. Since the flash memory FMRY has a storage format, the time required for erasure is not shortened even if the memory capacity of the memory block as a batch erasure unit is reduced. For example, it takes several tens of milliseconds to several seconds. As a result, it is difficult to tune data by rewriting control data and the like held in the flash memory FMRY in real time while operating a system in which the microcomputer MCU is mounted. In order to cope with this, the built-in RAM is used as a work area or a data buffer area for rewriting a memory block. That is, first, data of a predetermined small memory block SMB holding data to be tuned is transferred to a specific address of the random access memory RAM. Next, the specific address area of the random access memory RAM is overlapped with the address of a predetermined small memory block SMB. Such a change in the address arrangement can be realized by making it possible to switch the decoding logic of the random access memory RAM in response to the setting of a predetermined control bit or flag. Tuning of control data and the like is performed using a random access memory RAM in which addresses of a predetermined memory block SMB are overlapped. After completing the tuning, the address overlap between the random access memory RAM and the memory block SMB is released, and the arrangement address of the random access memory RAM is restored to the original state. Finally, the tuned data held in the random access memory RAM is used to rewrite the memory block SMB of the flash memory. As a result, the same data as when the control data held in the flash memory is rewritten in real time can be obtained in the memory block SMB as a result of operating the system in which the microcomputer MCU is mounted.

〔7〕メモリブロックの一部書換えの能率化
図10にはフラッシュメモリのメモリブロックの一部書換えを能率化する手法の一例が示される。プログラムのバグの修正若しくはバージョンアップなどに際して、フラッシュメモリFMRYの所定メモリブロックSMBが保持している情報の一部を書換える場合は、前記RAMよりも記憶容量の小さなメモリブロックSMBの保持情報を内蔵RAMに転送し、転送された情報の一部をそのRAM上で更新して、その更新された情報で当該メモリブロックを書換えるようにする。これにより、メモリブロックSMBの一つを一括消去しても、当該メモリブロックSMBの保持情報はRAMに保存されているため、書換えるべきデータだけを外部から受け取ってそのRAM上で書換を行えば、書換え前にフラッシュメモリFMRYが保持している書換を要しない情報を重ねて外部から転送を受けなくても済み、メモリブロックの一部書換のための情報転送の無駄を省くことができる。
[7] Efficiency of Partial Rewriting of Memory Block FIG. 10 shows an example of a technique for improving the efficiency of partial rewriting of a memory block of a flash memory. When rewriting a part of information held in a predetermined memory block SMB of the flash memory FMRY when correcting a bug of the program or upgrading the version, information held in a memory block SMB having a smaller storage capacity than the RAM is incorporated. The data is transferred to the RAM, a part of the transferred information is updated on the RAM, and the memory block is rewritten with the updated information. As a result, even if one of the memory blocks SMB is erased at once, the retained information of the memory block SMB is stored in the RAM. Therefore, if only the data to be rewritten is received from the outside and rewritten on the RAM, The information that does not need to be rewritten and stored in the flash memory FMRY before the rewriting does not need to be transferred from the outside, and the waste of information transfer for partial rewriting of the memory block can be eliminated.

〔8〕フラッシュメモリの原理
図11にはフラッシュメモリの原理が示される。同図(A)に例示的に示されたメモリセルは、2層ゲート構造の絶縁ゲート型電界効果トランジスタにより構成されている。同図において、1はP型シリコン基板、2は上記シリコン基板1に形成されたP型拡散層、4はN型拡散層である。5は薄い酸化膜6(例えば厚さ10nm)を介して上記P型シリコン基板1上に形成されたフローティングゲート、7は酸化膜8を介して上記フローティングゲート5上に形成されたコントロールゲート、9はソース、10はドレインである。このメモリセルに記憶される情報は、実質的にしきい値電圧の変化としてトランジスタに保持される。以下、特に述べないかぎり、メモリセルにおいて、情報を記憶するトランジスタ(以下、記憶トランジスタと称する)がNチャンネル型の場合について述べる。
[8] Principle of Flash Memory FIG. 11 shows the principle of flash memory. The memory cell exemplarily shown in FIG. 2A is composed of an insulated gate field effect transistor having a two-layer gate structure. In the figure, 1 is a P-type silicon substrate, 2 is a P-type diffusion layer formed on the silicon substrate 1, and 4 is an N-type diffusion layer. 5 is a floating gate formed on the P-type silicon substrate 1 through a thin oxide film 6 (for example, 10 nm thick), 7 is a control gate formed on the floating gate 5 through an oxide film 8, Is a source and 10 is a drain. Information stored in the memory cell is substantially held in the transistor as a change in threshold voltage. Unless otherwise specified, a case where a transistor for storing information (hereinafter referred to as a storage transistor) is an N-channel type in a memory cell will be described below.

メモリセルへの情報の書き込み動作は、例えばコントロールゲート7及びドレイン10に高圧を印加して、アバランシェ注入によりドレイン10側からフローティングゲート5に電子を注入することで実現される。この書き込み動作により記憶トランジスタは、図11の(B)に示されるように、そのコントロールゲート7からみたしきい値電圧が、書き込み動作を行わなかった消去状態の記憶トランジスタに比べて高くなる。   The operation of writing information to the memory cell is realized, for example, by applying a high voltage to the control gate 7 and the drain 10 and injecting electrons from the drain 10 side to the floating gate 5 by avalanche injection. As shown in FIG. 11B, the threshold voltage seen from the control gate 7 of the memory transistor becomes higher than that of the memory transistor in the erased state where the programming operation is not performed.

一方、消去動作は、例えばソースに高圧を印加して、トンネル現象によりフローティングゲート7からソース9側に電子を引き抜くことによって実現される。図11の(B)に示されるように、消去動作により記憶トランジスタはそのコントロールゲート7からみたしきい値電圧が低くされる。図11の(B)では、書き込み並びに消去状態の何れにおいても記憶トランジスタのしきい値は正の電圧レベルにされる。すなわちワード線からコントロールゲートに与えられるワード線選択レベルに対して、書き込み状態のしきい値電圧は高くされ、消去状態のしきい値電圧は低くされる。双方のしきい値電圧とワード線選択レベルとがそのような関係を持つことによって、選択トランジスタを採用することなく1個のトランジスタでメモリセルを構成することができる。記憶情報を電気的に消去する場合においては、フローティングゲートに蓄積された電子をソース電極に引く抜くことにより、記憶情報の消去が行われるため、比較的長い時間、消去動作を続けると、書き込み動作の際にフローティングゲートに注入した電子の量よりも多くの電子が引く抜かれることになる。そのため、電気的消去を比較的長い時間続けるような過消去を行うと、記憶トランジスタのしきい値電圧は例えば負のレベルになって、ワード線の非選択レベルにおいても選択されるような不都合を生ずる。尚、書込みも消去と同様にトンネル電流を利用して行うこともできる。   On the other hand, the erase operation is realized, for example, by applying a high voltage to the source and extracting electrons from the floating gate 7 to the source 9 side by a tunnel phenomenon. As shown in FIG. 11B, the threshold voltage viewed from the control gate 7 of the memory transistor is lowered by the erase operation. In FIG. 11B, the threshold value of the memory transistor is set to a positive voltage level in both the writing and erasing states. That is, the threshold voltage in the write state is increased and the threshold voltage in the erase state is decreased with respect to the word line selection level applied from the word line to the control gate. Since both the threshold voltages and the word line selection level have such a relationship, a memory cell can be configured with a single transistor without employing a selection transistor. In the case of electrically erasing stored information, the stored information is erased by pulling out the electrons accumulated in the floating gate to the source electrode. Therefore, if the erase operation is continued for a relatively long time, the write operation is performed. At this time, more electrons are drawn than the amount of electrons injected into the floating gate. For this reason, when over-erasing is performed such that electrical erasing is continued for a relatively long time, the threshold voltage of the storage transistor becomes, for example, a negative level, which is disadvantageous in that it is selected even at a non-selected level of the word line. Arise. Note that writing can also be performed using a tunnel current in the same manner as erasing.

読み出し動作においては、上記メモリセルに対して弱い書き込み、すなわち、フローティングゲート5に対して不所望なキャリアの注入が行われないように、ドレイン10及びコントロールゲート7に印加される電圧が比較的低い値に制限される。例えば、1V程度の低電圧がドレイン10に印加されるとともに、コントロールゲート7に5V程度の低電圧が印加される。これらの印加電圧によって記憶トランジスタを流れるチャンネル電流の大小を検出することにより、メモリセルに記憶されている情報の“0”、“1”を判定することができる。   In the read operation, the voltage applied to the drain 10 and the control gate 7 is relatively low so that weak writing to the memory cell, that is, unwanted carrier injection into the floating gate 5 is not performed. Limited to value. For example, a low voltage of about 1 V is applied to the drain 10 and a low voltage of about 5 V is applied to the control gate 7. By detecting the magnitude of the channel current flowing through the memory transistor using these applied voltages, it is possible to determine “0” or “1” of the information stored in the memory cell.

図12は前記記憶トランジスタを用いたメモリセルアレイの構成原理を示す。同図には代表的に4個の記憶トランジスタ(メモリセル)Q1乃至Q4が示される。X,Y方向にマトリクス配置されたメモリセルにおいて、同じ行に配置された記憶トランジスタQ1,Q2(Q3,Q4)のコントロールゲート(メモリセルの選択ゲート)は、それぞれ対応するワード線WL1(WL2)に接続され、同じ列に配置された記憶トランジスタQ1,Q3(Q2,Q4)のドレイン領域(メモリセルの入出力ノード)は、それぞれ対応するデータ線DL1,DL2に接続されている。上記記憶トランジスタQ1,Q3(Q2,Q4)のソース領域は、ソース線SL1(SL2)に結合される。   FIG. 12 shows the configuration principle of a memory cell array using the memory transistor. In the figure, typically four memory transistors (memory cells) Q1 to Q4 are shown. In memory cells arranged in a matrix in the X and Y directions, the control gates (selection gates of memory cells) of the storage transistors Q1, Q2 (Q3, Q4) arranged in the same row respectively correspond to the corresponding word lines WL1 (WL2). The drain regions (input / output nodes of the memory cells) of the storage transistors Q1, Q3 (Q2, Q4) arranged in the same column are connected to the corresponding data lines DL1, DL2, respectively. Source regions of the storage transistors Q1, Q3 (Q2, Q4) are coupled to a source line SL1 (SL2).

図13にはメモリセルに対する消去動作並びに書込み動作のための電圧条件の一例が示される。同図においてメモリ素子はメモリセルを意味し、ゲートはメモリセルの選択ゲートとしてのコントロールゲートを意味する。同図において負電圧方式の消去はコントロールゲートに例えば−10Vのような負電圧を印加することによって消去に必要な高電界を形成する。同図に例示される電圧条件から明らかなように、正電圧方式の消去にあっては少なくともソースが共通接続されたメモリセルに対して一括消去を行うことができる。したがって図12の構成において、ソース線SL1,SL2が接続されていれば、4個のメモリセルQ1乃至Q4は一括消去可能にされる。この場合、同一ソース線につながるメモリビットの数を変えることによりメモリブロックのサイズを任意に設定することができる。ソース線分割方式の場合には最小の一括消去単位とされるメモリブロックはデータ線一本分となる。一方、負電圧方式の消去にあっては少なくともコントロールゲートが共通接続されたメモリセルに対して一括消去を行うことができる。   FIG. 13 shows an example of voltage conditions for an erase operation and a write operation for a memory cell. In the figure, a memory element means a memory cell, and a gate means a control gate as a selection gate of the memory cell. In the figure, erasing in the negative voltage method forms a high electric field necessary for erasing by applying a negative voltage such as -10 V to the control gate. As is clear from the voltage conditions illustrated in the figure, at the time of erasing in the positive voltage system, at least batch erasing can be performed on memory cells whose sources are commonly connected. Therefore, in the configuration of FIG. 12, if the source lines SL1 and SL2 are connected, the four memory cells Q1 to Q4 can be erased collectively. In this case, the size of the memory block can be arbitrarily set by changing the number of memory bits connected to the same source line. In the case of the source line division method, the memory block which is the minimum batch erase unit is one data line. On the other hand, in the case of erasing using the negative voltage method, it is possible to perform batch erasing on at least memory cells to which control gates are commonly connected.

〔9〕記憶容量を相違させた複数メモリブロック化
図14には一括消去可能なメモリブロックの記憶容量を相違させたフラッシュメモリの一例回路ブロック図が示される。
[9] Multiple Memory Blocks with Different Storage Capacities FIG. 14 is a circuit block diagram showing an example of a flash memory with different storage capacities for batch erasable memory blocks.

同図に示されるフラッシュメモリFMRYは、8ビットのデータ入出力端子D0〜D7を有し、各データ入出力端子毎にメモリアレイARY0〜ARY7を備える。メモリアレイARY0〜ARY7は、相対的に記憶容量の大きなメモリブロックLMBと相対的に記憶容量の小さなメモリブロックSMBとに2分割されている。図には代表的にメモリアレイARY0の詳細が示されているが、その他のメモリアレイARY1〜ARY7も同様に構成されている。   The flash memory FMRY shown in the figure has 8-bit data input / output terminals D0 to D7, and includes a memory array ARY0 to ARY7 for each data input / output terminal. Memory arrays ARY0 to ARY7 are divided into two, memory block LMB having a relatively large storage capacity and memory block SMB having a relatively small storage capacity. In the figure, the details of the memory array ARY0 are representatively shown, but the other memory arrays ARY1 to ARY7 are similarly configured.

夫々のメモリアレイARY0〜ARY7には前記図11で説明した2層ゲート構造の絶縁ゲート型電界効果トランジスタによって構成されたメモリセルMCがマトリクス配置されている。同様同図においてWL0〜WLnは全てのメモリアレイARY0〜ARY7に共通のワード線である。同一行に配置されたメモリセルのコントロールゲートは、それぞれ対応するワード線に接続される。夫々のメモリアレイARY0〜ARY7において、同一列に配置されたメモリセルMCのドレイン領域は、それぞれ対応するデータ線DL0〜DL7に接続されている。メモリブロックSMBを構成するメモリセルMCのソース領域はソース線SL1に共通接続され、メモリブロックLMBを構成するメモリセルMCのソース領域はソース線SL2に共通接続されている。   In each of the memory arrays ARY0 to ARY7, memory cells MC constituted by the insulated gate field effect transistors having the two-layer gate structure described with reference to FIG. 11 are arranged in a matrix. In the same figure, WL0 to WLn are word lines common to all the memory arrays ARY0 to ARY7. The control gates of the memory cells arranged in the same row are connected to the corresponding word lines. In each of the memory arrays ARY0 to ARY7, the drain regions of the memory cells MC arranged in the same column are connected to the corresponding data lines DL0 to DL7, respectively. The source regions of the memory cells MC constituting the memory block SMB are commonly connected to the source line SL1, and the source regions of the memory cells MC constituting the memory block LMB are commonly connected to the source line SL2.

前記ソース線SL1,SL2には電圧出力回路VOUT1,VOUT2から消去に利用される高電圧Vppが供給される。電圧出力回路VOUT1,VOUT2の出力動作は、消去ブロック指定レジスタのビットB1,B2の値によって選択される。例えば消去ブロック指定レジスタのビットB1に”1”が設定されることによって各メモリアレイARY0〜ARY7のメモリブロックSMBだけが一括消去可能にされる。消去ブロック指定レジスタのビットB2に”1”が設定された場合は、各メモリアレイARY0〜ARY7のメモリブロックLMBだけが一括消去可能にされる。双方のビットB1,B2に”1”が設定されたときはフラッシュメモリ全体が一括消去可能にされる。   The source lines SL1 and SL2 are supplied with a high voltage Vpp used for erasing from the voltage output circuits VOUT1 and VOUT2. The output operation of the voltage output circuits VOUT1 and VOUT2 is selected by the values of the bits B1 and B2 of the erase block designation register. For example, by setting “1” in the bit B1 of the erase block designation register, only the memory blocks SMB of the memory arrays ARY0 to ARY7 can be erased collectively. When “1” is set in the bit B2 of the erase block designation register, only the memory blocks LMB of the memory arrays ARY0 to ARY7 can be erased collectively. When both bits B1 and B2 are set to "1", the entire flash memory can be erased collectively.

前記ワード線WL0〜WLnの選択は、ロウアドレスバッファXABUFF及びロウアドレスラッチXALATを介して取り込まれるロウアドレス信号AXをロウアドレスデコーダXADECが解読することによって行われる。ワードドライバWDRVはロウアドレスデコーダXADECから出力される選択信号に基づいてワード線を駆動する。データ読出し動作においてワードドライバWDRVは電圧選択回路VSELから供給される5Vのような電圧Vccと0Vのような接地電位とを電源として動作され、選択されるべきワード線を電圧Vccによって選択レベルに駆動し、非選択とされるべきワード線を接地電位のような非選択レベルに維持させる。データの書き込み動作においてワードドライバWDRVは、電圧選択回路VSELから供給される12Vのような電圧Vppと0Vのような接地電位とを電源として動作され、選択されるべきワード線を12Vのような書き込み用高電圧レベルに駆動する。データの消去動作においてワードドライバWDRVの出力は0Vのような低い電圧レベルにされる。   The selection of the word lines WL0 to WLn is performed by the row address decoder XADEC decoding the row address signal AX taken in via the row address buffer XABUFF and the row address latch XALAT. The word driver WDRV drives the word line based on the selection signal output from the row address decoder XADEC. In the data read operation, the word driver WDRV is operated using a voltage Vcc such as 5 V and a ground potential such as 0 V supplied from the voltage selection circuit VSEL as power sources, and drives a word line to be selected to a selected level by the voltage Vcc. Then, the word line to be unselected is maintained at a non-selected level such as the ground potential. In the data write operation, the word driver WDRV is operated with a voltage Vpp such as 12V supplied from the voltage selection circuit VSEL and a ground potential such as 0V as power supplies, and the word line to be selected is written as 12V. Drive to high voltage level. In the data erasing operation, the output of the word driver WDRV is set to a low voltage level such as 0V.

夫々のメモリアレイARY0〜ARY7において前記データ線DL0〜DL7はカラム選択スイッチYS0〜YS7を介して共通データ線CDに共通接続される。カラム選択スイッチYS0〜YS7のスイッチ制御は、カラムアドレスバッファYABUFF及びカラムアドレスラッチYALATを介して取り込まれるカラムアドレス信号AYをカラムアドレスデコーダYADECが解読することによって行われる。カラムアドレスデコーダYADECの出力選択信号は全てのメモリアレイARY0〜ARY7に共通に供給される。したがって、カラムアドレスデコーダYADECの出力選択信号のうちの何れか一つが選択レベルにされることにより、各メモリアレイARY0〜ARY7において共通データ線CDには1本のデータ線が接続される。   In each of the memory arrays ARY0 to ARY7, the data lines DL0 to DL7 are commonly connected to a common data line CD via column selection switches YS0 to YS7. The column selection switches YS0 to YS7 are controlled by the column address decoder YADEC decoding the column address signal AY fetched through the column address buffer YABUFF and the column address latch YALAT. The output selection signal of the column address decoder YADEC is supplied in common to all the memory arrays ARY0 to ARY7. Therefore, when any one of the output selection signals of the column address decoder YADEC is set to the selection level, one data line is connected to the common data line CD in each of the memory arrays ARY0 to ARY7.

メモリセルMCから共通データ線CDに読出されたデータは選択スイッチRSを介してセンスアンプSAMPに与えられ、ここで増幅されて、データ出力バッファDOBUFFから外部に出力される。前記選択スイッチRSは読出し動作に同期して選択レベルにされる。外部から供給される書き込みデータはデータ入力バッファDIBUFFを介してデータ入力ラッチ回路DILATに保持される。データ入力ラッチ回路DILATに保持されたデータが”0”のとき、書き込み回路WRITは選択スイッチWSを介して共通データ線CDに書き込み用の高電圧を供給する。この書き込み用高電圧はカラムアドレス信号AYによって選択されたデータ線を通して、ロウアドレス信号AXでコントロールゲートに高電圧が印加されるメモリセルのドレインに供給され、これによって当該メモリセルが書き込みされる。前記選択スイッチWSは書き込み動作に同期して選択レベルにされる。書き込み消去の各種タイミングや電圧の選択制御は書き込み消去制御回路WECONTが生成する。   Data read from the memory cell MC to the common data line CD is applied to the sense amplifier SAMP via the selection switch RS, where it is amplified and output to the outside from the data output buffer DOBUFF. The selection switch RS is set to a selection level in synchronization with the read operation. Write data supplied from the outside is held in the data input latch circuit DILAT via the data input buffer DIBUFF. When the data held in the data input latch circuit DILAT is “0”, the write circuit WRIT supplies a high voltage for writing to the common data line CD via the selection switch WS. The high voltage for writing is supplied to the drain of the memory cell to which the high voltage is applied to the control gate by the row address signal AX through the data line selected by the column address signal AY, thereby writing the memory cell. The selection switch WS is set to the selection level in synchronization with the write operation. The write / erase control circuit WECONT generates various write / erase timings and voltage selection control.

〔10〕図1に対応されるマイクロコンピュータの詳細
図15には図1のマイクロコンピュータに対応される更に詳細なマイクロコンピュータの実施例ブロック図が示される。同図に示されるマイクロコンピュータMCUは、図1に示される機能ブロックと同一機能ブロックとして、中央処理装置CPU、フラッシュメモリFMRY、シリアル・コミュニケーション・インタフェースSCI、制御回路CONT、及びランダム・アクセス・メモリRAMを含む。図1のタイマに相当するものとして、16ビット・インテグレーテッド・タイマ・パルスユニットIPUと、ウォッチドッグタイマWDTMRを備える。また、図1の入出力回路I/Oに相当するものとして、ポートPORT1乃至PORT12を備える。更にその他の機能ブロックとして、クロック発振器CPG、割り込みコントローラIRCONT、アナログ・ディジタル変換器ADC、及びウェートステートコントローラWSCONTが設けられている。前記中央処理装置CPU、フラッシュメモリFMRY、ランダム・アクセス・メモリRAM、及び16ビット・インテグレーテッド・タイマ・パルスユニットIPUは、アドレスバスABUS、下位データバスLDBUS(例えば8ビット)、及び上位データバスHDBUS(例えば8ビット)に接続される。前記シリアル・コミュニケーション・インタフェースSCI、ウォッチドッグタイマWDTMR、割り込みコントローラIRCONT、アナログ・ディジタル変換器ADC、ウェートステートコントローラWSCONT、及びポートPORT1乃至PORT12は、アドレスバスABUS、及び上位データバスHDBUSに接続される。
[10] Details of Microcomputer Corresponding to FIG. 1 FIG. 15 is a block diagram showing a more detailed embodiment of the microcomputer corresponding to the microcomputer of FIG. The microcomputer MCU shown in the figure includes a central processing unit CPU, a flash memory FMRY, a serial communication interface SCI, a control circuit CONT, and a random access memory RAM as the same functional blocks as the functional blocks shown in FIG. including. As equivalent to the timer of FIG. 1, a 16-bit integrated timer pulse unit IPU and a watchdog timer WDTMR are provided. Further, ports PORT1 to PORT12 are provided as equivalent to the input / output circuit I / O of FIG. As other functional blocks, a clock oscillator CPG, an interrupt controller IRCONT, an analog / digital converter ADC, and a wait state controller WSCONT are provided. The central processing unit CPU, flash memory FMRY, random access memory RAM, and 16-bit integrated timer pulse unit IPU include an address bus ABUS, a lower data bus LDBUS (for example, 8 bits), and an upper data bus HDBUS. (For example, 8 bits). The serial communication interface SCI, the watchdog timer WDTMR, the interrupt controller IRCONT, the analog / digital converter ADC, the wait state controller WSCONT, and the ports PORT1 to PORT12 are connected to an address bus ABUS and an upper data bus HDBUS.

図15において、VppはフラッシュメモリFMRYの書換え用高電圧である。EXTAL及びXTALはマイクロコンピュータのチップに外付けされる図示しない振動子から前記クロック発振器CPGに与えられる信号である。φはクロック発振器CPGから外部に出力される同期クロック信号である。MD0乃至MD2はフラッシュメモリFMRYの書換えに際して第1動作モード又は第2動作モードを設定するために制御回路CONTに供給されるモード信号であり、図1のモード信号MODEに対応される。RES*はリセット信号、STBY*はスタンバイ信号であり、中央処理装置CPU並びにその他の回路ブロックに供給される。NMIはノン・マスカブル・インタラプト信号であり、マスク不可能な割り込みを前記割り込みコントローラICONTに与える。図示しないその他の割り込み信号はポートPORT8,PORT9を介して割り込みコントローラICONTに与えられる。AS*は外部に出力されるアドレス信号の有効性を示すアドレスストローブ信号、RD*はリードサイクルであることを外部に通知するリード信号、HWR*は上位8ビットのライトサイクルであることを外部に通知するアッパーバイト・ライト信号、LWR*は下位8ビットのライトサイクルであることを外部に通知するロアーバイト・ライト信号であり、それらはマイクロコンピュータMCUの外部に対するアクセス制御信号とされる。   In FIG. 15, Vpp is a high voltage for rewriting the flash memory FMRY. EXTAL and XTAL are signals given to the clock oscillator CPG from a vibrator (not shown) externally attached to the microcomputer chip. φ is a synchronous clock signal output from the clock oscillator CPG to the outside. MD0 to MD2 are mode signals supplied to the control circuit CONT to set the first operation mode or the second operation mode when the flash memory FMRY is rewritten, and correspond to the mode signal MODE in FIG. RES * is a reset signal and STBY * is a standby signal, which are supplied to the central processing unit CPU and other circuit blocks. NMI is a non-maskable interrupt signal and gives an interrupt that cannot be masked to the interrupt controller ICONT. Other interrupt signals (not shown) are provided to the interrupt controller ICONT via the ports PORT8 and PORT9. AS * is an address strobe signal indicating the validity of an address signal output to the outside, RD * is a read signal notifying the outside that it is a read cycle, and HWR * is an externally indicating that it is a write cycle of upper 8 bits. The upper byte write signal to be notified, LWR * is a lower byte write signal for notifying the outside that it is a lower 8-bit write cycle, and is an access control signal to the outside of the microcomputer MCU.

外部のPROMライタでフラッシュメモリFMRYを直接書換え制御する第2動作モード以外において、マイクロコンピュータMCUが外部をアクセスするためのデータBD0乃至BD15の入出力には、特に制限されないが、前記ポートPORT1,PORT2が割当てられる。このときのアドレス信号BA0乃至BA19の出力には、特に制限されないが、前記ポートPORT3乃至PORT5が割当てられる。   Except for the second operation mode in which the flash memory FMRY is directly rewritten and controlled by an external PROM writer, the input / output of the data BD0 to BD15 for the microcomputer MCU to access the outside is not particularly limited, but the ports PORT1, PORT2 Is assigned. The output of the address signals BA0 to BA19 at this time is not particularly limited, but the ports PORT3 to PORT5 are assigned.

一方、マイクロコンピュータMCUに第2動作モードが設定されたとき、そのフラッシュメモリFMRYを書換え制御するPROMライタとの接続には、特に制限されないが、前記ポートPORT2乃至PORT5及びPORT8が割当てられる。すなわち、書込み並びにベリファイのためのデータED0乃至ED7入出力には前記ポートPORT2が割当てられ、アドレス信号EA0ないしEA16の入力並びにアクセス制御信号CE*(チップイネーブル信号),OE*(アウトプットイネーブル信号),WE*(ライトイネーブル信号)の入力には前記ポートPORT3乃至PORT5及びPORT8が割当てられる。前記チップイネーブル信号CE*はPROMライタからのフラッシュメモリFMRYの動作選択信号であり、アウトプットイネーブル信号OE*はフラッシュメモリFMRYに対する出力動作の指示信号であり、ライトイネーブル信号WE*はフラッシュメモリFMRYに対する書込み動作の指示信号である。尚、アドレス信号EA0ないしEA16のうちの1ビットEA9の入力には前記信号NMIの入力端子が割当てられる。この様にして割当てられたポートの外部端子、並びに高電圧Vppの印加端子などのその他必要な外部端子は、図3で説明した変換ソケットSOCKETを介して汎用PROMライタPRWに接続される。このときの斯る外部端子の割り当ては、マイクロコンピュータMCUを変換ソケットSOCKETを介してPROMライタPRWに接続し易い端子配列になるように考慮することができる。上記第2動作モードにおいてPROMライタPRWとの接続に割当てられる外部端子群には、マイクロコンピュータMCUのその他の動作モードにおいては他の機能が割当てられることになる。   On the other hand, when the second operation mode is set in the microcomputer MCU, the ports PORT2 to PORT5 and PORT8 are assigned to the PROM writer for rewriting control of the flash memory FMRY, although not particularly limited. That is, the port PORT2 is assigned to input / output data ED0 to ED7 for writing and verifying, and input of address signals EA0 to EA16 and access control signals CE * (chip enable signal), OE * (output enable signal). , WE * (write enable signal) are assigned the ports PORT3 to PORT5 and PORT8. The chip enable signal CE * is an operation selection signal for the flash memory FMRY from the PROM writer, the output enable signal OE * is an output operation instruction signal for the flash memory FMRY, and the write enable signal WE * is for the flash memory FMRY. This is an instruction signal for a write operation. Incidentally, the input terminal of the signal NMI is assigned to the input of one bit EA9 of the address signals EA0 to EA16. Other necessary external terminals such as the external terminal of the port assigned in this way and the application terminal of the high voltage Vpp are connected to the general-purpose PROM writer PRW via the conversion socket SOCKET described in FIG. The assignment of the external terminals at this time can be considered so that the terminal arrangement is easy to connect the microcomputer MCU to the PROM writer PRW via the conversion socket SOCKET. In the second operation mode, the external terminal group assigned to the connection with the PROM writer PRW is assigned another function in the other operation mode of the microcomputer MCU.

図16には図15のマイクロコンピュータMCUを、例えば、樹脂によって封止することによって得られた4方向に外部端子を有するフラットパッケージの上面を示す。図16に示された信号は図15と共通である。信号名の示されていない外部端子(ピン)は、ウェート信号の入力ピン、バスリクエスト信号の入力ピン、バスアクノレッジ信号の出力ピン、シリアル・コミュニケーション・インタフェースSCIなどの周辺回路と外部との信号入出力ピンなどに利用される。   FIG. 16 shows an upper surface of a flat package having external terminals in four directions obtained by sealing the microcomputer MCU shown in FIG. 15 with, for example, resin. The signals shown in FIG. 16 are the same as those in FIG. External terminals (pins) not indicated by signal names are input pins for wait signals, input pins for bus request signals, output pins for bus acknowledge signals, serial communication interface SCI, and other peripheral circuits. Used for output pins.

図16に示されるパッケージFPにおいて、上記パッケージFPから導出される各端子(ピン)の間隔は、0.5mm以下とされても良い。すなわち、マイクロコンピュータMCUのユーザが上記マイクロコンピュータMCU内のフラッシュメモリFMRYを変換ソケットSOCKETを介してPROMライタPRWに接続し、上記フラッシュメモリFMRYにデータを書き込む場合、パッケージFPの各端子間隔(ピンピッチ)PPが0.5mm以下とされると、上記変換ソケットSOCKETへ、上記パッケージFPを挿入する時に、変換ソケットSOCKETと上記パッケージFPの外部端子との不所望な接触に起因するピン曲りが発生しやすくなる。この様なピン曲りが発生すると、上記変換ソケットSOCKETの各端子と上記パッケージFPの各端子との電気的接続が、ピン曲りの発生している端子に関して、行われなくなる。その結果、PROMライタPRWで上記フラッシュメモリFMRYにデータを書き込めなくなる。   In the package FP shown in FIG. 16, the interval between the terminals (pins) derived from the package FP may be 0.5 mm or less. That is, when the user of the microcomputer MCU connects the flash memory FMRY in the microcomputer MCU to the PROM writer PRW via the conversion socket SOCKET and writes data into the flash memory FMRY, the terminal interval (pin pitch) of the package FP When PP is 0.5 mm or less, when the package FP is inserted into the conversion socket SOCKET, pin bending due to undesired contact between the conversion socket SOCKET and the external terminals of the package FP is likely to occur. Become. When such pin bending occurs, electrical connection between each terminal of the conversion socket SOCKET and each terminal of the package FP is not performed with respect to the terminal where pin bending occurs. As a result, data cannot be written to the flash memory FMRY by the PROM writer PRW.

この点に関し本発明においては、中央処理装置CPUがフラッシュメモリFMRYにデータを書き込み可能とされているので、ユーザは、上記フラッシュメモリFMRYへのデータ書き込みに外部PROMライタPRWを使用せず、上記マイクロコンピュータMCUのパッケージを実装基板(プリント基板)に実装した後、中央処理装置CPUで上記フラッシュメモリFMRYにデータを書き込むようにすれば、上記マイクロコンピュータMCUが、ピンピッチPPが0.5mm以下のパッケージに封止されても、ユーザはパッケージから導出される外部端子のリード曲りを防止できる。尚、半導体メーカーは、自動ハンドラーを有しているので、0.5mm以下のピンピッチを有するパッケージに上記マイクロコンピュータMCUが封止されても、上記マイクロコンピュータMCUのテストをピン曲りを発生させないで確実に実行できる。   In this regard, in the present invention, since the central processing unit CPU can write data to the flash memory FMRY, the user does not use the external PROM writer PRW to write data to the flash memory FMRY, but the micro processor After the package of the computer MCU is mounted on a mounting board (printed board), if the central processing unit CPU writes data into the flash memory FMRY, the microcomputer MCU has a pin pitch PP of 0.5 mm or less. Even if sealed, the user can prevent lead bending of the external terminal led out of the package. Since the semiconductor manufacturer has an automatic handler, even if the microcomputer MCU is sealed in a package having a pin pitch of 0.5 mm or less, the microcomputer MCU can be reliably tested without causing pin bending. Can be executed.

〔11〕フラッシュメモリFMRYの書換え用制御回路
図17には図15のマイクロコンピュータMCUに内蔵されるフラッシュメモリFMRYの全体的なブロック図が示される。同図においてARYは前記図11で説明した2層ゲート構造の絶縁ゲート型電界効果トランジスタによって構成されたメモリセルをマトリクス配置したメモリアレイである。このメモリアレイARYは図14で説明した構成と同様に、メモリセルのコントロールゲートはそれぞれ対応するワード線に接続され、メモリセルのドレイン領域はそれぞれ対応するデータ線に接続され、メモリセルのソース領域はメモリブロック毎に共通のソース線に接続されているが、メモリブロックの分割態様は図14とは相違される。例えば、図18に示されるように、相対的にそれぞれの記憶容量が大きな7個の大メモリブロック(大ブロック)LMB0乃至LMB6と、相対的にそれぞれの記憶容量が小さな8個の小メモリブロック(小ブロック)SMB0乃至SMB7とに分割されている。大メモリブロックはプログラム格納領域又は大容量データ格納領域などに利用される。小メモリブロックは小容量データ格納領域などに利用される。
[11] Rewrite Control Circuit for Flash Memory FMRY FIG. 17 shows an overall block diagram of the flash memory FMRY built in the microcomputer MCU shown in FIG. In the figure, ARY is a memory array in which memory cells constituted by the insulated gate field effect transistors having the two-layer gate structure described in FIG. 11 are arranged in a matrix. In the memory array ARY, similarly to the configuration described in FIG. 14, the control gates of the memory cells are connected to the corresponding word lines, the drain regions of the memory cells are connected to the corresponding data lines, and the source regions of the memory cells. Are connected to a common source line for each memory block, but the division of the memory block is different from that of FIG. For example, as shown in FIG. 18, seven large memory blocks (large blocks) LMB0 to LMB6 having relatively large storage capacities, and eight small memory blocks having relatively small storage capacities ( Small block) is divided into SMB0 to SMB7. The large memory block is used as a program storage area or a large capacity data storage area. The small memory block is used for a small capacity data storage area or the like.

図17において、ALATはアドレス信号PAB0乃至PAB15のラッチ回路である。第1動作モードにおいてそのアドレス信号PAB0乃至PAB15は中央処理装置CPUの出力アドレス信号に対応される。第2動作モードではアドレス信号PAB0乃至PAB15はPROMライタPRWの出力アドレス信号EA0乃至EA15に対応される。XADECはアドレスラッチALATを介して取り込まれるロウアドレス信号を解読するロウアドレスデコーダである。WDRVはロウアドレスデコーダXADECから出力される選択信号に基づいてワード線を駆動するワードドライバである。データ読出し動作においてワードドライバWDRVは5Vのような電圧でワード線を駆動し、データの書き込み動作では12Vのような高電圧でワード線を駆動する。データの消去動作においてワードドライバWDRVの全ての出力は0Vのような低い電圧レベルにされる。YADECはアドレスラッチYALATを介して取り込まれるカラムアドレス信号を解読するカラムアドレスデコーダである。YSELはカラムアドレスデコーダYADECの出力選択信号に従ってデータ線を選択するカラムアドレスデコーダである。SAMPはデータ読出し動作においてカラム選択回路YSELで選択されたデータ線からの読出し信号を増幅するセンスアンプである。DOLATはセンスアンプの出力を保持するデータ出力ラッチである。DOBUFFはデータ出力ラッチDOLATが保持するデータを外部に出力するためのデータ出力バッファである。図においてPDB0乃至PDB7は下位8ビット(1バイト)データであり、PDB8乃至PDB15は上位8ビット(1バイト)データである。この例に従えば出力データは最大2バイトとされる。DIBUFFは外部から供給される書き込みデータを取り込むためのデータ入力バッファである。データ入力バッファDIBUFFから取り込まれたデータはデータ入力ラッチ回路DILATに保持される。データ入力ラッチ回路DILATに保持されたデータが”0”のとき、書き込み回路WRITはカラム選択回路YSELで選択されたデータ線に書き込み用高電圧を供給する。この書き込み用高電圧はロウアドレス信号に従ってコントロールゲートに高電圧が印加されるメモリセルのドレインに供給され、これによって当該メモリセルが書き込みされる。ERASECは指定されたメモリブロックのソース線に消去用高電圧を供給してメモリブロックの一括消去を行うための消去回路である。   In FIG. 17, ALAT is a latch circuit for address signals PAB0 to PAB15. In the first operation mode, the address signals PAB0 to PAB15 correspond to the output address signal of the central processing unit CPU. In the second operation mode, the address signals PAB0 to PAB15 correspond to the output address signals EA0 to EA15 of the PROM writer PRW. XADEC is a row address decoder for decoding a row address signal fetched through the address latch ALAT. WDRV is a word driver that drives a word line based on a selection signal output from the row address decoder XADEC. In the data read operation, the word driver WDRV drives the word line with a voltage such as 5V, and in the data write operation, drives the word line with a high voltage such as 12V. In the data erasing operation, all outputs of the word driver WDRV are set to a low voltage level such as 0V. YADEC is a column address decoder that decodes a column address signal fetched via the address latch YALAT. YSEL is a column address decoder that selects a data line in accordance with the output selection signal of the column address decoder YADEC. SAMP is a sense amplifier that amplifies a read signal from the data line selected by the column selection circuit YSEL in the data read operation. DOLAT is a data output latch that holds the output of the sense amplifier. DOBUFF is a data output buffer for outputting data held by the data output latch DOLAT to the outside. In the figure, PDB0 to PDB7 are lower 8 bits (1 byte) data, and PDB8 to PDB15 are upper 8 bits (1 byte) data. According to this example, the output data is a maximum of 2 bytes. DIBUFF is a data input buffer for taking in write data supplied from the outside. Data taken from the data input buffer DIBUFF is held in the data input latch circuit DILAT. When the data held in the data input latch circuit DILAT is “0”, the write circuit WRIT supplies a high voltage for writing to the data line selected by the column selection circuit YSEL. This high voltage for writing is supplied to the drain of the memory cell to which the high voltage is applied to the control gate in accordance with the row address signal, whereby the memory cell is written. ERASEC is an erasing circuit for supplying a high voltage for erasing to a source line of a specified memory block and performing batch erasing of the memory block.

FCONTは、フラッシュメモリFMRYにおけるデータ読出し動作のタイミング制御、及び書き込み消去のための各種タイミングや電圧の選択制御などを行う制御回路である。この制御回路FCONTは、コントロールレジスタCREGを備える。   The FCONT is a control circuit that performs timing control of a data read operation in the flash memory FMRY, various timings for writing and erasing, and voltage selection control. The control circuit FCONT includes a control register CREG.

図19にはコントロールレジスタCREGの一例が示される。コントロールレジスタCREGは、それぞれ8ビットのプログラム/イレーズ制御レジスタPEREGと、消去ブロック指定レジスタMBREG1およびMBREG2によって構成される。プログラム/イレーズ制御レジスタPEREGにおいて、Vppは書換え用高電圧印加に応じて”1”にされる高電圧印加フラグである。Eビットは消去動作を指示するビットとされ、EVビットは消去におけるベリファイ動作の指示ビットとされる。Pビットは書込み動作(プログラム動作)の指示ビットとされ、PVビットは書込みにおけるベリファイ動作の指示ビットとされる。消去ブロック指定レジスタMBREG1およびMBREG2は、それぞれ7分割された大ブロックと8分割された小ブロックに含まれる何れのメモリブロックを消去するかを指定するレジスタであり、その第0ビットから第7ビットは各メモリブロックの指定用ビットとされ、例えばビット”1”は対応メモリブロックの選択を意味し、ビット”0”は対応メモリブロックの非選択を意味する。例えば、消去ブロック指定レジスタMBREG2の第7ビットが”1”のときは、小メモリブロックSMB7の消去が指定される。   FIG. 19 shows an example of the control register CREG. The control register CREG is composed of an 8-bit program / erase control register PEREG and erase block designation registers MBREG1 and MBREG2. In the program / erase control register PEREG, Vpp is a high voltage application flag that is set to “1” in response to the application of a rewrite high voltage. The E bit is a bit for instructing an erasing operation, and the EV bit is an instructing bit for a verify operation in erasing. The P bit is an instruction bit for a write operation (program operation), and the PV bit is an instruction bit for a verify operation in writing. Erase block designation registers MBREG1 and MBREG2 are registers for designating which memory blocks included in the large block divided into 7 and the small block divided into 8 are erased. For example, bit “1” means selection of the corresponding memory block, and bit “0” means non-selection of the corresponding memory block. For example, when the seventh bit of the erase block designation register MBREG2 is “1”, erase of the small memory block SMB7 is designated.

上記コントロールレジスタCREGは外部からリード・ライト可能にされている。制御回路FCONTは、そのコントロールレジスタCREGの設定内容を参照し、それにしたがって消去・書込みなどの制御を行う。外部においては、そのコントロールレジスタCREGの内容を書換えることによって、消去・書込み動作の状態を制御することができる。   The control register CREG can be read / written from the outside. The control circuit FCONT refers to the setting contents of the control register CREG, and performs control such as erasing / writing according to the setting contents. Externally, the state of the erase / write operation can be controlled by rewriting the contents of the control register CREG.

図17において、制御回路FCONTには、制御信号としてFLM,MS−FLN,MS−MISN,M2RDN,M2WRN,MRDN,MWRN,IOWORDN,及びRSTが供給され、更に、上位1バイトのデータPDB8乃至PDB15と、アドレス信号PAB0乃至PAB15の所定ビットが与えられる。   In FIG. 17, the control circuit FCONT is supplied with FLM, MS-FLN, MS-MISN, M2RDN, M2WRN, MRDN, MWRN, IOWORDN, and RST as control signals, and further, upper one byte data PDB8 to PDB15 The predetermined bits of the address signals PAB0 to PAB15 are given.

制御信号FLMは、フラッシュメモリFMRYの動作モードを指定する信号であり、その”0”が第1動作モードを指定し、”1”が第2動作モードを指定する。この信号FLMは、例えば前記モード信号MD0乃至MD2に基づいて形成される。   The control signal FLM is a signal that designates the operation mode of the flash memory FMRY, and “0” designates the first operation mode and “1” designates the second operation mode. The signal FLM is formed based on the mode signals MD0 to MD2, for example.

制御信号MS−FLNは、フラッシュメモリFMRYの選択信号であり、その”0”が選択を指示し、”1”が非選択を指示する。第1動作モードでは中央処理装置CPUがその制御信号MS−FLNを出力し、第2動作モードにおいてその制御信号MS−FLNは、PROMライタPRWから供給されるチップ・イネーブル信号CE*に対応される。   The control signal MS-FLN is a selection signal for the flash memory FMRY, and “0” indicates selection and “1” indicates non-selection. In the first operation mode, the central processing unit CPU outputs the control signal MS-FLN. In the second operation mode, the control signal MS-FLN corresponds to the chip enable signal CE * supplied from the PROM writer PRW. .

制御信号MS−MISNはコントロールレジスタCREGの選択信号である。このとき、プログラム/イレーズ制御レジスタPEREGと消去ブロック指定レジスタMBREG1およびMBREG2の何れを選択するかは、アドレス信号PAB0乃至PAB15の所定ビットを参照して決定される。第1動作モードでは中央処理装置CPUがその制御信号MS−MISNを出力する。第2動作モードでは、特に制限されないが、PROMライタPRWが出力する最上位アドレスビットEA16がその制御信号MS−MISNとみなされる。   The control signal MS-MISN is a selection signal for the control register CREG. At this time, which one of the program / erase control register PEREG and the erase block designation registers MBREG1 and MBREG2 is selected is determined with reference to predetermined bits of the address signals PAB0 to PAB15. In the first operation mode, the central processing unit CPU outputs the control signal MS-MISN. In the second operation mode, although not particularly limited, the most significant address bit EA16 output from the PROM writer PRW is regarded as the control signal MS-MISN.

M2RDNはメモリリードストローブ信号、M2WRNはメモリライトストローブ信号、MRDNはコントロールレジスタCREGのリード信号、MWRNはコントロールレジスタCREGのライト信号である。第1動作モードでは中央処理装置CPUがそれら制御信号を出力する。第2動作モードでは、特に制限されないが、PROMライタPRWから供給されるライトイネーブル信号WE*が前記信号M2WRN,MWRNとみなされ、PROMライタから供給されるアウトプットイネーブル信号OE*が前記信号M2RDN,MRDNとみなされる。尚、メモリライトストローブ信号M2WRNは、メモリセルに書込むべきデータをデータ入力ラッチ回路DILATに書込むためのストローブ信号とみなされる。メモリセルへの実際の書込みは前記コントロールレジスタCREGのPビットをセットすることによって開始される。   M2RDN is a memory read strobe signal, M2WRN is a memory write strobe signal, MRDN is a read signal for the control register CREG, and MWRN is a write signal for the control register CREG. In the first operation mode, the central processing unit CPU outputs these control signals. In the second operation mode, although not particularly limited, the write enable signal WE * supplied from the PROM writer PRW is regarded as the signals M2WRN and MWRN, and the output enable signal OE * supplied from the PROM writer is the signal M2RDN, Considered MRDN. The memory write strobe signal M2WRN is regarded as a strobe signal for writing data to be written to the memory cell to the data input latch circuit DILAT. The actual writing to the memory cell is initiated by setting the P bit of the control register CREG.

IOWORDNはフラッシュメモリFMRYに対する8ビットリードアクセスと16ビットリードアクセスとの切換え信号とされる。第2動作モードにおいては当該制御信号IOWORDNは8ビットリードアクセスを指示する論理値に固定される。   IOWORDN is a signal for switching between 8-bit read access and 16-bit read access to the flash memory FMRY. In the second operation mode, the control signal IOWORDN is fixed to a logical value instructing 8-bit read access.

RSTはフラッシュメモリFMRYのリセット信号である。この信号RSTによってフラッシュメモリFMRYがリセットされることにより、或は前記プログラム/イレーズ制御レジスタPEREGのVppフラグが”0”にされることにより、前記プログラム/イレーズ制御レジスタPEREGにおけるEV,PV,E,Pの各モード設定ビットがクリアされる。   RST is a reset signal for the flash memory FMRY. When the flash memory FMRY is reset by this signal RST or the Vpp flag of the program / erase control register PEREG is set to “0”, the EV, PV, E, and E in the program / erase control register PEREG are set. Each mode setting bit of P is cleared.

図20にはフラッシュメモリFMRYにおけるメモリリード動作の一例タイミングチャートが示される。同図においてCK1M,CK2Mはノン・オーバーラップ2相のクロック信号であり、動作基準クロック信号とみなされる。tCYCはサイクルタイムであり、RAMに対するアクセスタイムと大差ない。コントロールレジスタCREGに対するリード動作もこれと同様のタイミングで行われる。   FIG. 20 shows an example timing chart of the memory read operation in the flash memory FMRY. In the figure, CK1M and CK2M are non-overlapping two-phase clock signals and are regarded as operation reference clock signals. tCYC is the cycle time, which is not much different from the access time to the RAM. The read operation for the control register CREG is also performed at the same timing.

図21にはフラッシュメモリFMRYにおけるメモリライト動作の一例タイミングチャートが示される。同図に示されるライトストローブ信号M2WRNによって指示されるメモリライト動作では、前述のように、メモリセルに対する実際の書込みは行われず、入力アドレス信号PAB0乃至PAB15がアドレスラッチ回路ALATに保持されるとともに、入力データPB8乃至PB15がデータ入力ラッチDILATに保持されて、そのライトサイクルが終了される。コントロールレジスタCREGに対するライト動作もこれと同様のタイミングで行われるが、この場合にはコントロールレジスタCREGへの実際のデータ書込みが行われる。   FIG. 21 shows an example timing chart of the memory write operation in the flash memory FMRY. In the memory write operation indicated by the write strobe signal M2WRN shown in the figure, as described above, the actual writing to the memory cell is not performed, and the input address signals PAB0 to PAB15 are held in the address latch circuit ALAT. The input data PB8 to PB15 are held in the data input latch DILAT, and the write cycle is completed. The write operation to the control register CREG is also performed at the same timing, but in this case, actual data writing to the control register CREG is performed.

〔12〕フラッシュメモリFMRYの書換え制御手順の詳細
この項目では、中央処理装置CPU又はPROMライタが前記制御回路FCONTを介してフラッシュメモリの書込み,消去を行う制御手順の詳細な一例について説明する。フラッシュメモリに対する情報の書込みは、基本的に消去状態のメモリセルに対して行われる。マイクロコンピュータがシステムに実装された状態でフラッシュメモリの書換えを行う第1動作モードにおいて、中央処理装置CPUが実行すべき書換え制御プログラムは、消去用プログラムと、書込み用プログラムを含む。第1動作モードの指定に従って、最初に消去の処理ルーチンを実行し、ひき続いて自動的に書込みの処理ルーチンを実行するように書換え制御プログラムを構成することができる。或は消去と書込みを分けて別々に第1動作モードを指定するようにしてもよい。PROMライタによる書換え制御も第1動作モードの場合と同様のオペレーションによって実行される。以下、書込み制御手順と消去制御手順とをそれぞれ説明する。
[12] Details of Rewrite Control Procedure of Flash Memory FMRY In this item, a detailed example of a control procedure in which the central processing unit CPU or PROM writer writes and erases the flash memory via the control circuit FCONT will be described. Information writing to the flash memory is basically performed on an erased memory cell. In the first operation mode in which the flash memory is rewritten with the microcomputer mounted on the system, the rewrite control program to be executed by the central processing unit CPU includes an erasing program and a writing program. According to the designation of the first operation mode, the rewriting control program can be configured to execute the erasing processing routine first and then automatically execute the writing processing routine. Alternatively, the first operation mode may be designated separately by erasing and writing separately. The rewrite control by the PROM writer is also executed by the same operation as in the first operation mode. Hereinafter, the write control procedure and the erase control procedure will be described.

図22には書込み制御手順の詳細な一例が示される。同図に示される手順は、例えば1バイトのデータを書込むための手順であり、第1動作モードにおける中央処理装置CPUの制御と、第2動作モードにおけるPROMライタの制御との双方に共通とされる。例えば制御主体を中央処理装置CPUとして説明する。   FIG. 22 shows a detailed example of the write control procedure. The procedure shown in the figure is a procedure for writing, for example, 1-byte data, and is common to both the control of the central processing unit CPU in the first operation mode and the control of the PROM writer in the second operation mode. Is done. For example, the control main body will be described as a central processing unit CPU.

バイト単位でのデータ書込みの最初のステップでは、中央処理装置CPUはその内蔵カウンタnに1をセットする(ステップS1)。次に、中央処理装置CPUは、図21で説明したメモリライト動作を行って、フラッシュメモリFMRYに書込むべきデータを図17のデータ入力ラッチ回路DILATにセットするとともに、データを書込むべきアドレスをアドレスラッチ回路ALATにセットする(ステップS2)。そして中央処理装置CPUは、コントロールレジスタCREGに対するライトサイクルを発行して、プログラムビットPをセットする(ステップ3)。これにより制御回路FCONTは、前記ステップ2でセットされたデータ及びアドレスに基づいて、そのアドレスで指定されるメモリセルのコントロールゲートとドレインとに高圧を印加して書込みを行う。このフラッシュメモリ側での書込み処理時間として中央処理装置CPUは例えば10μsec待ち(ステップS4)、次いでプログラムビットPをクリアする(ステップS5)。   In the first step of writing data in byte units, the central processing unit CPU sets 1 to its built-in counter n (step S1). Next, the central processing unit CPU performs the memory write operation described with reference to FIG. 21, sets the data to be written to the flash memory FMRY in the data input latch circuit DILAT of FIG. 17, and sets the address to which the data is to be written. The address latch circuit ALAT is set (step S2). The central processing unit CPU issues a write cycle to the control register CREG and sets the program bit P (step 3). As a result, the control circuit FCONT performs writing by applying a high voltage to the control gate and drain of the memory cell specified by the address based on the data and address set in the step 2. As the write processing time on the flash memory side, the central processing unit CPU waits for 10 μsec, for example (step S4), and then clears the program bit P (step S5).

その後、中央処理装置CPUは書込み状態を確認するために、コントロールレジスタCREGに対するライトサイクルを発行して、プログラムベリファイビットPVをセットする(ステップ6)。これにより制御回路FCONTは、前記ステップ2でセットされたアドレスを利用して、そのアドレスで選択されるべきワード線にベリファイ用電圧を印加して、前記書込みを行ったメモリセルのデータを読出す。ここで前記ベリファイ用電圧は、充分な書込みレベルを保証するため、例えば5Vのような電源電圧Vccよりもレベルの高い7Vのような電圧レベルとされる。中央処理装置CPUはそれによって読出されたデータと書込みに利用したデータとの一致を確かめる(ステップS7)。中央処理装置CPUは、ベリファイによって一致を確認すると、プログラムベリファイビットPVをクリアし(ステップS8)、これにより当該1バイトデータの書込みが完了される。   Thereafter, the central processing unit CPU issues a write cycle for the control register CREG and sets the program verify bit PV in order to confirm the write state (step 6). As a result, the control circuit FCONT uses the address set in step 2 to apply a verify voltage to the word line to be selected by the address, and reads the data of the memory cell that has been written. . Here, the verify voltage is set to a voltage level such as 7V, which is higher than the power supply voltage Vcc, such as 5V, in order to guarantee a sufficient write level. The central processing unit CPU confirms the coincidence between the data read out and the data used for writing (step S7). When the central processing unit CPU confirms the coincidence by the verify, it clears the program verify bit PV (step S8), thereby completing the writing of the 1-byte data.

一方、中央処理装置CPUは、ステップS7のベリファイによって不一致を確認すると、ステップS9でプログラムベリファイビットPVをクリアした後、前記カウンタnの値が、書込みリトライ上限回数Nに到達しているかの判定を行う(ステップS10)。この結果、書込みリトライ上限回数Nに到達している場合には書込み不良として処理が終了される。書込みリトライ上限回数Nに到達していない場合には、中央処理装置CPUは、カウンタnの値を1だけインクリメントして(ステップS11)、前記ステップS3から処理を繰返していく。   On the other hand, when the central processing unit CPU confirms the mismatch by the verify in step S7, after clearing the program verify bit PV in step S9, the central processing unit CPU determines whether or not the value of the counter n has reached the write retry upper limit number N. It performs (step S10). As a result, when the write retry upper limit number N has been reached, the processing is terminated as a write failure. If the write retry upper limit number N has not been reached, the central processing unit CPU increments the value of the counter n by 1 (step S11), and repeats the processing from step S3.

図23には消去制御手順の詳細な一例が示される。同図に示される手順は、第1動作モードにおける中央処理装置CPUの制御と、第2動作モードにおけるPROMライタの制御との双方に共通とされる。例えば制御主体を中央処理装置CPUとして説明する。   FIG. 23 shows a detailed example of the erase control procedure. The procedure shown in the figure is common to both the control of the central processing unit CPU in the first operation mode and the control of the PROM writer in the second operation mode. For example, the control main body will be described as a central processing unit CPU.

中央処理装置CPUは、消去を行うに当たりその内蔵カウンタnに1をセットする(ステップS21)。次に中央処理装置CPUは、消去対象領域のメモリセルに対してプレライトを行う(ステップS22)。すなわち、消去対象アドレスのメモリセルに対してデータ”0”を書込む。このプレライトの制御手順は前記図22で説明した書込み制御手順を流用することができる。このプレライトの処理は、消去前のフローティングゲート内の電荷量を全ビット均一にして、消去状態を均一化するために行われる。   The central processing unit CPU sets 1 to its built-in counter n for erasing (step S21). Next, the central processing unit CPU pre-writes the memory cells in the erase target area (step S22). That is, data “0” is written to the memory cell at the address to be erased. As the prewrite control procedure, the write control procedure described with reference to FIG. 22 can be used. This pre-write process is performed in order to make the charge amount in the floating gate before erasure uniform for all bits and to make the erase state uniform.

次に、中央処理装置CPUは、コントロールレジスタCREGに対するライトサイクルを発行して、一括消去対象メモリブロックを指定する(ステップS23)。すなわち、消去ブロック指定レジスタMBREG1およびMBREG2に消去対象メモリブロック番号を指定する。消去対象メモリブロックを指定した後、中央処理装置CPUは、コントロールレジスタCREGに対するライトサイクルを発行して、イレーズビットEをセットする(ステップ24)。これにより制御回路FCONTは、前記ステップ23で指定されたメモリブロックのソース線に高圧を印加させて、当該メモリブロックを一括消去する。このフラッシュメモリ側での一括消去の処理時間として中央処理装置CPUは例えば10msec待つ(ステップS25)。この10msecという時間は、1回で消去動作を完結することができる時間に比べて短い時間とされている。そして、次いでイレーズビットEをクリアする(ステップS26)。   Next, the central processing unit CPU issues a write cycle to the control register CREG and designates a batch erase target memory block (step S23). That is, the erase target memory block number is designated in the erase block designation registers MBREG1 and MBREG2. After designating the memory block to be erased, the central processing unit CPU issues a write cycle to the control register CREG and sets the erase bit E (step 24). As a result, the control circuit FCONT applies a high voltage to the source line of the memory block specified in step 23 to erase the memory block at once. The central processing unit CPU waits for 10 msec, for example, as the batch erasure processing time on the flash memory side (step S25). The time of 10 msec is shorter than the time required to complete the erase operation once. Then, erase bit E is cleared (step S26).

その後、中央処理装置CPUは消去状態を確認するために、先ず一括消去対象メモリブロックの先頭アドレスをベリファイすべきアドレスとして内部にセットし(ステップS27)、次いで、ベリファイアドレスにダミーライトを行う(ステップS28)。すなわち、ベリファイすべきアドレスに対してメモリライトサイクルを発行する。これにより、ベリファイすべきメモリアドレスがアドレスラッチ回路ALATに保持される。その後中央処理装置CPUは、コントロールレジスタCREGに対するライトサイクルを発行して、イレーズベリファイビットEVをセットする(ステップ29)。これにより制御回路FCONTは、前記ステップS28でセットされたアドレスを利用して、そのアドレスで選択されるべきワード線に消去ベリファイ用電圧を印加して、前記消去されたメモリセルのデータを読出す。ここで前記消去ベリファイ用電圧は、充分な消去レベルを保証するため、例えば5Vのような電源電圧Vccよりもレベルの低い3.5Vのような電圧レベルとされる。中央処理装置CPUはそれによって読出されたデータが消去完結状態のデータに一致するかをベリファイする(ステップS30)。中央処理装置CPUは、ベリファイによって一致を確認すると、イレーズベリファイビットEVをクリアし(ステップS31)、次いで今回のベリファイアドレスが消去したメモリブロックの最終アドレスか否かを判定し(ステップS32)、最終アドレスであれば一連の消去動作を終了する。最終アドレスに至っていないと判定されたときは、ベリファイアドレスを1だけインクリメントして(ステップS33)、再びステップS29からの処理を繰返していく。   Thereafter, in order to confirm the erase state, the central processing unit CPU first sets the beginning address of the batch erase target memory block as an address to be verified (step S27), and then performs a dummy write to the verify address (step S27). S28). That is, a memory write cycle is issued for the address to be verified. As a result, the memory address to be verified is held in the address latch circuit ALAT. Thereafter, the central processing unit CPU issues a write cycle to the control register CREG and sets the erase verify bit EV (step 29). As a result, the control circuit FCONT uses the address set in step S28 to apply the erase verify voltage to the word line to be selected by the address, and reads the data of the erased memory cell. . Here, the erase verify voltage is set to a voltage level such as 3.5 V, which is lower than the power supply voltage Vcc, such as 5 V, for example, in order to guarantee a sufficient erase level. The central processing unit CPU verifies whether or not the data read by the central processing unit CPU matches the data in the erase complete state (step S30). When the central processing unit CPU confirms the coincidence by verify, the erase verify bit EV is cleared (step S31), and then it is determined whether or not the current verify address is the final address of the erased memory block (step S32). If it is an address, a series of erase operations is terminated. If it is determined that the final address has not been reached, the verify address is incremented by 1 (step S33), and the processing from step S29 is repeated again.

一方、中央処理装置CPUは、ステップS30のベリファイによって不一致を確認すると、ステップS34でイレーズベリファイビットEVをクリアした後、前記カウンタnの値が、漸次消去上限回数Nに到達しているかの判定を行う(ステップS35)。この結果、漸次消去上限回数Nに到達している場合には消去不良として処理が終了される。漸次消去上限回数Nに到達していない場合には、中央処理装置CPUは、カウンタnの値を1だけインクリメントして(ステップS36)、前記ステップS24から処理を繰返していく。実際には、消去し過ぎによってメモリセルのしきい値電圧が負の値になってしまうような過消去を防止するために、1回毎にベリファイを行いながら10msecというような短時間ずつ徐々に消去がくり返し行われていく。   On the other hand, when the central processing unit CPU confirms the mismatch by the verification in step S30, after clearing the erase verification bit EV in step S34, the central processing unit CPU determines whether or not the value of the counter n has reached the gradual deletion upper limit number N. This is performed (step S35). As a result, if the erasure upper limit number N is reached, the process ends as an erasure failure. If the gradual erasure upper limit number N has not been reached, the central processing unit CPU increments the value of the counter n by 1 (step S36), and repeats the processing from step S24. Actually, in order to prevent over-erasure that the threshold voltage of the memory cell becomes a negative value due to over-erasing, gradually verifying is performed every time, such as 10 msec. Erasing is repeated.

上記実施例によれば以下の作用効果がある。   According to the said Example, there exist the following effects.

(1)マイクロコンピュータMCUを所要のシステムに実装する前のような段階で最初に当該マイクロコンピュータMCUが内蔵するフラッシュメモリFMRYに情報を書き込むようなときは、第2動作モードを指定することにより、PROMライタPRWのような外部書き込み装置の制御によって能率的に情報の書込みを行うことができる。また、マイクロコンピュータMCUに第1動作モードを指定することにより、当該マイクロコンピュータMCUがシステムに実装された状態でそのフラッシュメモリFMRYの記憶情報を書換えることができる。このとき、一括消去機能により書換え時間の短縮を図ることができる。   (1) When information is first written in the flash memory FMRY built in the microcomputer MCU at a stage before the microcomputer MCU is mounted on a required system, the second operation mode is designated by Information can be efficiently written by controlling an external writing device such as a PROM writer PRW. Further, by designating the first operation mode to the microcomputer MCU, the storage information of the flash memory FMRY can be rewritten in a state where the microcomputer MCU is mounted on the system. At this time, the rewrite time can be shortened by the batch erasing function.

(2)フラッシュメモリFMRYにおける一括消去可能な単位として相互に記憶容量の相違される複数個のメモリブロック(LMB,SMB)を設けておくことにより、夫々のメモリブロックにはその記憶容量に応じて例えばプログラム、データテーブル、制御データなどを保持させることができる。すなわち、相対的に情報量の大きなデータは相対的に記憶容量の大きなメモリブロックに、相対的に情報量の小さなデータは相対的に記憶容量の小さなメモリブロックに書き込んでおくことができる。換言すれば、記憶すべき情報量に見合う記憶容量のメモリブロックを利用することができる。したがって、プログラム領域にはちょうど良いがデータ領域には消去単位が大きすぎて使いにくかったりする事態を防止することができる。また、フラッシュメモリの保持情報の一部書換えのために所要のメモリブロックを一括消去しても、実質的に書換えを要しない情報群も併せて消去した後で再び書き戻すと言うような無駄を極力防止することができる。   (2) By providing a plurality of memory blocks (LMB, SMB) having different storage capacities as a unit that can be erased at once in the flash memory FMRY, each memory block has a corresponding memory capacity. For example, programs, data tables, control data, etc. can be held. That is, data having a relatively large information amount can be written in a memory block having a relatively large storage capacity, and data having a relatively small information amount can be written in a memory block having a relatively small storage capacity. In other words, a memory block having a storage capacity corresponding to the amount of information to be stored can be used. Therefore, it is possible to prevent a situation where the erasing unit is too large for the program area but is difficult to use. In addition, even if a required memory block is erased at once for partial rewriting of information held in the flash memory, information that does not substantially need to be rewritten is erased together and then rewritten again. It can be prevented as much as possible.

(3)複数個のメモリブロックのうち内蔵RAMの記憶容量以下に設定されたメモリブロックを設けておくことにより、内蔵RAMをメモリブロック書換えのための作業領域若しくはデータバッファ領域として利用できるようになる。   (3) By providing a memory block set below the storage capacity of the built-in RAM among the plurality of memory blocks, the built-in RAM can be used as a work area or a data buffer area for rewriting the memory block. .

(4)上記(3)において、マイクロコンピュータの実装状態でフラッシュメモリを書換えるとき、書換対象メモリブロックの情報を内蔵RAMに転送し、書換えるべき一部の情報だけを外部からもらってそのRAM上で書換を行ってから、フラッシュメモリの書換を行うことにより、書換え前に内部で保持されている書換を要しない情報を重ねて外部から転送を受けなくても済み、メモリブロックの一部書換のための情報転送の無駄を省くことができる。   (4) In the above (3), when the flash memory is rewritten in the mounted state of the microcomputer, the information of the memory block to be rewritten is transferred to the built-in RAM, and only a part of the information to be rewritten is received from the outside, and the RAM By rewriting the flash memory after rewriting with, it is not necessary to superimpose the information that does not need to be rewritten inside before rewriting and to transfer it from the outside. Therefore, it is possible to eliminate waste of information transfer.

(5)フラッシュメモリの一括消去時間は小メモリブロックに対してもさほど短くならないから、マイクロコンピュータMCUによる制御動作に同期してリアルタイムにフラッシュメモリそれ自体を書換えることはできないが、内蔵RAMをメモリブロック書換えのための作業領域若しくはデータバッファ領域として利用することにより、リアルタイムに書換えたとのと同じデータを結果的にメモリブロックに得ることができる。   (5) Since the batch erase time of the flash memory is not so short even for a small memory block, the flash memory itself cannot be rewritten in real time in synchronization with the control operation by the microcomputer MCU. By using it as a work area or data buffer area for block rewriting, the same data as that rewritten in real time can be obtained in the memory block as a result.

(6)一括消去すべきメモリブロックの指定情報を書換え可能に保持するためのレジスタMBREGをフラッシュメモリFMRYに内蔵させることにより、一括消去すべきメモリブロックをマイクロコンピュータMCUの内外(内蔵中央処理装置,外部PROMライタ)から同じ様な手順で容易に指定できる。   (6) A register MBREG for holding rewritable memory block designation information in the batch memory is built in the flash memory FMRY so that the memory block to be erased in batches is located inside and outside the microcomputer MCU (built-in central processing unit, It can be easily specified in the same procedure from an external PROM writer.

(7)上記夫々の作用効果によって、マイクロコンピュータMCUに内蔵されたフラッシュメモリFMRYの使い勝手を向上させることができる。   (7) The usability of the flash memory FMRY built in the microcomputer MCU can be improved by the above-described effects.

以上本発明者によってなされた発明を実施例に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   Although the invention made by the present inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited thereto and can be variously modified without departing from the gist thereof.

例えば、マイクロコンピュータに内蔵される周辺回路は上記実施例に限定されず適宜変更することができる。フラッシュメモリのメモリセルトランジスタは上記実施例のスタックドゲート構造のMOSトランジスタに限定されず、書込み動作にもトンネル現象を用いたFLOTOX型のメモリセルトランジスタを用いることも可能である。上記実施例では、フラッシュメモリに対する消去並びに書込みの双方の制御を図22及び図23に示したようなソフトウェア的な手段を介して実現したが、本発明はそれに限定されるものではなく、例えば、比較的時間のかかる一括消去を、フラッシュメモリの内蔵専用ハードウェアによって制御させるようにしてもよい。例えばその専用ハードウェアは、EビットやEVビットのセット及びクリア制御をしたり、消去状態のベリファイを行ったりする制御論理を備えることになる。この一括消去の制御論理をフラッシュメモリに内蔵させる構成は、一括消去に関するソフトウェア的な負担が軽減されるという点においてユーザによる使い勝手を向上させるが、その制御論理は面積を増大させる。また、一括消去の単位はソース線を共通にするメモリブロックのほか、消去においてワード線を共通化できるメモリブロックとすることもできるが、その何れを選択するかは、消去電圧の極性をどうするか、或は、一括消去単位の記憶容量を極力小さくしようとする場合に単一のワード線に接続するメモリセルの数と単一のデータ線に接続されるメモリセルの数との何れの方が少ないかなどの事情を考慮して決定することができる。メモリブロックのサイズについては上記実施例のようなサイズ固定に限定されない。例えば、コントロールレジスタの設定又はモード信号の指示にしたがってそのサイズを可変にすることができる。例えば、ワード線を最小単位として一括消去電圧を印加する場合には、ワード線を消去電圧で駆動するドライバの動作をそのコントロールレジスタの設定又はモード信号の指示にしたがって選択させればよい。更にメモリブロックの分割態様としては、図24に示される様に、全体を複数個の大ブロックLMB0〜7に分割し、更にその各大ブロックの中を複数個の小ブロックSMB0〜SMB7に分けて、大ブロック単位又は小ブロック単位で一括消去できるようにすることも可能である。また、フラッシュメモリのメモリセルトランジスタにおいて、そのソース及びドレインは、印加される電圧によって定まる相対的なものとして把握されるものもある。   For example, the peripheral circuit built in the microcomputer is not limited to the above embodiment, and can be changed as appropriate. The memory cell transistor of the flash memory is not limited to the stacked gate structure MOS transistor of the above embodiment, and a FLOTOX type memory cell transistor using a tunnel phenomenon can also be used for the write operation. In the above embodiment, control of both erasing and writing to the flash memory is realized via software means as shown in FIGS. 22 and 23. However, the present invention is not limited to this, and for example, The batch erasure that takes a relatively long time may be controlled by dedicated hardware in the flash memory. For example, the dedicated hardware is provided with control logic for setting and clearing the E bit and the EV bit and verifying the erased state. The configuration in which the batch erase control logic is built in the flash memory improves the usability for the user in that the software burden on the batch erase is reduced, but the control logic increases the area. In addition to the memory block that uses the same source line as the unit for batch erase, it is possible to use a memory block that can share the word line for erasing. Which one is selected depends on the polarity of the erase voltage. Or, when trying to reduce the storage capacity of the batch erase unit as much as possible, whichever is the number of memory cells connected to a single word line or the number of memory cells connected to a single data line It can be decided in consideration of the circumstances such as few. The size of the memory block is not limited to the fixed size as in the above embodiment. For example, the size can be made variable according to the setting of the control register or the instruction of the mode signal. For example, when a batch erase voltage is applied with the word line as the minimum unit, the operation of the driver that drives the word line with the erase voltage may be selected according to the setting of the control register or the instruction of the mode signal. Further, as shown in FIG. 24, the memory block is divided into a plurality of large blocks LMB0 to LMB7, and each large block is further divided into a plurality of small blocks SMB0 to SMB7. It is also possible to enable batch erasure in units of large blocks or small blocks. In some memory cell transistors of a flash memory, the source and drain are grasped as relative ones determined by an applied voltage.

本発明は、少なくとも単一の半導体チップ上に中央処理装置と電気的な消去・書込みによって書換え可能な不揮発性のフラッシュメモリとを備えた条件のマイクロコンピュータに広く適用することができる。   The present invention can be widely applied to microcomputers having conditions that include a central processing unit and a nonvolatile flash memory that can be rewritten by electrical erasing and writing on at least a single semiconductor chip.

図1は全面フラッシュメモリを採用したマイクロコンピュータの一実施例ブロック図である。FIG. 1 is a block diagram showing an embodiment of a microcomputer adopting a full flash memory. 図2はフラッシュメモリと共にマスクROMを採用したマイクロコンピュータの一実施例ブロック図である。FIG. 2 is a block diagram of an embodiment of a microcomputer adopting a mask ROM together with a flash memory. 図3は汎用PROMライタによるフラッシュメモリの書換えに着目したブロック図である。FIG. 3 is a block diagram focusing on the rewriting of the flash memory by the general-purpose PROM writer. 図4にCPU制御によるフラッシュメモリの書換えに着目したブロック図である。FIG. 4 is a block diagram focusing on rewriting of flash memory under CPU control. 図5は全面フラッシュメモリとされるマイクロコンピュータの一例メモリマップである。FIG. 5 is an example memory map of a microcomputer that is a full-scale flash memory. 図6はフラッシュメモリと共にマスクROMを有するマイクロコンピュータの一例メモリマップである。FIG. 6 is an example memory map of a microcomputer having a mask ROM together with a flash memory. 図7は消去の概略的な一例制御手順説明図である。FIG. 7 is a diagram for explaining an example of a schematic control procedure for erasure. 図8は書き込みの概略的な一例制御手順説明図である。FIG. 8 is an explanatory diagram of a schematic example of the control procedure for writing. 図9はフラッシュメモリのリアルタイム書換えへの対応手法の一例説明図である。FIG. 9 is an explanatory diagram showing an example of a technique for dealing with real-time rewriting of a flash memory. 図10はフラッシュメモリのメモリブロックの一部書換えを能率化する手法の一例説明図である。FIG. 10 is an explanatory diagram showing an example of a technique for improving the efficiency of partial rewriting of the memory block of the flash memory. 図11はフラッシュメモリの原理説明図である。FIG. 11 is an explanatory diagram of the principle of the flash memory. 図12は図11の記憶トランジスタを用いたメモリセルアレイの構成原理説明図である。FIG. 12 is an explanatory diagram of a configuration principle of a memory cell array using the memory transistor of FIG. 図13はメモリセルに対する消去動作並びに書込み動作のための電圧条件の一例説明図である。FIG. 13 is an explanatory diagram showing an example of voltage conditions for the erase operation and the write operation for the memory cell. 図14は一括消去可能なメモリブロックの記憶容量を相違させたフラッシュメモリの一例回路ブロック図である。FIG. 14 is a circuit block diagram showing an example of a flash memory in which the memory capacity of the batch-erasable memory block is different. 図15は図1のマイクロコンピュータに対応される更に詳細なマイクロコンピュータの実施例ブロック図である。FIG. 15 is a block diagram showing a more detailed microcomputer corresponding to the microcomputer shown in FIG. 図16は図15のマイクロコンピュータがパッケージされた状態を示す平面図である。FIG. 16 is a plan view showing a state in which the microcomputer of FIG. 15 is packaged. 図17は図15のマイクロコンピュータに内蔵されるフラッシュメモリの全体的なブロック図である。FIG. 17 is an overall block diagram of a flash memory built in the microcomputer of FIG. 図18はメモリブロックの分割態様の一例説明図である。FIG. 18 is an explanatory diagram of an example of a division mode of the memory block. 図19はコントロールレジスタの一例説明図である。FIG. 19 is an explanatory diagram of an example of the control register. 図20はフラッシュメモリにおけるメモリリード動作の一例タイミングチャートである。FIG. 20 is a timing chart showing an example of a memory read operation in the flash memory. 図21はフラッシュメモリにおけるメモリライト動作の一例タイミングチャートである。FIG. 21 is an example timing chart of the memory write operation in the flash memory. 図22は書込み制御手順の詳細な一例フローチャートである。FIG. 22 is a flowchart showing a detailed example of the write control procedure. 図23は消去制御手順の詳細な一例フローチャートである。FIG. 23 is a flowchart showing a detailed example of the erase control procedure. 図24はメモリブロック分割態様の別の例を示す説明図である。FIG. 24 is an explanatory diagram showing another example of the memory block division mode.

符号の説明Explanation of symbols

MCU マイクロコンピュータ
CHP 半導体チップ
FMRY フラッシュメモリ
LNB 大メモリブロック
SMB 小メモリブロック
CPU 中央処理装置
RAM ランダム・アクセス・メモリ
CONT 制御回路
MASKROM マスク・リード・オンリ・メモリ
MODE モード信号
Pmode モード信号入力端子
MD0乃至MD2 モード信号
PORTdata ポート
PORTaddr ポート
PORTcont ポート
socket ソケット
PRW 汎用PROMライタ
ABUS アドレスバス
DBUS データバス
5 フローティングゲート
7 コントロールゲート
9 ソース
10 ドレイン
ARY1乃至ARY7 メモリアレイ
MC メモリセル
WL0乃至WLn ワード線
DL0乃至DL7 データ線
SL1,SL2 ソース線
B1,B2 消去ブロック指定レジスタのビット
PORT1乃至PORT12 ポート
ED0乃至ED7 PROMライタとの入出力データ
EA0乃至EA16 PROMライタからの入力アドレス信号
CE* チップイネーブル信号
OE* アウトプットイネーブル信号
WE* ライトイネーブル信号
FCONT 制御回路
CREG コントロールレジスタ
NBREG 消去ブロック指定レジスタ
PEREG プログラム/イレーズ制御レジスタ
E イレーズビット
EV イレーズベリファイビット
P プログラムビット
PE プログラムベリファイビット
ERASEC 消去回路
LMB0乃至LMB6 大メモリブロック
SMB0乃至SMB7 小メモリブロック
MCU Microcomputer CHP Semiconductor chip FMRY Flash memory LNB Large memory block SMB Small memory block CPU Central processing unit RAM Random access memory CONT Control circuit MASKROM Mask read only memory MODE mode signal Pmode mode signal input terminal MD0 to MD2 mode Signal PORTdata port PORTaddr port PORTcont port socket Socket PRW General-purpose PROM writer ABUS Address bus DBUS Data bus 5 Floating gate 7 Control gate 9 Source 10 Drain ARY1 to ARY7 Memory array MC Memory cell WL0 to WLn Word line DL0 to DL7 Data line Source line B1, B Bits of erasing block designation register PORT1 to PORT12 Ports ED0 to ED7 Input / output data with PROM writer EA0 to EA16 Input address signal from PROM writer CE * Chip enable signal OE * Output enable signal WE * Write enable signal FCONT control circuit CREG Control register NBREG Erase block designation register PEREG Program / erase control register E Erase bit EV Erase verify bit P Program bit PE Program verify bit ERASEC Erase circuit LMB0 to LMB6 Large memory block SMB0 to SMB7 Small memory block

Claims (5)

CPUと、
I/Oポートと、
フラッシュメモリと、
ランダムアクセスメモリと、を単一の半導体チップに構成されるマイクロコンピュータにおいて、
前記フラッシュメモリは、複数の一括消去可能な記憶領域に分割され、書換え制御プログラムと転送制御プログラムとを格納し、
消去・書込み等の動作状態を設定するためのコントロールレジスタを有し、
前記コントロールレジスタは、消去動作を指示するビット、書込み動作を指示するビット、ベリファイ動作を指示するビット、および消去対象となる記憶領域を指定するビットとを有し、前記CPUによって制御可能とされ、
前記CPUは、前記コントロールレジスタの設定に応じて動作可能とされ、前記転送制御プログラムを実行することにより、前記書換え制御プログラムを前記ランダムアクセスメモリへ転送し、さらに前記ランダムアクセスメモリへ転送された書換え制御プログラムを前記CPUが実行することにより、用意されたデータを前記フラッシュメモリへ書き込むマイクロコンピュータ。
CPU,
I / O port,
Flash memory,
In a microcomputer configured with a random access memory and a single semiconductor chip,
The flash memory is divided into a plurality of batch erasable storage areas, stores a rewrite control program and a transfer control program,
It has a control register for setting the operating state such as erasing / writing,
The control register includes a bit for instructing an erase operation, a bit for instructing a write operation, a bit for instructing a verify operation, and a bit for designating a storage area to be erased, and can be controlled by the CPU.
The CPU is operable according to the setting of the control register, and by executing the transfer control program, the rewrite control program is transferred to the random access memory, and the rewrite transferred to the random access memory is further performed. A microcomputer for writing prepared data into the flash memory by the CPU executing a control program.
前記フラッシュメモリに対する書込みは、前記I/Oポートを介してマイクロコンピュータに入力されたデータを用いて行われる請求項1記載のマイクロコンピュータ。   2. The microcomputer according to claim 1, wherein the writing to the flash memory is performed using data input to the microcomputer via the I / O port. 前記フラッシュメモリの所定の記憶領域に格納された情報の更新は、前記情報を前記ランダムアクセスメモリへ転送し、前記ランダムアクセスメモリ上で情報を更新し、さらに、更新された情報を用いて前記フラッシュメモリに書き込むことで制御される請求項1または2記載のマイクロコンピュータ。   The information stored in a predetermined storage area of the flash memory is updated by transferring the information to the random access memory, updating the information on the random access memory, and further using the updated information to the flash memory. 3. The microcomputer according to claim 1, which is controlled by writing to a memory. 前記更新された情報は、前記所定の記憶領域に格納される請求項3記載のマイクロコンピュータ。   The microcomputer according to claim 3, wherein the updated information is stored in the predetermined storage area. 前記マイクロコンピュータは、さらに外部から動作モードを指定する信号を入力する端子を有し、
前記端子から入力される信号に応じて、前記フラッシュメモリに対して書き込みを要しない動作モードか、書き込みを行う動作モードであるかを判定することが可能である請求項1乃至4の何れか1項に記載のマイクロコンピュータ。
The microcomputer further has a terminal for inputting a signal designating an operation mode from the outside,
5. It is possible to determine whether the operation mode does not require writing to the flash memory or the operation mode in which writing is performed in accordance with a signal input from the terminal. The microcomputer according to item.
JP2008176658A 2008-07-07 2008-07-07 Microcomputer Withdrawn JP2008276938A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008176658A JP2008276938A (en) 2008-07-07 2008-07-07 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008176658A JP2008276938A (en) 2008-07-07 2008-07-07 Microcomputer

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007190517A Division JP2008004258A (en) 2007-07-23 2007-07-23 Manufacturing method of semiconductor system

Publications (1)

Publication Number Publication Date
JP2008276938A true JP2008276938A (en) 2008-11-13

Family

ID=40054682

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008176658A Withdrawn JP2008276938A (en) 2008-07-07 2008-07-07 Microcomputer

Country Status (1)

Country Link
JP (1) JP2008276938A (en)

Similar Documents

Publication Publication Date Title
US5844843A (en) Single chip data processing apparatus having a flash memory which is rewritable under the control of built-in CPU in the external write mode
US5768194A (en) Data line disturbance free memory block divided flash memory and microcomputer having flash memory therein
US5881295A (en) Data processor which controls interrupts during programming and erasing of on-chip erasable and programmable non-volatile program memory
US20070083745A1 (en) Data processor
JP4936086B2 (en) Memory device distributed controller system
JPH05266219A (en) Microcomputer
JP2006107719A (en) Nonvolatile memory device and program method thereof
JP3534781B2 (en) Microcomputer and flash memory
US7057937B1 (en) Data processing apparatus having a flash memory built-in which is rewritable by use of external device
EP0617377A2 (en) Microcomputer with flash memory
JP4127562B2 (en) Microcomputer
JP4018402B2 (en) Manufacturing method of semiconductor system
JPH113594A (en) Non-volatile memory, data writing and read method
US20220283726A1 (en) Method for assisting in the identification of blank sectors of a non-volatile memory of a microcontroller
JP2004246923A (en) Microcomputer
JP3765585B2 (en) Data processing device
JP2008276938A (en) Microcomputer
JP2008004258A (en) Manufacturing method of semiconductor system
US10732894B2 (en) Method of writing in a non-volatile memory device and corresponding non-volatile memory device
JPH11288410A (en) Microcomputer
JP2003076672A (en) Microcomputer
JP2008181596A (en) Semiconductor storage device
JPH11316753A (en) Micro computer
JPH11316752A (en) Micro computer
JP3810745B2 (en) Microcomputer

Legal Events

Date Code Title Description
A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20081107