JP3205998B2 - Single chip microcomputer - Google Patents

Single chip microcomputer

Info

Publication number
JP3205998B2
JP3205998B2 JP30656990A JP30656990A JP3205998B2 JP 3205998 B2 JP3205998 B2 JP 3205998B2 JP 30656990 A JP30656990 A JP 30656990A JP 30656990 A JP30656990 A JP 30656990A JP 3205998 B2 JP3205998 B2 JP 3205998B2
Authority
JP
Japan
Prior art keywords
circuit
test
shift register
data
value
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
JP30656990A
Other languages
Japanese (ja)
Other versions
JPH04178747A (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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP30656990A priority Critical patent/JP3205998B2/en
Publication of JPH04178747A publication Critical patent/JPH04178747A/en
Application granted granted Critical
Publication of JP3205998B2 publication Critical patent/JP3205998B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、単一半導体基板上にメモリ機能及びコンピ
ュータ機能を集積したシングルチップマイクロコンピュ
ータに関し、特に内蔵PROMに格納したパスワードに対応
したデータを外部から入力した場合のみ内部PROMを直接
外部よりテスト可能としたシングルチップマイクロコン
ピュータに関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a single-chip microcomputer having a memory function and a computer function integrated on a single semiconductor substrate, and more particularly, to data corresponding to a password stored in a built-in PROM. The present invention relates to a single-chip microcomputer in which an internal PROM can be directly tested externally only when externally input.

〔従来の技術〕[Conventional technology]

近年はLSI製造技術の進歩により、シングルチップマ
イクロコンピュータ(以下シングルチップマイコンとい
う)の分野においても高集積化が進み、単位機能当たり
のコストの低下も著しくなってきている。
In recent years, due to advances in LSI manufacturing technology, high integration has been progressing in the field of single-chip microcomputers (hereinafter, also referred to as single-chip microcomputers), and the cost per unit function has been significantly reduced.

従来、銀行などの金融機関においては磁気カードが主
に使用されていたが、磁気カードは記憶容量が少く、ま
たセキュリティの面で問題があり、最近では不正使用、
偽造など多くの犯罪が頻発し、大きな社会問題となって
いる。ここに、この磁気カードに代るものとしてシング
ルチップマイコンを搭載したICカードが登場し、国内外
において実用化に向けて大規模な実験が進んでいる。こ
のICカードは、磁気カードに比べ、記憶容量も数段大き
く、またカード内にコンピュータ機能を内蔵しているの
でセキュリティの面でも格段の信頼度がある。
In the past, magnetic cards were mainly used in financial institutions such as banks, but magnetic cards have a small storage capacity and have security problems, and recently, unauthorized use,
Many crimes, such as counterfeiting, occur frequently and have become a major social problem. Here, an IC card equipped with a single-chip microcomputer has appeared as an alternative to the magnetic card, and large-scale experiments are being carried out in Japan and overseas for practical use. This IC card has a storage capacity several steps larger than that of a magnetic card, and has a built-in computer function in the card, so that it has extremely high reliability in terms of security.

一般に、シングルチップマイコンを搭載したICカード
においては、データメモリの大部分にUVEPROM(Ultra−
Violet Erasable Programmable ROM)またはEEPROM(El
ectrical Erasable Programmable ROM)を使用しており
(以下UVEPROM、EEPROMを含む場合PROMという)、その
データメモリをいくつかの領域に分割しそのアクセスを
管理している。
Generally, in an IC card equipped with a single-chip microcomputer, most of the data memory has a UVEPROM (Ultra-
Violet Erasable Programmable ROM) or EEPROM (El
(Electrical Erasable Programmable ROM) is used (hereinafter referred to as PROM when including UVEPROM and EEPROM), and its data memory is divided into several areas to manage access.

銀行などの金融機関でのキャッシュカード,クレジッ
トカードとしてICカードを使用する場合、この分割され
たデータメモリの一部をシークレット・ゾーン(Secret
Zone)と呼び、銀行の口座番号,IDナンバー,シークレ
ットナンバーなど機密性の高いデータの格納に使用して
いる。
When using an IC card as a cash card or a credit card at a financial institution such as a bank, a part of the divided data memory is used as a secret zone (Secret zone).
Zone), which is used to store highly sensitive data such as bank account numbers, ID numbers, and secret numbers.

そのシークレット・ゾーンはICカードの不正使用、偽
造を防止する上で重要な部分であって、このICカード使
用時にはソフトウェアによりその領域に対するアクセス
を管理し、特別の場合だけその領域に対しアクセスでき
るようになっている。ところが、テストモード時には、
容易に外部より内蔵PROM全領域に直接アクセスが可能で
あり、シークレット・ゾーン内の値を読出して悪用した
り、故意に変更することが可能であるという欠点があっ
た。
The secret zone is an important part of preventing unauthorized use and forgery of the IC card.When using this IC card, access to the area is controlled by software, and it is possible to access the area only in special cases. It has become. However, in the test mode,
The entire area of the built-in PROM can be easily accessed directly from the outside, and the value in the secret zone can be read and abused or changed intentionally.

第14図は従来のシングルチップマイコンの一例のブロ
ック図である。この図において、メモリ部3はユーザプ
ログラム格納及びデータの格納に用いる読出し専用また
は、読出し書込ともに可能なメモリ、内部バス4はアド
レス及びデータを時分割に転送するバス、内部バス8
は、テストモード時に外部端子10を介して内部バス4に
アドレス及びデータを転送する際に用いる時分割バスで
ある。
FIG. 14 is a block diagram of an example of a conventional single-chip microcomputer. In this figure, a memory unit 3 is a read-only or read-write memory used for storing user programs and data, an internal bus 4 is a bus for transferring addresses and data in a time-division manner, and an internal bus 8
Is a time division bus used for transferring addresses and data to the internal bus 4 via the external terminals 10 in the test mode.

中央処理装置(以下CPUという)2は、メモリ部3に
格納したプログラムに従ってデータ処理を行ない、テス
トモード時には、内部バス8及び外部端子10を介しチッ
プ外部からプログラムをフェッチして実行する。周辺部
6は、チップ外部との通信を行なうためのポート等から
構成され、内部バス4を介して入力したデータを外部端
子61に出力し、また外部端子61からデータを入力して内
部バス4に出力する機能を持つ。
A central processing unit (hereinafter, referred to as a CPU) 2 performs data processing according to a program stored in a memory unit 3, and fetches and executes a program from outside the chip via an internal bus 8 and an external terminal 10 in a test mode. The peripheral unit 6 includes a port for performing communication with the outside of the chip, and outputs data input through the internal bus 4 to the external terminal 61 and inputs data from the external terminal 61 to the internal bus 4. It has the function to output to.

PROM5はデータメモリとしてUVEPROMまたはEEPROMから
構成され、メモリ内にはシークレット・ゾーン51を有
し、カードのIDナンバー,シークレットナンバー,口座
番号等を格納しており、CPU2の命令により読出し及び書
込みを行なう。そのシークレット・ゾーン51へのアクセ
ス管理は、ユーザがソフトウェアにより行なっている。
The PROM 5 is composed of a UVEPROM or an EEPROM as a data memory, has a secret zone 51 in the memory, stores an ID number of the card, a secret number, an account number, etc., and performs reading and writing according to instructions of the CPU 2. . The user manages access to the secret zone 51 by software.

また、端子15は、テストモード時に「1」とする外部
入力端子であり、この時インバータ7の出力が「0」と
なるため、内部バス4にはPROM5のみ接続され、PROM5へ
のアクセスがチップ外部より直接可能となり、端子10
は、内部バス8を介してアドレス及びデータを外部に入
出力端子で、内部バス4に接続されており、端子12は、
CPU2の出力するCPUクロック11を出力する端子、端子13
は、CPU2をリセットする端子であり、これが「1」の時
リセット信号14が「1」となりCPU2をリセットする。
The terminal 15 is an external input terminal which is set to "1" in the test mode. At this time, since the output of the inverter 7 is "0", only the PROM 5 is connected to the internal bus 4 and access to the PROM 5 is performed by the chip. Directly available from outside, terminal 10
Is an input / output terminal for externally inputting addresses and data via the internal bus 8 and is connected to the internal bus 4;
Terminal to output CPU clock 11 output by CPU2, terminal 13
Is a terminal for resetting the CPU2. When this terminal is "1", the reset signal 14 becomes "1" and resets the CPU2.

このシステムのテスト時の動作を説明する。 The operation of this system during a test will be described.

まず端子13を「1」のまま端子15「1」とし、端子13
をCPUクロック11の立下がりに同期して「0」とする。
この時、テスト信号9は「1」となりインバータ7の出
力は「0」となるので、CPU2,メモリ部3,周辺部6は内
部バス4から電気的に切離される。従って、内部バス4
に接続されているのはPRO5Mのみとなる。
First, the terminal 13 is changed to the terminal 15 “1” while the terminal 13 is set to “1”.
To “0” in synchronization with the fall of the CPU clock 11.
At this time, the test signal 9 becomes "1" and the output of the inverter 7 becomes "0", so that the CPU 2, the memory section 3, and the peripheral section 6 are electrically disconnected from the internal bus 4. Therefore, internal bus 4
Is connected only to PRO5M.

この状態で外部端子10,内部バス8を介してアドレス
及びデータをPROM5に入力し、データの読出し及び書込
を行なう。
In this state, an address and data are input to the PROM 5 via the external terminal 10 and the internal bus 8 to read and write data.

この時、シークレットゾーン51のアドレスを入力すれ
ば容易にゾーン内データにアクセス可能であり、従って
データリード及びライトが容易に行なえることとなる。
At this time, if the address of the secret zone 51 is input, the data in the zone can be easily accessed, so that data reading and writing can be easily performed.

このように従来のシングルチップマイコンにおいて
は、秘匿データを格納するシークレット・ゾーンに対す
るアクセス管理をすべてユーザのソフトウェアにより行
なっている。このようなシングルチップマイコンをカー
ドに搭載した場合、テストモードを使用することによ
り、シークレット・ゾーンに対し不当なデータアクセス
を行なうことが可能である。さらに、データメモリに電
気消去型読出し専用メモリ(EEPROM)が使用されている
場合には、書込み命令が実行されるとPROM内部で自動的
に書込み用の電圧が生成されるので、シークレット・ゾ
ーンに対し、不当な書込みが容易に行なうことが可能と
なる。
As described above, in the conventional single-chip microcomputer, access control to the secret zone storing secret data is entirely performed by the user's software. When such a single-chip microcomputer is mounted on a card, illegal data access to the secret zone can be performed by using the test mode. Furthermore, if an electrically erasable read-only memory (EEPROM) is used as the data memory, a write voltage is automatically generated inside the PROM when a write instruction is executed. On the other hand, improper writing can be easily performed.

第15図は従来の別のシングルチップマイクロコンピュ
ータのブロック図である。
FIG. 15 is a block diagram of another conventional single-chip microcomputer.

このマイクロコンピュータICは、第14図に対してPROM
の代りにEEPROM5aを用い、このEEPROM5aにプログラム信
号42により制御されるライト回路52を含む点が相違して
いる。
This microcomputer IC has a PROM
Instead, an EEPROM 5a is used, and the EEPROM 5a includes a write circuit 52 controlled by a program signal 42.

PROM5aはデータメモリとしてEEPROMから構成され、メ
モリ内にはシークレット・ゾーン51があり、カードのID
ナンバー,シークレットナンバー,口座番号等が格納さ
れ、CPU2の命令により読出し及び書込みを行なう。その
書込みの際には、プログラム信号42をPROM5a内のライト
回路52に対して出力する、 次に、このマイクロコンピュータのテスト時の動作を
説明する。
The PROM 5a is composed of an EEPROM as data memory, has a secret zone 51 in the memory, and has a card ID.
A number, a secret number, an account number, and the like are stored, and are read and written by a command from the CPU 2. At the time of writing, the program signal 42 is output to the write circuit 52 in the PROM 5a. Next, the operation of this microcomputer during a test will be described.

端子13を1のまま端子15を1とし、端子13をCPUクロ
ック11の立ち下がりに同期して0とする。この時、テス
ト信号9は1となりインバータ7の出力は0となるので
メモリ部3,周辺部6は内部バス4から電気的に切り離さ
れる。従って、内部バス4に接続されているのはPROM5a
及びCPU2のみとなる。
The terminal 15 is set to 1 while the terminal 13 remains 1, and the terminal 13 is set to 0 in synchronization with the fall of the CPU clock 11. At this time, the test signal 9 becomes 1 and the output of the inverter 7 becomes 0, so that the memory section 3 and the peripheral section 6 are electrically disconnected from the internal bus 4. Therefore, the PROM 5a is connected to the internal bus 4.
And only CPU2.

この状態で外部端子10,内部バス8を介してCPU2の出
力するアドレスに従って命令及びデータを入力し、CPU2
のプログラム実行によりPROM5aに対しデータを読出し及
び書込みを行なう。この書込みは、CPU2の命令により行
ない、この時のCPU2はプログラム信号42をPROM5a内のラ
イト回路52に対して出力する。
In this state, an instruction and data are input according to the address output from the CPU 2 via the external terminal 10 and the internal bus 8, and the CPU 2
Data is read from and written to the PROM 5a by executing the program. This writing is performed according to a command from the CPU 2, and at this time, the CPU 2 outputs the program signal 42 to the write circuit 52 in the PROM 5a.

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

上述した従来のデータメモリにおいては、アクセス保
護の領域であるシークレット・ゾーンへのアクセスを管
理しているシングルチップマイコンが内蔵PROMまたはEE
PROMへのアクセス管理をすべてソフトウェアによって行
なっているので、テストモード時に容易にアクセス可能
であり、不正なアクセスが行なわれてシークレット・ゾ
ーン内のデータが悪用されたり、また故意にデータが書
き換えられる危険性が在るという欠点が存在した。
In the conventional data memory described above, a single-chip microcomputer that manages access to the secret zone, which is an area of access protection, has a built-in PROM or EE.
Since all access control to the PROM is performed by software, it can be easily accessed in the test mode, and there is a risk that unauthorized access will result in misuse of data in the secret zone or intentional rewriting of data. There was a drawback of having sex.

本発明の目的は、このような欠点を除き、簡単なテス
ト回路を付加することにより、テストモード時の不当な
アクセスを排除し、より確実なセキュリティを容易に得
られるようにしたシングルチップマイクロコンピュータ
を提供することにある。
An object of the present invention is to provide a single-chip microcomputer which eliminates such drawbacks and adds a simple test circuit, thereby eliminating unauthorized access in a test mode and easily obtaining more reliable security. Is to provide.

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

本発明の構成は、単一半導体基板上に中央処理装置,
記憶部,周辺部およびPROMを集積し、このPROMに対しテ
スト回路によりテストが実行されるようにしたシングル
チップマイクロコンピュータにおいて、前記PROMには複
数のパスワードが格納され、前記テスト回路は、外部か
ら入力した2個の第1および第2のフィールドから成る
データをシリアルに一時記憶するシフトレジスタと、こ
のシフトレジスタの出力の前記第2のフィールドのデー
タを暗号化する暗号化回路と、前記シフトレジスタの出
力の前記第1のフィールドでアドレス指定されて前記PR
OMから読出された複数のパスワードのうちの1個の値お
よび前記暗号化回路により暗号化した値を比較する比較
回路と、この比較回路の比較値が等しい場合にのみ外部
から前記PROMへのテストを可能とするようにしたことを
特徴とする。
The configuration of the present invention comprises a central processing unit on a single semiconductor substrate,
In a single-chip microcomputer in which a storage unit, a peripheral unit, and a PROM are integrated and a test is performed on the PROM by a test circuit, a plurality of passwords are stored in the PROM, and the test circuit is externally provided. A shift register for temporarily storing serially the input data consisting of the two first and second fields, an encryption circuit for encrypting the data of the second field of the output of the shift register, and the shift register Addressed in the first field of the output of the PR
A comparison circuit for comparing one of a plurality of passwords read from the OM and a value encrypted by the encryption circuit, and a test from the outside to the PROM only when the comparison value of the comparison circuit is equal Is made possible.

本発明の他の特徴は、単一半導体基板上に中央処理装
置,記憶部,周辺部および電気的に書込みのできるEEPR
OMを集積し,このEEPROMに対しテスト回路によりテスト
が実行されるようにしたシングルチップマイクロコンピ
ュータにおいて、前記EEPROMにはパスワードが格納さ
れ、前記テスト回路は、外部から入力したデータをシリ
アルに一時記憶するシフトレジスタと、このシフトレジ
スタへの入力ビット数をカウントしてこのシフトレジス
タを制御するカウンタと、前記パスワードの値および前
記シフトレジスタに入力した値を比較する比較回路とを
備え、この比較回路の比較値が等しい場合にのみ外部か
ら前記EEPROMへのテストを可能とするとともに、再度前
記シフトレジスタに入力した値を前記EEPROMにライトす
ることにより前記パスワードを更新することを特徴とす
る。
Another feature of the present invention is that a central processing unit, a memory unit, a peripheral unit and an electrically writable EEPROM are provided on a single semiconductor substrate.
In a single-chip microcomputer in which an OM is integrated and a test is performed on the EEPROM by a test circuit, a password is stored in the EEPROM, and the test circuit temporarily stores data input from the outside in a serial manner. A shift register, a counter for counting the number of bits input to the shift register and controlling the shift register, and a comparison circuit for comparing the value of the password and the value input to the shift register. Only when the comparison values are equal to each other, a test to the EEPROM can be performed from the outside, and the password is updated by writing the value input to the shift register to the EEPROM again.

〔実施例〕〔Example〕

次に、本発明について図面を用いて説明する。 Next, the present invention will be described with reference to the drawings.

第1図は本発明の第1の実施例のシングルチップマイ
コンのブロック図である。本実施例のシングルチップマ
イコンは、新たに追加したテスト回路17以外の構成要素
は、第14図の従来例と同じであり、このテスト回路17を
中心に説明する。
FIG. 1 is a block diagram of a single-chip microcomputer according to a first embodiment of the present invention. The components of the single-chip microcomputer of this embodiment other than the newly added test circuit 17 are the same as those of the conventional example shown in FIG. 14, and the test circuit 17 will be mainly described.

図において、テスト回路17は、CPUの出力するクロッ
ク信号11に同期して外部端子19よりシリアルに2個のフ
ィールド(フィールド1及びフィールド2)から成るデ
ータを入力し、フィールド1でアドレス指定するPROM5
内のシークレットゾーン51内に格納した複数のパスワー
ドのうちの1個の値とフィールド2を比較して、一致す
る場合のみテストモードを許可する機能を有している。
In the figure, a test circuit 17 inputs data consisting of two fields (field 1 and field 2) serially from an external terminal 19 in synchronization with a clock signal 11 output from the CPU, and specifies a PROM 5 for addressing in field 1.
Has a function of comparing one value of a plurality of passwords stored in the secret zone 51 in the field 2 with the field 2 and permitting the test mode only when they match.

第2図は第1図のテスト回路17の構成を示すブロック
図である。
FIG. 2 is a block diagram showing the configuration of the test circuit 17 of FIG.

テスト回路17は、シフトレジスタ20,暗号回路21,比較
回路22,カウンタ24から構成される。シフトレジスタ20
は、リセット信号14が0でシフト許可信号28が1の時、
CPUクロック11の立下りに同期して信号線18上の10ビッ
トシリアルデータ(2ビット長のフィールド1及び8ビ
ット長のフィールド2から構成する)を入力する。暗号
回路21は、シフトレジスタ20の格納するフィールド2を
暗号化し、出力する。
The test circuit 17 includes a shift register 20, an encryption circuit 21, a comparison circuit 22, and a counter 24. Shift register 20
When the reset signal 14 is 0 and the shift enable signal 28 is 1,
In synchronization with the falling edge of the CPU clock 11, 10-bit serial data (composed of a 2-bit field 1 and an 8-bit field 2) on a signal line 18 is input. The encryption circuit 21 encrypts the field 2 stored in the shift register 20 and outputs it.

比較回路22は、暗号回路21の出力と、フィールド1に
対応したアドレス信号40でアドレス指定するPROM5内の
シークレットゾーン51に格納した複数パスワードのうち
の1個であるパスワード23の値を比較し、一致した時の
みテスト信号9を出力する。カウンタ24は、シフトレジ
スタ20のシフト動作を制御する回路で、基本クロック11
の立上がりに同期し、テストモード信号16が1で、リセ
ット信号14が0の時のみ、CPUクロック11をカウントす
るとともに、シフトレジスタ20に対しシフト許可信号28
を出力する。
The comparison circuit 22 compares the output of the encryption circuit 21 with the value of the password 23 which is one of a plurality of passwords stored in the secret zone 51 in the PROM 5 addressed by the address signal 40 corresponding to the field 1, The test signal 9 is output only when they match. The counter 24 is a circuit for controlling the shift operation of the shift register 20, and includes a basic clock 11
Only when the test mode signal 16 is 1 and the reset signal 14 is 0, the CPU clock 11 is counted and the shift register 20
Is output.

次に、テスト回路17の動作を説明する。 Next, the operation of the test circuit 17 will be described.

まず、リセット信号14を1のままテストモード信号16
を0としておく。次に、テスト信号モード16を1とし、
リセット信号14をCPUクロック11の立下りに同期して0
とする。CPUクロック11の立上りに同期して、外部端子1
9よりシリアルに10ビットデータを入力する。
First, the test mode signal 16 is kept while the reset signal 14 is kept at 1.
Is set to 0. Next, the test signal mode 16 is set to 1 and
Reset signal 14 is set to 0 in synchronization with the fall of CPU clock 11.
And External pin 1 is synchronized with the rising edge of CPU clock 11.
Input 10-bit data serially from 9.

この時カウンタ24は、CPUクロック11に同期して11回
カウントするとともに、シフト許可信号28を1としシフ
トレジスタ20に対し出力する。カウンタ24は、11回カウ
ント動作後シフト許可信号28は0にして停止する。
At this time, the counter 24 counts 11 times in synchronization with the CPU clock 11, sets the shift permission signal 28 to 1, and outputs it to the shift register 20. After counting 11 times, the counter 24 sets the shift permission signal 28 to 0 and stops.

シフトレジスタ20は、シフト許可信号28が1の時、CP
Uクロック11の立下りに同期してシフト動作を10回行な
った後、シフト許可信号28が0となるとめシフト動作を
停止する。また、リセット信号14が1のとき、格納値を
0にクリアする。10ビットの入力データは、上位2ビッ
トがフィールド1で残り8ビットがフィールド2に対応
する。10ビットのシリアルデータを受信後、シフトレジ
スタ20の格納値のうちフィールド2は、暗号回路21によ
り暗号化され、比較回路22に出力される。
When the shift enable signal 28 is 1, the shift register 20
After performing the shift operation ten times in synchronization with the falling of the U clock 11, the shift operation is stopped when the shift permission signal 28 becomes 0. When the reset signal 14 is 1, the stored value is cleared to 0. In the 10-bit input data, the upper 2 bits correspond to field 1 and the remaining 8 bits correspond to field 2. After receiving the 10-bit serial data, the field 2 of the stored value of the shift register 20 is encrypted by the encryption circuit 21 and output to the comparison circuit 22.

比較回路22は、PROM5内のシークレットゾーン51内に
格納した複数のパスワードのうち、アドレス信号40にて
アドレス指定されたパスワード23と比較し、これらの値
が同一の場合テスト信号9を出力する。
The comparison circuit 22 compares the password stored in the secret zone 51 in the PROM 5 with the password 23 addressed by the address signal 40, and outputs the test signal 9 when these values are the same.

このテスト回路17の動作タイミングを、第3図に示
す。
The operation timing of the test circuit 17 is shown in FIG.

次にカウンタ24の構成及び動作を第4図により説明す
る。
Next, the configuration and operation of the counter 24 will be described with reference to FIG.

カウンタ24は、4ビットのアップカウンタ30,ANDゲー
ト31,NANDゲート32から構成される。リセット信号14が
1の時、アップカウンタ30はクリアされて、動作を停止
する。
The counter 24 includes a 4-bit up counter 30, an AND gate 31, and a NAND gate 32. When the reset signal 14 is 1, the up counter 30 is cleared and stops operating.

リセット信号14が0でテストモード信号16が1の時、
カウンタ30はANDゲート31の出力の立上がりに同期して
カウントアップする。11回カウントすると、第3ビット
=第1ビット=第0ビット=0となるため、NANDゲート
32の出力が0となる。従って、ANDゲート31の出力も0
となり、カウンタ30はカウント動作を停止する。
When the reset signal 14 is 0 and the test mode signal 16 is 1,
The counter 30 counts up in synchronization with the rising of the output of the AND gate 31. After counting 11 times, 3rd bit = 1st bit = 0th bit = 0, so the NAND gate
The output of 32 becomes 0. Therefore, the output of the AND gate 31 is also 0
And the counter 30 stops counting.

次に、暗号回路21の構成を第5図を用いて説明する。 Next, the configuration of the encryption circuit 21 will be described with reference to FIG.

暗号回路21は、8ビットの入力データに対し、以下の
データ変換を行なった後8ビットデータを出力する。
The encryption circuit 21 outputs the 8-bit data after performing the following data conversion on the 8-bit input data.

(1) ビット0とビット7を入替え、ビット7は反転
し、ビット0はそのまま出力する。
(1) Bits 0 and 7 are interchanged, bit 7 is inverted, and bit 0 is output as it is.

(2) ビット6は、反転後そのまま出力する。(2) Bit 6 is output as it is after inversion.

(3) ビット4とビット5は、入替えた後反転し出力
する。
(3) Bits 4 and 5 are interchanged and then inverted and output.

(4) ビット1,ビット2,ビット3はそのまま出力す
る。
(4) Bit 1, bit 2, and bit 3 are output as they are.

例えば、入力FFHの時出力は0FHとなる。 For example, when the input is FFH, the output is 0FH.

ここでパスワードは8ビット長であるから、28=256
通のパタンが存在する。しかも、暗号回路にて入力デー
タをスクランブルし、かつ4個のパスワードのうち1個
を使用するので、テストモードを実現可能の10ビットパ
タンを検出するのがより、困難となり、第3者によるテ
ストモードの実行はより困難となる。
Since the password is 8 bits long, 2 8 = 256
There are common patterns. In addition, since the input data is scrambled by the encryption circuit and one of the four passwords is used, it becomes more difficult to detect a 10-bit pattern that can realize the test mode, and a third party performs a test. Mode execution becomes more difficult.

本実施例においては、簡単のハードウェアから構成さ
れるテスト回路17を付加することにより、第3者による
テストモードの実現が容易でなくなり、シークレット・
ゾーン51内のデータに対する不当なアクセスやデータの
消失を防ぐことができ、高度なフェール・セーフが実現
される。
In this embodiment, by adding the test circuit 17 composed of simple hardware, it is not easy to realize the test mode by a third party, and the secret
Unauthorized access to the data in the zone 51 and loss of the data can be prevented, and a high level of fail-safe is realized.

第6図は本発明における第2の実施例のシングルチッ
プマイクロコンピュータに用いられるテスト回路17aの
ブロック図である。
FIG. 6 is a block diagram of a test circuit 17a used in a single-chip microcomputer according to a second embodiment of the present invention.

本実施例のシングルチップマイクロコンピュータにお
けるテスト回路17aは、第1の実施例のテスト回路17に
対して、10ビットのシリアル入力データ全てを暗号化
後、PROM5に内蔵した複数パスワードを指定するアドレ
ス信号及び比較データとして使用する点で相違してお
り、他の構成及び動作に差異はないので、以下シフトレ
ジスタ20にデータ入力後の動作を説明する。
The test circuit 17a in the single-chip microcomputer of the present embodiment is different from the test circuit 17 of the first embodiment in that after encrypting all 10-bit serial input data, an address signal for designating a plurality of passwords built in the PROM 5 is obtained. The operation after inputting data to the shift register 20 will be described below because there is no difference in the other configuration and operation.

このテスト回路17aにおいては、シフトレジスタ20に1
0ビットデータを入力後、暗号回路25aにて暗号化し、10
ビットデータを出力する。この出力データのうち、上位
2ビットをフィールド1及び残りのビットをフィールド
2に割当て、フィールド1をアドレス信号40としPROM5
のシークレットゾーン51に内蔵した4個のパスワードの
うち1個のパスワード23の指定に使用する。8ビット長
のフィールド2は、比較回路22にてパスワード23と比較
するのに使用する。このテスト回路17aは、両者が一致
した場合のみテスト信号9を出力し、テストモードを実
現する。
In this test circuit 17a, 1
After inputting 0-bit data, the encryption circuit 25a encrypts
Outputs bit data. Of the output data, the upper 2 bits are assigned to field 1 and the remaining bits are assigned to field 2, and field 1 is used as an address signal 40 for PROM5.
Is used to designate one password 23 among the four passwords built in the secret zone 51. The 8-bit long field 2 is used for comparison with the password 23 in the comparison circuit 22. The test circuit 17a outputs the test signal 9 only when both match, and implements the test mode.

第7図は第6図内の暗号回路21aの構成を示すブロッ
ク図である。
FIG. 7 is a block diagram showing the configuration of the encryption circuit 21a in FIG.

この暗号回路21aは10ビットの入力データに対し、次
のデータ変換を行ない、10ビットデータを出力する。
The encryption circuit 21a performs the following data conversion on the 10-bit input data and outputs 10-bit data.

ビット0とビット7を入替え、ビット7を反転し、ビ
ット0はそのまま出力し、ビット4は反転後出力し、ビ
ット5とビット6は入替えた後反転し出力し、ビット8
とビット9は入替えた後反転し出力し、ビット1,ビット
2,ビット3はそのまま出力する。
Bit 0 and bit 7 are interchanged, bit 7 is inverted, bit 0 is output as it is, bit 4 is output after inversion, bit 5 and bit 6 are inverted and output after being inverted, bit 8
And bit 9 are exchanged and then inverted and output.
2, bit 3 is output as it is.

例えば、入力が3FFHの時出力は00FHとなる。となる。 For example, when the input is 3FFH, the output is 00FH. Becomes

ここでPROM5の出力するパスワードは8ビット長であ
るから、28=256通のパタンが存在する。しかも、暗号
回路にて入力データを全てスクランブルし、かつ4個の
パスワードのうち1個を使用するので、テストモードを
実現可能な10ビットパタンを検出するのがより困難とな
る。
Since the password output from the PROM 5 is 8 bits long, there are 2 8 = 256 patterns. In addition, since all the input data is scrambled by the encryption circuit and one of the four passwords is used, it becomes more difficult to detect a 10-bit pattern that can realize the test mode.

また、テスト回路17aはアドレス信号40となるフィー
ルド1をも暗号回路21aで暗号化しており、パスワード2
3と10ビット入力データとの関係がますます判別しにく
くなっている。従って、第3者によるテストモードの実
現は、第1の実施例よりも困難となる。
The test circuit 17a also encrypts the field 1 which becomes the address signal 40 by the encryption circuit 21a,
The relationship between 3 and 10-bit input data has become increasingly difficult to determine. Therefore, realization of the test mode by a third party is more difficult than in the first embodiment.

第8図は本発明の第3の実施例のシングルチップマイ
コンのブロック図である。本実施例においては、PROM5
としてEEPROM5aが用いられ、このEEPROM5aのライト回路
52にプログラム41により書込みが出来るようになってい
る。
FIG. 8 is a block diagram of a single-chip microcomputer according to a third embodiment of the present invention. In this embodiment, PROM5
EEPROM5a is used as the write circuit of this EEPROM5a.
52 can be written by the program 41.

本実施例もテスト回路17b以外の構成要素は、第15図
の従来例と相違がない。このテスト回路17bは、CPUの出
力するクロック信号11に同期して外部端子19よりシリア
ルにデータを入力し、アドレス信号40でアドレス指定す
るEEPROM5aに格納したCPU2からアクセス不可のパスワー
ドの値と入力データを比較して、一致する場合のみテス
トモードを許可する機能を有し、またテストモードにお
いてパスワードの値を更新する機能を有する。
In this embodiment, components other than the test circuit 17b are the same as those of the conventional example shown in FIG. This test circuit 17b inputs data serially from the external terminal 19 in synchronization with the clock signal 11 output from the CPU, and stores the password value and the input data inaccessible from the CPU 2 stored in the EEPROM 5a addressed by the address signal 40. Have a function of permitting the test mode only when they match, and a function of updating the password value in the test mode.

第9図は第8図のテスト回路17bのブロック図であ
る。
FIG. 9 is a block diagram of the test circuit 17b of FIG.

このテスト回路17bは、シフトレジスタ20,比較回路2
2,カウンタ24,ラッチ34,35,ANDゲート44から構成され
る。
The test circuit 17b includes a shift register 20, a comparison circuit 2
2, a counter 24, latches 34 and 35, and an AND gate 44.

シフトレジスタ20は、リセット信号14が0でシフト許
可信号28が1の時、CPUクロック11の立下りに同期して
信号線18上の8ビットシリアルデータを入力する。比較
回路22はシフトレジスタ20の出力と、EEPROM5aのパスワ
ード23の値を比較し、一致した時のみ信号を出力しラッ
チ35の出力を1とする。ラッチ35は比較回路22の出力に
より出力を1としテスト信号9を出力し、リセット信号
14により出力を0とする。
When the reset signal 14 is 0 and the shift enable signal 28 is 1, the shift register 20 inputs 8-bit serial data on the signal line 18 in synchronization with the fall of the CPU clock 11. The comparing circuit 22 compares the output of the shift register 20 with the value of the password 23 of the EEPROM 5a, outputs a signal only when the values match, and sets the output of the latch 35 to 1. The latch 35 sets the output to 1 according to the output of the comparison circuit 22, outputs a test signal 9, and outputs a reset signal.
The output is set to 0 by 14.

カウンタ24は、シフトレジスタ20のシフト動作を制御
し、基本クロック11の立下がりに同期し、テストモード
信号16が1の時のみ、CPUクロック11をカウントすると
ともに、シフトレジスタ20に対しシフト許可信号28を出
力し、テストモード信号16が0の時0にクリアされ、動
作を停止するラッチ34はカウンタ24のオーバフロウ信号
37により出力値を反転するラッチであり、リセット信号
14により1に設定する。
The counter 24 controls the shift operation of the shift register 20, synchronizes with the falling edge of the basic clock 11, counts the CPU clock 11 only when the test mode signal 16 is 1, and sends a shift enable signal to the shift register 20. The test mode signal 16 is cleared to 0 when the test mode signal 16 is 0, and the operation of the latch 34 is stopped.
This is a latch that inverts the output value according to 37.
Set to 1 by 14.

ANDゲート44は、テスト信号9及びラッチ34の出力信
号43を入力し論理積をとる2入力ANDゲートであり、プ
ログラム信号41を出力する。
The AND gate 44 is a two-input AND gate that receives the test signal 9 and the output signal 43 of the latch 34 and takes a logical product, and outputs a program signal 41.

このテスト回路17bの動作を説明する。 The operation of the test circuit 17b will be described.

まず、リセット信号14を1のままテストモード信号16
を0としておく。次に、テストモード16を1とし、リセ
ット信号14をCPUクロック11の立ち下がりに同期して0
とする。CPUクロック11の立上がりに同期して、外部端
子19よりシリアルに8ビットデータを入力する。
First, the test mode signal 16 is kept while the reset signal 14 is kept at 1.
Is set to 0. Next, the test mode 16 is set to 1 and the reset signal 14 is set to 0 in synchronization with the fall of the CPU clock 11.
And In synchronization with the rise of the CPU clock 11, 8-bit data is serially input from the external terminal 19.

この時カウンタ24は、CPUクロック11に同期して8回
カウントするとともに、シフトレジスタ許可信号28を1
としシフトレジスタ20に対し出力する。カウンタ24は、
8回カウント動作後シフト許可信号28を0にして停止す
る。またラッチ34はカウンタ24のオーバフロウ信号37に
従って値を反転0を出力する。
At this time, the counter 24 counts eight times in synchronization with the CPU clock 11, and outputs the shift register enable signal 28 to 1
And outputs the result to the shift register 20. Counter 24
After the count operation is performed eight times, the shift permission signal 28 is set to 0 and the operation is stopped. In addition, the latch 34 outputs 0 inverting the value according to the overflow signal 37 of the counter 24.

シフトレジスタ20は、シフト許可信号28が1の時、CP
Uクロック11の立下りに同期してシフト動作を8回行な
った後、シフト許可信号28が0となるためシフト動作を
停止し、リセット信号14が1のとき、格納値を0にクリ
アする。
When the shift enable signal 28 is 1, the shift register 20
After performing the shift operation eight times in synchronization with the falling of the U clock 11, the shift operation is stopped because the shift permission signal 28 becomes 0, and the stored value is cleared to 0 when the reset signal 14 is 1.

8ビットのシリアルデータを受信後、シフトレジスタ
20の格納値は比較回路22に出力される。比較回路22は、
EEPROM5a内に格納したパスワード23とシフトレジスタ20
への入力データを比較し、値が同一の場合ラッチ35を1
に設定し、テスト信号9を出力する。チップ外部からの
入力データがパスワード23と一致しない場合、比較回路
9の出力は0であるからラッチ35は0を出力し、テスト
信号9は出力されない。
After receiving 8-bit serial data, shift register
The stored value of 20 is output to the comparison circuit 22. The comparison circuit 22
Password 23 and shift register 20 stored in EEPROM 5a
Compare the input data to the latch, and if the values are the same, set the latch 35 to 1
And the test signal 9 is output. If the input data from the outside of the chip does not match the password 23, the output of the comparison circuit 9 is 0, so the latch 35 outputs 0 and the test signal 9 is not output.

第10図はこのテスト回路17bの動作タイミング図であ
る。
FIG. 10 is an operation timing chart of the test circuit 17b.

次にテスト信号9を出力後、EEPROM5aのテストを行な
い最後にパスワードの更新を行なう場合について述べ
る。
Next, a case where the test of the EEPROM 5a is performed after the test signal 9 is output and the password is updated at the end will be described.

この時、まず外部端子15をCPUクロック11の立下り同
期で0とし、次にCPUクロック11の立下り同期で1とし
てからデータをCPUクロック11の立ち上がり同期で入力
する。外部端子15を0とすると、テストモード信号16が
0となりカウンタ24が0にクリアされる。すると、シフ
ト許可信号28が1となり、シフトレジスタ20は外部でデ
ータ入力可能となる。
At this time, first, the external terminal 15 is set to 0 at the falling synchronization of the CPU clock 11, then to 1 at the falling synchronization of the CPU clock 11, and then data is input at the rising synchronization of the CPU clock 11. When the external terminal 15 is set to 0, the test mode signal 16 becomes 0 and the counter 24 is cleared to 0. Then, the shift permission signal 28 becomes 1, and the shift register 20 can externally input data.

この外部端子15を1とすると、テストモード信号16が
1となりカウンタ30の動作が可能となる。こうして再度
チップ外部からデータ入力が可能であるが、この時カウ
ンタ24はオーバフロウ信号37を出力するためラッチ34は
値を反転し1を出力する。このラッチ34はリセット後の
値が1でパスワードを受信しているため0を出力してい
るので、データの入力により1を出力するこことなる。
Assuming that the external terminal 15 is 1, the test mode signal 16 becomes 1 and the operation of the counter 30 becomes possible. In this way, data can be input again from outside the chip. At this time, the counter 24 outputs the overflow signal 37, so that the latch 34 inverts the value and outputs 1. Since the value of the latch 34 after reset is 1 and the password has been received, the latch 34 outputs 0, so that 1 is output by data input.

この時、ラッチ35の出力が1であるためANDゲート44
の出力は1となり、プログラム信号101を出力する。
At this time, since the output of the latch 35 is 1, the AND gate 44
Is 1 and the program signal 101 is output.

従って、EEPROM5a内のライト回路52はプログラム信号
41によりバス36を介してシフトレジスタ20の格納値を入
力し、パスワード格納アドレスにライトする。
Therefore, the write circuit 52 in the EEPROM 5a
The value stored in the shift register 20 is input via the bus 36 via 41 and written to the password storage address.

第11図はテスト回路17の動作タイミング図を示す。 FIG. 11 shows an operation timing chart of the test circuit 17.

第12図は第9図のカウンタ24の構成を示すブロック図
である。
FIG. 12 is a block diagram showing the configuration of the counter 24 of FIG.

このカウンタ24は、第4図と同様の4ビットのアップ
カウンタ30,ANDゲート31およびインバータ39から構成さ
れる。
The counter 24 includes a 4-bit up counter 30, an AND gate 31, and an inverter 39 similar to those shown in FIG.

テストモード信号16が0の時、アップカウンタ30はク
リアされて、動作を停止し、テストモード信号16が1の
時、カウンタ30はANDゲート31の出力の立上がりに同期
してカウントアップする。すなわち、テストモート信号
16が0でインバータ39の出力が1のため、ANDゲート31
はCPUクロック11をそのまま出力し、カウンタ30はCPUク
ロックをカウントする。
When the test mode signal 16 is 0, the up counter 30 is cleared and stops operating. When the test mode signal 16 is 1, the counter 30 counts up in synchronization with the rising of the output of the AND gate 31. That is, the test mote signal
Since 16 is 0 and the output of inverter 39 is 1, AND gate 31
Outputs the CPU clock 11 as it is, and the counter 30 counts the CPU clock.

カウンタ30がCPUクロック11を9回カウントすると、
カウンタ30の第3ビット=1となるため、インバータ39
の出力が0となり、シフト許可信号28が0となる。従っ
て、ANDゲート31の出力も0となり、カウンタ30はカウ
ント動作を停止する。
When the counter 30 counts the CPU clock 11 nine times,
Since the third bit of the counter 30 = 1, the inverter 39
Becomes zero, and the shift permission signal 28 becomes zero. Therefore, the output of the AND gate 31 also becomes 0, and the counter 30 stops counting.

チップ外部から再度データを入力する場合、まず外部
端子15をCPUクロック11の立下り同期で0とし、次にCPU
クロック11の立下り同期で1としてからデータをCPUク
ロック11の立上り同期で入力する。
To input data again from outside the chip, first set the external terminal 15 to 0 at the falling synchronization of the CPU clock 11, and then
Data is input at the rising synchronization of the CPU clock 11 after being set to 1 at the falling synchronization of the clock 11.

外部端子15をロウとすると、テストモード信号16が0
となりカウンタ30が0にクリアされる。すると、シフト
許可信号28が1となり、シフトレジスタ20は外部データ
入力可能となる。この外部端子15を1とすると、テスト
モード信号16が1となりカウンタ30の動作が可能とな
る。
When the external terminal 15 is set to low, the test mode signal 16 becomes 0
And the counter 30 is cleared to 0. Then, the shift permission signal 28 becomes 1, and the shift register 20 can input external data. Assuming that the external terminal 15 is 1, the test mode signal 16 becomes 1 and the operation of the counter 30 becomes possible.

本実施例のテスト回路においては、チップ外部からの
データ入力が内蔵EEPROMに格納するパスワードと一致し
た場合のみテストモードを許可するので、第三者による
テストモードの実行はより困難となる。また、パスワー
ドはCPUからアクセス不可であり、かつテストモードに
おいてパスワードの更新も可能であるため、パスワード
を頻繁に変更することによりセキュリテイのレベルがア
ップする。
In the test circuit of this embodiment, the test mode is permitted only when the data input from the outside of the chip matches the password stored in the built-in EEPROM, so that it becomes more difficult for a third party to execute the test mode. Further, since the password is inaccessible from the CPU and can be updated in the test mode, the security level is increased by frequently changing the password.

第13図は本発明の第4の実施例のシングルチップマイ
クロコンピュータのテスト回路17cのブロック図であ
る。
FIG. 13 is a block diagram of a test circuit 17c of the single-chip microcomputer according to the fourth embodiment of the present invention.

このテスト回路17cは、第9図のテスト回路17bに対し
て、EEPROM5aに格納したパスワードとシフトレジスタ20
に格納したデータを、暗号回路21によりデータ変換した
データと比較し、シフトレジスタ20に再度入力したデー
タをこの暗号回路21で変換後、新たなパスワードとして
EEPROM5aにライトする手段52を有するという点で異なっ
ている。
This test circuit 17c is different from the test circuit 17b in FIG. 9 in that the password stored in the EEPROM 5a and the shift register 20
The data stored in the shift register 20 is compared with the data converted by the encryption circuit 21, and the data input again to the shift register 20 is converted by the encryption circuit 21 and then converted as a new password.
The difference is that a means 52 for writing to the EEPROM 5a is provided.

この暗号回路21は、第5図に示すもとの同様に、8ビ
ットの入力データの対して変換を行って8ビットの出力
データを得る回路を用いている。
This encryption circuit 21 uses a circuit that converts 8-bit input data to obtain 8-bit output data, as in the case shown in FIG.

この暗号回路21を用いているので、何等の手法により
EEPROM5aに格納したパスワードを知ることができても、
比較する前に値が変換されているので、そのパスワード
の値をチップ外部から入力してもテストモードを実現で
きない。また、パスワードの更新を行なう際もシフトレ
ジスタへの入力値が変換されてEEPROM5aにライトされる
ため、新パスワードを知ったとしてもテストモードを実
現できない。従って第3者によるテストモードの実現
は、第3の実施例に比べてより困難となる。
Since this encryption circuit 21 is used, any method
Even if you can know the password stored in EEPROM5a,
Since the value is converted before the comparison, the test mode cannot be realized even if the password value is input from outside the chip. Also, when updating the password, the input value to the shift register is converted and written to the EEPROM 5a, so that even if the new password is known, the test mode cannot be realized. Therefore, the realization of the test mode by a third party is more difficult than in the third embodiment.

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

以上説明したように本発明は、従来データメモリとし
て使用しているPROM中のシークレット・ゾーンに複数の
パスワードを格納し、外部から入力した2個の第1およ
び第2のフィールドから成るデータを用いて、第1のフ
ィールドでアドレス指定する複数のパスワードのうちの
1個の値と第2のフィールドを暗号化した値が一致した
場合のみテストモードを許可するテスト回路を付加する
ことにより、従来のシークレッド・ゾーンへのデータア
クセスをテストモードの実現にて自由に行なっていた時
に生じる不当なデータアクセスを禁止し、高度のセキュ
リティを実現することができるという効果がある。
As described above, the present invention stores a plurality of passwords in a secret zone in a PROM conventionally used as a data memory, and uses data comprising two first and second fields input from the outside. By adding a test circuit that permits a test mode only when one of a plurality of passwords specified in the first field and a value obtained by encrypting the second field match, a conventional test circuit is added. There is an effect that illegal data access that occurs when data access to the secret zone is freely performed in the realization of the test mode is prohibited, and high security can be realized.

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

第1図は本発明の第1の実施例におけるシングルチップ
マイクロコンピュータのブロック図、第2図は第1図の
テスト回路17aの一例のブロック図、第3図は第2図の
テスト回路17の動作タイミング図、第4図は第2図のテ
スト回路内のカウンタのブロック図、第5図は第2図に
おけるテスト回路内の暗号回路のブロック図、第6図は
本発明の第2の実施例のテスト回路17aのブロック図、
第7図は第6図の暗号回路のブロック図、第8図は本発
明の第3の実施例におけるシングルチップマイクロコン
ピュータのブロック図、第9図は第8図のテスト回路の
一例のブロック図、第10図及び第11図はテスト回路の動
作タイミング図、第12図はテスト回路内のカウンタのブ
ロック図、第13図は本発明の第4の実施例のテスト回路
のブロック図、第14図,第15図は従来のシングルチップ
マイクロコンピュータの二例を示すブロック図である。 1,1a,1b,1c……シングルチップマイクロコンピュータ、
2……CPU、3……メモリ部、4,8……内部バス、5……
PROM、5a……EEPROM、51……シークレットゾーン、52…
…ライト回路、6……周辺部、7,39……インバータ、9
……テスト信号、10,12,13,15,19,61……外部端子、11
……CPUクロック、14……リセット信号、16……テスト
モード信号、17,17a……テスト回路、18……信号線、20
……シフトレジスタ、21,21a……暗号回路、22……比較
回路、23……パスワード、24,30……カウンタ、28……
シフト許可信号、31,44……ANDゲート、33……ANDゲー
ト、34,35……ラッチ、36……バス、37……オーバフロ
ウ信号、40……アドレス信号、41,42……プログラム信
号。
FIG. 1 is a block diagram of a single-chip microcomputer according to a first embodiment of the present invention, FIG. 2 is a block diagram of an example of a test circuit 17a of FIG. 1, and FIG. 3 is a block diagram of the test circuit 17 of FIG. FIG. 4 is a block diagram of a counter in the test circuit of FIG. 2, FIG. 5 is a block diagram of an encryption circuit in the test circuit of FIG. 2, and FIG. 6 is a second embodiment of the present invention. Block diagram of an example test circuit 17a,
7 is a block diagram of the encryption circuit of FIG. 6, FIG. 8 is a block diagram of a single-chip microcomputer according to a third embodiment of the present invention, and FIG. 9 is a block diagram of an example of the test circuit of FIG. 10 and 11 are operation timing diagrams of the test circuit, FIG. 12 is a block diagram of a counter in the test circuit, FIG. 13 is a block diagram of a test circuit according to a fourth embodiment of the present invention, and FIG. FIG. 15 is a block diagram showing two examples of a conventional single-chip microcomputer. 1,1a, 1b, 1c …… Single-chip microcomputer,
2 ... CPU, 3 ... Memory, 4,8 ... Internal bus, 5 ...
PROM, 5a …… EEPROM, 51 …… Secret zone, 52…
… Write circuit, 6… Peripheral part, 7,39 …… Inverter, 9
…… Test signal, 10,12,13,15,19,61 …… External terminal, 11
... CPU clock, 14 ... reset signal, 16 ... test mode signal, 17, 17a ... test circuit, 18 ... signal line, 20
... shift register, 21, 21a ... encryption circuit, 22 ... comparison circuit, 23 ... password, 24, 30 ... counter, 28 ...
Shift enable signal, 31, 44 AND gate, 33 AND gate, 34, 35 latch, 36 bus, 37 overflow signal, 40 address signal, 41, 42 program signal.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/14 ──────────────────────────────────────────────────続 き Continued on front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 12/14

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】単一半導体基板上に中央処理装置、記憶
部、周辺部およびPROMを集積し、このPROMに対してテス
ト回路によりテストが実行されるようにしたシングルチ
ップマイクロコンピュータにおいて、前記PROMには複数
のパスワードが格納され、前記テスト回路は、外部から
入力した2個の第1および第2のフィールドから成るデ
ータをシリアルに一時記憶するシフトレジスタと、この
シフトレジスタの出力の前記第2のフィールドのデータ
を暗号化する暗号化回路と、前記シフトレジスタの出力
の前記第1のフィールドでアドレス指定されて前記PROM
から読出された複数のパスワードのうちの1個の値およ
び前記暗号化回路により暗号化した値を比較する比較回
路と、この比較回路の比較値が等しい場合にのみ外部か
ら前記PROMへのテストを可能とするようにしたことを特
徴とするシングルチップマイクロコンピュータ。
1. A single-chip microcomputer in which a central processing unit, a storage unit, a peripheral unit, and a PROM are integrated on a single semiconductor substrate, and a test is performed on the PROM by a test circuit. , A plurality of passwords are stored. The test circuit includes: a shift register for temporarily storing serially stored data consisting of two first and second fields input from the outside; and a second register for outputting the shift register. An encryption circuit for encrypting the data of the field of the PROM, and an address of the PROM addressed by the first field of the output of the shift register.
A comparison circuit for comparing one value of a plurality of passwords read from the password and a value encrypted by the encryption circuit, and performing a test from the outside to the PROM only when the comparison value of the comparison circuit is equal. A single-chip microcomputer characterized by being made possible.
【請求項2】シフトレジスタに入力した2個のフィール
ドのデータが全て暗号化回路により暗号化され、第1の
フィールドで暗号化したデータでアドレス指定される前
記PROMから読出された前記複数のパスワードのうちの1
個の値および第2のフィールドで暗号化した値が比較回
路で比較される請求項1記載のシングルチップマイクロ
コンピュータ。
2. The plurality of passwords read from the PROM addressed by the data encrypted in the first field, wherein all data in the two fields input to the shift register are encrypted by an encryption circuit. One of
2. The single-chip microcomputer according to claim 1, wherein the value and the value encrypted in the second field are compared by a comparison circuit.
【請求項3】単一半導体基板上に中央処理装置、記憶
部、周辺部および電気的に書込みのできるEEPROMを集積
し、このEEPROMに対してテスト回路によりテストが実行
されるようにしたシングルチップマイクロコンピュータ
において、前記EEPROMにはパスワードが格納され、前記
テスト回路は、外部から入力したデータをシリアルに一
時記憶するシフトレジスタと、このシフトレジスタへの
入力ビット数をカウントしてこのシフトレジスタを制御
するカウンタと、前記パスワードの値および前記シフト
レジスタに入力した値を比較する比較回路とを備え、こ
の比較回路の比較値が等しい場合にのみ外部から前記EE
PROMへのテストを可能とするとともに、再度前記シフト
レジスタに入力した値を前記EEPROMに書込むことにより
前記パスワードを更新することを特徴とするシングルチ
ップマイクロコンピュータ。
3. A single chip in which a central processing unit, a storage unit, a peripheral unit, and an electrically writable EEPROM are integrated on a single semiconductor substrate, and a test is executed on the EEPROM by a test circuit. In the microcomputer, a password is stored in the EEPROM, the test circuit controls the shift register that temporarily stores data input from the outside in a serial manner, and counts the number of bits input to the shift register to control the shift register. And a comparison circuit for comparing the value of the password and the value input to the shift register, and the EE is externally provided only when the comparison values of the comparison circuits are equal.
A single-chip microcomputer which enables a test to a PROM and updates the password by writing a value input to the shift register to the EEPROM again.
【請求項4】シフトレジスタからの入力データが暗号回
路により変換され、この暗号回路による変換値とパスワ
ードの値が比較回路により比較されるようにした請求項
3記載のシングルチップマイクロコンピュータ。
4. The single-chip microcomputer according to claim 3, wherein input data from the shift register is converted by an encryption circuit, and a value converted by the encryption circuit and a password value are compared by a comparison circuit.
JP30656990A 1990-11-13 1990-11-13 Single chip microcomputer Expired - Fee Related JP3205998B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30656990A JP3205998B2 (en) 1990-11-13 1990-11-13 Single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30656990A JP3205998B2 (en) 1990-11-13 1990-11-13 Single chip microcomputer

Publications (2)

Publication Number Publication Date
JPH04178747A JPH04178747A (en) 1992-06-25
JP3205998B2 true JP3205998B2 (en) 2001-09-04

Family

ID=17958639

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30656990A Expired - Fee Related JP3205998B2 (en) 1990-11-13 1990-11-13 Single chip microcomputer

Country Status (1)

Country Link
JP (1) JP3205998B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4523613B2 (en) * 2007-03-26 2010-08-11 株式会社エルイーテック Program decoding prevention circuit in microcomputer chip for game machine control

Also Published As

Publication number Publication date
JPH04178747A (en) 1992-06-25

Similar Documents

Publication Publication Date Title
US11809335B2 (en) Apparatuses and methods for securing an access protection scheme
CA2026739C (en) Transaction system security method and apparatus
US7149854B2 (en) External locking mechanism for personal computer memory locations
US8746578B2 (en) System and method for updating read-only memory in smart card memory modules
JP3493047B2 (en) memory card
JPS6270993A (en) Portable data carrier for storing and processing data
US6823451B1 (en) Integrated circuit for security and manageability
KR20010032465A (en) Secure memory having anti-wire tapping
US20240086338A1 (en) Refresh and access modes for memory
JPH02293196A (en) Ic card
US6862641B1 (en) Interruptable and re-enterable system management mode programming code
US20030028781A1 (en) Mechanism for closing back door access mechanisms in personal computer systems
JPS63127335A (en) Security system
JPS63136295A (en) Data carrier
TW498284B (en) Card memory apparatus
JP2005515542A (en) Apparatus and method for writing to NV memory in a controller architecture together with a corresponding computer program and a corresponding computer-readable storage medium
US7353403B2 (en) Computer systems such as smart cards having memory architectures that can protect security information, and methods of using same
US7216362B1 (en) Enhanced security and manageability using secure storage in a personal computer system
JP2002503007A (en) System and method for controlling access to computer code in an IC card
US6735697B1 (en) Circuit arrangement for electronic data processing
JP3205998B2 (en) Single chip microcomputer
CN111651791A (en) Block chain private key storage and identity authentication device
US20040186947A1 (en) Access control system for nonvolatile memory
JPH09265254A (en) Mutual authentication system for information recording medium
JPH05265867A (en) Single chip microcomputer

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees