JPH08147186A - Microcomputer with built-in flash memory - Google Patents

Microcomputer with built-in flash memory

Info

Publication number
JPH08147186A
JPH08147186A JP6290118A JP29011894A JPH08147186A JP H08147186 A JPH08147186 A JP H08147186A JP 6290118 A JP6290118 A JP 6290118A JP 29011894 A JP29011894 A JP 29011894A JP H08147186 A JPH08147186 A JP H08147186A
Authority
JP
Japan
Prior art keywords
flash memory
data
emulation
built
microcomputer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP6290118A
Other languages
Japanese (ja)
Inventor
Bunro Kobayashi
文朗 小林
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.)
Denso Corp
Original Assignee
NipponDenso Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NipponDenso Co Ltd filed Critical NipponDenso Co Ltd
Priority to JP6290118A priority Critical patent/JPH08147186A/en
Publication of JPH08147186A publication Critical patent/JPH08147186A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)
  • Microcomputers (AREA)

Abstract

PURPOSE: To enable the reloading of a built-in flash memory even during real- time control. CONSTITUTION: The prescribed area of a flash memory 13 is divided into arbitrary blocks, and a voltage Vpp for erase and write is impressed only to the block to be the object of erasure and write among the divided blocks. A normal voltage Vcc is impressed to the other blocks. Besides, the addresses of the arbitrary areas of the flash memory 13 are registered on a register 14 so as to overlap those areas to the arbitrary areas of a RAM 12. These address registered areas of the flash memory 13 are logically disconnected, and the data in these disconnected flash memory areas are emulated by those address registered areas on the RAM 12. These emulated data are written back through a control circuit 16 to the relevant areas of the flash memory 13 during the execution of emulation.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、ワンチップマイクロ
コンピュータのプログラム及びデータメモリとしてフラ
ッシュメモリを内蔵したフラッシュメモリ内蔵マイクロ
コンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer with a built-in flash memory, which has a built-in flash memory as a program and data memory of a one-chip microcomputer.

【0002】[0002]

【従来の技術】フラッシュメモリは、いわゆるオンボー
ドでのデータの書き換えが可能で且つEEPROM(El
ectrically Erasable and Programmable Read Only Me
mory)に比較してその構造が簡単なことから、現在多く
のコンピュータ関連機器に使用されている。
2. Description of the Related Art A flash memory has a so-called on-board rewritable data and has an EEPROM (El
ectrically Erasable and Programmable Read Only Me
mory) has a simpler structure compared to mory) and is currently used in many computer-related devices.

【0003】また近年は、そのメモリ空間をいくつかの
ブロックに分割して、それら個々のブロックを単位とし
た消去及び書き込みを可能とするフラッシュメモリが主
流になりつつある。
Further, in recent years, a flash memory, which is capable of erasing and writing in units of individual blocks by dividing the memory space into several blocks, is becoming the mainstream.

【0004】ところで、このようなフラッシュメモリを
ワンチップマイクロコンピュータのプログラム及びデー
タメモリとして内蔵したフラッシュメモリ内蔵マイクロ
コンピュータにあっては通常、その消去及び書き込み
時、同フラッシュメモリからのデータ読み出しや割り込
みは禁止される。このため、上記ブロック分割によって
それら個々のブロック毎にデータの書き換えが可能にな
るとはいえ、それら書き換えを実行している間は、同フ
ラッシュメモリ内の他のブロックのプログラムを実行す
ることはできなくなる。換言すれば、フラッシュメモリ
内のプログラムの実行に基づく任意制御対象のリアルタ
イムでの制御中には、フラッシュメモリに対するデータ
の書き換えを行うことはできない。
By the way, in a microcomputer with a built-in flash memory as a program and data memory of a one-chip microcomputer, usually, during erasing and writing, data reading and interruption from the flash memory are not performed. prohibited. Therefore, although it is possible to rewrite data in each of the individual blocks by the block division, it is not possible to execute the programs of other blocks in the flash memory while the rewriting is being executed. . In other words, data cannot be rewritten to the flash memory during real-time control of an arbitrary control target based on execution of a program in the flash memory.

【0005】そこで従来は、このフラッシュメモリ内蔵
マイクロコンピュータに外部メモリとしてランダムアク
セスメモリ(RAM)を外付けするとともに、この外付
けしたRAMを用いて内蔵フラッシュメモリのエミュレ
ーションを行い、制御終了後に、該エミュレーションし
たデータによって内蔵フラッシュメモリを書き換えるな
どの開発手法が用いられている。
Therefore, conventionally, a random access memory (RAM) is externally attached as an external memory to the microcomputer with a built-in flash memory, and the built-in flash memory is emulated using the externally attached RAM, and after the control is completed, Development methods such as rewriting the built-in flash memory with emulated data are used.

【0006】図6に、例えばエンジン制御等に使用され
る電子制御装置にフラッシュメモリ内蔵マイクロコンピ
ュータが採用される場合の、該従来の開発手法に基づく
装置基板の推移を示す。
FIG. 6 shows the transition of the device substrate based on the conventional development method when a microcomputer with a built-in flash memory is adopted in an electronic control device used for engine control or the like.

【0007】すなわち同図6において、図6(a)は、
電子制御装置の試作時(試験時)における装置基板への
部品装着態様を示し、図6(b)は、同電子制御装置の
量産時における装置基板への部品装着態様を示す。当該
電子制御装置の試作時には、図6(a)に示されるよう
に、フラッシュメモリ内蔵マイクロコンピュータ1をは
じめ、ポート代価IC4及び外部メモリ(外付けRA
M)5等が装置基板2上に一括搭載される。ポート代価
IC4は、マイクロコンピュータ1の外部メモリ5との
接続に使用されるポート分を補うために設けられたIC
であり、マイクロコンピュータ1とコネクタ3とは、一
部このポート代価IC4を介して電気的に接続される。
また、コネクタ3には、制御対象となるエンジンに配設
された各種センサやアクチュエータ、若しくはそのドラ
イバ回路等が接続される。試作、或いは試験に際して
は、これらセンサやアクチュエータがコネクタ3に接続
されて且つ、エンジンの運転が維持された状態で各種制
御での適合処理が行われ、その適合データが内蔵フラッ
シュメモリをエミュレートする上記外部メモリ5に書き
込まれる。そして、その書き込まれた適合データが、そ
れら制御(試験)の終了後、マイクロコンピュータ1の
内蔵フラッシュメモリに書き戻される。他方、同電子制
御装置の量産時には、図6(b)に示されるように、上
記ポート代価IC4や外部メモリ5は外され、予め上記
適合データが内蔵フラッシュメモリに書き込まれたマイ
クロコンピュータ1だけが装置基板2上に装着されて、
コネクタ3と電気的に接続される。
That is, in FIG. 6, FIG.
FIG. 6B shows a component mounting state on the device board at the time of trial production (testing) of the electronic control device, and FIG. 6B shows a component mounting state on the device board at the time of mass production of the electronic control device. At the time of trial production of the electronic control unit, as shown in FIG. 6A, the microcomputer 1 with a built-in flash memory, the port price IC 4 and the external memory (external RA
M) 5 etc. are collectively mounted on the device substrate 2. The port price IC 4 is an IC provided to supplement the port used for connection with the external memory 5 of the microcomputer 1.
Therefore, the microcomputer 1 and the connector 3 are partially electrically connected via the port price IC 4.
Further, the connector 3 is connected to various sensors and actuators arranged in the engine to be controlled, or their driver circuits. At the time of trial manufacture or test, the matching process is performed under various controls while these sensors and actuators are connected to the connector 3 and the operation of the engine is maintained, and the matching data emulates the built-in flash memory. It is written in the external memory 5. Then, the written compatible data is written back to the built-in flash memory of the microcomputer 1 after the control (test) is completed. On the other hand, when the electronic control unit is mass-produced, as shown in FIG. 6B, the port price IC 4 and the external memory 5 are removed, and only the microcomputer 1 in which the compatible data is written in the built-in flash memory in advance. Mounted on the device substrate 2,
It is electrically connected to the connector 3.

【0008】[0008]

【発明が解決しようとする課題】例えばエンジン制御用
の電子制御装置にあって、エンジンの各種パラメータ等
を適合処理する場合などには、その処理中、エンジンの
運転を停止させることができない。そこで、上記従来の
開発手法として述べたように、フラッシュメモリ内蔵マ
イクロコンピュータにRAMを外付けし、この外付けし
たRAMを用いて内蔵フラッシュメモリのエミュレーシ
ョンを行うようにすれば、エンジンの運転を停止させる
ことなく、いわゆるリアルタイムでの適合処理が可能と
なる。
For example, in an electronic control unit for engine control, when various parameters of the engine are adapted and processed, the operation of the engine cannot be stopped during the processing. Therefore, as described above as the conventional development method, if the RAM is externally attached to the microcomputer with the built-in flash memory and the built-in flash memory is emulated using the externally attached RAM, the operation of the engine is stopped. It is possible to perform so-called real-time matching processing without performing the adjustment.

【0009】しかし、同従来の手法によれば、上記RA
Mを通じてのエミュレーション実行中は、フラッシュメ
モリ内蔵マイクロコンピュータをシングルチップ動作さ
せることができず、また内蔵フラッシュメモリの書き換
えを行うこともできない。そして結局は図6に例示した
ように、試作(試験)時と量産時とで同一の装置構成と
することができず、基板自体も、これら試作時と量産時
とで各別のものを使用せざるを得なくなる。しかも従来
のフラッシュメモリ内蔵マイクロコンピュータでは、一
旦これを図6(b)に示される如く電子制御装置基板に
組み込んでしまうと、その後上記適合データの再調整が
必要とされる場合でも、これに容易に対処することがで
きなくなる。
However, according to the conventional method, the RA
During emulation through M, the microcomputer with built-in flash memory cannot be operated in a single chip, and the built-in flash memory cannot be rewritten. After all, as shown in FIG. 6, the same device configuration cannot be used at the time of trial production (test) and at the time of mass production, and different substrates are used at the time of trial production and at the time of mass production. I have no choice but to do it. Moreover, in the conventional microcomputer with a built-in flash memory, once this is incorporated into the electronic control device substrate as shown in FIG. 6B, even if the readjustment of the conformity data is required thereafter, it is easy to do so. Unable to deal with.

【0010】この発明は、こうした実情に鑑みてなされ
たものであり、上記エンジン制御等のリアルタイム制御
中であっても、その内蔵されるフラッシュメモリの書き
換えを行うことのできるフラッシュメモリ内蔵マイクロ
コンピュータを提供することを目的とする。
The present invention has been made in view of the above circumstances, and provides a microcomputer with a built-in flash memory capable of rewriting the built-in flash memory even during real-time control such as engine control. The purpose is to provide.

【0011】[0011]

【課題を解決するための手段】こうした目的を達成する
ため、請求項1記載の発明では、ワンチップマイクロコ
ンピュータのプログラム及びデータメモリとしてフラッ
シュメモリを内蔵したフラッシュメモリ内蔵マイクロコ
ンピュータにおいて、前記フラッシュメモリの所定領域
を所定数にブロック分割して、これら分割したブロック
のうち消去及び書き込み対象となるブロックを他のブロ
ックと分離してこれに消去及び書き込み用電圧を印加
し、他のブロックには通常の読み出し用電圧を印加する
フラッシュメモリ制御手段を具える構成とする。
In order to achieve such an object, according to the invention of claim 1, in a microcomputer with a built-in flash memory, which has a built-in flash memory as a program and data memory of a one-chip microcomputer, The predetermined area is divided into a predetermined number of blocks, and the blocks to be erased and written among these divided blocks are separated from the other blocks, and the erase and write voltages are applied to the blocks, and the other blocks are normally erased. It is configured to include flash memory control means for applying a read voltage.

【0012】また、請求項2記載の発明では、こうした
請求項1記載の発明の構成において更に、内蔵ランダム
アクセスメモリと、前記フラッシュメモリの前記ブロッ
ク分割した任意領域を該ランダムアクセスメモリの任意
領域にオーバーラップさせるべくそれら領域のアドレス
が登録されるレジスタ手段と、前記フラッシュメモリの
前記アドレス登録された領域を論理的に切り離し、同ア
ドレス登録された前記ランダムアクセスメモリ上の領域
によって該切り離したフラッシュメモリ領域のデータを
エミュレートするエミュレート手段と、このエミュレー
トされたデータを前記フラッシュメモリ制御手段を通じ
て前記フラッシュメモリの当該領域に書き戻す書き込み
制御手段とを具える構成とする。
Further, in the invention of claim 2, in the structure of the invention of claim 1, the built-in random access memory and the block-divided arbitrary area of the flash memory are set as arbitrary areas of the random access memory. The register means in which the addresses of the areas are registered so as to be overlapped, and the area in which the address is registered in the flash memory are logically separated, and the separated flash memory is formed by the area in the random access memory in which the address is registered. The configuration includes emulation means for emulating data in an area and write control means for writing back the emulated data to the area of the flash memory through the flash memory control means.

【0013】また、請求項3記載の発明では、該請求項
2記載の発明の構成において、前記書き込み制御手段
を、前記エミュレート手段が能動となっているときにの
みそのエミュレートデータの前記フラッシュメモリへの
書き戻しが許可されるものとして構成する。
According to a third aspect of the present invention, in the configuration of the second aspect of the invention, the write control means is provided with the flash of the emulation data only when the emulation means is active. Configure to allow write back to memory.

【0014】また、請求項4記載の発明では、同請求項
2記載の発明の構成において、前記エミュレート手段に
よるエミュレート並びに前記書き込み制御手段による同
エミュレートデータの書き戻しが128バイトを単位と
して行われるようにする。
According to a fourth aspect of the invention, in the configuration of the second aspect of the invention, the emulation by the emulation means and the writing back of the emulation data by the write control means are performed in units of 128 bytes. To be done.

【0015】[0015]

【作用】フラッシュメモリ内蔵マイクロコンピュータに
あって、内蔵フラッシュメモリの任意ブロックの消去及
び書き込みを行う場合、従来は、同フラッシュメモリに
格納されている消去及び書き込みプログラムをRAMに
転送し、RAM上でこの消去及び書き込みプログラムを
実行する。
In a microcomputer with a built-in flash memory, when erasing and writing an arbitrary block of the built-in flash memory, conventionally, the erasing and writing program stored in the flash memory is transferred to the RAM and the This erase and write program is executed.

【0016】またその際、同フラッシュメモリの各ブロ
ックには、それら消去及び書き込み用の専用の電圧(V
pp)が印加されて、それらブロックからのデータの読み
出しが禁止される。
At this time, each block of the flash memory has a dedicated voltage (V) for erasing and writing.
pp) is applied to prohibit reading of data from these blocks.

【0017】そしてこのことが、同フラッシュメモリ内
蔵マイクロコンピュータのシングルチップ動作中に、リ
アルタイムでのデータ書き換えが実現されないことの要
因になっている。
This is a factor that real-time data rewriting cannot be realized during the single-chip operation of the microcomputer with the built-in flash memory.

【0018】そこで、請求項1記載の発明では、上記フ
ラッシュメモリ制御手段を通じて、フラッシュメモリの
上記分割したブロックのうちの消去及び書き込み対象と
なるブロックを他のブロックと分離してこれに消去及び
書き込み用電圧(Vpp)を印加し、その他のブロックに
は通常の読み出し用電圧(Vcc)を印加するようにす
る。
Therefore, according to the first aspect of the present invention, the block to be erased and written in the divided blocks of the flash memory is separated from the other blocks through the flash memory control means, and erased and written to this block. The read voltage (Vpp) is applied, and the normal read voltage (Vcc) is applied to the other blocks.

【0019】上記分割した各ブロックに対しこのような
印加電圧制御を行うようにすれば、消去及び書き込み対
象としてそれ専用の電圧(Vpp)が印加されるブロック
以外のブロックからは通常にデータを読み出すことがで
きるようになる。このため、上記消去及び書き込みプロ
グラムであれ、必ずしもこれをRAM等に転送しなくと
も、フラッシュメモリ上から直接実行することができる
ようになる。勿論、同フラッシュメモリ上から直接実行
することのできるプログラムは、この消去及び書き込み
プログラムには限られない。すなわちこのことは、フラ
ッシュメモリに格納されている例えばエンジン制御プロ
グラムの実行中であっても、同フラッシュメモリ内の任
意のブロックについて、そのデータ書き換えが可能にな
ることを意味する。
If such an applied voltage control is performed for each of the divided blocks, data is normally read from the blocks other than the block to which the dedicated voltage (Vpp) is applied for erasing and writing. Will be able to. Therefore, the erasing and writing program can be directly executed from the flash memory without necessarily transferring it to the RAM or the like. Of course, the program that can be directly executed from the flash memory is not limited to this erasing and writing program. That is, this means that even if, for example, the engine control program stored in the flash memory is being executed, the data can be rewritten for any block in the flash memory.

【0020】また、請求項2記載の発明によるように、 ・内蔵ランダムアクセスメモリ(RAM)。 ・前記フラッシュメモリの前記ブロック分割した任意領
域を該RAMの任意領域にオーバーラップさせるべくそ
れら領域のアドレスが登録されるレジスタ手段。 ・前記フラッシュメモリの前記アドレス登録された領域
を論理的に切り離し、同アドレス登録された前記RAM
上の領域によって該切り離したフラッシュメモリ領域の
データをエミュレートするエミュレート手段。 ・このエミュレートされたデータを前記フラッシュメモ
リ制御手段を通じて前記フラッシュメモリの当該領域に
書き戻す書き込み制御手段。を更に具える構成とすれ
ば、消去及び書き込みに時間のかかるフラッシュメモリ
であっても、上記RAMによるエミュレーションを通じ
て、効率的にそのデータ書き換えが実現されるようにな
る。
According to the second aspect of the invention, a built-in random access memory (RAM). -Register means for registering the addresses of the block-divided arbitrary areas of the flash memory so as to overlap the arbitrary areas of the RAM. -The RAM in which the address registered area of the flash memory is logically separated and the address is registered
Emulation means for emulating the data in the flash memory area separated by the upper area. Write control means for writing back the emulated data to the area of the flash memory through the flash memory control means. If the configuration further includes, even in the case of a flash memory that requires a long time for erasing and writing, the data rewriting can be efficiently realized through the emulation by the RAM.

【0021】また、請求項3記載の発明によるように、
上記書き込み制御手段を、 ・前記エミュレート手段が能動となっているときにのみ
そのエミュレートデータの前記フラッシュメモリへの書
き戻しが許可されるもの。として構成すれば、同書き込
み制御手段によるデータの誤った書き戻し等は回避さ
れ、上記エンジン等のリアルタイム制御中におけるフラ
ッシュメモリのデータ書き換えがより円滑に実行される
ようになる。
According to the invention of claim 3,
The write control means is as follows: Writing back of the emulated data to the flash memory is permitted only when the emulation means is active. With this configuration, erroneous data write-back by the write control means can be avoided, and data rewriting of the flash memory can be executed more smoothly during real-time control of the engine or the like.

【0022】また、請求項4記載の発明によるように、 ・前記エミュレート手段によるエミュレート並びに前記
書き込み制御手段による同エミュレートデータの書き戻
しは128バイトを単位として行われる。ものとすれ
ば、上記エミュレーションを利用した制御パラメータの
適合等に際して、最適なデータ転送サイズとすることが
できるとともに、適合におけるデータ書き換え頻度も最
小限に抑えることができるようになる。
According to the present invention, the emulation by the emulation means and the writing back of the emulation data by the write control means are performed in units of 128 bytes. By doing so, when adapting the control parameters using the emulation, etc., the optimum data transfer size can be set, and the data rewriting frequency in the adaption can be minimized.

【0023】[0023]

【実施例】図1に、この発明にかかるフラッシュメモリ
内蔵マイクロコンピュータについてその一実施例を示
す。
FIG. 1 shows an embodiment of a microcomputer with a built-in flash memory according to the present invention.

【0024】この実施例のマイクロコンピュータは、リ
アルタイム制御中であっても、またシングルチップ動作
中であっても、その内蔵するフラッシュメモリの書き換
えを行うことができる構成となっている。
The microcomputer of this embodiment has a structure capable of rewriting the built-in flash memory even during real-time control or single-chip operation.

【0025】はじめに、同図1を参照して、この実施例
のマイクロコンピュータの構成について説明する。この
実施例のマイクロコンピュータ10は、図1に示される
ように、演算処理装置であるCPU11をはじめ、デー
タメモリとして用いられるRAM(ランダムアクセスメ
モリ)12、並びにプログラム及びデータメモリとして
用いられるフラッシュメモリ13を基本的に具えて構成
される。
First, the configuration of the microcomputer of this embodiment will be described with reference to FIG. As shown in FIG. 1, the microcomputer 10 of this embodiment includes a CPU 11 as an arithmetic processing unit, a RAM (random access memory) 12 used as a data memory, and a flash memory 13 used as a program and a data memory. It basically consists of.

【0026】CPU11からこれらメモリ12及び13
に対するアドレス指定は、アドレスバス17(17a〜
17f)を介して行われ、CPU11とこれらメモリ1
2及び13との間でのデータの授受は、データバス18
(18a〜18f)を介して行われる。
From the CPU 11 to these memories 12 and 13
Is addressed to the address bus 17 (17a ...
17f), and the CPU 11 and these memories 1
The data bus 18 sends and receives data to and from 2 and 13.
(18a to 18f).

【0027】なお、図1においては図示を割愛したが、
これらアドレスバス17及びデータバス18は、同マイ
クロコンピュータ10の入出力ポートとも接続され、例
えばセンサやアクチュエータ、或いは後述するツール
(マイクロコンピュータ10に対してデータの書き込み
等を指示する例えばパーソナルコンピュータ等からなる
補助装置)などは、この入出力ポートを介して同マイク
ロコンピュータと接続される。
Although not shown in FIG. 1,
The address bus 17 and the data bus 18 are also connected to the input / output ports of the microcomputer 10, and are, for example, a sensor or an actuator, or a tool described later (from a personal computer or the like that instructs the microcomputer 10 to write data, for example). Auxiliary device) and the like are connected to the same microcomputer through this input / output port.

【0028】一方、フラッシュメモリ13の周辺には、
フラッシュメモリ制御レジスタ15及びフラッシュメモ
リ制御回路16が配設されている。フラッシュメモリ制
御レジスタ15は、フラッシュメモリ13の動作モード
(例えば書き込みモードや書き込みベリファイモード、
消去モード、消去ベリファイモード、等々)を設定する
ための情報や後述するエミュレーションに際しての制御
フラグ等がセットされるレジスタである。
On the other hand, in the periphery of the flash memory 13,
A flash memory control register 15 and a flash memory control circuit 16 are provided. The flash memory control register 15 is used for operating modes of the flash memory 13 (for example, a write mode and a write verify mode,
This is a register in which information for setting the erase mode, erase verify mode, etc.) and control flags for emulation, which will be described later, are set.

【0029】また、フラッシュメモリ制御回路16は、
このフラッシュメモリ制御レジスタ15の設定内容に基
づき、フラッシュメモリ制御バス19を介して、フラッ
シュメモリ13上のデータの書き換え、或いは同フラッ
シュメモリ13からのデータ読み出し等を統括管理する
回路である。
Further, the flash memory control circuit 16 is
Based on the setting contents of the flash memory control register 15, it is a circuit that integrally manages rewriting of data on the flash memory 13 or reading of data from the flash memory 13 via the flash memory control bus 19.

【0030】ここで、フラッシュメモリ13自身は、同
図1に併せ示されるように、その全メモリ空間のうちの
例えば適合データの格納に使用される一部の領域が1〜
Nのブロックに分割して管理されるようになっている。
因みに同実施例にあっては、この分割管理される各ブロ
ックの大きさが128バイトに設定され、ブロック数N
は、 対象となる適合データの全てが十分に格納される容量
/ 128バイト として決定されている。
Here, in the flash memory 13 itself, as shown in FIG. 1, a part of the total memory space used for storing, for example, compatible data is 1 to 1.
It is divided into N blocks and managed.
By the way, in the embodiment, the size of each block to be divided and managed is set to 128 bytes, and the number of blocks N
Is the capacity to store all applicable conformance data
/ 128 bytes.

【0031】そして、同実施例にあっては特に、上記フ
ラッシュメモリ制御回路16を通じて、これら分割され
た各ブロック毎に、その印加電圧が制御されるようにな
っている。すなわち、上記ブロックのうちの消去及び書
き込み対象となるブロックにのみ消去及び書き込み用電
圧Vpp(例えば12V)が印加され、他のブロック或い
は他の領域には通常の読み出し用電圧Vcc(例えば5
V)が印加されるようになっている。
In particular, in the embodiment, the applied voltage is controlled by the flash memory control circuit 16 for each of the divided blocks. That is, the erasing and writing voltage Vpp (for example, 12 V) is applied only to the block to be erased and written among the above blocks, and the normal reading voltage Vcc (for example, 5 V is applied to other blocks or other regions).
V) is applied.

【0032】同実施例のマイクロコンピュータ10のこ
うした構成により、上記フラッシュメモリ13の消去或
いは書き込み中であっても、他のブロック或いは他の領
域を通じて、同フラッシュメモリ13に格納されている
プログラムを実行することができるようになる。
With the configuration of the microcomputer 10 of the embodiment, the program stored in the flash memory 13 can be executed through another block or another area even while the flash memory 13 is being erased or written. You will be able to.

【0033】また、同実施例のマイクロコンピュータ1
0において、エミュレーション領域レジスタ14は、以
下に説明するRAMエミュレーションに際して、フラッ
シュメモリ13の上記分割した任意のブロックをRAM
12の任意の領域にオーバーラップさせるべく、それら
領域のアドレスが一時登録されるレジスタである。
Further, the microcomputer 1 of the same embodiment
0, the emulation area register 14 stores any of the divided blocks of the flash memory 13 in the RAM emulation described below.
This is a register in which the addresses of the 12 areas are temporarily registered so as to overlap them.

【0034】図2は、このエミュレーション領域レジス
タ14並びに上記フラッシュメモリ制御レジスタ15の
設定に基づき実行されるRAMエミュレーションについ
て、その実行態様を模式的に示したものである。
FIG. 2 schematically shows an execution mode of the RAM emulation executed based on the settings of the emulation area register 14 and the flash memory control register 15.

【0035】次に、この図2を併せ参照して、同実施例
のマイクロコンピュータ10によるフラッシュメモリ1
3のデータ書き換え手法を更に詳述する。例えばいま、
フラッシュメモリ13の上記分割ブロックのうちのブロ
ック3に格納されているデータを書き換えるものとする
と、マイクロコンピュータ10では、図示しないツール
からの指示に基づき、以下に列記する手順をもってRA
Mエミュレーション並びにフラッシュメモリ13のデー
タ書き換えを実行する。
Next, referring also to FIG. 2, the flash memory 1 by the microcomputer 10 of the embodiment.
The data rewriting method of No. 3 will be described in more detail. For example,
Assuming that the data stored in the block 3 of the above-mentioned divided blocks of the flash memory 13 is rewritten, the microcomputer 10 executes the RA procedure according to the following instructions based on an instruction from a tool (not shown).
M emulation and data rewriting of the flash memory 13 are executed.

【0036】(1)RAM12上のオーバーラップさせ
るべき領域12aのアドレス「XX80H」をエミュレ
ーション領域レジスタ14にセットする。 (2)このアドレス「XX80H」のオーバーラップ領
域12aにフラッシュメモリ13上の書き換えが所望さ
れるブロック3のデータを転送する。
(1) The address "XX80H" of the area 12a to be overlapped on the RAM 12 is set in the emulation area register 14. (2) The data of the block 3 of the flash memory 13 which is desired to be rewritten is transferred to the overlap area 12a of the address "XX80H".

【0037】(3)同ブロック3のアドレス「YY80
H」をエミュレーション領域レジスタ14にセットす
る。 (4)フラッシュメモリ制御レジスタ15に、エミュレ
ーション制御フラグをセットする(同フラグを「1」と
する)。
(3) Address "YY80" of the same block 3
“H” is set in the emulation area register 14. (4) The emulation control flag is set in the flash memory control register 15 (the flag is set to "1").

【0038】(5)該エミュレーション制御フラグのセ
ットに基づき、エミュレーションを開始する。なお、こ
のエミュレーション実行中は、フラッシュメモリ13の
上記ブロック3へのアクセスはRAM12上の上記オー
バーラップ領域12aが選択され、同ブロック3はバス
17及び18から論理的に切り離される。
(5) Emulation is started based on the setting of the emulation control flag. During execution of this emulation, the overlap area 12a on the RAM 12 is selected to access the block 3 of the flash memory 13, and the block 3 is logically separated from the buses 17 and 18.

【0039】(6)他方、同エミュレーション制御フラ
グのセットに基づき、同ブロック3のデータ消去及びデ
ータ書き込みが可能な状態となる。該消去及び書き込み
は、上記フラッシュメモリ制御レジスタ15に対する書
き込みフラグのセットに基づき、上記フラッシュメモリ
制御回路16を通じて実行される。
(6) On the other hand, based on the setting of the emulation control flag, the data erasing and data writing of the block 3 is enabled. The erasing and writing are executed through the flash memory control circuit 16 based on the setting of the write flag for the flash memory control register 15.

【0040】(7)該消去及び書き込みに際し、フラッ
シュメモリ制御回路16では、上記フラッシュメモリ制
御バス19を通じて、当該ブロック3への印加電圧のみ
消去及び書き込み用電圧Vppとし、その他のブロックへ
の印加電圧は通常の読み出し用電圧Vccに維持する。そ
して、こうした印加電圧に保った状態で、該ブロック3
のデータを消去し、上記エミュレーションに基づき変更
されたRAM12上のデータ(オーバーラップ領域12
aのデータ)を同ブロック3に書き戻す。
(7) At the time of the erasing and writing, the flash memory control circuit 16 uses only the voltage applied to the block 3 as the erasing and writing voltage Vpp through the flash memory control bus 19 and applies the voltage to the other blocks. Is maintained at the normal read voltage Vcc. Then, with the applied voltage maintained, the block 3
Of the data on the RAM 12 that has been erased by deleting the data of the
(data of a) is written back to the same block 3.

【0041】(8)こうしてフラッシュメモリ13のデ
ータ書き換えを終えれば、フラッシュメモリ制御レジス
タ15の上記書き込みフラグをクリアし、同様にエミュ
レーションを終えれば、同フラッシュメモリ制御レジス
タ15の上記エミュレーション制御フラグをクリアす
る。
(8) When the rewriting of data in the flash memory 13 is completed in this way, the write flag of the flash memory control register 15 is cleared, and when the emulation is similarly completed, the emulation control flag of the flash memory control register 15 is also completed. To clear.

【0042】図3〜図5に、こうした実施例のフラッシ
ュメモリ内蔵マイクロコンピュータ10がエンジン制御
用の電子制御装置に搭載される場合に、同エンジンのリ
アルタイム制御中に実行される上記エミュレーション並
びにフラッシュメモリ13のデータ書き換え手順を例示
する。
3 to 5, when the microcomputer 10 with a built-in flash memory of this embodiment is installed in an electronic control unit for engine control, the emulation and flash memory are executed during real-time control of the engine. 13 illustrates a data rewriting procedure of 13.

【0043】すなわち、エンジン制御プログラムにあっ
ては通常、図3に示されるように、ステップ101にて
初期設定を行った後、ステップ102にて、制御パラメ
ータ等を最適化するための適合処理を行って、ステップ
104以降の気筒同期処理としての点火・噴射演算、並
びにこの演算された値に基づく点火処理や噴射処理を含
むステップ110以降の時間同期処理が行われる。
That is, in the engine control program, normally, as shown in FIG. 3, after initial setting is performed in step 101, a matching process for optimizing control parameters and the like is performed in step 102. Then, the ignition / injection calculation as the cylinder synchronization process at step 104 and the time synchronization process at step 110 and thereafter including the ignition process and the injection process based on the calculated value are performed.

【0044】ここで、同実施例のマイクロコンピュータ
10が、上記フラッシュメモリ13の消去或いは書き込
み中であっても、他のブロック或いは他の領域を通じ
て、同フラッシュメモリ13に格納されているプログラ
ムを実行することができることは上述した通りである。
Here, the microcomputer 10 of the embodiment executes the program stored in the flash memory 13 through another block or another area even while the flash memory 13 is being erased or written. What can be done is as described above.

【0045】すなわち同実施例のマイクロコンピュータ
10にあっては、フラッシュメモリ13に格納されてい
るこうしたエンジン制御プログラムを実行しながらで
も、同フラッシュメモリ13内のデータ書き換えを行う
ことができる。そしてこれは、同図3に示されるよう
に、上記エンジン制御プログラムに対し、ステップ10
3としてエミュレーションチェック処理を追加すること
で実現される。この追加されるエミュレーションチェッ
クは、例えば図4及び図5に示される内容のものとな
る。
That is, in the microcomputer 10 of the embodiment, the data in the flash memory 13 can be rewritten while executing the engine control program stored in the flash memory 13. Then, as shown in FIG. 3, step 10 is executed for the engine control program.
It is realized by adding emulation check processing as 3. The added emulation check has the contents shown in FIGS. 4 and 5, for example.

【0046】まず、図4に示されるエミュレーションチ
ェックの基本処理において、CPU11は、ステップ2
01にて、フラッシュメモリ制御レジスタ15の上記エ
ミュレーション制御フラグの状態に基づき、現在エミュ
レーション中であるか否かを判断する。ここで、エミュ
レーション中ではない旨判断される場合には、ステップ
202にて、上記ツールによりエミュレーションの開始
が指示されているか否かを判断し、指示されていなけれ
ば、同エミュレーションチェックにかかる処理を一旦抜
ける。他方、同ツールによりエミュレーションの開始が
指示されていれば、ステップ203にて、エミュレーシ
ョン領域レジスタ14に対するアドレス登録を行った上
で、フラッシュメモリ制御レジスタ15に上記エミュレ
ーション制御フラグをセットする。この場合にはその
後、上記エンジン制御プログラムの適合処理(図3ステ
ップ102)を通じて、上述したRAMエミュレーショ
ンが実行されることとなる。
First, in the basic processing of the emulation check shown in FIG. 4, the CPU 11 executes step 2
At 01, based on the state of the emulation control flag of the flash memory control register 15, it is determined whether or not the emulation is currently being performed. Here, if it is determined that the emulation is not in progress, it is determined in step 202 whether or not the tool has instructed to start the emulation. If not, the process related to the emulation check is performed. Exit once. On the other hand, if the emulation start is instructed by the tool, in step 203, the address is registered in the emulation area register 14, and then the emulation control flag is set in the flash memory control register 15. In this case, thereafter, the RAM emulation described above is executed through the adaptation process of the engine control program (step 102 in FIG. 3).

【0047】一方、上記ステップ201において、エミ
ュレーション中である旨判断される場合、CPU11
は、ステップ204にて、フラッシュメモリ制御レジス
タ15の上記書き込みフラグの状態に基づき、フラッシ
ュメモリ13に対するデータの書き込み中であるか否か
を判断する。ここで、書き込み中ではない旨判断される
場合には、ステップ205にて、同書き込みの開始が上
記ツールにより指示されているか否かを判断し、指示さ
れていれば、ステップ206にて、フラッシュメモリ制
御レジスタ15に上記書き込みフラグをセットする。こ
の場合にはその後、ステップ207として、フラッシュ
メモリ消去及び書き込みチェックに移行する。このフラ
ッシュメモリ消去及び書き込みチェックについては、図
5にその一例を示しており、後に同図5を併せ参照して
詳述する。
On the other hand, if it is determined in step 201 that emulation is in progress, the CPU 11
At step 204, it is determined whether or not data is being written to the flash memory 13 based on the state of the write flag of the flash memory control register 15. Here, if it is determined that the writing is not being performed, it is determined in step 205 whether or not the start of the writing is instructed by the tool, and if it is instructed, a flash is performed in step 206. The write flag is set in the memory control register 15. In this case, after that, as step 207, the process shifts to the flash memory erase and write check. FIG. 5 shows an example of this flash memory erasing and writing check, and will be described later in detail with reference to FIG.

【0048】また、上記ステップ204において、フラ
ッシュメモリ13への書き込み中である旨判断される場
合、CPU11は、ステップ208にて、同書き込みの
終了指示が上記ツールから出されているか否かを判断
し、該終了指示が出されていなければ、ステップ209
として、フラッシュメモリ消去及び書き込みチェック
(図5)に移行する。他方、同ステップ208におい
て、上記書き込み終了指示が出されている旨判断される
場合には、ステップ210にて、フラッシュメモリ制御
レジスタ15の上記セットした書き込みフラグをクリア
して、同エミュレーションチェックにかかる処理を一旦
抜ける。
If it is determined in step 204 that writing to the flash memory 13 is in progress, the CPU 11 determines in step 208 whether or not the writing end instruction has been issued from the tool. If the end instruction is not issued, step 209
As a result, the flash memory erase and write check (FIG. 5) is performed. On the other hand, if it is determined in the same step 208 that the write end instruction has been issued, the set write flag of the flash memory control register 15 is cleared in step 210 and the emulation check is started. Exit the process once.

【0049】また一方、上記ステップ205において、
フラッシュメモリ13への書き込み開始が指示されてい
ない旨判断される場合、CPU11は更に、ステップ2
11にて、当該エミュレーションの終了が同ツールを通
じて指示されていないか否かを判断する。そして、該エ
ミュレーションの終了が指示されていれば、ステップ2
12にて、フラッシュメモリ制御レジスタ15の上記セ
ットしたエミュレーション制御フラグをクリアして、ま
た同終了が指示されていなければそのまま、同エミュレ
ーションチェックにかかる処理を一旦抜ける。
On the other hand, in step 205,
When it is determined that the writing start to the flash memory 13 is not instructed, the CPU 11 further executes step 2
At 11, it is judged whether the end of the emulation is instructed through the tool. If the end of the emulation is instructed, step 2
In step 12, the emulation control flag set in the flash memory control register 15 is cleared, and if the end is not instructed, the process related to the emulation check is temporarily exited.

【0050】この実施例のマイクロコンピュータ10に
おいてはこのように、或いは図2を参照して既に説明し
たように、フラッシュメモリ13のあるブロックについ
てのエミュレーション実行中にのみ、同ブロックに関す
るデータの書き込みができるようになっている。
In the microcomputer 10 of this embodiment, as described above, or as already described with reference to FIG. 2, only during emulation of a certain block of the flash memory 13, writing of data relating to the same block is possible. You can do it.

【0051】次に、上記ステップ207或いはステップ
209にかかる該フラッシュメモリ13の消去及び書き
込みチェック処理の一例について、図5を併せ参照して
説明する。
Next, an example of the erase and write check processing of the flash memory 13 in step 207 or step 209 will be described with reference to FIG.

【0052】なおこの消去及び書き込みチェックは、上
記エミュレーションチェックにおいてフラッシュメモリ
制御レジスタ15に上記書き込みフラグがセットされる
ことにより、ツール側のプログラムに基づき、フラッシ
ュメモリ制御回路16を通じて自動実行される。またこ
の際、フラッシュメモリ13の該消去及び書き込みの行
われるブロックのみに、同フラッシュメモリ制御回路1
6を通じて、消去及び書き込み用電圧Vppが印加される
ようになることは上述した通りである。
The erase and write check is automatically executed through the flash memory control circuit 16 based on the program on the tool side by setting the write flag in the flash memory control register 15 in the emulation check. At this time, the flash memory control circuit 1 is provided only in the block of the flash memory 13 in which the erasing and writing are performed.
As described above, the erasing and writing voltage Vpp is applied through 6.

【0053】さて、同図5に示される消去及び書き込み
チェック処理において、ツール側のプログラムはまず、
ステップ301にて、フラッシュメモリ13が消去中で
あるか否かを判断する。そして、消去中である旨判断さ
れる場合には、次のステップ302にて、同フラッシュ
メモリ13に消去エラーが起こっていないか否かを更に
判断し、エラーがなければ同消去及び書き込みチェック
にかかる処理を一旦抜ける(エンジン制御プログラムに
処理を一旦返す)。同ステップ302において消去エラ
ーである旨判断される場合には、ステップ303にて、
プログラム自らソフトウェア的にエラーフラグをセット
するなどして、同処理を抜ける。なお、こうしてエラー
フラグがセットされる場合、当該マイクロコンピュータ
10は、チップ不良として処分される。
In the erase and write check process shown in FIG. 5, the program on the tool side first
In step 301, it is determined whether the flash memory 13 is being erased. If it is determined that the flash memory 13 is being erased, it is further determined in the next step 302 whether or not an erase error has occurred in the flash memory 13. If there is no error, the same erase and write check is performed. The processing is once exited (the processing is once returned to the engine control program). If it is determined in step 302 that there is an erasing error, in step 303
The program itself sets the error flag by software and exits the processing. When the error flag is set in this way, the microcomputer 10 is disposed of as a defective chip.

【0054】一方、上記ステップ301において、消去
中ではない旨判断される場合、上記プログラムは次に、
ステップ304にて、フラッシュメモリ13へのデータ
書き込み中であるか否かを判断する。そして現在、デー
タ書き込み中でなければ、次のステップ305にて、デ
ータ書き込みが未だ終了していない旨判断されることを
条件に、ステップ306にて、次データ(例えばバイト
とかワードとかを単位とする次のデータ)の書き込みを
開始する。上記ステップ305において、当該ブロック
に関する全てのデータの書き込みが終了した旨判断され
る場合には、ステップ307にてプログラム自らソフト
ウェア的に終了フラグをセットするなどして、同処理を
一旦抜ける。
On the other hand, if it is determined in step 301 that the erasure is not being performed, then the program
In step 304, it is determined whether data is being written to the flash memory 13. If data writing is not currently being performed, the next data (for example, byte or word) is set as a unit in step 306, provided that it is determined in the next step 305 that the data writing is not yet completed. Start writing the next data). When it is determined in step 305 that writing of all data regarding the block has been completed, the program temporarily sets the end flag by software in step 307, and the process is temporarily exited.

【0055】また、上記ステップ304において、現在
データ書き込み中である旨判断される場合、同プログラ
ムは、ステップ308にて、同フラッシュメモリ13に
書き込みエラーが起こっていないか否かを判断し、エラ
ーがなければ、同チェックにかかる処理を一旦抜ける。
このステップ308において、書き込みエラーである旨
判断される場合には、ステップ309にて、この場合も
プログラム自らソフトウェア的にエラーフラグをセット
するなどして、同処理を抜ける。エラーフラグがセット
される場合、チップ不良として処分されるようになるこ
とはこの場合も同様である。
If it is determined in step 304 that data is being written, the program determines in step 308 whether a write error has occurred in the flash memory 13 and an error is detected. If not, the process related to the check is temporarily exited.
If it is determined in step 308 that there is a write error, in step 309 the program itself also sets an error flag by software, and the process is exited. In this case as well, when the error flag is set, the chip is discarded as a defective chip.

【0056】なお、フラッシュメモリ13の上述した消
去エラーや書き込みエラーについての検出手法は任意で
ある。通常はベリファイ処理を併用し、NG回数が所定
回数以上となるとき、それら消去或いは書き込みエラー
として判断する。
The method of detecting the above-mentioned erase error and write error of the flash memory 13 is arbitrary. Normally, verify processing is also used together, and when the number of NG times is a predetermined number or more, it is judged as an erase or write error.

【0057】以上のように、同実施例のフラッシュメモ
リ内蔵マイクロコンピュータ10によれば、エンジン等
のリアルタイムでの制御中であっても、その内蔵フラッ
シュメモリ13のデータ書き換えを行うことができる。
As described above, according to the flash memory built-in microcomputer 10 of the embodiment, the data in the built-in flash memory 13 can be rewritten even during real-time control of the engine or the like.

【0058】しかも、このようなエンジン等の制御並び
にデータの書き換えは、同マイクロコンピュータ10の
シングルチップ動作において実現されることから、該チ
ップを搭載した電子制御装置の試作時であれ、或いは量
産時であれ、先の図6(b)に示されるような形態での
同一の装置としてこれを構成することができ、ひいては
その開発にかかる工数を大幅に削減することができるよ
うになる。
Moreover, since the control of the engine and the rewriting of data are realized by the single-chip operation of the microcomputer 10, the electronic control device having the chip mounted therein may be prototyped or mass-produced. However, this can be configured as the same device in the form as shown in FIG. 6 (b) above, and the number of man-hours required for its development can be greatly reduced.

【0059】また、同実施例のマイクロコンピュータ1
0の上記構成によれば、量産された電子制御装置の適合
データ再調整が必要とされる場合でも、これに容易に対
処することができ、逆に、例えば車両への搭載検討や耐
久試験等、同電子制御装置の最終形状での検討も、その
試作段階で可能になる。
Further, the microcomputer 1 of the same embodiment
According to the above configuration of 0, even if it is necessary to readjust the adaptive data of the mass-produced electronic control device, this can be easily dealt with, and conversely, for example, consideration of installation in a vehicle or durability test, etc. It is also possible to study the final shape of the electronic control unit at the prototype stage.

【0060】また、同実施例のマイクロコンピュータ1
0では上述のように、エミュレーション実行中にのみ、
フラッシュメモリ13のデータ書き換えを行うことがで
きるようになっている。このため、データの誤った書き
戻しが行われることもなく、該データ書き換えにかかる
処理が円滑に実行されるようになる。
Further, the microcomputer 1 of the same embodiment
0, as described above, only during emulation execution
The data in the flash memory 13 can be rewritten. For this reason, the data rewriting is not erroneously performed, and the process for rewriting the data can be smoothly performed.

【0061】なお、以上の説明では、フラッシュメモリ
13の一部のデータを書き換える場合についてのみ言及
したが、フラッシュメモリ13の全領域についてそのデ
ータ書き換えを行うこともできる。すなわちこの場合、
上記エンジン等のリアルタイム制御中である必要はない
ため、 (a)フラッシュメモリ13の全体を消去する。 (b)ツールからRAM12にデータを一旦転送し、上
記フラッシュメモリ制御レジスタ15及びフラッシュメ
モリ制御回路16を通じて、このRAM12への転送デ
ータを順次書き込む。 といった手順によって、該フラッシュメモリ13の全領
域についてのデータ書き換えが実現される。
In the above description, only the case where a part of the data in the flash memory 13 is rewritten has been described, but the data can be rewritten in the entire area of the flash memory 13. That is, in this case,
Since it is not necessary to perform real-time control of the engine or the like, (a) the entire flash memory 13 is erased. (B) Data is temporarily transferred from the tool to the RAM 12, and the transfer data to the RAM 12 is sequentially written through the flash memory control register 15 and the flash memory control circuit 16. By this procedure, data rewriting for the entire area of the flash memory 13 is realized.

【0062】また、上記実施例においては、データの転
送サイズ、並びに適合におけるデータ書き換え頻度を考
慮して、上記エミュレーション並びにそのデータの書き
戻しを128バイト単位にて行うようにした。ただし、
この発明にかかるマイクロコンピュータが、このような
データ単位での処理に限られるものでないことは勿論で
あり、こうしたエミュレーション並びにデータの書き戻
しは、64バイト単位、或いは256バイト単位等、任
意の単位にて行うことができる。
Further, in the above-described embodiment, the emulation and the write-back of the data are performed in units of 128 bytes in consideration of the data transfer size and the data rewriting frequency in the adaptation. However,
It goes without saying that the microcomputer according to the present invention is not limited to the processing in such a data unit, and such emulation and data write-back can be performed in an arbitrary unit such as a 64-byte unit or a 256-byte unit. Can be done by

【0063】また同実施例のマイクロコンピュータ10
においては、エミュレーション領域レジスタ14にオー
バーラップされる各領域のアドレスをセットし、フラッ
シュメモリ制御レジスタ15にエミュレーションや書き
込みを制御するためのフラグをセットするようにした
が、こうしたレジスタの構成も任意である。
Further, the microcomputer 10 of the same embodiment.
In the above, the address of each area to be overlapped is set in the emulation area register 14, and the flag for controlling emulation and writing is set in the flash memory control register 15, but the configuration of such a register is also optional. is there.

【0064】すなわち、前述したエミュレーション、並
びにフラッシュメモリ13のデータ書き換えを実現する
部分として要は、上記各領域のアドレスがセットされる
適宜のレジスタ手段に加え、他はフラグ使用の有無にか
かわらず、 ・フラッシュメモリ13の上記アドレス登録された領域
を論理的に切り離し、同アドレス登録されたRAM12
上の領域によって該切り離したフラッシュメモリ領域の
データをエミュレートする手段。 ・このエミュレートされたデータを、フラッシュメモリ
制御回路16を通じて同フラッシュメモリ13の当該領
域に書き戻す手段。を具えるものであればよい。
That is, as a part for realizing the above-mentioned emulation and data rewriting of the flash memory 13, in addition to the appropriate register means for setting the address of each area, other than that, regardless of whether or not the flag is used, The RAM 12 registered at the same address by logically separating the above-mentioned address registered area of the flash memory 13.
A means for emulating the data of the flash memory area separated by the area above. A means for writing back this emulated data to the relevant area of the flash memory 13 through the flash memory control circuit 16. Anything that includes

【0065】そして、少なくとも ・フラッシュメモリ13の所定領域を任意にブロック分
割して、これら分割したブロックのうちの消去及び書き
込み対象となるブロックにのみ消去及び書き込み用電圧
Vppを印加し、他のブロックには通常の読み出し用電圧
Vccを印加する手段。を具えるものでさえあれば、フラ
ッシュメモリ13に格納されている例えばエンジン制御
プログラムの実行中であっても、同フラッシュメモリ1
3内の任意のブロックについて、そのデータ書き換えを
行うことができるようになる。勿論、そのプログラムに
よる制御対象がエンジンである必要はない。
At least the predetermined area of the flash memory 13 is arbitrarily divided into blocks, and the erasing and writing voltage Vpp is applied only to the blocks to be erased and written among these divided blocks, and the other blocks are applied. Is a means for applying a normal read voltage Vcc. As long as it is equipped with the flash memory 1 even if the engine control program stored in the flash memory 13 is being executed.
It becomes possible to rewrite the data of any block in the block 3. Of course, the control target by the program does not need to be the engine.

【0066】[0066]

【発明の効果】以上説明したように、この発明のフラッ
シュメモリ内蔵マイクロコンピュータによれば、シング
ルチップ動作において、リアルタイム制御中に、その内
蔵するフラッシュメモリの書き換えを行うことができる
ようになる。
As described above, according to the microcomputer with a built-in flash memory of the present invention, it is possible to rewrite the built-in flash memory during real-time control in a single-chip operation.

【0067】そしてこのため、例えば同フラッシュメモ
リ内蔵マイクロコンピュータを搭載する電子制御装置の
開発並びに生産等に際しても、その試作時と量産時とで
同一の装置基板を用いる同一の装置構成とすることがで
き、その工数を大幅に削減することができるようにな
る。
Therefore, for example, even in the development and production of an electronic control device equipped with the same microcomputer with a built-in flash memory, the same device configuration may be used using the same device substrate during trial manufacture and mass production. It is possible to reduce the man-hours.

【0068】また、量産された電子制御装置の適合デー
タ再調整が必要とされる場合でも、これに容易に対処す
ることができ、また逆に、同装置の最終形状での検討
(例えば車両への搭載検討や耐久試験等)も、その試作
段階で可能になる。
Further, even when it is necessary to readjust the conformity data of the mass-produced electronic control device, this can be easily dealt with, and conversely, the final shape of the device can be examined (for example, to a vehicle). It is also possible at the trial production stage to study the mounting and durability test).

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

【図1】この発明のフラッシュメモリ内蔵マイクロコン
ピュータの一実施例を示すブロック図。
FIG. 1 is a block diagram showing an embodiment of a microcomputer with a built-in flash memory according to the present invention.

【図2】同マイクロコンピュータのエミュレーション実
行態様を示す略図。
FIG. 2 is a schematic diagram showing an emulation execution mode of the microcomputer.

【図3】エンジン制御プログラムの一例を示すフローチ
ャート。
FIG. 3 is a flowchart showing an example of an engine control program.

【図4】フラッシュメモリのエミュレーションチェック
手順を示すフローチャート。
FIG. 4 is a flowchart showing a flash memory emulation check procedure.

