JP2702277B2 - Microcomputer with built-in PROM - Google Patents

Microcomputer with built-in PROM

Info

Publication number
JP2702277B2
JP2702277B2 JP31833390A JP31833390A JP2702277B2 JP 2702277 B2 JP2702277 B2 JP 2702277B2 JP 31833390 A JP31833390 A JP 31833390A JP 31833390 A JP31833390 A JP 31833390A JP 2702277 B2 JP2702277 B2 JP 2702277B2
Authority
JP
Japan
Prior art keywords
prom
data
microcomputer
write
verification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP31833390A
Other languages
Japanese (ja)
Other versions
JPH04188247A (en
Inventor
俊雄 土居
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP31833390A priority Critical patent/JP2702277B2/en
Publication of JPH04188247A publication Critical patent/JPH04188247A/en
Application granted granted Critical
Publication of JP2702277B2 publication Critical patent/JP2702277B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、PROMを内蔵した半導体デバイスに関し、
特にPROM内蔵のマイコンに関するものである。
The present invention relates to a semiconductor device incorporating a PROM,
In particular, it relates to a microcomputer with a built-in PROM.

〔従来の技術〕[Conventional technology]

従来のPROM内蔵マイコンの構成を、図を用いて説明す
る。
The configuration of a conventional PROM built-in microcomputer will be described with reference to the drawings.

第3図は従来のPROM内蔵マイコンの構成を示す模式図
である。図において、1は製造後に使用者が書き込み可
能で電源が供給されなくてもデータを保持することがで
きるPROM、2は随時読み書きが可能で電源が供給されな
いとデータが失われるRAM、8はデータの処理などを行
うマイコンコア、9は複数の信号線で構成されRAM2やPR
OM1や外部デバイスを区別し、RAM2またはPROM1の内部の
任意のアドレスを選択するアドレスバス、10は複数の信
号線で構成され、任意のアドレスのPROM1やRAM2やレジ
スタや外部の回路との間でデータの授受を行うデータバ
ス、11はマイコンコア8がアドレスを出力し、内蔵のPR
OM1,RAM2,外部デバイス等から命令,データを読み込ん
で処理をする、マイコンモードか否かを示すマイコンモ
ード線で、「1」のときマイコンモードを、「0」のと
きは書き込みモードか検証モードであることを示す。
FIG. 3 is a schematic diagram showing a configuration of a conventional PROM built-in microcomputer. In the figure, 1 is a PROM that can be written by a user after manufacture and can hold data even when power is not supplied, 2 is a RAM that can be read and written at any time and data is lost when power is not supplied, and 8 is a data ROM A microcomputer core 9 that performs processing of the RAM 9 and a plurality of signal lines
An address bus that distinguishes OM1 and external devices and selects an arbitrary address inside RAM2 or PROM1, 10 is composed of multiple signal lines, and can be used between PROM1, RAM2, registers and external circuits of arbitrary addresses. A data bus 11 for sending and receiving data, 11 is an address from which the microcomputer core 8 outputs an address, and a built-in PR.
A microcomputer mode line that reads and processes instructions and data from OM1, RAM2, external devices, etc., and indicates whether or not the microcomputer mode is set. The microcomputer mode line is set to "1", and the write mode or verification mode is set to "0". It is shown that.

12は書き込みモードか検証モードかを示す書き込み/
検証*モード線で、「1」のときマイコンコア8の機能
は停止され、外部から与えられたアドレスのPROM1に、
外部から与えられたデータが書きこまれる書き込みモー
ドを、「0」のときマイコンコア8の機能は停止され、
外部から与えられたアドレスのPROM1からデータが外部
に読み出される検証モードを示す。13はPROM1にデータ
書き込みを指示する書き込み線で、「1」のときに書き
込まれる。14はアドレスバス9,データバス10,PROM1,RAM
2,マイコンコア8で構成されるPROM内蔵マイコンで、マ
イコン,書き込み,検証の3つのモードをもつ。
12 is a write / indicate which indicates write mode or verify mode.
Verification * When the mode line is "1", the function of the microcomputer core 8 is stopped and the PROM1 of the address given from the outside is
When the write mode in which externally applied data is written is “0”, the function of the microcomputer core 8 is stopped,
This shows a verification mode in which data is read out from the PROM 1 at an address given from the outside. A write line 13 instructs the PROM 1 to write data, and is written when it is "1". 14 is address bus 9, data bus 10, PROM1, RAM
2. A microcomputer with a built-in PROM composed of a microcomputer core 8 and has three modes: microcomputer, writing, and verification.

また第4図は従来のPROM内蔵のマイコンの書き込み方
法を示す模式図である。図において、15は一般的にPROM
1に書き込む時に使用されるPROMライタ、16はデータバ
スの幅のデータを一度に比較できる外部比較回路、17は
データバスの幅の書き込みデータを保持する保持レジス
タである。
FIG. 4 is a schematic diagram showing a writing method of a conventional microcomputer with a built-in PROM. In the figure, 15 is generally PROM
A PROM writer used when writing 1 is used, 16 is an external comparison circuit that can compare data of the data bus width at a time, and 17 is a holding register that holds write data of the data bus width.

次に従来のPROM内蔵マイコンの一例の動作を図を用い
て説明する。始めにPROM内蔵マイコンの3つのモードの
動作を簡単に説明する。
Next, the operation of an example of a conventional PROM built-in microcomputer will be described with reference to the drawings. First, the operation of the PROM built-in microcomputer in three modes will be briefly described.

まずマイコンモードではマイコンコア8がアドレスを
出力し、内蔵のPROM1,RAM2,外部デバイス等から命令,
データを読み込んで処理をする。次に書き込みモードで
はマイコンコア8の機能は停止され、外部から与えられ
たアドレスのPROM1に、外部から与えられたデータが書
きこまれる。そして検証モードではマイコンコア8の機
能は停止され、外部から与えられたアドレスのPROM1か
らデータが外部に読み出される。従ってマイコンモード
での処理に必要な命令やデータをPROM1に書き込むため
に、書き込みモードと検証モードを使用する。1つのア
ドレスに書き込み、検証の動作を行い、正しく書き込め
ていれば次のアドレスについて同様の手順を行う。
First, in the microcomputer mode, the microcomputer core 8 outputs an address, and commands and instructions from the built-in PROM1, RAM2, and external devices.
Read and process data. Next, in the write mode, the function of the microcomputer core 8 is stopped, and the externally applied data is written into the PROM 1 at the externally applied address. In the verification mode, the function of the microcomputer core 8 is stopped, and data is read out from the PROM 1 at the address given from the outside. Therefore, the write mode and the verification mode are used to write commands and data necessary for processing in the microcomputer mode to the PROM1. A write operation to one address and a verification operation are performed, and if the data is correctly written, the same procedure is performed for the next address.

次にPROM1にデータを書き込む動作を詳細に説明す
る。1つのアドレスについて、まず書き込み手段で最短
時間での書き込み動作を行う。
Next, the operation of writing data to PROM1 will be described in detail. For one address, a writing operation is first performed in the shortest time by the writing means.

PROMライタ15が図示しない手段でマイコンモード線11
を「0」にし、書き込み/検証*モード線12を「1」に
する。PROM内蔵マイコン14は書き込みモードになる。
The PROM writer 15 is connected to the microcomputer mode line 11 by means not shown.
To “0” and the write / verify * mode line 12 to “1”. The microcomputer 14 with the built-in PROM enters the write mode.

図示しない手段で保持レジスタ17にPROM1に書き込む
データがセットされる。PROMライタ15からアドレスバス
9にアドレスを与え、保持レジスタ17からデータバス10
にデータを与え、PROMライタ15がPROM内蔵マイコン14の
書き込み線13を最小限の時間「1」にする。これによっ
てPROM1にデータバス10のデータが書き込まれる。
Data to be written to the PROM 1 is set in the holding register 17 by means not shown. An address is given from the PROM writer 15 to the address bus 9, and the data is transferred from the holding register 17 to the data bus 10.
And the PROM writer 15 sets the write line 13 of the PROM built-in microcomputer 14 to "1" for a minimum time. As a result, the data on the data bus 10 is written to the PROM1.

次にPROM1のデータを検証する動作を詳細に説明す
る。PROMライタ15の外部比較回路16を用いて書き込みに
使用したデータと、読み出されたデータが等しいかを検
証すると、これによりPROMライタ15が図示しない手段で
書き込み/検証*モード線12を「0」にする。これによ
りPROM内蔵マイコン14は検証モードになる。引き続きPR
OMライタ15からアドレスバス9にアドレスを与え、PROM
ライタ15からPROM内蔵マイコン14に読み出し信号を与え
ると、PROM内蔵マイコン14のPROM1からPROMライタ15に
データバス10を経てデータが読み出される。
Next, the operation of verifying the data of PROM1 will be described in detail. When the external comparison circuit 16 of the PROM writer 15 verifies whether the data used for writing and the read data are equal, the PROM writer 15 sets the write / verification * mode line 12 to “0” by means not shown in the drawing. ". As a result, the PROM built-in microcomputer 14 enters the verification mode. Continue PR
The address is given from the OM writer 15 to the address bus 9 and the PROM
When a read signal is given from the writer 15 to the microcomputer 14 with built-in PROM, data is read from the PROM 1 of the microcomputer 14 with built-in PROM to the PROM writer 15 via the data bus 10.

PROMライタ15の外部比較回路16は保持レジスタ17の値
と、読み出されたデータが一致するかどうかを検証し、
一致していれば次のアドレスについて同様の手順を行
う。一致しなければ上記書き込み手段により長い時間で
の書き込み動作を再度行う。即ち、前記書き込み手順の
書き込み線13をより長い時間「1」にし、外部比較回路
16を用いて保持レジスタ17の値と、読み出されたデータ
が等しいか否かを再度検証する。一致していれば次のア
ドレスについて同様の手順を行う。一致しなければ書き
込みを中止して、そのPROM1が書き込み不可能であるこ
とを通知する。この手順を必要な回数繰り返す。
The external comparison circuit 16 of the PROM writer 15 verifies whether the value of the holding register 17 matches the read data,
If they match, the same procedure is performed for the next address. If they do not match, the writing means performs the writing operation for a long time again. That is, the write line 13 in the write procedure is set to "1" for a longer time, and the external comparison circuit
Using 16, it is verified again whether the value of the holding register 17 is equal to the read data. If they match, the same procedure is performed for the next address. If they do not match, the writing is stopped and the PROM 1 is notified that writing is not possible. Repeat this procedure as many times as necessary.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来のPROM内蔵マイコンは、以上のように構成されて
いるので、PROMに書き込まれたデータの検証をPROMライ
タなどで行う必要があり、PROMのデータをデバイス外部
に出力する手段を持つため、PROMの内容を容易に外部か
ら読み取ることができ、PROMの内容を秘密化するのが困
難であるという問題点があった。
The conventional microcomputer with a built-in PROM is configured as described above, so it is necessary to verify the data written in the PROM with a PROM writer or the like, and since there is a means to output the PROM data to the outside of the device, the PROM There is a problem that the contents of the PROM can be easily read from the outside, and it is difficult to keep the contents of the PROM secret.

この発明は、上記のような問題点を解消するためにな
されたもので、PROMの内容を容易に外部から読み取るこ
とができず、PROMの内容を秘密化することができるPROM
内蔵マイコンを得ることを目的とする。
The present invention has been made in order to solve the above problems, and a PROM that cannot easily read the contents of a PROM from the outside and can keep the contents of the PROM secret.
The purpose is to obtain a built-in microcomputer.

〔課題を解決するための手段〕[Means for solving the problem]

この発明に係るPROM内蔵マイコンは、マイコンコアお
よびPROMを内蔵したPROM内蔵マイコンにおいて、製造後
に使用者が書き込み可能で電源が供給されなくてもデー
タを保持することができ、所定の条件が整わないと読み
出されない上記PROMと、随時読み書き可能で、上記PROM
と同じデータが書き込まれる,電源が供給されないとデ
ータが失われるRAMと、複数の信号線で構成され、上記R
AM,PROMあるいは外部デバイスを区別し、RAMまたはPROM
の内部の任意のアドレスを選択するアドレスバスと、複
数の信号線で構成され、任意のアドレスの上記PROM,RAM
あるいはレジスタ,外部の回路との間でデータの授受を
行うデータバスと、上記マイコンコア内に設けられた、
上記データバスの幅に相当するデータを記憶でき、上記
PROM、および上記RAMに書き込まれたデータを、上記デ
ータバスを介して転送され、これを記憶する複数のレジ
スタと、上記データバスの幅に相当するデータの比較を
することができ、上記複数のレジスタのうち、上記PROM
に書き込まれたデータを記憶した一のレジスタの内容
と、上記RAMに書き込まれた内容を記憶した他のレジス
タの内容とを比較する比較手段と、上記PROMにデータの
読み出しを許可するために用いられるものであり、上記
PROMに対しての書き込み動作があった場合にセットさ
れ、上記比較手段が行う上記比較の結果が不一致であっ
た場合にリセットされる書き込みフラグと、後述する検
証結果を蓄積するために用いられるものであり、上記PR
OMに対しての書き込み動作があった場合にリセットさ
れ、当該検証結果が不一致であったときセットされる,
検証フラグとからなり、上記PROMのデータの検証にあた
り、上記書き込みフラグがセットされている場合、当該
マイコン内部で、上記比較手段の行う上記比較によっ
て、上記PROMのデータを外部へ読み出すことなく書き込
みデータを検証して、一致、又は不一致の検証結果を取
得する検証手段とを備え、マイコン本来の動作をするマ
イコンモード,外部からのデータをPROMとRAMとの両方
に書き込む書き込みモード,およびPROMとRAMとのデー
タをマイコン内部で検証する検証モードの3つのモード
を有するものである。
A microcomputer with a built-in PROM according to the present invention is a microcomputer with a built-in PROM having a built-in microcomputer core and a PROM, which can be written by a user after manufacture and can retain data even when power is not supplied, and predetermined conditions are not satisfied. The above PROM is not read and the above PROM is readable and writable at any time.
The same data is written to the RAM. The RAM consists of a RAM that loses data when power is not supplied and multiple signal lines.
AM, PROM or external device, RAM or PROM
It consists of an address bus for selecting an arbitrary address inside and a plurality of signal lines.
Alternatively, a data bus for transferring data between a register and an external circuit, and a data bus provided in the microcomputer core,
Data corresponding to the width of the data bus can be stored.
The data written in the PROM and the RAM is transferred through the data bus, and a plurality of registers storing the data can be compared with data corresponding to the width of the data bus. Of the registers, the above PROM
Comparing means for comparing the contents of one register storing the data written in the RAM with the contents of another register storing the data written in the RAM, and used for permitting the PROM to read data. Above
A write flag that is set when there is a write operation to the PROM and that is reset when the result of the comparison performed by the comparing means does not match, and that is used to accumulate a verification result described later. And the above PR
Reset when there is a write operation to OM, set when the verification result does not match,
When the write flag is set in the verification of the data of the PROM, the comparison is performed by the comparing means inside the microcomputer, and the data of the PROM is read without reading the data of the PROM to the outside. A verification mode for verifying the data and obtaining a verification result of a match or a mismatch; a microcomputer mode in which the microcomputer performs its original operation; a write mode for writing external data to both the PROM and the RAM; and a PROM and a RAM. Has three modes, a verification mode for verifying the data in the microcomputer.

〔作用〕[Action]

この発明においては、従来PROMにのみ書き込まれてい
たデータをRAMにも書き込み、マイコンコアに内蔵され
ている比較回路を用いてPROMのデータを検証し、かつフ
ラグを用いてPROMの読み出しを制限するようにしたの
で、従来のPROM内蔵マイコンで書き込まれたデータの検
証のために必要であったPROMのデータをデバイス外部に
直接出力する手段が不要になるため、PROMの内容を容易
に外部から読み取ることが困難になり、PROMの内容を秘
密化するのが容易になる。
In the present invention, data that was previously written only in the PROM is also written in the RAM, the data in the PROM is verified using a comparison circuit built in the microcomputer core, and reading of the PROM is restricted using a flag. This eliminates the need for a means to directly output the PROM data to the outside of the device, which was necessary for verifying the data written by the conventional PROM built-in microcomputer, so that the contents of the PROM can be easily read from the outside This makes it difficult to keep the contents of the PROM secret.

〔実施例〕〔Example〕

以下、この発明の実施例を図について説明する。 Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

第1図は本発明の実施例によるPROM内蔵マイコンのブ
ロック構成を示す。
FIG. 1 shows a block configuration of a PROM built-in microcomputer according to an embodiment of the present invention.

図において、1は製造後に使用者が書き込み可能で電
源が供給されなくてもデータを保持することができ条件
が整わないと読み出されないPROM、2は随時読み書き可
能であらかじめ別の手段で検証可能であり電源が供給さ
れないとデータが失われるRAM、3はデータバスと同じ
幅のデータを一度に比較できる、マイコンの通常の演算
機能を流用した比較回路、4,5はデータバスと同じ幅の
データを記憶できあらかじめ別の手段で検証可能であ
る、マイコンの通常のレジスタを流用した複数のレジス
タ、6は検証開始(PROM書き込み)時にリセットされ、
検証結果が不一致であったときセットされる検証フラ
グ、7はPROM1への書き込み動作でセットされ、検証結
果が不一致であったときリセットされる書き込みフラグ
であり、この書き込みフラグがセットされている時のみ
PROMの内容がレジスタ4に読み出される。8はアドレス
バス9,データバス10,複数のレジスタ4および5,比較回
路3,検証フラグ6,書き込みフラグ7で構成され、これら
によって、PROM1の検証を行うマイコンコア、9は複数
の信号線で構成されRAM2やPROM1や外部デバイスを区別
し、RAM2またはPROM1の内部の任意のアドレスを選択す
るアドレスバス、10は複数の信号線で構成され任意のア
ドレスのPROM1やRAM2やレジスタ4,5や外部の回路との間
でデータの授受を行うデータバス、11はマイコンモード
か否かを示すマイコンモード線で、「1」のときマイコ
ンモードを、「0」のときは書き込みモードか検証モー
ドであることを示す。12は書き込みモードか検証モード
かを示す書き込み/検証*モード線で、「1」のとき書
き込みモードを、「0」のとき検証モードを示す。13は
PROMにデータ書き込みを指示する書き込み線で、「1」
のときにデータが書き込まれる。14はアドレスバス9,デ
ータバス10,PROM1,RAM2、マイコンコア8で構成されるP
ROM内蔵マイコンで、マイコン,書き込み,検証の3つ
のモードを持つ。
In the figure, 1 is a PROM that can be written by a user after manufacture and can hold data even when power is not supplied, and is not read unless conditions are met. RAM loses data when power is not supplied. 3 is a comparison circuit that uses the normal arithmetic function of a microcomputer, which can compare data of the same width as the data bus at a time. 4, 5 has the same width as the data bus. A plurality of registers, which can store data and can be verified in advance by another means, using a normal register of the microcomputer, are reset when verification is started (PROM writing),
A verification flag that is set when the verification results do not match. A reference numeral 7 is a write flag that is set by a write operation to the PROM1 and that is reset when the verification results do not match. only
The contents of the PROM are read into the register 4. Reference numeral 8 denotes an address bus 9, a data bus 10, a plurality of registers 4 and 5, a comparison circuit 3, a verification flag 6, and a write flag 7. By these, a microcomputer core for verifying the PROM 1 is provided. An address bus configured to distinguish between RAM2, PROM1, and external devices, and to select an arbitrary address inside RAM2 or PROM1, 10 is composed of a plurality of signal lines, and PROM1, RAM2, registers 4, 5, and external for arbitrary addresses A data bus 11 for transmitting and receiving data to and from the circuit of the microcomputer; 11 is a microcomputer mode line indicating whether or not the microcomputer mode is set; when "1", the microcomputer mode is set; when "0", the write mode or verification mode is set; Indicates that Reference numeral 12 denotes a write / verify * mode line that indicates whether the mode is the write mode or the verify mode. 13 is
Write line that instructs PROM to write data, "1"
Data is written when. Reference numeral 14 denotes a P comprising an address bus 9, a data bus 10, PROM1, RAM2, and a microcomputer core 8.
A microcomputer with a built-in ROM, and has three modes: microcomputer, writing, and verification.

次に第2図はこの発明の第1の実施例によるPROM内蔵
マイコンの書き込み方法を示す模式図である。図におい
て、15は一般的にPROM1に書き込む時に使用されるPROM
ライタ、16はデータバスの幅のデータを一度に比較でき
る外部比較回路、17はデータバスと同じ幅の書き込みデ
ータを保持する保持レジスタ、18はデータと同じ幅の書
き込みデータを保持し、該データを変更またはそのまま
で出力する第2保持レジスタ、19は介在回路である。
Next, FIG. 2 is a schematic diagram showing a writing method of the microcomputer with a built-in PROM according to the first embodiment of the present invention. In the figure, 15 is the PROM generally used when writing to PROM1
A writer, 16 is an external comparison circuit that can compare data of the width of the data bus at a time, 17 is a holding register that holds write data of the same width as the data bus, 18 is a write register that holds write data of the same width as the data, Is a second holding register for changing or outputting the same as it is, and 19 is an intervening circuit.

次にこの発明の実施例によるPROM内蔵マイコンの動作
を図について説明する。
Next, the operation of the PROM built-in microcomputer according to the embodiment of the present invention will be described with reference to the drawings.

PROM1の検証に先立って、あらかじめRAM2と複数のレ
ジスタ4,5を検証しておく。RAM2とレジスタ4,5を使って
PROM1の検証をするためRAM2とレジスタ4,5の機能が正常
である必要があるからである。
Prior to the verification of the PROM1, the RAM2 and the plurality of registers 4 and 5 are verified in advance. Using RAM2 and registers 4 and 5
This is because the functions of the RAM 2 and the registers 4 and 5 need to be normal in order to verify the PROM 1.

ここでPROM1とRAM2にデータを書き込む動作を詳細に
説明する。PROMライタ15が図示しない手段でマイコンモ
ード線11を「0」にし、書き込み/検証*モード線12を
「1」にする。この書き込みモードでは図示しない手段
によってアドレスバス9の複数の信号線のうち、PROM1
とRAM2を区別する信号線が無視され、同時に検証フラグ
6がリセットされる。
Here, the operation of writing data to the PROM1 and the RAM2 will be described in detail. The PROM writer 15 sets the microcomputer mode line 11 to “0” and the write / verify * mode line 12 to “1” by means (not shown). In this write mode, the PROM 1 out of a plurality of signal lines of the
The signal line which distinguishes the RAM 2 from the RAM 2 is ignored, and at the same time, the verification flag 6 is reset.

次に、上記同様に図示しない手段で、保持レジスタ17
に、PROM1に書き込むデータがセットされる。PROMライ
タ15からアドレスバス9にアドレスを与え、保持レジス
タ17からデータバス10にデータを与え、PROMライタ15か
らPROM内蔵マイコン14に書き込み線13を最小限の時間
「1」にする。PROM1とRAM2を区別する信号線が無視さ
れるため書き込み線13によってデータバス10を経て、PR
OM1とRAM2に同じデータが書き込まれる。同じく書き込
み線13によって書き込みフラグ7がセットされる。次に
PROMライタ15は検証動作を行うとするが、この検証動作
は介在回路19によって欺瞞されている。即ち、介在回路
19は常にPROMライタ15が書き込んだものと同じデータを
PROMライタ15へ返すことにより、PROMライタ15を欺瞞す
る。これに対し、PROMライタ15は図示しない手段で書き
込み/検証*モード線12を「0」にしようとするが、こ
の動作に対して、介在回路19はこれに内蔵されたロジッ
ク(図示せず)を用いてこの動作を妨げる。そして、そ
の結果引き続きPROMライタ15からアドレスバス9にアド
レスを与え、PROMライタ15から介在回路19に読み出し信
号を与え、介在回路19の第2保持レジスタ18からPROMラ
イタ15に正しいデータが読み出される。外部比較回路16
は保持レジスタ17の値と、読み出されたデータが一致す
るかどうか検証する。これは常に一致する。この手順が
必要な回数繰り返される。従って、PROMライタ15は介在
回路19によってPROM内蔵マイコン14のPROM1のデータを
あたかも検証動作を行ったがごとく動作させられてい
る。
Next, similarly to the above, the holding register 17 is
Is set to the data to be written to PROM1. An address is applied from the PROM writer 15 to the address bus 9, data is applied from the holding register 17 to the data bus 10, and the write line 13 is set to “1” for a minimum time from the PROM writer 15 to the PROM built-in microcomputer 14. Since the signal line that distinguishes PROM1 and RAM2 is ignored, the write line 13 passes through the data bus 10 and the PR
The same data is written to OM1 and RAM2. Similarly, the write flag 7 is set by the write line 13. next
It is assumed that the PROM writer 15 performs the verification operation, but this verification operation is deceived by the interposition circuit 19. That is, the intervening circuit
19 always uses the same data as that written by PROM writer 15.
By returning to the PROM writer 15, the PROM writer 15 is deceived. On the other hand, the PROM writer 15 tries to set the write / verify * mode line 12 to "0" by means not shown, but the intervening circuit 19 responds to this operation by using a logic (not shown) built therein. To prevent this operation. Then, as a result, an address is successively provided from the PROM writer 15 to the address bus 9, a read signal is provided from the PROM writer 15 to the intervening circuit 19, and correct data is read from the second holding register 18 of the intervening circuit 19 to the PROM writer 15. External comparison circuit 16
Verifies whether the value of the holding register 17 matches the read data. This always matches. This procedure is repeated as necessary. Therefore, the PROM writer 15 is operated by the interposition circuit 19 as if the data of the PROM 1 of the microcomputer 14 with a built-in PROM were verified.

次にPROM1のデータを検証する、本来の検証動作を詳
細に説明する。まずマイコンコア8の比較回路3を用い
てRAM2のデータと、PROM1のデータが等しいか否かを検
証する。検証モードにするため介在回路19が図示しない
手段で書き込み/検証*モード線12を「0」にする。こ
こで上記同様PROMライタ15は書き込み動作を行うが、こ
の動作は介在回路によって欺瞞されている。即ち、PROM
ライタ15から介在回路19にアドレスを与え、保持レジス
タ17から介在回路19にデータを与え、PROMライタ15がPR
OM内蔵マイコン14の書き込み線13を最小限の時間「1」
にしようとするが、介在回路19はPROMライタ15の書き込
み動作のための信号をPROM内蔵マイコン14に伝えず、ア
ドレスをアドレスバス9に与え、読み出し信号を与え
る。従って、PROMライタ15は介在回路19によってあたか
も書き込み動作を行ったがごとく動作させられている。
また介在回路19はPROMライタ15から書き込まれたデータ
を第2保持レジスタ18に保持する。
Next, the original verification operation for verifying the data in the PROM 1 will be described in detail. First, using the comparison circuit 3 of the microcomputer core 8, it is verified whether the data in the RAM2 and the data in the PROM1 are equal. In order to enter the verification mode, the intervening circuit 19 sets the write / verification * mode line 12 to “0” by means not shown. Here, the PROM writer 15 performs the write operation as described above, but this operation is deceived by the intervening circuit. That is, PROM
The address is given from the writer 15 to the intervening circuit 19, the data is given from the holding register 17 to the intervening circuit 19, and the PROM writer 15
Set the write line 13 of the OM built-in microcomputer 14 to the minimum time "1"
However, the intervening circuit 19 does not transmit a signal for a write operation of the PROM writer 15 to the microcomputer 14 with built-in PROM, but supplies an address to the address bus 9 and a read signal. Therefore, the PROM writer 15 is operated by the intervening circuit 19 as if a write operation was performed.
Further, the interposition circuit 19 holds the data written from the PROM writer 15 in the second holding register 18.

ここでPROM内蔵マイコン14内部では、書き込みフラグ
7がセットされている場合、第1のレジスタ4にアドレ
スで示されるPROM1のデータが読み込まれる。
Here, in the PROM built-in microcomputer 14, when the write flag 7 is set, the data of the PROM 1 indicated by the address is read into the first register 4.

そして引き続きPROMライタ15が図示しない手段で書き
込み/検証*モード12を「0」にしようとする。この動
作は書き込み動作に続いて介在回路19により欺瞞されて
いる。即ち、介在回路19はPROMライタ15の検証動作のた
めの信号をPROM内蔵マイコン14に伝えず、引き続きPROM
ライタ15から介在回路19にアドレスを与え、PROMライタ
15から介在回路19に読み出し信号を与える。介在回路19
はRAM2の該当するアドレスをアドレスバス9に与え、読
み出し信号をPROM内蔵マイコン14に与える。第2のレジ
スタ5に該当するアドレスのRAM2のデータが読み込まれ
る。他方で介在回路19はPROMライタ15に対して第2保持
レジスタ18の正しいデータを読み出させる。外部比較回
路16は保持レジスタ17の値と、読み出されたデータが一
致するかどうかを検証し、これは必ず一致する。従っ
て、PROMライタ15は介在回路19によってPROM内蔵マイコ
ン14のPROM1のデータをあたかも検証動作を行ったがご
とく動作させられている。
Then, the PROM writer 15 tries to set the write / verify * mode 12 to "0" by means not shown. This operation is deceived by the intervening circuit 19 following the write operation. That is, the intervening circuit 19 does not transmit a signal for the verification operation of the PROM
The address is given from the writer 15 to the intervening circuit 19, and the PROM writer is
From 15, a read signal is given to the intervening circuit 19. Interposed circuit 19
Supplies a corresponding address of the RAM 2 to the address bus 9 and supplies a read signal to the microcomputer 14 with a built-in PROM. The data in the RAM 2 at the address corresponding to the second register 5 is read. On the other hand, the intervening circuit 19 causes the PROM writer 15 to read the correct data of the second holding register 18. The external comparison circuit 16 verifies whether the value of the holding register 17 and the read data match, and this always matches. Therefore, the PROM writer 15 is operated by the interposition circuit 19 as if the data of the PROM 1 of the microcomputer 14 with a built-in PROM were verified.

一方PROM内蔵マイコン14内部では、本来の検証動作で
あるPROM1のデータとRAM2のデータとの検証が行われて
おり、比較回路3を用いて第1と第2のレジスタ4,5の
データが一致するか否かを検証し、検証フラグ6に検証
結果を蓄積する。検証結果が正しければ、検証フラグ6
は変化せず、検証結果が正しくなければ検証フラグ6を
セットし、書き込みフラグ7をリセットする。書き込み
フラグ7がセットされていなければ検証動作は起こらな
いため、以後のデータは無視される。一組のデータの検
証が終了したら第1と第2のレジスタの値を消去する。
この手順を必要な回数繰り返す。最後に介在回路19が特
別なアドレス、即ち検証フラグを読み出すためのPROM1
とRAM2とは別のアドレスを入力し、検証フラグ6がデー
タバス10を経て介在回路19に読みだされる。PROM1の内
容とRAM2の内容が1つでも異なっていれば、検証フラグ
6の値は「1」であり、全て等しければ「0」となる。
On the other hand, in the microcomputer 14 with built-in PROM, the data of the PROM 1 and the data of the RAM 2 which are the original verification operations are verified, and the data of the first and second registers 4 and 5 match using the comparison circuit 3. It verifies whether or not to perform the verification, and stores the verification result in the verification flag 6. If the verification result is correct, verification flag 6
Does not change. If the verification result is not correct, the verification flag 6 is set and the write flag 7 is reset. If the write flag 7 is not set, the verification operation does not occur, and the subsequent data is ignored. When the verification of one set of data is completed, the values of the first and second registers are erased.
Repeat this procedure as many times as necessary. Finally, the intervening circuit 19 reads the special address, that is, the PROM 1 for reading the verification flag.
And another address from the RAM 2 and the verification flag 6 is read out to the interposition circuit 19 via the data bus 10. If at least one of the contents of the PROM1 and the contents of the RAM2 are different, the value of the verification flag 6 is "1", and if all are equal, the value is "0".

以上のように、本発明の第1の実施例では、検証モー
ドのとき書き込みフラグ7がセットされていなければ、
1つのアドレスが与えられると、PROM内蔵マイコン14は
外部に対しては書き込みフラグ7セット時と同様の反応
を示すが、PROM内蔵マイコン14内部では検証は行われな
い。書き込みフラグ7をセットするためには、書き込み
モードで最低一回の書き込み、すなわち現在のデータの
破壊を行う必要があるため、検証モードを悪用してPROM
1のデータを間接的に読みだすことが困難となる。ま
た、検証結果が正しくなければ書き込みフラグ7がリセ
ットされるため、一回の書き込みで1つのアドレスが示
されるデータを破壊するという犠牲を伴う検証モードを
悪用して、他のアドレスのデータを間接的に読み出すこ
とが困難である。
As described above, in the first embodiment of the present invention, if the write flag 7 is not set in the verification mode,
When one address is given, the PROM built-in microcomputer 14 responds to the outside in the same manner as when the write flag 7 is set, but no verification is performed inside the PROM built-in microcomputer 14. In order to set the write flag 7, it is necessary to perform at least one write in the write mode, that is, to destroy the current data.
It becomes difficult to indirectly read out the data of (1). Further, if the verification result is not correct, the write flag 7 is reset, so that the verification mode with the sacrifice of destroying the data indicated by one address by one write is indirectly used to indirectly transfer the data of another address. Is difficult to read.

なお、上記第1の実施例では、一般的なPROMライタを
使用したが、本来のPROMライタ機能とともに介在回路を
も有するPROMライタを使用してもよい。この場合、書き
込み,検証手順に無駄がなくなり、介在回路19も不要に
なる。
Although a general PROM writer is used in the first embodiment, a PROM writer having an intervening circuit in addition to the original PROM writer function may be used. In this case, there is no waste in the writing and verification procedures, and the intervening circuit 19 is not required.

また上記第1の実施例では、PROM1とRAM2への書き込
みは同時に行われるが、別々に書き込んでもよい。この
場合書き込み時間は長くなるが、書き込みモード時にア
ドレスの一部を無視する回路が不要になる。
In the first embodiment, writing to PROM1 and RAM2 is performed simultaneously, but writing may be performed separately. In this case, the write time becomes longer, but a circuit for ignoring a part of the address in the write mode is not required.

さらに上記第1の実施例では、データバス10は単数で
あったが複数でもよい。この場合検証時のPROM1とRAM2
からレジスタへのデータの読み出しが同時に実行でき
る。
Further, in the first embodiment, the data bus 10 is singular, but may be plural. In this case, PROM1 and RAM2 at the time of verification
Data can be simultaneously read from the register to the register.

次に上記第1の実施例では、PROM1とRAM2へ連続して
書き込み、その後連続して検証を行ったが、第2の実施
例として1アドレスごとに書き込み検証を行ってもよ
い。その場合の手順と介在回路19の働きを以下に説明す
る。
Next, in the above-described first embodiment, writing is continuously performed on the PROM1 and the RAM2, and then the verification is continuously performed. However, as the second embodiment, the write verification may be performed for each address. The procedure in that case and the function of the intervening circuit 19 will be described below.

まず手順としては通常のPROMライタ15の動作と同様、
1つのアドレスに書き込み,検証の動作を行い、正しく
書き込めていれば次のアドレスについて同様の手順を行
う。1つのアドレスについて最短時間での書き込み手段
で書き込み動作を行う。次に介在回路19はPROMライタ15
の信号をそのまま使用して、PROM1に書き込みを行う。
同時に介在回路19は書き込みデータを記憶する。ただ
し、上述したようにPROM1とRAM2に別々に書き込む場
合、介在回路19がRAM2への書き込み動作を行う。そして
PROMライタ15がPROM1のデータを読み出そうとする。こ
のとき介在回路19はPROM内蔵マイコン14に対して検証動
作をさせる。検証結果が正しければ、介在回路19は先に
記憶した正しいデータをPROMライタ15に読み出させ、検
証結果が正しくなければ、介在回路19は正しくないデー
タをPROMライタ15に読みださせる。正しくないデータは
例えば先に記憶したデータの一部または全部のビットを
反転することによって作成する。PROMライタ15は外部比
較回路16を用いて保持レジスタのデータと、読み出され
たデータが等しいかを検証し、一致していれば次のアド
レスについて同様の手順を行う。また一致しなければよ
り長い時間での書き込み手段で再度書き込み動作を行
い、PROMライタ15は外部比較回路16を用いて保持レジス
タのデータと、読み出されたデータが等しいかを再度検
証する。一致していれば次のアドレスについて同様の手
順を行う。
First, as the procedure, like the normal operation of the PROM writer 15,
The writing and verification operations are performed on one address, and if the writing is correctly performed, the same procedure is performed on the next address. A write operation is performed for one address by the write unit in the shortest time. Next, the interposed circuit 19 is a PROM writer 15
Using this signal as it is, write to PROM1.
At the same time, the intervening circuit 19 stores the write data. However, as described above, when writing to the PROM1 and the RAM2 separately, the intervening circuit 19 performs a writing operation to the RAM2. And
The PROM writer 15 tries to read the data of the PROM1. At this time, the intervening circuit 19 causes the PROM built-in microcomputer 14 to perform a verification operation. If the verification result is correct, the intervening circuit 19 causes the PROM writer 15 to read the correct data stored earlier, and if the verification result is not correct, the interposition circuit 19 causes the PROM writer 15 to read incorrect data. Incorrect data is created, for example, by inverting some or all bits of previously stored data. The PROM writer 15 verifies whether the data in the holding register and the read data are equal by using the external comparison circuit 16, and if they match, performs the same procedure for the next address. If they do not match, the writing operation is performed again by the writing means for a longer time, and the PROM writer 15 again verifies whether the data in the holding register and the read data are equal using the external comparison circuit 16. If they match, the same procedure is performed for the next address.

それでも一致しなければ書き込みを中止して、そのPR
OM1が書き込み不可能であることを通知する。
If it still does not match, stop writing and the PR
Notifies that OM1 is not writable.

このように上記2つの実施例では、PROM内蔵マイコン
の内部のPROMとRAMにデータを書き込み、マイコンコア
に内蔵された比較回路を用いてPROMのデータを検証し、
PROMの読み出しに制限を加えることによりPROM読み出し
モードがなくても書き込みデータの検証が可能になり、
PROMのデータを外部に読みだすことが困難であるため、
PROMの内容を秘密化するのが容易である効果がある。ま
た16ビット,32ビットのマイコンの場合、内部のバス及
びレジスタ,ALUなどをフルに使用することにより通常の
8ビットあるいは1ビットのポートを使用して検証する
より検証時間を短くすることができる。
As described above, in the above two embodiments, the data is written to the PROM and the RAM inside the PROM built-in microcomputer, and the PROM data is verified using the comparison circuit built in the microcomputer core.
By restricting PROM reading, write data can be verified without PROM reading mode.
Because it is difficult to read PROM data externally,
There is an effect that it is easy to keep the contents of the PROM secret. In the case of 16-bit and 32-bit microcomputers, the verification time can be shortened by fully using the internal bus, register, ALU, etc., compared to the verification using a normal 8-bit or 1-bit port. .

〔発明の効果〕〔The invention's effect〕

以上のように、この発明に係るPROM内蔵マイコンによ
れば、該PROM内蔵マイコンの内部のPROMとRAMにデータ
を書き込み、マイコンコアに内蔵された比較回路を用い
てPROMのデータを検証し、PROMの読み出しに制限を加え
ることによりPROM読み出しモードがなくても書き込みデ
ータの検証が可能になり、PROMのデータを外部に読みだ
すことが困難であるため、PROMの内容を秘密化するのが
容易となる効果がある。
As described above, according to the microcomputer with a built-in PROM according to the present invention, the data is written into the PROM and the RAM inside the microcomputer with a built-in PROM, the data in the PROM is verified using a comparison circuit built in the microcomputer core, and the PROM is verified. By restricting the reading of the PROM, it is possible to verify the write data without the PROM read mode, and it is difficult to read the PROM data to the outside, so it is easy to keep the contents of the PROM secret. There is an effect.

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

第1図は本発明の一実施例によるPROM内蔵マイコンの構
成を示す模式図、第2図は本発明の一実施例によるPROM
内蔵マイコンの書き込み方法を示す模式図、第3図は従
来例によるPROM内蔵マイコンの構成を示す模式図、第4
図は従来例によるPROM内蔵マイコンの書き込み方法を示
す模式図である。 図において、1はPROM、2はRAM、3は比較回路、4,5は
レジスタ、6は検証フラグ、7は書き込みフラグ、8は
マイコンコア、9はアドレスバス、10はデータバス、11
はマイコンモード線、12は書き込み/検証モード線、13
は書き込み線、14はPROM内蔵マイコンである。 なお図中同一符号は同一又は相当部分を示す。
FIG. 1 is a schematic diagram showing a configuration of a PROM built-in microcomputer according to one embodiment of the present invention, and FIG. 2 is a PROM according to one embodiment of the present invention.
FIG. 3 is a schematic diagram showing a writing method of a built-in microcomputer, FIG. 3 is a schematic diagram showing a configuration of a conventional PROM built-in microcomputer, FIG.
FIG. 1 is a schematic diagram showing a writing method of a conventional PROM built-in microcomputer. In the figure, 1 is a PROM, 2 is a RAM, 3 is a comparison circuit, 4 and 5 are registers, 6 is a verification flag, 7 is a write flag, 8 is a microcomputer core, 9 is an address bus, 10 is a data bus, 11
Is the microcomputer mode line, 12 is the write / verify mode line, 13
Is a write line, and 14 is a microcomputer with a built-in PROM. In the drawings, the same reference numerals indicate the same or corresponding parts.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】マイコンコアおよびPROMを内蔵したPROM内
蔵マイコンにおいて、 製造後に使用者が書き込み可能で電源が供給されなくて
もデータを保持することができ、所定の条件が整わない
と読み出されない上記PROMと、 随時読み書き可能で、上記PROMと同じデータが書き込ま
れる,電源が供給されないとデータが失われるRAMと、 複数の信号線で構成され、上記RAM,PROMあるいは外部デ
バイスを区別し、RAMまたはPROMの内部の任意のアドレ
スを選択するアドレスバスと、 複数の信号線で構成され、任意のアドレスの上記PROM,R
AMあるいはレジスタ,外部の回路との間でデータの授受
を行うデータバスと、 上記マイコンコア内に設けられた、 上記データバスの幅に相当するデータを記憶でき、上記
PROM、および上記RAMに書き込まれたデータを、上記デ
ータバスを介して転送され、これを記憶する複数のレジ
スタと、 上記データバスの幅に相当するデータの比較をすること
ができ、上記複数のレジスタのうち、上記PROMに書き込
まれたデータを記憶した一のレジスタの内容と、上記RA
Mに書き込まれた内容を記憶した他のレジスタの内容と
を比較する比較手段と、 上記PROMにデータの読み出しを許可するために用いられ
るものであり、上記PROMに対しての書き込み動作があっ
た場合にセットされ、上記比較手段が行う上記比較の結
果が不一致であった場合にリセットされる書き込みフラ
グと、 後述する検証結果を蓄積するために用いられるものであ
り、上記PROMに対しての書き込み動作があった場合にリ
セットされ、当該検証結果が不一致であったときセット
される,検証フラグとからなり、 上記PROMのデータの検証にあたり、上記書き込みフラグ
がセットされている場合、当該マイコン内部で、上記比
較手段の行う上記比較によって、上記PROMのデータを外
部へ読み出すことなく書き込みデータを検証して、一
致、又は不一致の検証結果を取得する検証手段とを備
え、 マイコン本来の動作をするマイコンモード,外部からの
データをPROMとRAMとの両方に書き込む書き込みモー
ド,およびPROMとRAMとのデータをマイコン内部で検証
する検証モードの3つのモードを有することを特徴とす
るPROM内蔵マイコン。
1. A microcomputer with a built-in PROM including a microcomputer core and a PROM, which can be written by a user after manufacture and can retain data even when power is not supplied, and cannot be read unless predetermined conditions are satisfied. The above PROM, a RAM which is readable and writable at any time, writes the same data as the above PROM, and loses data when power is not supplied; Alternatively, an address bus for selecting an arbitrary address inside the PROM, and a plurality of signal lines, and the above-mentioned PROM, R
A data bus for exchanging data with an AM or a register or an external circuit; and a data bus provided in the microcomputer core and corresponding to a width of the data bus.
The data written to the PROM and the RAM is transferred via the data bus, and a plurality of registers storing the data can be compared with data corresponding to the width of the data bus. Of the registers, the contents of one register storing the data written to the PROM and the RA
A comparing means for comparing the contents written in M with the contents of other registers storing the contents, and used for permitting the PROM to read data, and there was a write operation to the PROM. And a write flag that is set when the result of the comparison performed by the comparing means does not match, and is used to accumulate a verification result described later, and is used for writing to the PROM. It is reset when there is an operation, and is set when the verification result does not match. It consists of a verification flag. When verifying the data of the PROM, if the write flag is set, the By the comparison performed by the comparing means, the write data is verified without reading the data of the PROM to the outside, and a match or a mismatch is verified. Verification means for obtaining the verification results, a microcontroller mode in which the original operation of the microcontroller is performed, a write mode in which external data is written to both the PROM and the RAM, and verification for verifying the data in the PROM and the RAM inside the microcontroller A microcomputer with a built-in PROM, which has three modes.
JP31833390A 1990-11-21 1990-11-21 Microcomputer with built-in PROM Expired - Fee Related JP2702277B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31833390A JP2702277B2 (en) 1990-11-21 1990-11-21 Microcomputer with built-in PROM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31833390A JP2702277B2 (en) 1990-11-21 1990-11-21 Microcomputer with built-in PROM

Publications (2)

Publication Number Publication Date
JPH04188247A JPH04188247A (en) 1992-07-06
JP2702277B2 true JP2702277B2 (en) 1998-01-21

Family

ID=18097998

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31833390A Expired - Fee Related JP2702277B2 (en) 1990-11-21 1990-11-21 Microcomputer with built-in PROM

Country Status (1)

Country Link
JP (1) JP2702277B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5462453B2 (en) * 2008-06-19 2014-04-02 富士通セミコンダクター株式会社 Semiconductor device

Also Published As

Publication number Publication date
JPH04188247A (en) 1992-07-06

Similar Documents

Publication Publication Date Title
JPH11126174A (en) Device and method for reading memory information of microprocessor
US20080263422A1 (en) Control of the integrity of a memory external to a microprocessor
JPH0869377A (en) Electronic circuit and method for use of coprocessor
US20060010263A1 (en) Direct memory access (DMA) devices, data transfer systems including DMA devices and methods of performing data transfer operations using the same
JP3673015B2 (en) Peripheral device identification method in semiconductor device
JP2702277B2 (en) Microcomputer with built-in PROM
JP3078000B2 (en) Information processing device
JP2859184B2 (en) Field programmable gate array
JPH1091593A (en) Data processor provided with microprocessor and optional calculation unit
JP3323526B2 (en) Digital signal processor
JPS61134856A (en) Ram check circuit
JP2002150795A (en) Semiconductor integrated circuit
JP2984628B2 (en) Microcomputer
JPH10198524A (en) Hard disk controller
JP3168845B2 (en) Digital signal processor
JP2002215413A (en) Firmware transfer method and inter-module data transmission system
JPH02177091A (en) Prom built-in integrated circuit
JP2000132209A (en) Programmable controller
JP2000132491A (en) Method and system for device control
JPH07334359A (en) Semiconductor integrated circuit device
JPH1115713A (en) Data transmitter-receiver
JPH05204775A (en) Local memory diagnostic device
JP2001320358A (en) Processor for ciphering data
JPH06282413A (en) Comparing circuit
KR19980017737A (en) Bit operation processing method and program apparatus of programmable controller

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees