JPH06111032A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH06111032A
JPH06111032A JP4283493A JP28349392A JPH06111032A JP H06111032 A JPH06111032 A JP H06111032A JP 4283493 A JP4283493 A JP 4283493A JP 28349392 A JP28349392 A JP 28349392A JP H06111032 A JPH06111032 A JP H06111032A
Authority
JP
Japan
Prior art keywords
data
address
latch
flash memory
circuit
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
JP4283493A
Other languages
Japanese (ja)
Inventor
Yukie Kuroda
幸枝 黒田
Hiroshi Ueki
浩 植木
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4283493A priority Critical patent/JPH06111032A/en
Publication of JPH06111032A publication Critical patent/JPH06111032A/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)

Abstract

PURPOSE:To easily execute rewriting and erasure of a program in a flash memory in a state mounted to a printed board by providing a serial input terminal and an SIO (serial data communication) circuit. CONSTITUTION:This microcomputer is provided with an input terminal 21 of a data rewriting permitting signal, an input terminal 22 of serial data, and an SIO circuit 23 for executing a series-parallel conversion of data inputted to the terminal 22. The SIO circuit 23 includes a receiving shift register 24 for the series-parallel conversion, and a receiving buffer 25 for storing temporarily received data. In such a state, the SIO circuit 23 converts series data inputted to the input terminal 22 to parallel data, and transfers the data to a command latch 14, an address latch 11, or a data latch 13 used by a control circuit 3 or a W-E-R(write-erasure-readout) circuit 2 under the control of the control circuit 3.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、フラッシュメモリを
内蔵したマイクロコンピュータに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer incorporating a flash memory.

【0002】[0002]

【従来の技術】図8は従来のフラッシュメモリを内蔵し
たワンチップマイクロコンピュータの主要部を示すブロ
ック図である。
2. Description of the Related Art FIG. 8 is a block diagram showing the main part of a conventional one-chip microcomputer incorporating a flash memory.

【0003】図において、1は電気的書き込み一括消去
可能読み出し専用メモリすなわちフラッシュメモリ、2
はフラッシュメモリ1に対する読み出し、消去および書
き込みを行う書き込み−消去−読み出し回路(以下、W
−E−R回路という。)、3はW−E−R回路2などを
制御する制御回路、4はアドレスバス5に接続された入
出力ポート、6はデータバス7に接続された入出力ポー
トである。なお、アドレスバス5およびデータバス7は
中央処理装置(CPU、図示せず)にも接続されてい
る。
In the drawing, reference numeral 1 is a read-only memory, that is, flash memory, which is capable of collectively erasing electrical writing.
Is a write-erase-read circuit (hereinafter, W) for reading, erasing and writing to the flash memory 1.
-E-R circuit. ) 3 is a control circuit for controlling the W-E-R circuit 2 and the like, 4 is an input / output port connected to the address bus 5, and 6 is an input / output port connected to the data bus 7. The address bus 5 and the data bus 7 are also connected to a central processing unit (CPU, not shown).

【0004】また、11はアドレスバス5上のアドレス
データをラッチするアドレスラッチ、12は連続する多
数のアドレスデータを生成するアドレス自動生成回路、
13はデータバス7上のデータをラッチするデータラッ
チ、14はデータバス7上のコマンドをラッチするコマ
ンドラッチ、33,34,36〜39はゲート、35は
W−E−R回路2のアドレス入力切り替えのためのスイ
ッチである。
Further, 11 is an address latch for latching address data on the address bus 5, 12 is an automatic address generation circuit for generating a large number of continuous address data,
Reference numeral 13 is a data latch for latching data on the data bus 7, 14 is a command latch for latching a command on the data bus 7, 33, 34, 36 to 39 are gates, 35 is an address input of the WER circuit 2. It is a switch for switching.

【0005】次に動作について説明する。まず、フラッ
シュメモリ1にデータを書き込む際の動作について説明
する。この場合、まず、書き込みを指定するコマンドと
書き込みデータとが順次外部から入出力ポート6に与え
られる。また、書き込みアドレスが入出力ポート4に与
えられる。
Next, the operation will be described. First, the operation when writing data to the flash memory 1 will be described. In this case, first, a command designating writing and write data are sequentially applied to the input / output port 6 from the outside. Further, the write address is given to the input / output port 4.

【0006】制御回路3は、入出力ポート6にコマンド
が与えられたときに、ゲート39を開け、さらに、ゲー
ト36,37を順次開ける。この結果、データバス7を
介して、コマンドはコマンドラッチ14に、書き込みデ
ータはデータラッチ13に転送される。また、制御回路
3は、ゲート38,34を開き、書き込みアドレスが、
アドレスバス5を介して、アドレスラッチ11に転送さ
れる。
When a command is given to the input / output port 6, the control circuit 3 opens the gate 39, and further sequentially opens the gates 36 and 37. As a result, the command is transferred to the command latch 14 and the write data is transferred to the data latch 13 via the data bus 7. Further, the control circuit 3 opens the gates 38 and 34, and the write address is
It is transferred to the address latch 11 via the address bus 5.

【0007】次に、制御回路3は、コマンドの内容に従
って、スイッチ35をアドレスラッチ11側に接続しW
−E−R回路2に書き込み制御信号を与える。W−E−
R回路2は、書き込み制御信号に従って、データラッチ
13にラッチされているデータを、アドレスラッチ11
にラッチされている書き込みアドレスに従ってフラッシ
ュメモリ1に書き込む。
Next, the control circuit 3 connects the switch 35 to the address latch 11 side in accordance with the content of the command and outputs W.
A write control signal is supplied to the E-R circuit 2. WE-
The R circuit 2 transfers the data latched in the data latch 13 to the address latch 11 according to the write control signal.
The flash memory 1 is written according to the write address latched in.

【0008】フラッシュメモリ1のブロック消去は以下
のように実行される。まず、ブロック消去を指定するコ
マンドが、外部から入出力ポート6に与えられる。ま
た、ブロック消去の対象となるアドレスの先頭アドレス
を示すスタートアドレスが入出力ポート4に与えられ
る。
The block erase of the flash memory 1 is executed as follows. First, a command for designating block erase is externally given to the input / output port 6. In addition, a start address indicating the start address of the block erase target address is given to the input / output port 4.

【0009】制御回路3は、ブロック消去を指定するコ
マンドが入出力ポート6に入力されたときに、ゲート3
9を開け、さらに、ゲート36を開ける。その結果、コ
マンドは、データバス7を介して、コマンドラッチ14
にラッチされる。また、制御回路3は、ゲート39,3
3を開ける。すると、スタートアドレスがアドレスバス
5を介してアドレス自動生成回路12に転送される。
The control circuit 3 controls the gate 3 when a command for designating block erase is input to the input / output port 6.
9 is opened, and further the gate 36 is opened. As a result, the command is transmitted via the data bus 7 to the command latch 14
Latched on. Further, the control circuit 3 includes gates 39 and 3
Open 3 Then, the start address is transferred to the address automatic generation circuit 12 via the address bus 5.

【0010】次に、制御回路3は、コマンドの内容に従
って、スイッチ35をアドレス自動生成回路12側に接
続しW−E−R回路2とアドレス自動生成回路12に制
御信号を与える。アドレス自動生成回路12は、その制
御信号に応じて、スタートアドレスが示すアドレスを先
頭とするアドレスを連続的に生成し、それらを順次W−
E−R回路2に供給する。また、W−E−R回路2は、
制御信号に応じて、ブロック消去の準備として、アドレ
ス自動生成回路12から供給される各アドレスを用い
て、フラッシュメモリ1のブロック内の全アドレスに書
き込みを行う。その書き込みが終了したら、W−E−R
回路2は、そのブロック内の全アドレスについて消去を
行う。
Next, the control circuit 3 connects the switch 35 to the address automatic generation circuit 12 side in accordance with the content of the command, and gives a control signal to the WER circuit 2 and the address automatic generation circuit 12. The address automatic generation circuit 12 continuously generates addresses starting with the address indicated by the start address in response to the control signal, and sequentially generates W-
It is supplied to the E-R circuit 2. In addition, the W-E-R circuit 2
In response to the control signal, as a preparation for block erasing, each address supplied from the automatic address generation circuit 12 is used to write to all addresses in the block of the flash memory 1. When the writing is completed, W-ER
The circuit 2 erases all the addresses in the block.

【0011】フラッシュメモリ1にプログラムデータが
書き込まれているマイクロコンピュータが印刷配線板
(プリント基板)に実装された後に、プログラムの書換
えを行う場合には、そのマイクロコンピュータがプリン
ト基板から外され、書換え器によって、フラッシュメモ
リ1の内容が書き換えられる。または、マイクロコンピ
ュータがプリント基板に実装された状態で、書換えのた
めのデータが入出力ポート6を介して供給されることに
よって、フラッシュメモリ1の内容が書き換えられる。
When rewriting the program after the microcomputer in which the program data is written in the flash memory 1 is mounted on the printed wiring board (printed circuit board), the microcomputer is removed from the printed circuit board and rewritten. The contents of the flash memory 1 are rewritten by the container. Alternatively, the contents of the flash memory 1 are rewritten by supplying data for rewriting through the input / output port 6 with the microcomputer mounted on the printed circuit board.

【0012】[0012]

【発明が解決しようとする課題】従来のフラッシュメモ
リを内蔵したマイクロコンピュータは以上のように構成
されているので、以下のような問題点があった。すなわ
ち、フラッシュメモリ1内のプログラムを書き換えよう
とする場合に、マイクロコンピュータをプリント基板か
ら外して書換えを行う方法によると、取り外しや再実装
の際に、集積回路のリード線やプリント基板のパターン
を損傷することが多い。特に、多端子型のフラットパケ
ージによるマイクロコンピュータにあっては、損傷の可
能性が大きく、現実にはこの方法によるプログラムの書
換えは困難である。また、プリント基板に実装したまま
で書換えを行う方法によると、入出力ポート6はプリン
ト基板上で他の回路に接続されているので書換えデータ
供給のためのラインが他の回路にも接続されることにな
り、他の回路が短絡状態になったり他の回路に過大な負
荷がかかる場合がある。
Since the conventional microcomputer having the built-in flash memory is configured as described above, it has the following problems. That is, in the case of rewriting the program in the flash memory 1, according to the method of rewriting by removing the microcomputer from the printed circuit board, the lead wire of the integrated circuit and the pattern of the printed circuit board are removed at the time of removal and remounting. Often damaged. In particular, a microcomputer with a multi-terminal flat package has a high possibility of damage, and it is actually difficult to rewrite a program by this method. Further, according to the method of rewriting while mounted on the printed board, since the input / output port 6 is connected to another circuit on the printed board, the line for supplying rewriting data is also connected to another circuit. As a result, other circuits may be short-circuited or overloaded to other circuits.

【0013】この発明は上記のような問題点を解消する
ためになされたもので、プリント基板に実装された状態
でフラッシュメモリに記憶されているプログラムを容易
に書換えることのできるマイクロコンピュータを得るこ
とを目的とする。
The present invention has been made to solve the above problems, and provides a microcomputer capable of easily rewriting a program stored in a flash memory mounted on a printed circuit board. The purpose is to

【0014】[0014]

【課題を解決するための手段】請求項1記載の発明に係
るマイクロコンピュータは、フラッシュメモリを内蔵
し、フラッシュメモリに対する書き込みまたは消去を指
定するコマンドを保持するコマンドラッチと、フラッシ
ュメモリに対する書き込みデータを保持するデータラッ
チと、フラッシュメモリの書き込みまたは消去対象のア
ドレスを保持するアドレスラッチと、アドレスラッチ内
のアドレスデータに従ってフラッシュメモリに対するデ
ータラッチ内のデータの書き込みまたはフラッシュメモ
リの消去を行うW−E−R回路と、コマンドラッチ内の
データに従って書き込みまたは消去の指示をW−E−R
回路に与える制御回路とを備え、さらに、コマンド、ア
ドレスデータおよび書き込みデータ入力用のシリアル入
力端子と、シリアル入力端子に与えられたデータを並列
変換してコマンドラッチ、アドレスラッチまたはデータ
ラッチに供給するシリアルデータ通信回路とを備えたも
のである。
According to a first aspect of the present invention, there is provided a microcomputer including a flash memory, a command latch for holding a command for designating writing or erasing of the flash memory, and write data for the flash memory. A data latch to hold, an address latch to hold an address to be written to or erased from the flash memory, and write data in the data latch to the flash memory or erase the flash memory according to the address data in the address latch W-E- R-circuit and write or erase instruction according to the data in the command latch W-ER
And a control circuit to be supplied to the circuit, and further, serial input terminals for inputting command, address data and write data, and data supplied to the serial input terminals are converted into parallel and supplied to a command latch, an address latch or a data latch. And a serial data communication circuit.

【0015】請求項2記載の発明に係るマイクロコンピ
ュータは、請求項1記載の発明に係るマイクロコンピュ
ータにおいて、さらに、シリアルデータ通信回路に受信
シフトレジスタとともに設けられた受信シフトレジスタ
が空でないときに、送信開始禁止信号を外部に出力する
送信開始禁止信号発生回路を備えたものである。
A microcomputer according to a second aspect of the present invention is the microcomputer according to the first aspect of the present invention, further comprising: when the receive shift register provided together with the receive shift register in the serial data communication circuit is not empty, A transmission start prohibition signal generation circuit for outputting a transmission start prohibition signal to the outside is provided.

【0016】請求項3記載の発明に係るマイクロコンピ
ュータは、請求項1記載の発明に係るマイクロコンピュ
ータにおいて、さらに、アドレスデータが連続書き込み
の先頭アドレスを示すものである場合にその先頭アドレ
スから始まる連続アドレスを生成してW−E−R回路に
供給するアドレス自動生成回路を備えたものである
The microcomputer according to a third aspect of the present invention is the microcomputer according to the first aspect of the present invention, further, in the case where the address data indicates a start address of continuous writing, the start is continued from the start address. An automatic address generation circuit for generating an address and supplying it to the W-E-R circuit is provided.

【0017】そして、請求項4記載の発明に係るマイク
ロコンピュータは、アドレスデータが通過するアドレス
バスと、データが通過するデータバスと、複数のフラッ
シュメモリと、フラッシュメモリに対する書き込みまた
は消去を指定するコマンドを保持するコマンドラッチ
と、フラッシュメモリに対する書き込みデータを保持す
る複数のデータラッチと、各フラッシュメモリの書き込
みまたは消去対象のアドレスを保持する複数のアドレス
ラッチと、アドレスラッチ内のアドレスデータに従って
フラッシュメモリに対する前記データラッチ内のデータ
の書き込みまたはフラッシュメモリの消去を行う複数の
W−E−R回路と、コマンドラッチ内のデータに従って
書き込みまたは消去の指示をW−E−R回路に与える制
御回路と、コマンド、アドレスデータおよび書き込みデ
ータ入力用のシリアル入力端子と、シリアル入力端子に
与えられたデータを並列変換してコマンドラッチ、アド
レスラッチまたはデータラッチに供給するシリアルデー
タ通信回路と、各W−E−R回路のうちの1つのW−E
−R回路がそれに対応するフラッシュメモリをアクセス
しているときにCPUのそのフラッシュメモリに対する
アクセスを禁止するメモリアクセス禁止回路と、シリア
ルデータ通信回路からアドレスバスまたはデータバスを
介してコマンドラッチ、アドレスラッチまたはデータラ
ッチにデータが転送されているときにCPUのアドレス
バスおよびデータバスのアクセスを禁止するバスアクセ
ス禁止回路とを備えたものである。
A microcomputer according to a fourth aspect of the present invention is directed to an address bus through which address data passes, a data bus through which data passes, a plurality of flash memories, and a command for designating writing or erasing to the flash memories. Command latch that holds the data, multiple data latches that hold the write data to the flash memory, multiple address latches that hold the write or erase target address of each flash memory, and the flash memory according to the address data in the address latch. A plurality of W-E-R circuits for writing data in the data latch or erasing the flash memory; a control circuit for giving a write or erase instruction to the W-E-R circuit according to the data in the command latch; A serial input terminal for inputting address data and write data, a serial data communication circuit for parallel-converting data supplied to the serial input terminal and supplying the data to a command latch, an address latch or a data latch, and each W-E-R circuit One of the WE
-A memory access prohibition circuit that prohibits the CPU from accessing the flash memory when the R circuit is accessing the corresponding flash memory, and a command latch or address latch from the serial data communication circuit via the address bus or the data bus. Alternatively, it is provided with a bus access prohibition circuit that prohibits access to the address bus and data bus of the CPU when data is being transferred to the data latch.

【0018】[0018]

【作用】請求項1記載の発明におけるシリアルデータ通
信回路は、シリアル入力端子に入力された直列データを
並列データに変換し、制御回路の制御のもとに、制御回
路またはW−E−R回路が使用するコマンドラッチ、ア
ドレスラッチまたはデータラッチにデータを転送する。
According to the first aspect of the invention, the serial data communication circuit converts serial data input to the serial input terminal into parallel data, and under the control of the control circuit, the control circuit or the W-E-R circuit. Transfer data to the command latch, address latch or data latch used by the.

【0019】請求項2記載の発明における受信シフトレ
ジスタおよび受信バッファは、外部からのデータ書換え
に関するデータを先取り受信し、データ書換えに要する
時間を短縮する。また、送信開始禁止信号発生回路は、
受信シフトレジスタへのデータ上書きを防止する。
The reception shift register and the reception buffer according to the second aspect of the present invention pre-receives data relating to data rewriting from the outside, and shortens the time required for data rewriting. Further, the transmission start prohibition signal generation circuit is
Prevents overwriting of data in the receive shift register.

【0020】請求項3記載の発明におけるアドレス自動
生成回路は、フラッシュメモリの連続したアドレスのデ
ータを書換えるときに、書換え対象の連続したアドレス
を生成する。
According to the third aspect of the present invention, the automatic address generation circuit generates a continuous address to be rewritten when rewriting continuous address data in the flash memory.

【0021】そして、請求項4記載の発明における二重
化されたフラッシュメモリおよびW−E−R回路、なら
びにメモリアクセス禁止回路およびバスアクセス禁止回
路は、1つのフラッシュメモリがデータ書換えまたは消
去の対象になっているときに、CPUがその動作と競合
せずに他のフラッシュメモリに対するアクセスを可能に
する。
In the duplicated flash memory and W-E-R circuit, and the memory access prohibition circuit and the bus access prohibition circuit in the invention of claim 4, one flash memory is the object of data rewriting or erasing. The CPU allows access to other flash memory without competing with its operation.

【0022】[0022]

【実施例】【Example】

実施例1.図1はこの発明の一実施例によるフラッシュ
メモリを内蔵したワンチップマイクロコンピュータの主
要部を示すブロック図である。図において、21はデー
タ書換え許可信号の入力端子、22はシリアルデータの
入力端子(シリアル入力端子)、23は入力端子22に
入力されたデータの直列−並列変換を行うシリアルデー
タ通信回路(以下、SIO回路という。)であり、直列
−並列変換のための受信シフトレジスタ24および受信
したデータを一時格納する受信バッファ25を含む。
Example 1. FIG. 1 is a block diagram showing the main part of a one-chip microcomputer incorporating a flash memory according to an embodiment of the present invention. In the figure, 21 is an input terminal for a data rewrite permission signal, 22 is an input terminal for serial data (serial input terminal), and 23 is a serial data communication circuit that performs serial-parallel conversion of data input to the input terminal 22 (hereinafter, referred to as SIO circuit) and includes a reception shift register 24 for serial-parallel conversion and a reception buffer 25 for temporarily storing received data.

【0023】また、26は送信開始禁止信号発生回路
(以下、BUSY回路という。)、27は送信開始禁止
信号(以下、BUSY信号という。)の出力端子であ
る。その他のものは同一符号を付して図8に示したもの
と同一のものである。
Reference numeral 26 is a transmission start prohibition signal generation circuit (hereinafter referred to as BUSY circuit), and 27 is an output terminal of a transmission start prohibition signal (hereinafter referred to as BUSY signal). Others are the same as those shown in FIG. 8 with the same reference numerals.

【0024】次に動作について説明する。まず、フラッ
シュメモリ1のあるアドレスへのデータの書き込みにつ
いて説明する。この場合、入力端子22を介してSIO
回路23に与えられるシリアルデータは、図2に示すよ
うに、コマンドデータ、上位アドレスデータ、下位アド
レスデータおよび書き込みデータで構成される。各デー
タは、例えばそれぞれ8ビット長である。また、各デー
タを転送する際の通信方式として、図3に示すようなス
タートビットおよびストップビットを付加した調歩同期
式が一般に採用される。
Next, the operation will be described. First, the writing of data to a certain address in the flash memory 1 will be described. In this case, SIO via the input terminal 22
As shown in FIG. 2, the serial data supplied to the circuit 23 is composed of command data, upper address data, lower address data, and write data. Each data has a length of 8 bits, for example. Further, as a communication method for transferring each data, an asynchronous method with a start bit and a stop bit as shown in FIG. 3 is generally adopted.

【0025】コマンドデータによるコマンドは、書き込
みまたは消去の命令を選択するためのものであるが、こ
の場合は書き込み動作が実行されるので、書き込み命令
を示す。また、上位アドレスと下位アドレスによるアド
レスデータは、フラッシュメモリ1のアドレスを指定す
るものであり、図2に示す例では、216までのアドレス
指定が可能である。
The command based on the command data is for selecting an instruction for writing or erasing. In this case, since the writing operation is executed, it indicates a writing instruction. Further, the address data by the upper address and the lower address specifies the address of the flash memory 1, and in the example shown in FIG. 2, up to 2 16 addresses can be specified.

【0026】外部からデータ書換え許可信号が入力端子
21に与えられると、SIO回路23内のゲートが開
き、SIO回路23はデータを受け入れられる状態にな
る。また、制御回路3は、ゲート38,39を閉じて入
出力ポート4,6からのフラッ0シュメモリ1の内容書
換えを禁止する状態とする。ここで、コマンドデータが
入力端子22からSIO回路23に与えられると、SI
O回路23は、そのコマンドデータに付属するスタート
ビットを検出する。そして、それに続く8ビットのデー
タを受信シフトレジスタ24に順次与える。
When a data rewrite permission signal is externally applied to the input terminal 21, the gate in the SIO circuit 23 is opened and the SIO circuit 23 is ready to receive data. Further, the control circuit 3 closes the gates 38 and 39 to set the state in which the rewriting of the contents of the flash memory 1 from the input / output ports 4 and 6 is prohibited. Here, if command data is applied to the SIO circuit 23 from the input terminal 22, SI
The O circuit 23 detects the start bit attached to the command data. Then, the subsequent 8-bit data is sequentially given to the reception shift register 24.

【0027】また、SIO回路23は、スタートビット
を検出すると、BUSY回路26にその旨を伝える。B
USY回路26は、それに応じてBUSY信号を出力端
子27から出力する。SIO回路23は、ストップビッ
トを検出すると、受信バッファ25が空ならば、受信シ
フトレジスタ24内のデータすなわちコマンドデータを
受信バッファ25に転送する。このとき、SIO回路2
3は、コマンドデータの受信完了を示す受信完了信号を
制御回路3およびBUSY回路26に送る。すると、B
USY回路26はBUSY信号の出力をやめる。外部の
回路は、BUSY信号のオフを検出して受信シフトレジ
スタ24の空を知り、次のデータの送信の可能状態にな
ったことを検知する。また、制御回路3は、受信完了信
号を受けるとゲート32,36を開ける。よって、受信
バッファ25内のデータは、データバス7を介してコマ
ンドラッチ14に転送される。
When the SIO circuit 23 detects the start bit, the SIO circuit 23 informs the BUSY circuit 26 accordingly. B
The USY circuit 26 outputs the BUSY signal from the output terminal 27 accordingly. When the SIO circuit 23 detects the stop bit and the reception buffer 25 is empty, the SIO circuit 23 transfers the data in the reception shift register 24, that is, the command data, to the reception buffer 25. At this time, the SIO circuit 2
3 sends a reception completion signal indicating the completion of reception of the command data to the control circuit 3 and the BUSY circuit 26. Then B
The USY circuit 26 stops outputting the BUSY signal. The external circuit detects that the BUSY signal is off, knows that the reception shift register 24 is empty, and detects that the next data can be transmitted. Further, the control circuit 3 opens the gates 32 and 36 when receiving the reception completion signal. Therefore, the data in the reception buffer 25 is transferred to the command latch 14 via the data bus 7.

【0028】以後、同様にして、外部から順次上位アド
レスデータ、下位アドレスデータおよび書き込みデータ
が入力端子22を介してSIO回路23に送信される。
上位アドレスデータおよび下位アドレスデータは、ゲー
ト31、アドレスバス5およびゲート34を介して受信
バッファ25からアドレスラッチ11に転送され、書き
込みデータはゲート32、データバス7およびゲート3
7を介してデータラッチ13に転送される。
Thereafter, similarly, the upper address data, the lower address data and the write data are sequentially transmitted from the outside to the SIO circuit 23 via the input terminal 22.
The upper address data and the lower address data are transferred from the reception buffer 25 to the address latch 11 via the gate 31, the address bus 5 and the gate 34, and the write data is the gate 32, the data bus 7 and the gate 3.
7 is transferred to the data latch 13.

【0029】書き込みデータがデータラッチ13にラッ
チされると、制御回路3は、スイッチ35をアドレスラ
ッチ11側に接続しW−E−R回路2に書き込み制御信
号を与える。W−E−R回路2は、書き込み制御信号に
従って、データラッチ13にラッチされているデータ
を、アドレスラッチ11にラッチされている書き込みア
ドレスに従ってフラッシュメモリ1に書き込む。W−E
−R回路2は、書き込みを行うと、そのアドレスのデー
タを読み出して正常に書き込みがなされたかどうか判定
する。そして、正常に書き込みがなされなかったと判定
した場合には、正常に書き込みが行われるまでその書き
込みデータの書き込みを繰り返す。
When the write data is latched by the data latch 13, the control circuit 3 connects the switch 35 to the address latch 11 side and gives a write control signal to the WR circuit 2. The W-E-R circuit 2 writes the data latched in the data latch 13 into the flash memory 1 according to the write address latched in the address latch 11 according to the write control signal. WE
When writing, the R circuit 2 reads the data at the address and determines whether the writing has been performed normally. Then, when it is determined that the writing is not normally performed, the writing of the write data is repeated until the writing is normally performed.

【0030】W−E−R回路2が書き込みを完了する前
に、外部から次のデータ書換えのためのデータが送られ
た場合には、それらのデータは受信シフトレジスタ24
および受信バッファ25に保持される。W−E−R回路
2の書き込み動作に比べて次のデータ転送が極めて速い
場合には次のコマンドデータが受信バッファ25に、そ
のコマンドに続く上位アドレスが受信シフトレジスタ2
3に保持された状態でBUSY信号が出力されたままに
なっている(図4参照)。W−E−R回路2は、正常に
データの書き込みが終了したと判断すると、書き込み終
了信号を制御回路3に送る。
If data for rewriting the next data is sent from the outside before the W-E-R circuit 2 completes writing, these data are received.
And held in the reception buffer 25. When the next data transfer is extremely fast as compared to the write operation of the W-E-R circuit 2, the next command data is stored in the reception buffer 25, and the upper address following the command is stored in the reception shift register 2.
The BUSY signal is still output while being held at 3 (see FIG. 4). When the W-E-R circuit 2 determines that the data writing is normally completed, it sends a write completion signal to the control circuit 3.

【0031】制御回路3は、書き込み終了信号を受ける
と、受信バッファ25にデータがあればゲート32,3
6を開けて受信バッファ25内のデータをコマンドラッ
チ14に送る。そして、受信シフトレジスタ24に8ビ
ットのデータが揃っていれば、空になった受信バッファ
25に受信シフトレジスタ24内のデータが転送され
る。このとき、受信シフトレジスタ24は空になるの
で、BUSY回路26は、BUSY信号の出力を停止す
る。以下、外部から続くデータが順次送信されてデータ
の書換えが続行される。
When the control circuit 3 receives the write end signal, if there is data in the reception buffer 25, the gates 32, 3
6 is opened and the data in the reception buffer 25 is sent to the command latch 14. If the reception shift register 24 has 8-bit data, the data in the reception shift register 24 is transferred to the empty reception buffer 25. At this time, since the reception shift register 24 becomes empty, the BUSY circuit 26 stops outputting the BUSY signal. After that, the data continuing from the outside is sequentially transmitted and the rewriting of the data is continued.

【0032】実施例2.次に、フラッシュメモリ1の連
続したアドレスに対するデータ書き込みについて説明す
る。外部からは、図5に示すようなデータが順次入力端
子22に与えられる。この場合、コマンドデータは連続
書き込み命令を指定するものである。また、上位スター
トアドレスデータは書き込み開始アドレスの上位を示す
ものであり、下位スタートアドレスデータは書き込み開
始アドレスの下位を示すものである。そして、バイト数
データは連続書き込みの対象になるフラッシュメモリ1
のアドレス数を示す。バイト数データがnを示していれ
ば、バイト数データに続いてn個の書き込みデータが続
いて送信される。
Example 2. Next, data writing to consecutive addresses of the flash memory 1 will be described. From the outside, data as shown in FIG. 5 is sequentially applied to the input terminal 22. In this case, the command data specifies a continuous write command. The upper start address data indicates the upper side of the write start address, and the lower start address data indicates the lower side of the write start address. The byte number data is the flash memory 1 that is the target of continuous writing.
Indicates the number of addresses. If the number-of-bytes data indicates n, then n pieces of write data are transmitted subsequently to the number-of-bytes data.

【0033】次に動作について図1を参照して説明す
る。実施例1の場合と同様に、外部からデータ書換え許
可信号が入力端子21に与えられると、SIO回路23
はデータを受け入れられる状態になる。また、制御回路
3は、ゲート38,39を閉じて入出力ポート4,6か
らのフラッシュメモリ1の内容書換えを禁止する状態と
する。コマンドデータが入力端子22からSIO回路2
3に与えられると、SIO回路23は、そのコマンドデ
ータに付属するスタートビットを検出する。そして、そ
れに続く8ビットのデータを受信シフトレジスタ24に
順次与える。
Next, the operation will be described with reference to FIG. Similar to the case of the first embodiment, when the data rewrite permission signal is externally applied to the input terminal 21, the SIO circuit 23
Is ready to accept data. Further, the control circuit 3 closes the gates 38 and 39 to prohibit the rewriting of the contents of the flash memory 1 from the input / output ports 4 and 6. Command data is input from the input terminal 22 to the SIO circuit 2
3, the SIO circuit 23 detects the start bit attached to the command data. Then, the subsequent 8-bit data is sequentially given to the reception shift register 24.

【0034】SIO回路23がスタートビットを検出す
ると、BUSY回路26は、それに応じてBUSY信号
を出力端子27から出力する。SIO回路23は、スト
ップビットを検出すると、受信シフトレジスタ24内の
コマンドデータを受信バッファ25に転送する。また、
制御回路3は、ゲート32,36を開け、受信バッファ
25内のデータは、データバス7を介してコマンドラッ
チ14に転送される。
When the SIO circuit 23 detects the start bit, the BUSY circuit 26 outputs the BUSY signal from the output terminal 27 accordingly. When detecting the stop bit, the SIO circuit 23 transfers the command data in the reception shift register 24 to the reception buffer 25. Also,
The control circuit 3 opens the gates 32 and 36, and the data in the reception buffer 25 is transferred to the command latch 14 via the data bus 7.

【0035】制御回路3が、コマンドラッチ14内のデ
ータが連続書き込みを指定するものであることを認識す
ると、制御回路3は、ゲート31,33を開けて、続い
てSIO回路23が受信する上位スタートアドレスデー
タ、下位スタートアドレスデータおよびバイト数データ
をアドレス自動生成回路12に転送する。上位スタート
アドレスデータおよび下位スタートアドレスデータは、
アドレス自動生成回路12において、アドレスカウンタ
の上位および下位に設定される。また、アドレス自動生
成回路12においてバイト数データはバイト数カウンタ
に設定される。
When the control circuit 3 recognizes that the data in the command latch 14 specifies continuous writing, the control circuit 3 opens the gates 31 and 33, and then the higher order received by the SIO circuit 23. The start address data, the lower start address data and the byte number data are transferred to the address automatic generation circuit 12. The upper start address data and lower start address data are
In the automatic address generation circuit 12, the upper and lower bits of the address counter are set. Further, in the address automatic generation circuit 12, the byte number data is set in the byte number counter.

【0036】次に、制御回路3は、ゲート32,37を
開けて、SIO回路23が受信した書き込みデータを受
信バッファ25からデータラッチ13に転送しゲート3
2,37を閉じる。する。データラッチ13は、書き込
みデータをラッチすると、データラッチ完了信号を制御
回路3に送る。制御回路3は、スイッチ35をアドレス
自動生成回路12側に接続しデータラッチ完了信号に応
じて書き込み信号をW−E−R回路2に与える。W−E
−R回路2は、書き込み信号に応じてアドレス自動生成
回路12のアドレスカウンタの内容で示されるフラッシ
ュメモリ1のアドレスにデータラッチ13にラッチされ
ているデータを書き込む。
Next, the control circuit 3 opens the gates 32 and 37, transfers the write data received by the SIO circuit 23 from the reception buffer 25 to the data latch 13, and the gate 3
Close 2, 37. To do. When the write data is latched, the data latch 13 sends a data latch completion signal to the control circuit 3. The control circuit 3 connects the switch 35 to the address automatic generation circuit 12 side and gives a write signal to the W-E-R circuit 2 according to the data latch completion signal. WE
The -R circuit 2 writes the data latched in the data latch 13 to the address of the flash memory 1 indicated by the content of the address counter of the address automatic generation circuit 12 according to the write signal.

【0037】W−E−R回路2は、書き込みが正常に終
了したことを確認すると、制御回路3に書き込み完了信
号を送る。制御回路3は、書き込み完了信号に応じてア
ドレス自動生成回路12にインクリメント信号を送る。
また、ゲート32,37を再度開いて受信バッファ25
内のデータをデータラッチ13に転送する。アドレス自
動生成回路12は、インクリメント信号を受けると、ア
ドレスカウンタの内容を1だけ増加させ、バイト数カウ
ンタの内容を1だけ減ずる。データラッチ13は、デー
タをラッチするとデータラッチ完了信号を出力する。
When the W-E-R circuit 2 confirms that the writing has been completed normally, it sends a write completion signal to the control circuit 3. The control circuit 3 sends an increment signal to the address automatic generation circuit 12 in response to the write completion signal.
Further, the gates 32 and 37 are opened again to open the reception buffer 25.
The data inside is transferred to the data latch 13. When the address automatic generation circuit 12 receives the increment signal, it increments the content of the address counter by 1 and decrements the content of the byte number counter by 1. When the data latch 13 latches the data, it outputs a data latch completion signal.

【0038】次に、制御回路3は、データラッチ完了信
号に応じて書き込み信号をW−E−R回路2に与える。
W−E−R回路2は、書き込み信号に応じてアドレス自
動生成回路12のアドレスカウンタの内容で示されるフ
ラッシュメモリ1のアドレスにデータラッチ13にラッ
チされているデータを書き込む。
Next, the control circuit 3 gives a write signal to the W-E-R circuit 2 in response to the data latch completion signal.
The W-E-R circuit 2 writes the data latched in the data latch 13 to the address of the flash memory 1 indicated by the content of the address counter of the address automatic generation circuit 12 according to the write signal.

【0039】以下、フラッシュメモリ1への書き込みが
正常に終了するたびに、アドレス自動生成回路12のア
ドレスカウンタの内容は1増加し、バイト数カウンタの
内容は1減り、データラッチ13内のデータがフラッシ
ュメモリ1に書き込まれる。そして、バイト数カウンタ
の内容が0になったときに連続書き込みは終了する。
Thereafter, every time the writing to the flash memory 1 is normally completed, the content of the address counter of the automatic address generation circuit 12 is incremented by 1, the content of the byte number counter is decremented by 1, and the data in the data latch 13 is It is written in the flash memory 1. Then, when the content of the byte number counter becomes 0, the continuous writing ends.

【0040】なお、上記実施例では、バイト数カウンタ
をアドレス自動生成回路12内に設け、バイト数カウン
タの内容が0になったときに連続書き込みを終了する場
合について説明したが、アドレス自動生成回路12にス
トップアドレス保持レジスタを設けてもよい。すなわ
ち、バイト数データの代わりにストップアドレスを外部
から送信し、それをストップアドレス保持レジスタに設
定し、書き込みアドレスがストップアドレス保持レジス
タの内容に一致したら連続書き込みを終了するようにし
てもよい。
In the above embodiment, the case where the byte number counter is provided in the address automatic generation circuit 12 and the continuous writing is ended when the content of the byte number counter becomes 0 has been described. 12 may be provided with a stop address holding register. That is, instead of the byte number data, a stop address may be transmitted from the outside, the stop address may be set in the stop address holding register, and the continuous writing may be ended when the write address matches the contents of the stop address holding register.

【0041】実施例3.次に、フラッシュメモリ1のブ
ロック消去について説明する。この場合には、外部から
図6に示すデータが送信される。ここで、コマンドデー
タは、ブロック消去データを指定するものである。ま
た、上位スタートアドレスデータはブロック消去の対象
となるフラッシュメモリ1のブロックの先頭アドレスの
上位を指定するものであり、下位スタートアドレスデー
タは先頭アドレスの下位を指定するものである。
Example 3. Next, block erase of the flash memory 1 will be described. In this case, the data shown in FIG. 6 is transmitted from the outside. Here, the command data specifies block erase data. The upper start address data specifies the upper part of the start address of the block of the flash memory 1 to be erased, and the lower start address data specifies the lower part of the start address.

【0042】次に動作について図1を参照して説明す
る。実施例1の場合と同様に、外部からデータ書換え許
可信号が入力端子21に与えられると、SIO回路23
はデータを受け入れられる状態になる。また、制御回路
3は、ゲート38,39を閉じて入出力ポート4,6か
らのフラッシュメモリ1の内容書換えを禁止する状態と
する。コマンドデータが入力端子22からSIO回路2
3に与えられると、SIO回路23は、そのコマンドデ
ータに付属するスタートビットを検出する。そして、そ
れに続く8ビットのデータを受信シフトレジスタ24に
順次与える。
Next, the operation will be described with reference to FIG. Similar to the case of the first embodiment, when the data rewrite permission signal is externally applied to the input terminal 21, the SIO circuit 23
Is ready to accept data. Further, the control circuit 3 closes the gates 38 and 39 to prohibit the rewriting of the contents of the flash memory 1 from the input / output ports 4 and 6. Command data is input from the input terminal 22 to the SIO circuit 2
3, the SIO circuit 23 detects the start bit attached to the command data. Then, the subsequent 8-bit data is sequentially given to the reception shift register 24.

【0043】SIO回路23がスタートビットを検出す
ると、BUSY回路26は、それに応じてBUSY信号
を出力端子27から出力する。SIO回路23は、スト
ップビットを検出すると、受信シフトレジスタ24内の
コマンドデータを受信バッファ25に転送する。また、
制御回路3は、ゲート32,36を開け、受信バッファ
25内のデータは、データバス7を介してコマンドラッ
チ14に転送される。
When the SIO circuit 23 detects the start bit, the BUSY circuit 26 outputs the BUSY signal from the output terminal 27 accordingly. When detecting the stop bit, the SIO circuit 23 transfers the command data in the reception shift register 24 to the reception buffer 25. Also,
The control circuit 3 opens the gates 32 and 36, and the data in the reception buffer 25 is transferred to the command latch 14 via the data bus 7.

【0044】制御回路3がコマンドラッチ14内のデー
タがブロック消去を指定するものであることを認識する
と、制御回路3は、ゲート31,33を開けて、続いて
SIO回路23が受信する上位スタートアドレスデータ
および下位スタートアドレスデータをアドレス自動生成
回路12に転送する。
When the control circuit 3 recognizes that the data in the command latch 14 specifies the block erase, the control circuit 3 opens the gates 31 and 33, and then the upper start received by the SIO circuit 23. The address data and the lower start address data are transferred to the address automatic generation circuit 12.

【0045】そして、制御回路3は、W−E−R回路2
にブロック消去のための制御信号を与える。すると、W
−E−R回路2は、従来の場合と同様に動作してフラッ
シュメモリ1のブロック消去を行う。
The control circuit 3 is the W-ER circuit 2
A control signal for block erasing is given to. Then W
The -ER circuit 2 operates in the same manner as in the conventional case to erase the block of the flash memory 1.

【0046】実施例4.図7はこの発明の他の実施例に
よるフラッシュメモリを内蔵したワンチップマイクロコ
ンピュータの主要部を示すブロック図である。図におい
て、8はCPU、9はCPU8のメモリアクセスを禁止
する信号を発生するメモリアクセス禁止回路、10はC
PU8のバスアクセスを禁止する信号を発生するバスア
クセス禁止回路である。また、1a,1bはそれぞれフ
ラッシュメモリ、2a,2bはそれぞれW−E−R回
路、11a,11bはそれぞれ図1に示すアドレスラッ
チ11と同様のアドレスラッチ、13a,13bはそれ
ぞれ図1に示すデータラッチ13と同様のデータラッチ
である。
Example 4. FIG. 7 is a block diagram showing the main part of a one-chip microcomputer incorporating a flash memory according to another embodiment of the present invention. In the figure, 8 is a CPU, 9 is a memory access prohibition circuit for generating a signal for prohibiting memory access of the CPU 8, and 10 is a C
This is a bus access prohibition circuit that generates a signal for prohibiting bus access of PU8. 1a and 1b are flash memories, 2a and 2b are W-E-R circuits, 11a and 11b are address latches similar to the address latch 11 shown in FIG. 1, and 13a and 13b are data shown in FIG. It is a data latch similar to the latch 13.

【0047】このように、フラッシュメモリおよびデー
タの書換え部が二重化されているので、例えば、CPU
8は、W−E−R回路2aがフラッシュメモリ1aにデ
ータを書き込んだり消去したりしているときに、アドレ
スバス5およびデータバス7を用いてフラッシュメモリ
1b内のプログラムを実行できる。また、W−E−R回
路2aがフラッシュメモリ1aのデータを書き換えてい
るときにCPU8がフラッシュメモリ1aをアクセスし
ようとした場合には、メモリアクセス禁止回路9は、メ
モリアクセスを禁止する信号をCPU8に与える。する
と、CPU8はその信号を契機として割り込み処理を行
い、アクセスが競合したことを知る。
As described above, since the flash memory and the data rewriting section are duplicated, for example, the CPU
8 can execute the program in the flash memory 1b by using the address bus 5 and the data bus 7 while the W-E-R circuit 2a is writing or erasing data in the flash memory 1a. If the CPU 8 tries to access the flash memory 1a while the W-E-R circuit 2a is rewriting the data in the flash memory 1a, the memory access prohibition circuit 9 sends a signal for prohibiting memory access to the CPU 8 Give to. Then, the CPU 8 performs an interrupt process triggered by the signal and knows that the access conflicts.

【0048】メモリアクセス禁止回路9は、例えば、W
−E−R回路2aからフラッシュメモリ1aへのデータ
書き込み実行中であることを通知されているときにはア
ドレスバス5を監視する。そして、フラッシュメモリ1
aに割り当てられているアドレスがアドレスバス5に現
れたら、CPU8のメモリアクセスを禁止する信号を出
力する。また、アドレスバス5やデータバス7が受信バ
ッファ25から各ラッチに至るデータを転送していると
きには、例えば、制御回路3がバスアクセス禁止回路1
0にその旨を知らせる。すると、バスアクセス禁止回路
10は、CPU8のバスアクセスを禁止する信号を出力
する。CPU8は、その信号が出力されている間バスア
クセスを行わないよう待機する。
The memory access prohibition circuit 9 is, for example, W
The address bus 5 is monitored when it is notified from the -ER circuit 2a that data writing to the flash memory 1a is being executed. And flash memory 1
When the address assigned to a appears on the address bus 5, the CPU 8 outputs a signal for inhibiting the memory access. Further, when the address bus 5 and the data bus 7 are transferring data from the reception buffer 25 to each latch, for example, the control circuit 3 causes the bus access prohibition circuit 1 to operate.
Notify 0 to that effect. Then, the bus access prohibition circuit 10 outputs a signal for prohibiting the bus access of the CPU 8. The CPU 8 stands by so as not to perform bus access while the signal is being output.

【0049】[0049]

【発明の効果】以上のように、請求項1記載の発明によ
れば、マイクロコンピュータを、コマンド、アドレスデ
ータおよび書き込みデータ入力用のシリアル入力端子
と、シリアル入力端子に与えられたデータを並列変換し
てコマンドラッチ、アドレスラッチまたはデータラッチ
に供給するSIO回路とを備えた構成としたので、プリ
ント基板に実装された状態で、フラッシュメモリ内のプ
ログラムの書換えや消去を容易に行いうるものが得られ
る効果がある。
As described above, according to the first aspect of the present invention, a microcomputer is provided with a serial input terminal for inputting command, address data and write data, and parallel conversion of data applied to the serial input terminal. Since it is configured to include a command latch, an address latch, or an SIO circuit for supplying data latch, it is possible to easily rewrite or erase the program in the flash memory when mounted on the printed circuit board. It is effective.

【0050】請求項2記載の発明によれば、マイクロコ
ンピュータを、SIO回路が受信シフトレジスタおよび
受信バッファを有し,BUSY信号を出力するBUSY
回路を備えた構成としたので、さらに、より高速かつ安
全に、内蔵されているフラッシュメモリのデータ書換え
を行えるものが得られる効果がある。
According to the second aspect of the present invention, in the microcomputer, the SIO circuit has a reception shift register and a reception buffer, and a BUSY signal for outputting a BUSY signal is output.
Since the configuration is provided with the circuit, there is an effect that it is possible to more rapidly and safely rewrite the data of the built-in flash memory.

【0051】請求項3記載の発明によれば、マイクロコ
ンピュータを、アドレス自動生成回路を備えた構成とし
たので、さらに、書き込み時間が短縮化されるものが得
られる効果がある。
According to the third aspect of the present invention, since the microcomputer is configured to have the automatic address generation circuit, there is an effect that the writing time can be further shortened.

【0052】そして、請求項4記載の発明によれば、マ
イクロコンピュータを、フラッシュメモリおよびW−E
−R回路が多重化されたものとし、さらに、CPUのメ
モリアクセスおよびバスアクセスを禁止するメモリアク
セス禁止回路およびバスアクセス禁止回路とを備えた構
成としたので、フラッシュメモリのデータ書換え中であ
ってもプログラムの実行ができるものが得られる効果が
ある。
According to the fourth aspect of the invention, the microcomputer includes a flash memory and a WE.
Since the configuration is such that the -R circuit is multiplexed, and further the memory access prohibition circuit and the bus access prohibition circuit for prohibiting the memory access and the bus access of the CPU are provided, it is possible that the flash memory is being rewritten. Also has the effect of being able to execute the program.

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

【図1】この発明の一実施例によるワンチップマイクロ
コンピュータの主要部を示すブロック図である。
FIG. 1 is a block diagram showing a main part of a one-chip microcomputer according to an embodiment of the present invention.

【図2】データ書き込みの際に外部から与えられるデー
タの一例を示す説明図である。
FIG. 2 is an explanatory diagram showing an example of data given from the outside when writing data.

【図3】データの通信方式を示す説明図である。FIG. 3 is an explanatory diagram showing a data communication system.

【図4】データ転送の様子を示すタイミング図である。FIG. 4 is a timing chart showing how data is transferred.

【図5】連続書き込みの際に外部から与えられるデータ
の一例を示す説明図である。
FIG. 5 is an explanatory diagram showing an example of data given from the outside during continuous writing.

【図6】ブロック消去の際に外部から与えられるデータ
の一例を示す説明図である。
FIG. 6 is an explanatory diagram showing an example of data given from the outside when erasing a block.

【図7】この発明の他の実施例によるワンチップマイク
ロコンピュータの主要部を示すブロック図である。
FIG. 7 is a block diagram showing a main part of a one-chip microcomputer according to another embodiment of the present invention.

【図8】従来のワンチップマイクロコンピュータの主要
部を示すブロック図である。
FIG. 8 is a block diagram showing a main part of a conventional one-chip microcomputer.

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

1,1a,1b フラッシュメモリ 2,2a,2b W−E−R回路(書き込み−消去−読
み出し回路) 3 制御回路 5 アドレスバス 7 データバス 9 メモリアクセス禁止回路 10 バスアクセス禁止回路 11,11a,11b アドレスラッチ 12 アドレス自動生成回路 13,13a,13b データラッチ 14 コマンドラッチ 22 シリアル入力端子 23 SIO回路(シリアルデータ通信回路) 24 受信シフトレジスタ 25 受信バッファ 26 BUSY回路(送信開始禁止信号発生回路)
1, 1a, 1b Flash memory 2, 2a, 2b W-E-R circuit (write-erase-read circuit) 3 Control circuit 5 Address bus 7 Data bus 9 Memory access prohibition circuit 10 Bus access prohibition circuit 11, 11a, 11b Address latch 12 Address automatic generation circuit 13, 13a, 13b Data latch 14 Command latch 22 Serial input terminal 23 SIO circuit (serial data communication circuit) 24 Reception shift register 25 Reception buffer 26 BUSY circuit (transmission start prohibition signal generation circuit)

─────────────────────────────────────────────────────
─────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成5年2月22日[Submission date] February 22, 1993

【手続補正1】[Procedure Amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】特許請求の範囲[Name of item to be amended] Claims

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【特許請求の範囲】[Claims]

【手続補正2】[Procedure Amendment 2]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0009[Correction target item name] 0009

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0009】制御回路3は、ブロック消去を指定するコ
マンドが入出力ポート6に入力されたときに、ゲート3
9を開け、さらに、ゲート36を開ける。その結果、コ
マンドは、データバス7を介して、コマンドラッチ14
にラッチされる。また、制御回路3は、ゲート38,3
3を開ける。すると、スタートアドレスがアドレスバス
5を介してアドレス自動生成回路12に転送される。
The control circuit 3 controls the gate 3 when a command for designating block erase is input to the input / output port 6.
9 is opened, and further the gate 36 is opened. As a result, the command is transmitted via the data bus 7 to the command latch 14
Latched on. Further, the control circuit 3 includes gates 38 , 3
Open 3 Then, the start address is transferred to the address automatic generation circuit 12 via the address bus 5.

【手続補正3】[Procedure 3]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0014[Correction target item name] 0014

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0014】[0014]

【課題を解決するための手段】請求項1記載の発明に係
るマイクロコンピュータは、フラッシュメモリを内蔵
し、フラッシュメモリに対する書き込みや消去等を指定
するコマンドを保持するコマンドラッチと、フラッシュ
メモリに対する書き込みデータを保持するデータラッチ
と、フラッシュメモリの書き込みまたは読み出しまたは
消去対象のアドレスを保持するアドレスラッチと、アド
レスラッチ内のアドレスデータに従ってフラッシュメモ
リに対するデータラッチ内のデータの書き込み及び読み
出しまたはフラッシュメモリの消去を行うW−E−R回
路と、コマンドラッチ内のデータに従って書き込みや消
去等の指示をW−E−R回路に与える制御回路とを備
え、さらに、コマンド、アドレスデータおよび書き込み
データ入力用のシリアル入力端子と、シリアル入力端子
に与えられたデータを並列変換してコマンドラッチ、ア
ドレスラッチまたはデータラッチに供給するシリアルデ
ータ通信回路とを備えたものである。
According to another aspect of the present invention, there is provided a microcomputer including a flash memory, a command latch for holding a command for designating writing and erasing of the flash memory, and write data for the flash memory. Hold data latch and write or read flash memory or
An address latch that holds the address to be erased, and writing and reading of the data in the data latch to the flash memory according to the address data in the address latch
ER circuit for writing or erasing flash memory and writing or erasing according to the data in the command latch.
And a control circuit for giving an instruction to the W-E-R circuit to the W-E-R circuit, and further, a serial input terminal for inputting commands, address data and write data, and a command by parallel-converting the data given to the serial input terminal. And a serial data communication circuit for supplying to a latch, an address latch or a data latch.

【手続補正4】[Procedure amendment 4]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0015[Name of item to be corrected] 0015

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0015】請求項2記載の発明に係るマイクロコンピ
ュータは、請求項1記載の発明に係るマイクロコンピュ
ータにおいて、さらに、シリアルデータ通信回路に受信
バッファとともに設けられた受信シフトレジスタが空で
ないときに、送信開始禁止信号を外部に出力する送信開
始禁止信号発生回路を備えたものである。
According to a second aspect of the present invention, there is provided a microcomputer according to the first aspect, further comprising a serial data communication circuit for receiving data.
It is provided with a transmission start prohibition signal generation circuit that outputs a transmission start prohibition signal to the outside when the reception shift register provided together with the buffer is not empty.

【手続補正5】[Procedure Amendment 5]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0017[Correction target item name] 0017

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0017】そして、請求項4記載の発明に係るマイク
ロコンピュータは、アドレスデータが通過するアドレス
バスと、データが通過するデータバスと、複数のフラッ
シュメモリと、フラッシュメモリに対する書き込みや消
去等を指定するコマンドを保持するコマンドラッチと、
フラッシュメモリに対する書き込みデータを保持する複
数のデータラッチと、各フラッシュメモリの書き込み
たは読み出しまたは消去対象のアドレスを保持する複数
のアドレスラッチと、アドレスラッチ内のアドレスデー
タに従ってフラッシュメモリに対する前記データラッチ
内のデータの書き込み及び読み出しまたはフラッシュメ
モリの消去を行う複数のW−E−R回路と、コマンドラ
ッチ内のデータに従って書き込みや消去等の指示をW−
E−R回路に与える制御回路と、コマンド、アドレスデ
ータおよび書き込みデータ入力用のシリアル入力端子
と、シリアル入力端子に与えられたデータを並列変換し
てコマンドラッチ、アドレスラッチまたはデータラッチ
に供給するシリアルデータ通信回路と、各W−E−R回
路のうちの1つのW−E−R回路がそれに対応するフラ
ッシュメモリをアクセスしているときにCPUのそのフ
ラッシュメモリに対するアクセスを禁止するメモリアク
セス禁止回路と、シリアルデータ通信回路からアドレス
バスまたはデータバスを介してコマンドラッチ、アドレ
スラッチまたはデータラッチにデータが転送されている
ときにCPUのアドレスバスおよびデータバスのアクセ
スを禁止するバスアクセス禁止回路とを備えたものであ
る。
According to a fourth aspect of the present invention, there is provided a microcomputer in which an address bus through which address data passes, a data bus through which data passes, a plurality of flash memories, and writing and erasing to the flash memories.
A command latch that holds a command that specifies leaving etc. ,
A plurality of data latch for holding the write data to the flash memory, the writing of the flash memory or
Or a plurality of address latches for holding addresses to be read or erased, and a plurality of W-E-s for writing and reading data in the data latch to the flash memory or erasing the flash memory according to the address data in the address latch. W-commands such as writing and erasing according to the data in the R circuit and command latch
A control circuit to be given to the E-R circuit, a serial input terminal for inputting command, address data and write data, and a serial input terminal for serially converting the data given to the serial input terminal and supplying it to a command latch, an address latch or a data latch. A data communication circuit and a memory access prohibition circuit for prohibiting the CPU from accessing the flash memory when one of the W-E-R circuits is accessing the corresponding flash memory And a bus access prohibition circuit that prohibits access to the address bus and data bus of the CPU when data is transferred from the serial data communication circuit to the command latch, address latch or data latch via the address bus or data bus. Be prepared.

【手続補正6】[Procedure correction 6]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0026[Correction target item name] 0026

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0026】外部からデータ書換え許可信号が入力端子
21に与えられると、SIO回路23内のゲートが開
き、SIO回路23はデータを受け入れられる状態にな
る。また、制御回路3は、ゲート38,39を閉じて入
出力ポート4,6からのフラッシュメモリ1の内容書換
えを禁止する状態とする。ここで、コマンドデータが入
力端子22からSIO回路23に与えられると、SIO
回路23は、そのコマンドデータに付属するスタートビ
ットを検出する。そして、それに続く8ビットのデータ
を受信シフトレジスタ24に順次与える。
When a data rewrite permission signal is externally applied to the input terminal 21, the gate in the SIO circuit 23 is opened and the SIO circuit 23 is ready to receive data. Further, the control circuit 3 closes the gates 38 and 39 to prohibit the rewriting of the contents of the flash memory 1 from the input / output ports 4 and 6. Here, when the command data is given from the input terminal 22 to the SIO circuit 23, the SIO
The circuit 23 detects the start bit attached to the command data. Then, the subsequent 8-bit data is sequentially given to the reception shift register 24.

【手続補正7】[Procedure Amendment 7]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0036[Correction target item name] 0036

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0036】次に、制御回路3は、ゲート32,37を
開けて、SIO回路23が受信した書き込みデータを受
信バッファ25からデータラッチ13に転送しゲート3
2,37を閉じる。データラッチ13は、書き込みデー
タをラッチすると、データラッチ完了信号を制御回路3
に送る。制御回路3は、スイッチ35をアドレス自動生
成回路12側に接続しデータラッチ完了信号に応じて書
き込み信号をW−E−R回路2に与える。W−E−R回
路2は、書き込み信号に応じてアドレス自動生成回路1
2のアドレスカウンタの内容で示されるフラッシュメモ
リ1のアドレスにデータラッチ13にラッチされている
データを書き込む。
Next, the control circuit 3 opens the gates 32 and 37, transfers the write data received by the SIO circuit 23 from the reception buffer 25 to the data latch 13, and the gate 3
Close the 2, 37. De Taratchi 13, when latches the write data, control data latch completion signal circuit 3
Send to. The control circuit 3 connects the switch 35 to the address automatic generation circuit 12 side and gives a write signal to the W-E-R circuit 2 according to the data latch completion signal. The W-E-R circuit 2 has an address automatic generation circuit 1 according to a write signal.
The data latched in the data latch 13 is written into the address of the flash memory 1 indicated by the contents of the address counter 2 of FIG.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 電気的書き込み一括消去可能な読み出し
専用メモリであるフラッシュメモリと、前記フラッシュ
メモリに対する書き込みまたは消去を指定するコマンド
を保持するコマンドラッチと、前記フラッシュメモリに
対する書き込みデータを保持するデータラッチと、前記
フラッシュメモリの書き込みまたは消去対象のアドレス
を保持するアドレスラッチと、前記アドレスラッチ内の
アドレスデータに従って前記フラッシュメモリに対する
前記データラッチ内のデータの書き込みまたは前記フラ
ッシュメモリの消去を行う書き込み−消去−読み出し回
路と、前記コマンドラッチ内のデータに従って書き込み
または消去の指示を前記書き込み−消去−読み出し回路
に与える制御回路とを備えたマイクロコンピュータにお
いて、前記コマンド、アドレスデータおよび書き込みデ
ータ入力用のシリアル入力端子と、前記シリアル入力端
子に与えられたデータを並列変換して前記コマンドラッ
チ、アドレスラッチまたはデータラッチに供給するシリ
アルデータ通信回路とを備えたことを特徴とするマイク
ロコンピュータ。
1. A flash memory, which is a read-only memory capable of electrically erasing data in batch, a command latch that holds a command that specifies writing or erasing to the flash memory, and a data latch that holds write data to the flash memory. An address latch for holding an address to be written or erased in the flash memory, and a write-erase for writing data in the data latch to the flash memory or erasing the flash memory according to address data in the address latch A microcomputer provided with a read circuit and a control circuit for giving a write or erase instruction to the write-erase-read circuit according to the data in the command latch; A serial input terminal for inputting address data and write data, and a serial data communication circuit for parallel-converting data supplied to the serial input terminal and supplying the parallel data to the command latch, address latch or data latch. Characteristic microcomputer.
【請求項2】 電気的書き込み一括消去可能な読み出し
専用メモリであるフラッシュメモリと、前記フラッシュ
メモリに対する書き込みまたは消去を指定するコマンド
を保持するコマンドラッチと、前記フラッシュメモリに
対する書き込みデータを保持するデータラッチと、前記
フラッシュメモリの書き込みまたは消去対象のアドレス
を保持するアドレスラッチと、前記アドレスラッチ内の
アドレスデータに従って前記フラッシュメモリに対する
前記データラッチ内のデータの書き込みまたは前記フラ
ッシュメモリの消去を行う書き込み−消去−読み出し回
路と、前記コマンドラッチ内のデータに従って書き込み
または消去の指示を前記書き込み−消去−読み出し回路
に与える制御回路とを備えたマイクロコンピュータにお
いて、前記コマンド、アドレスデータおよび書き込みデ
ータ入力用のシリアル入力端子と、前記シリアル入力端
子に与えられたデータを並列変換する受信シフトレジス
タおよびこの受信シフトレジスタの内容を引き取る受信
バッファを有し、この受信バッファの内容を前記コマン
ドラッチ、アドレスラッチまたはデータラッチに供給す
るシリアルデータ通信回路と、前記受信シフトレジスタ
が空でないときに送信開始禁止信号を外部に出力する送
信開始禁止信号発生回路とを備えたことを特徴とするマ
イクロコンピュータ。
2. A flash memory, which is a read-only memory capable of electrically erasing data in batch, a command latch that holds a command that specifies writing or erasing to the flash memory, and a data latch that holds write data to the flash memory. An address latch for holding an address to be written or erased in the flash memory, and a write-erase for writing data in the data latch to the flash memory or erasing the flash memory according to address data in the address latch A microcomputer provided with a read circuit and a control circuit for giving a write or erase instruction to the write-erase-read circuit according to the data in the command latch; , A serial input terminal for inputting address data and write data, a reception shift register for converting data given to the serial input terminal in parallel, and a reception buffer for receiving the contents of the reception shift register, and the contents of the reception buffer To a command latch, an address latch, or a data latch, and a transmission start prohibition signal generation circuit that outputs a transmission start prohibition signal to the outside when the reception shift register is not empty. And a microcomputer.
【請求項3】 電気的書き込み一括消去可能な読み出し
専用メモリであるフラッシュメモリと、前記フラッシュ
メモリに対する書き込みまたは消去を指定するコマンド
を保持するコマンドラッチと、前記フラッシュメモリに
対する書き込みデータを保持するデータラッチと、前記
フラッシュメモリの書き込みまたは消去対象のアドレス
を保持するアドレスラッチと、前記アドレスラッチ内の
アドレスデータに従って前記フラッシュメモリに対する
前記データラッチ内のデータの書き込みまたは前記フラ
ッシュメモリの消去を行う書き込み−消去−読み出し回
路と、前記コマンドラッチ内のデータに従って書き込み
または消去の指示を前記書き込み−消去−読み出し回路
に与える制御回路とを備えたマイクロコンピュータにお
いて、前記コマンド、アドレスデータおよび書き込みデ
ータ入力用のシリアル入力端子と、前記シリアル入力端
子に与えられたデータを並列変換して前記コマンドラッ
チ、アドレスラッチまたはデータラッチに供給するシリ
アルデータ通信回路と、前記アドレスデータが連続書き
込みの先頭アドレスを示すものである場合にその先頭ア
ドレスから始まる連続アドレスを生成して前記書き込み
−消去−読み出し回路に供給するアドレス自動生成回路
とを備えたことを特徴とするマイクロコンピュータ。
3. A flash memory, which is a read-only memory capable of electrically erasing data in batch, a command latch holding a command designating writing or erasing to the flash memory, and a data latch holding write data to the flash memory. An address latch for holding an address to be written or erased in the flash memory, and a write-erase for writing data in the data latch to the flash memory or erasing the flash memory according to address data in the address latch A microcomputer provided with a read circuit and a control circuit for giving a write or erase instruction to the write-erase-read circuit according to the data in the command latch; , A serial input terminal for inputting address data and write data, a serial data communication circuit that parallel-converts the data given to the serial input terminal and supplies the parallel data to the command latch, address latch or data latch, and the address data A microcomputer provided with an address automatic generation circuit for generating a continuous address starting from the start address when supplying the start address of continuous write and supplying the same to the write-erase-read circuit.
【請求項4】 アドレスデータが通過するアドレスバス
と、データが通過するデータバスと、複数の電気的書き
込み一括消去可能な読み出し専用メモリであるフラッシ
ュメモリと、前記各フラッシュメモリに対する書き込み
または消去を指定するコマンドを保持するコマンドラッ
チと、前記フラッシュメモリに対する書き込みデータを
保持する複数のデータラッチと、前記各フラッシュメモ
リの書き込みまたは消去対象のアドレスを保持する複数
のアドレスラッチと、前記アドレスラッチ内のアドレス
データに従って前記フラッシュメモリに対する前記デー
タラッチ内のデータの書き込みまたは前記フラッシュメ
モリの消去を行う複数の書き込み−消去−読み出し回路
と、前記コマンドラッチ内のデータに従って書き込みま
たは消去の指示を前記書き込み−消去−読み出し回路に
与える制御回路と、前記コマンド、アドレスデータおよ
び書き込みデータ入力用のシリアル入力端子と、前記シ
リアル入力端子に与えられたデータを並列変換して前記
コマンドラッチ、アドレスラッチまたはデータラッチに
供給するシリアルデータ通信回路と、前記各書き込み−
消去−読み出し回路のうちの1つの書き込み−消去−読
み出し回路がそれに対応するフラッシュメモリをアクセ
スしているときに中央処理装置のそのフラッシュメモリ
に対するアクセスを禁止するメモリアクセス禁止回路
と、前記シリアルデータ通信回路から前記アドレスバス
またはデータバスを介して前記コマンドラッチ、アドレ
スラッチまたはデータラッチにデータが転送されている
ときに前記中央処理装置のアドレスバスおよびデータバ
スのアクセスを禁止するバスアクセス禁止回路とを備え
たことを特徴とするマイクロコンピュータ。
4. An address bus through which address data passes, a data bus through which data passes, a flash memory which is a read-only memory capable of erasing a plurality of electrically writable data, and writing or erasing to each of the flash memories is specified. A command latch for holding a command, a plurality of data latches for holding write data for the flash memory, a plurality of address latches for holding an address to be written or erased in each flash memory, and an address in the address latch. A plurality of write-erase-read circuits for writing data in the data latch to the flash memory or erasing the flash memory according to data, and for issuing a write or erase instruction according to the data in the command latch. The control circuit applied to the write-erase-read circuit, the serial input terminal for inputting the command, the address data and the write data, and the data applied to the serial input terminal are parallel-converted to convert the command latch, the address latch or A serial data communication circuit for supplying to a data latch and each of the above-mentioned write-
A memory access inhibition circuit for inhibiting access to the flash memory of the central processing unit when one of the erase-read circuits is accessing the flash memory corresponding to the write-erase-read circuit; and the serial data communication. And a bus access prohibition circuit for prohibiting access to the address bus and the data bus of the central processing unit when data is transferred from the circuit to the command latch, the address latch or the data latch via the address bus or the data bus. A microcomputer characterized by being provided.
JP4283493A 1992-09-30 1992-09-30 Microcomputer Pending JPH06111032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4283493A JPH06111032A (en) 1992-09-30 1992-09-30 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4283493A JPH06111032A (en) 1992-09-30 1992-09-30 Microcomputer

Publications (1)

Publication Number Publication Date
JPH06111032A true JPH06111032A (en) 1994-04-22

Family

ID=17666269

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4283493A Pending JPH06111032A (en) 1992-09-30 1992-09-30 Microcomputer

Country Status (1)

Country Link
JP (1) JPH06111032A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6269429B1 (en) 1996-10-25 2001-07-31 Nec Corporation Microcomputer which writer data to memory based on an interrupt control mode
US6378034B1 (en) 1998-10-09 2002-04-23 Nec Corporation Microcomputer with flash EEPROM having automatic communication mode determining function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6269429B1 (en) 1996-10-25 2001-07-31 Nec Corporation Microcomputer which writer data to memory based on an interrupt control mode
US6378034B1 (en) 1998-10-09 2002-04-23 Nec Corporation Microcomputer with flash EEPROM having automatic communication mode determining function

Similar Documents

Publication Publication Date Title
US20230335166A1 (en) Memory devices having special mode access
KR100843280B1 (en) Memory system and data transfer method thereof
JP3229345B2 (en) Non-volatile IC memory
US5884074A (en) Microcomputer utilizing flash memory for data storage
JP2003317489A (en) Nonvolatile semiconductor memory device, method for controlling its write of data, and program
JP3152535B2 (en) Data processing device
JPH06111032A (en) Microcomputer
US6275923B1 (en) Data processing method and apparatus
JPH0764868A (en) Storage updating device
JP2002196977A (en) Memory controller, flash memory system with memory controller, and control method for flash memory
JP4478298B2 (en) Data transfer system
JPH05120890A (en) Information medium
US6789138B1 (en) Computer peripheral apparatus and a computer readable medium having a program for controlling the computer peripheral apparatus
JP2000040057A (en) Computer system, buffer controller and transferring method
JPH11284503A (en) Programmable gate array
JPS62264339A (en) Single chip microcomputer device
JPS61276050A (en) Data transmission system
JPH10340221A (en) Flash memory device
JPH10289221A (en) Microcontroller
JPH0883175A (en) Program controller
JPH05151079A (en) Information processor
JPH0764952A (en) Microprogram control unit with built-in flash memory
JPH03110649A (en) Electronic computer, its address conversion method, and electronic device mounted substrate
KR980011410A (en) Memory control circuit
JP2000305769A (en) Data processor