【図5】フラッシュメモリの消去及び書き込みチェック
手順を示すフローチャート。
FIG. 5 is a flowchart showing a procedure of erasing and writing check of the flash memory.

【図6】従来のフラッシュメモリ内蔵マイクロコンピュ
ータを採用した電子制御装置の試作時と量産時との装置
基板推移を示す略図。
FIG. 6 is a schematic diagram showing a transition of a device substrate between a prototype and a mass production of an electronic control device adopting a conventional microcomputer with a built-in flash memory.

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

1、10…フラッシュメモリ内蔵マイクロコンピュー
タ、2…装置基板、3…コネクタ、4…ポート代価I
C、5…外部メモリ、11…CPU、12…RAM、1
3…フラッシュメモリ、14…エミュレーション領域レ
ジスタ、15…フラッシュメモリ制御レジスタ、17
(17a〜17f)…アドレスバス、18(18a〜1
8f)…データバス、19…フラッシュメモリ制御バ
ス。
1, 10 ... Microcomputer with built-in flash memory, 2 ... Device substrate, 3 ... Connector, 4 ... Port price I
C, 5 ... External memory, 11 ... CPU, 12 ... RAM, 1
3 ... Flash memory, 14 ... Emulation area register, 15 ... Flash memory control register, 17
(17a to 17f) ... Address bus, 18 (18a to 1)
8f) ... Data bus, 19 ... Flash memory control bus.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】ワンチップマイクロコンピュータのプログ
ラム及びデータメモリとしてフラッシュメモリを内蔵し
たフラッシュメモリ内蔵マイクロコンピュータにおい
て、 前記フラッシュメモリの所定領域を所定数にブロック分
割して、これら分割したブロックのうち消去及び書き込
み対象となるブロックを他のブロックと分離してこれに
消去及び書き込み用電圧を印加し、他のブロックには通
常の読み出し用電圧を印加するフラッシュメモリ制御手
段を具えることを特徴とするフラッシュメモリ内蔵マイ
クロコンピュータ。
1. A microcomputer having a built-in flash memory as a program and data memory of a one-chip microcomputer, wherein a predetermined area of the flash memory is divided into a predetermined number of blocks, and erasing and A flash characterized by including a flash memory control unit for separating a block to be written from another block, applying an erase and write voltage to the block, and applying a normal read voltage to the other block. Microcomputer with built-in memory.
【請求項2】請求項1記載のフラッシュメモリ内蔵マイ
クロコンピュータにおいて、更に内蔵ランダムアクセス
メモリと、 前記フラッシュメモリの前記ブロック分割した任意領域
を該ランダムアクセスメモリの任意領域にオーバーラッ
プさせるべくそれら領域のアドレスが登録されるレジス
タ手段と、 前記フラッシュメモリの前記アドレス登録された領域を
論理的に切り離し、同アドレス登録された前記ランダム
アクセスメモリ上の領域によって該切り離したフラッシ
ュメモリ領域のデータをエミュレートするエミュレート
手段と、 このエミュレートされたデータを前記フラッシュメモリ
制御手段を通じて前記フラッシュメモリの当該領域に書
き戻す書き込み制御手段と、 を具えることを特徴とするフラッシュメモリ内蔵マイク
ロコンピュータ。
2. The microcomputer with a built-in flash memory according to claim 1, further comprising a built-in random access memory, and an arbitrary area of the flash memory divided into blocks so as to overlap the arbitrary area of the random access memory. The register means in which an address is registered and the address registered area of the flash memory are logically separated, and the area of the random access memory registered with the same address emulates the data of the separated flash memory area. A micro computer with a built-in flash memory, comprising: an emulation means; and a write control means for writing back the emulated data to the area of the flash memory through the flash memory control means. Data.
【請求項3】前記書き込み制御手段は、前記エミュレー
ト手段が能動となっているときにのみそのエミュレート
データの前記フラッシュメモリへの書き戻しが許可され
る請求項2記載のフラッシュメモリ内蔵マイクロコンピ
ュータ。
3. The microcomputer with built-in flash memory according to claim 2, wherein the write control means is allowed to write back the emulated data to the flash memory only when the emulation means is active. .
【請求項4】前記エミュレート手段によるエミュレー
ト、並びに前記書き込み制御手段による同エミュレート
データの書き戻しは、128バイトを単位として行われ
る請求項2記載のフラッシュメモリ内蔵マイクロコンピ
ュータ。
4. The microcomputer with a built-in flash memory according to claim 2, wherein the emulation by the emulation means and the writing back of the emulation data by the write control means are performed in units of 128 bytes.
JP6290118A 1994-11-24 1994-11-24 Microcomputer with built-in flash memory Pending JPH08147186A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6290118A JPH08147186A (en) 1994-11-24 1994-11-24 Microcomputer with built-in flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6290118A JPH08147186A (en) 1994-11-24 1994-11-24 Microcomputer with built-in flash memory

Publications (1)

Publication Number Publication Date
JPH08147186A true JPH08147186A (en) 1996-06-07

Family

ID=17752041

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6290118A Pending JPH08147186A (en) 1994-11-24 1994-11-24 Microcomputer with built-in flash memory

Country Status (1)

Country Link
JP (1) JPH08147186A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6324096B1 (en) 1999-09-09 2001-11-27 Oki Electric Industry Co., Ltd. Interface circuit and method for writing data into a non-volatile memory, and scan register
US6625060B2 (en) 2001-01-11 2003-09-23 Mitsubishi Denki Kabushiki Kaisha Microcomputer with efficient program storage

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6324096B1 (en) 1999-09-09 2001-11-27 Oki Electric Industry Co., Ltd. Interface circuit and method for writing data into a non-volatile memory, and scan register
US6442092B1 (en) 1999-09-09 2002-08-27 Oki Electric Industry Co., Ltd. Interface circuit and method for writing data into a non-volatile memory, and scan register
US6625060B2 (en) 2001-01-11 2003-09-23 Mitsubishi Denki Kabushiki Kaisha Microcomputer with efficient program storage

Similar Documents

Publication Publication Date Title
KR100508087B1 (en) System boot using nand flash memory and method thereof
RU2142168C1 (en) Method for complete rewriting of cleared non- volatile memory
EP0991081B1 (en) Emulated EEPROM memory device and corresponding method
EP1343082A2 (en) System boot using nand flash memory and method thereof
JP2007213571A (en) Method for starting system using direct memory access in novel memory architecture
JP2004118826A (en) System unit booted using flash memory, and its booting method
JP2000065899A (en) Semiconductor device, and its data rewriting method
CN111104064B (en) FLASH memory write protection processing method and device, computer equipment and medium
US7596036B2 (en) Memory control circuit, microcomputer, and data rewriting method
JPH08147186A (en) Microcomputer with built-in flash memory
JP2004005296A (en) Electronic control device
EP1619588B1 (en) Memory access
JP2907808B1 (en) Flash memory emulation device and debug system using the same
JP3127703B2 (en) Electronic control device including one-chip microcomputer and control data storage method thereof
JPH11184724A (en) In-circuit emulator and semiconductor integrated circuit
US6898680B2 (en) Minimization of overhead of non-volatile memory operation
JP2009223435A (en) Data storage method and device, and program
JPH08305680A (en) Semiconductor device
US7596717B2 (en) Microcomputer and debugging method
JP2001147863A (en) Flash memory rewrite device
JP3442972B2 (en) Information processing apparatus and rewritable nonvolatile memory rewriting method
JP2001125790A (en) Program reloading method for on-vehicle electronics
JP2004013338A (en) Data processor and method
JPH08286948A (en) Device and method for supporting software development
JP3535337B2 (en) Microcomputer emulator program loading device