JP2004094981A - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
JP2004094981A
JP2004094981A JP2003407344A JP2003407344A JP2004094981A JP 2004094981 A JP2004094981 A JP 2004094981A JP 2003407344 A JP2003407344 A JP 2003407344A JP 2003407344 A JP2003407344 A JP 2003407344A JP 2004094981 A JP2004094981 A JP 2004094981A
Authority
JP
Japan
Prior art keywords
program
rom
data
processing unit
central processing
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.)
Granted
Application number
JP2003407344A
Other languages
Japanese (ja)
Other versions
JP3840510B2 (en
Inventor
Naomiki Mitsuishi
三ツ石 直幹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2003407344A priority Critical patent/JP3840510B2/en
Publication of JP2004094981A publication Critical patent/JP2004094981A/en
Application granted granted Critical
Publication of JP3840510B2 publication Critical patent/JP3840510B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microcomputer, which responds immediately to various specification requirements and various applications from a user, has an advantage of storing data in an EEP-ROM almost permanently as needed, reduces a structure and scale of hardware in use, improves usability of a hardware resource, securely performs high-speed writing according to an element characteristic, and reduces writing time and response time. <P>SOLUTION: The microcomputer 10 of a single chip type has a CPU1, and an EEP-ROM4 in which a user program and data needed to be stored are written in an arbitrary rate, in the main part. The microcomputer 10 further includes a mask ROM3 previously storing a write control program for writing in the EEP-ROM4 as a part of a standard program. <P>COPYRIGHT: (C)2004,JPO

Description

 この発明は、マイクロ・コンピュータ技術、さらにはEEP−ROM(エレクトリカリ・エレーサブル・アンド・プログラマブル・リード・オンリ・メモリ)のような電気的に書込または消去が可能なROMを内蔵したシングルチップ型マイクロ・コンピュータに適用して有効な技術に関するもので、たとえば、ICカードに内蔵されるマイクロ・コンピュータに利用して有効な技術に関するものである。 The present invention relates to a microcomputer technology and a single-chip type having a built-in electrically erasable or erasable ROM such as an EEP-ROM (Electrically Erasable and Programmable Read Only Memory). The present invention relates to a technology that is effective when applied to a microcomputer, for example, a technology that is effective to be used for a microcomputer built in an IC card.

 最近、磁気カードなどに代わるものとして、いわゆるICカードが注目されている。このICカードは、たとえば特許文献1(特公昭56−19665号公報)などに記載されているように、ID(識別コード)などのデータを記憶させたP−ROM(紫外線消去型のプログラマブル・ROM)を内蔵することにより、たとえばキーの代わりをなす識別カードとして機能させることができる。 Recently, so-called IC cards have been attracting attention as an alternative to magnetic cards and the like. This IC card is a P-ROM (ultraviolet erasable programmable ROM) storing data such as an ID (identification code) as described in, for example, Patent Document 1 (Japanese Patent Publication No. 56-19665). ) Can function as, for example, an identification card instead of a key.

 ここで、本発明者は、たとえば上述したごときICカードに内蔵するのに適したEEP−ROM内蔵型のシングルチップ型マイクロ・コンピュータについて検討した。以下は、公知とされた技術ではないが、本発明者によって検討された技術であり、その概要は次のとおりである。 Here, the present inventor has studied a single-chip microcomputer with an EEP-ROM built-in suitable for being built in an IC card as described above, for example. The following is not a known technique, but is a technique studied by the present inventor, and its outline is as follows.

 図6は、本発明者によって検討されたマイクロ・コンピュータ10の構成を示す。同図に示すマイクロ・コンピュータ10はEEP−ROM内蔵のシングルチップ型であって、CPU(中央処理ユニット)1、RAM(ランダム・アクセス・メモリ)2、マスクROM(固定記憶ROM)3、EEP−ROM41,42、I/O(入出力ユニット)5、周辺回路6、及びEEP−ROM書込制御回路7などを同一半導体チップ内に有する。各部(1〜7)はアドレスバスLA及びデータバスLDによって相互に接続されている。 FIG. 6 shows the configuration of the microcomputer 10 studied by the present inventor. The microcomputer 10 shown in FIG. 1 is a single-chip type with a built-in EEP-ROM, and includes a CPU (central processing unit) 1, a RAM (random access memory) 2, a mask ROM (fixed storage ROM) 3, and an EEP-ROM. ROMs 41 and 42, an I / O (input / output unit) 5, a peripheral circuit 6, an EEP-ROM write control circuit 7, and the like are provided in the same semiconductor chip. Each part (1 to 7) is mutually connected by an address bus LA and a data bus LD.

 このシングルチップ型マイクロ・コンピュータ10は、たとえばICカード内に内蔵されて使用される。そして、図7に示すように、外部とのデータDxの授受はすべてCPU1を介して行われるようになっている。図7は、図6に示したマイクロ・コンピュータ10をデータDxの流れに着目して示したものである。このマイクロ・コンピュータ10は適切なソフトウェアによる「鍵」を使用しない限り内蔵ソフトウェアを知ることができない構成とすることができ、ICカード内に内蔵されるシングルチップ型マイクロ・コンピュータとしての適正を持たせている。 This single-chip microcomputer 10 is used, for example, built in an IC card. As shown in FIG. 7, the exchange of data Dx with the outside is all performed via the CPU 1. FIG. 7 shows the microcomputer 10 shown in FIG. 6 focusing on the flow of data Dx. This microcomputer 10 can be configured so that the built-in software cannot be known unless a "key" made of appropriate software is used, so that the microcomputer 10 is suitable as a single-chip microcomputer built in an IC card. ing.

 ここで、EEP−ROM41,42は同等のものが互いに独立して2つ設けられている。そして、図8に示すように、一方のEEP−ROM41は、いわゆるユーザ・プログラム領域(M1)として利用される。ここには、ユーザが任意に作成したプログラムが予め書き込まれる。このプログラムの書込は外部からの制御によってCPU1を停止し、外部から直接EEP−ROM41に対して行われる。このようなP−ROMのプログラム方法は、たとえば非特許文献1((株)日立製作所、昭和59年8月発行「日立マイクロコンピュータデータブック8ビットシングルチップ」823〜865頁)によって公知である。これにより製造工程におけるマスクROMの書換えが不要となり、ユーザの多様な応用に即座に応ずることができる。さらに、EEP−ROM41に対するプログラムが行われた後、このEEP−ROMに対する再書込あるいは読出しを禁止することを可能とする手段を有する構成とすれば内蔵ソフトウェアの保護として効果がある。他方のEEP−ROM42はデータ領域(M2)として利用される。ここには、CPU1によって管理される入出力データのうち、保存を要するデータDxが必要に応じて随時に書き込まれる。このEEP−ROM42に対する書込はCPU1によって制御される書込制御回路7を介して行われる。一般にEEP−ROMの書込に要する時間はCPUの平均的な命令実行時間に比べ1000倍程度であって、この書込期間、EEP−ROM42はCPU1から電気的に切離され、EEP−ROM42の読出し、書込ともに不可能となっている。 Here, two EEP-ROMs 41 and 42 are provided independently of each other. Then, as shown in FIG. 8, one EEP-ROM 41 is used as a so-called user program area (M1). Here, a program arbitrarily created by the user is written in advance. The writing of this program is performed by stopping the CPU 1 by external control and directly writing to the EEP-ROM 41 externally. Such a P-ROM programming method is known, for example, from Non-Patent Document 1 (Hitachi, Ltd., "Hitachi Microcomputer Data Book 8-bit Single Chip", pp. 823-865, issued August 1984). This eliminates the need to rewrite the mask ROM in the manufacturing process, and can immediately respond to various applications of the user. Furthermore, if a configuration is provided which enables prohibition of rewriting or reading of the EEP-ROM after the program for the EEP-ROM 41 has been executed, there is an effect as protection of the built-in software. The other EEP-ROM 42 is used as a data area (M2). Here, of the input / output data managed by the CPU 1, data Dx that needs to be stored is written as needed. Writing to the EEP-ROM 42 is performed via a write control circuit 7 controlled by the CPU 1. Generally, the time required for writing to the EEP-ROM is about 1000 times as long as the average instruction execution time of the CPU. During this writing period, the EEP-ROM 42 is electrically disconnected from the CPU 1 and Both reading and writing are disabled.

 他方、CPU1は、プログラム格納用EEP−ROM41に書き込まれたユーザ・プログラムIx2を1命令ずつ読込みながら、所定の処理動作を実行する。そして、その処理動作の過程にて要保存データDxをデータ格納用EEP−ROM42に書き込む必要が生じた場合には、EEP−ROM書込制御回路7を介して、そのEEP−ROM42への書込を行う。この処理動作の実行に際しては、マスクROM3に予め標準プログラムIx1として用意されているプログラム・ルーチン(あるいはプログラム・モジュール)が適宜参照される。前記プログラム・ルーチンは、たとえばソフトウェアタイマや除算のプログラムであって、多くの用途あるいは応用によって有用なプログラムが用意されている。一般にマスクROMは同容量のEEP−ROMに比べて小さい面積で実現可能である。このため、全てのプログラムをEEP−ROM41に格納せずに前記ROM3を利用することで半導体チップ全体のサイズを縮小することが可能となっている。 On the other hand, the CPU 1 executes a predetermined processing operation while reading the user program Ix2 written in the program storage EEP-ROM 41 one instruction at a time. Then, when it becomes necessary to write the storage-necessary data Dx into the data storage EEP-ROM 42 in the course of the processing operation, the data is written into the EEP-ROM 42 via the EEP-ROM write control circuit 7. I do. When executing this processing operation, a program routine (or a program module) prepared in advance as a standard program Ix1 in the mask ROM 3 is referred to as appropriate. The program routine is, for example, a software timer or a division program, and useful programs are prepared for many uses or applications. Generally, a mask ROM can be realized with a smaller area than an EEP-ROM having the same capacity. Therefore, by using the ROM 3 without storing all programs in the EEP-ROM 41, the size of the entire semiconductor chip can be reduced.

 しかし、全体的な処理はEEP−ROM41に書き込まれたユーザ・プログラムに従って行われる。 However, the overall processing is performed according to the user program written in the EEP-ROM 41.

 図7において示されるようなEEP−ROM書込制御回路7は、たとえば一方のEEP−ROM41に書き込まれたプログラムに基づく制御を受けながら、他方のEEP−ROM42への書込動作を行う。この他方のEEP−ROM42は、書込が行われている間、CPU1から切り離される。 (7) The EEP-ROM write control circuit 7 as shown in FIG. 7 performs a write operation to the other EEP-ROM 42 while receiving control based on a program written in one EEP-ROM 41, for example. The other EEP-ROM 42 is disconnected from the CPU 1 while writing is being performed.

 以上のようにして、ユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEEP−ROMに半永久的に保存させることが可能なマイクロ・コンピュータ10が構成されている。
特公昭56−19665号公報 (株)日立製作所、昭和59年8月発行「日立マイクロコンピュータデータブック8ビットシングルチップ」823〜865頁
As described above, the microcomputer 10 which can immediately respond to various specification requirements and various applications of the user and can semi-permanently store the data Dx in the EEP-ROM as necessary is provided. It is configured.
JP-B-56-19665 Hitachi, Ltd., "Hitachi Microcomputer Data Book 8-bit Single Chip," August 1984, pp. 823-865.

 しかしながら、上述した技術には、次のような問題点があることが本発明者によって明らかとされた。 However, it has been clarified by the present inventors that the above-described technology has the following problems.

 すなわち、上述したマイクロ・コンピュータ10では、ユーザ・プログラムIx2を書き込むためと要保存データDxを記憶するために、互いに独立した2つのEEP−ROM41,42が必要となる。EEP−ROMが1つだけでは、そのEEP−ROMに書込を行っている間、そのEEP−ROMに対する読出しアクセスができなくなって、CPU1が実行すべき命令を読み出せなくなってしまうからである。したがって、上述したように、プログラムとデータとをそれぞれに独立した2つのEEP−ROM41,42に格納させ、一方のEEP−ROM41から命令を読み出しながら、その読み出した命令に基づいて他方のEEP−ROM42の書込制御を実行するように構成しなければならなかった。 That is, in the above-described microcomputer 10, two independent EEP-ROMs 41 and 42 are required for writing the user program Ix2 and for storing the storage required data Dx. This is because if only one EEP-ROM is used, read access to the EEP-ROM cannot be performed while writing to the EEP-ROM, and the instruction to be executed by the CPU 1 cannot be read. Therefore, as described above, the program and the data are stored in the two independent EEP-ROMs 41 and 42, and while the instruction is read from one EEP-ROM 41, the other EEP-ROM 42 is read based on the read instruction. Must be configured to execute the write control.

 しかし、そのためには、互いに独立した2つのEEP−ROM41,42が必要であり、しかも各EEP−ROM41,42は、各方面のユーザからの種々多様な仕様要求に対応できるようにするために、それぞれに十分に大きな記憶領域M1,M2を用意できるものでなければならない。たとえば、データサイズは小さくてよいがプログラムサイズは大きく、あるいはプログラムサイズは小さくてよいがデータサイズは大きく、といったような2通りの要求のいずれにも対応できるようにするためには、結局、2つのEEP−ROM41,42のそれぞれの記憶容量をどちらも大きくせざるを得ない。さらに、2つのEEP−ROM41,42の各記憶容量を両方ともに大きくしても、そのどちらかは記憶容量が大きく余って有効に利用されない、という無駄が生じやすい。 However, for this purpose, two EEP-ROMs 41 and 42 independent of each other are required, and each EEP-ROM 41 and 42 needs to be capable of responding to various requirements from users in various fields. The storage areas M1 and M2 must be able to be prepared in each case. For example, in order to be able to cope with any of two kinds of requests such as a small data size and a large program size, or a small program size and a large data size, after all, 2 The storage capacity of each of the two EEP-ROMs 41 and 42 must be increased. Further, even if both of the storage capacities of the two EEP-ROMs 41 and 42 are both increased, it is easy to cause a waste that one of the storage capacities is too large to be used effectively.

 なお、EEP−ROM41,42のそれぞれは、メモリアレイとともにセンスアンプ、ドライバ回路のようなデータ入出力のための回路やアドレスを選択するための回路からなる周辺回路を持つ。それ故に、EEP−ROMが複数個独立して形成された場合、センスアンプ、ドライバなどの周辺回路がそれぞれのEEP−ROM内に設けられることになるので、多くの回路要素が必要とされる。これに応じて、EEP−ROMの全体のサイズを大きくせざるを得なくなっている。 Each of the EEP-ROMs 41 and 42 has a memory array as well as peripheral circuits including a circuit for data input / output such as a sense amplifier and a driver circuit and a circuit for selecting an address. Therefore, when a plurality of EEP-ROMs are independently formed, peripheral circuits such as a sense amplifier and a driver are provided in each EEP-ROM, so that many circuit elements are required. Accordingly, the overall size of the EEP-ROM has to be increased.

 そこで、本発明者は、EEP−ROM41に、EEP−ROM42の制御のためのプログラムを格納するとともにEEP−ROM42のプログラムによって参照されるべきデータを格納し、またEEP−ROM42に、EEP−ROM41の制御のためのプログラムとともにEEP−ROM41のプログラムによって参照されるデータを格納することも検討した。このようにすると、EEP−ROM41及び42のそれぞれにおけるプログラム格納エリアとデータ格納エリアとを可変にすることが可能になる。この場合、前述のようなメモリエリアもしくはサイズに関する問題は幾分緩和される。しかしながら、この場合であっても、各EEP−ROM41及び42が互いに独立的なセンスアンプやデコーダ回路のような周辺回路をそれぞれに持つので、EEP−ROM全体のサイズもしくは半導体チップ全体のサイズに関しての不利益は十分に除去されない。 Therefore, the present inventor stores a program for controlling the EEP-ROM 42 in the EEP-ROM 41 and stores data to be referred to by the program in the EEP-ROM 42, and stores the program of the EEP-ROM 41 in the EEP-ROM 42. It has been considered to store data referred to by the program of the EEP-ROM 41 together with the control program. This makes it possible to change the program storage area and the data storage area in each of the EEP-ROMs 41 and 42. In this case, the above-mentioned problems regarding the memory area or size are somewhat alleviated. However, even in this case, since each of the EEP-ROMs 41 and 42 has a peripheral circuit such as a sense amplifier and a decoder circuit which are independent of each other, the size of the entire EEP-ROM or the size of the entire semiconductor chip can be reduced. The disadvantages are not fully eliminated.

 以上のように、上述したマイクロ・コンピュータでは、ユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEEP−ROMに半永久的に保存させることができるという利点を有するものの、それぞれに十分に大きな記憶容量を持つ2つの独立したEEP−ROM41,42が必要であった。このため、そのハードウェア的な構成負担が大きく、特に、シングルチップ型のものにあっては、その半導体チップサイズがどうしても大きくなってしまい、その割にハードウェア資源の利用効率が必ずしもよくない、という問題点のあることが本発明者によって始めて明らかとされた。特にICカードに内蔵する場合に半導体チップサイズの縮小はカード強度の向上のために強い要求があり、上記の半導体チップはこれに反するものとなっている。 As described above, in the above-described microcomputer, it is possible to immediately respond to various specification requirements and various applications of the user, and to semi-permanently store the data Dx in the EEP-ROM as necessary. However, two independent EEP-ROMs 41 and 42 each having a sufficiently large storage capacity are required. For this reason, the hardware configuration burden is large, especially in the case of a single chip type, the semiconductor chip size is inevitably increased, and the utilization efficiency of hardware resources is not always good for that. The present inventor has clarified for the first time that there is a problem. In particular, when the semiconductor chip is incorporated in an IC card, there is a strong demand to reduce the size of the semiconductor chip in order to improve the card strength, and the above-mentioned semiconductor chip is contrary to this.

 本発明の目的は、上述したマイクロ・コンピュータの利点、すなわちユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータを必要に応じてEEP−ROMに半永久的に保存させることができるという利点を保持しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにする、という技術を提供することにある。特に、CPUの処理速度より、書込または消去の時間が長かったり、素子特性のバラツキの大きいEEP−ROMなどの電気的に書込(または消去)が可能なROMを内蔵した場合のように、素子特性にあった高速かつ確実な書込を実現することができ、書込時間の短縮、さらに応答時間の短縮が図れるようにする技術を提供するものである。 SUMMARY OF THE INVENTION An object of the present invention is to provide an advantage of the microcomputer described above, that is, it is possible to immediately respond to various specification requirements and various applications of a user, and to store data in an EEP-ROM semi-permanently when necessary. It is an object of the present invention to provide a technique capable of reducing the size of a hardware configuration and increasing the use efficiency of hardware resources while maintaining the advantage that the hardware resources can be used. In particular, as in the case where an electrically writable (or erasable) ROM such as an EEPROM such as an EEP-ROM having a large variation in element characteristics is built in, the writing or erasing time is longer than the processing speed of the CPU. An object of the present invention is to provide a technique capable of realizing high-speed and reliable writing suited to element characteristics, shortening the writing time, and shortening the response time.

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

 すなわち、本発明のマイクロ・コンピュータは、中央処理ユニット(CPU)と、上記中央処理ユニットが実行する第1プログラムを格納する領域を有するマスクROMと、上記中央処理ユニットが実行する第2プログラムとデータとを格納する領域を有する電気的に書込及び消去可能なROM(EEP−ROMなど)と、RAMとを有し、上記第1プログラムは、上記RAMに用意されたデータを上記ROMに書き込むためのプログラムであり、上記第2プログラムは、上記第1プログラムへジャンプする命令を有しているものである。 That is, a microcomputer according to the present invention includes a central processing unit (CPU), a mask ROM having an area for storing a first program executed by the central processing unit, a second program executed by the central processing unit, and data. An electrically writable and erasable ROM (such as an EEP-ROM) having an area for storing data and a RAM, and the first program is for writing data prepared in the RAM to the ROM. The second program has an instruction to jump to the first program.

 さらに、本発明の他のマイクロ・コンピュータは、上記第2プログラムが、上記中央処理ユニットが上記第1プログラムによって上記電気的に書込及び消去可能なROMにデータを書き込むための処理に移行するための命令を有している、上記第1プログラムが、上記電気的に書込及び消去可能なROMへのデータの書込処理が完了した後に、上記中央処理ユニットが上記第2プログラムの実行へと復帰するための命令を有している、あるいはフラグを有して上記中央処理ユニットが、上記フラグに基づき、上記電気的に書込及び消去可能なROMへのデータの書込処理の完了を判定し、上記判定結果に基づき上記中央処理ユニットが上記第2プログラムの実行へと復帰する、などの特徴を組み合わせて有しているものである。 Further, in another microcomputer of the present invention, the second program shifts to processing for the central processing unit to write data in the electrically writable and erasable ROM by the first program. After the first program has completed the process of writing data to the electrically writable and erasable ROM, the central processing unit starts executing the second program. The central processing unit having an instruction for returning, or having a flag, determines, based on the flag, completion of the process of writing data to the electrically writable and erasable ROM. The central processing unit has a combination of features such as returning to the execution of the second program based on the determination result.

 また、本発明の他のマイクロ・コンピュータは、中央処理ユニット(CPU)と、上記中央処理ユニットによって実行されるプログラムの格納領域と、データの格納領域とを有する電気的に書込及び消去可能なROM(EEP−ROMなど)と、上記電気的に書込及び消去可能なROMに書込を行うための書込制御プログラムを格納する領域を有する記憶手段(マスクROM、RAMなど)と、入出力手段(I/O)とを有するマイクロ・コンピュータであって、上記中央処理ユニットは、上記書込制御プログラムに基づき、上記電気的に書込及び消去可能なROMの上記プログラムの格納領域に、上記入出力手段を介して上記マイクロ・コンピュータ外より受信したプログラムを書き込み、上記電気的に書込及び消去可能なROMに格納されたプログラムは、上記中央処理ユニットが上記書込制御プログラムによって上記電気的に書込及び消去可能なROMにプログラムを書き込むための処理に移行するための命令を有しているものである。 Another microcomputer according to the present invention includes a central processing unit (CPU), a storage area for a program executed by the central processing unit, and a storage area for data. ROM (EEPROM, etc.), storage means (mask ROM, RAM, etc.) having an area for storing a write control program for writing in the electrically writable and erasable ROM, Means (I / O), the central processing unit stores the program in a storage area of the program in the electrically writable and erasable ROM based on the write control program. Writes the program received from outside the microcomputer via the entry / output means and stores it in the electrically writable / erasable ROM Programs are those in which the central processing unit has an instruction to shift to the processing for writing a program to the electrically writing and erasable ROM by the write control program.

 さらに、本発明の他のマイクロ・コンピュータは、上記書込制御プログラムが、上記電気的に書込及び消去可能なROMへのプログラムの書込処理が完了した後に、上記中央処理ユニットが上記電気的に書込及び消去可能なROMに格納されたプログラムの実行へと復帰するための命令を有している、フラグを有して上記中央処理ユニットが、上記フラグに基づき、上記電気的に書込及び消去可能なROMへのプログラムの書込処理の完了を判定し、上記判定結果に基づき上記中央処理ユニットが上記電気的に書込及び消去可能なROMに格納されたプログラムの実行へと復帰する、上記記憶手段が、上記電気的に書込及び消去可能なROMから上記書込制御プログラムの転送を受けたRAMである、あるいは上記電気的に書込及び消去可能なROMの上記プログラムの格納領域あるいは上記データの格納領域にプログラムあるいはデータを書き込み、そのプログラムあるいはデータを書き込むための処理に移行するための命令を有する、などの特徴を組み合わせて有しているものである。 Further, in another microcomputer of the present invention, after the write control program completes the process of writing the program into the electrically writable and erasable ROM, the central processing unit executes A central processing unit having an instruction for returning to the execution of a program stored in a writable and erasable ROM, the central processing unit having a flag, And the completion of the process of writing the program into the erasable ROM is determined, and the central processing unit returns to the execution of the program stored in the electrically rewritable ROM based on the determination result. The storage means is a RAM that receives the transfer of the write control program from the electrically writable and erasable ROM, or the electrically writable and erasable ROM is A combination of features such as writing a program or data in a storage area of the above-mentioned program or the above-mentioned data in a simple ROM and having an instruction to shift to processing for writing the program or data. It is.

 よって、前記マイクロ・コンピュータによれば、書込可能なROMにデータを書き込むのに際し、そのときだけCPUを別の記憶装置へジャンプさせて、そこに予め格納された所定の書込制御プログラムを実行させることにより、書込可能なROMへの書込動作中にもCPUに所定の書込制御処理を実行させることができる。これにより、ユーザ・プログラム領域とデータ領域とを1つの書込可能なROM内に置くことができ、さらに各領域の大きさの割合を任意に選ぶことができる。これによって、ユーザの多様な仕様要求に即座に応じられ、かつデータを必要に応じて上記ROMに半永久的に保存させることができるという利点を保持しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにする、という目的が達成される。特に、制御プログラムによってフラグを操作してROMの書込(または消去)を制御することにより、素子特性にあった高速かつ確実な書込を実現することができ、書込時間の短縮、さらに応答時間の短縮を図ることができる。 Therefore, according to the microcomputer, when writing data to the writable ROM, the CPU is jumped to another storage device only at that time, and the predetermined write control program stored in advance is executed. This allows the CPU to execute a predetermined write control process even during a write operation to the writable ROM. Thus, the user program area and the data area can be placed in one writable ROM, and the size ratio of each area can be arbitrarily selected. As a result, it is possible to immediately respond to various specification requirements of the user, and to maintain the advantage that data can be semi-permanently stored in the ROM as needed, while reducing the hardware configuration scale. The object of the present invention is made possible, and the utilization efficiency of hardware resources can be improved. In particular, by controlling the writing (or erasing) of the ROM by operating the flag by the control program, it is possible to realize high-speed and reliable writing according to the element characteristics, shorten the writing time, and further reduce the response time. Time can be reduced.

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

 すなわち、EEP−ROM内蔵型のマイクロ・コンピュータにあって、ユーザの多様な仕様要求及び多様な用途に対して即座に応じることができる。 That is, in the microcomputer with the built-in EEP-ROM, it is possible to immediately respond to various specification requirements and various applications of the user.

 以下、本発明の好適な実施の形態を図面に基づいて説明する。なお、各図中、同一符号は同一あるいは相当部分を示す。 Hereinafter, preferred embodiments of the present invention will be described with reference to the drawings. In the drawings, the same reference numerals indicate the same or corresponding parts.

 図1はこの発明による技術が適用されたマイクロ・コンピュータ10の主要部における一実施の形態を示す。 FIG. 1 shows an embodiment of a main part of a microcomputer 10 to which the technology according to the present invention is applied.

 同図にその主要部を示すマイクロ・コンピュータ10はシングルチップ型のものであって、CPU1とともに、ユーザ・プログラムIx2と要保存データの両方が任意の割合で書き込まれるEEP−ROM4を備える。これとともに、そのEEP−ROM4に書込を行うための書込制御プログラムが標準プログラムIx1の一部として予め固定的に格納されたいわゆるマスクROM3を備える。 The microcomputer 10 whose main part is shown in FIG. 1 is of a single-chip type, and includes a CPU 1 and an EEP-ROM 4 in which both a user program Ix2 and data to be stored are written at an arbitrary ratio. In addition, a so-called mask ROM 3 in which a write control program for writing to the EEP-ROM 4 is fixedly stored in advance as a part of the standard program Ix1 is provided.

 マスクROM3は、書込制御プログラムのみを格納したものであってもよく、あるいはさらに前記した標準プログラム・ルーチンを格納したものであってもよい。ここで、書込制御プログラムはたとえば書込制御回路7に対する起動のためのプログラムあるいは書込の終了を検出するためのプログラムを含むようなものである。さらに書込データが多量である場合にはRAM2内の所定の領域に用意されたデータを順次EEP−ROM4に対して転送し、書込を行うものであってもよい。さらに、そのEEP−ROM4とマスクROM3はそれぞれ、上記CPU1のアドレス空間上にて、互いに異なるアドレス位置に配置されている。ここで、図1におけるスイッチは仮想的なものであって、CPU1の実行プログラムがEEP−ROM4に対する書込時にはコール命令によってマスクROM3に移り、書込終了後リターン命令によってEEP−ROM4に戻ることを示すものである。 The mask ROM 3 may store only the write control program, or may store the standard program routine described above. Here, the write control program includes, for example, a program for starting the write control circuit 7 or a program for detecting the end of writing. Further, when the amount of write data is large, data prepared in a predetermined area in the RAM 2 may be sequentially transferred to the EEP-ROM 4 for writing. Further, the EEP-ROM 4 and the mask ROM 3 are respectively arranged at different address positions in the address space of the CPU 1. Here, the switch in FIG. 1 is virtual, and it is assumed that the execution program of the CPU 1 moves to the mask ROM 3 by a call command when writing to the EEP-ROM 4 and returns to the EEP-ROM 4 by a return command after the writing is completed. It is shown.

 この場合、EEP−ROM4内には、そのEEP−ROM4への書込制御プログラムの代わりに、マスクROM3内の特定ルーチンへのコール命令が書き込まれるようになっている。他方、マスクROM3内には、EEP−ROM4のための書込制御プログラムとともに、この書込制御プログラムの最後にEEP−ROM4へのリターン命令が書き込まれるようになっている。 In this case, in the EEP-ROM 4, a call instruction to a specific routine in the mask ROM 3 is written instead of the write control program for the EEP-ROM 4. On the other hand, in the mask ROM 3, together with a write control program for the EEP-ROM 4, a return command to the EEP-ROM 4 is written at the end of the write control program.

 図2は、図1に示したマイクロプロセッサ10の全体的な構成の一実施の形態を示す。 FIG. 2 shows an embodiment of the overall configuration of the microprocessor 10 shown in FIG.

 同図に示すように、上記マイクロ・コンピュータ10には、上述した構成要素すなわちCPU1、マスクROM3、及びEEP−ROM4の他に、CPU1の作業領域を提供するRAM2、外部に対してデータDxの受け渡しを行うI/O(入出力ユニット)5、周辺回路6、及びEEP−ROM書込制御回路7などが内蔵されている。これらを内蔵することにより、たとえばICカード内に内蔵されるシングルチップ型マイクロ・コンピュータとしての適性を持たせられている。マイクロ・コンピュータ10内の各部(1〜7)はアドレスバスLA及びデータバスLDによって相互に接続されている。各メモリや周辺回路に対する制御信号は省略されている。 As shown in FIG. 1, in addition to the above-mentioned components, that is, the CPU 1, the mask ROM 3, and the EEP-ROM 4, the RAM 2, which provides a work area for the CPU 1, and the transfer of data Dx to the outside, (Input / output unit) 5, a peripheral circuit 6, an EEP-ROM write control circuit 7, and the like. By incorporating them, for example, it is made suitable as a single-chip microcomputer incorporated in an IC card. Each section (1 to 7) in the microcomputer 10 is mutually connected by an address bus LA and a data bus LD. Control signals for each memory and peripheral circuits are omitted.

 図3は、図2に示したマイクロ・コンピュータ10を、データDxの流れに着目して示す。同図に示すように、外部とのデータDxの授受は全てCPU1を介して行われるようになっている。これにより適切なソフトウェアによる「鍵」を使用しない限り、内蔵ソフトウェアを知ることができない構成とすることが可能である。 FIG. 3 shows the microcomputer 10 shown in FIG. 2 focusing on the flow of data Dx. As shown in FIG. 1, the exchange of data Dx with the outside is all performed via the CPU 1. This makes it possible to adopt a configuration in which the built-in software cannot be known unless a “key” made by appropriate software is used.

 図4は、上記CPU1のアドレス空間の状態の3つの例をそれぞれメモリ・マップによって示す。同図に示すように、上記EEP−ROM4による記憶領域M内には、ユーザ・プログラム領域M1と、データ領域M2の両方が任意の割合でもって割り当てられるようになっている。 FIG. 4 shows three examples of the state of the address space of the CPU 1 by a memory map. As shown in the figure, in the storage area M of the EEP-ROM 4, both the user program area M1 and the data area M2 are allocated at an arbitrary ratio.

 図5は、上記CPU1がEEP−ROM4への書込制御を行う場合の処理動作例をフローチャートによって示す。 FIG. 5 is a flowchart showing an example of a processing operation when the CPU 1 controls writing to the EEP-ROM 4.

 図2において、CPU1は、ユーザ・プログラム領域M1に書き込まれたプログラムIx2を1命令ずつ読込みながら、所定の処理動作を実行する(ステップS6)。 2, in FIG. 2, the CPU 1 executes a predetermined processing operation while reading the program Ix2 written in the user program area M1 one instruction at a time (step S6).

 ここで、その処理動作の過程にて要保存データDxをEEP−ROM4に書き込む必要が生じると(ステップS1)、CPU1は、コール命令によって、マスクROM3に格納された標準プログラム領域Ix1中の書込制御プログラムの先頭アドレスにジャンプする(ステップS2)。そして、その書込制御プログラムにしたがってEEP−ROM4の書込制御処理を実行する(ステップS3)。これにより、EEP−ROM書込制御回路7を介して、そのEEP−ROM4への書込が行われる。この書込が行われている間、EEP−ROM4はCPU1から切り離される。 Here, when it becomes necessary to write the storage required data Dx to the EEP-ROM 4 in the course of the processing operation (step S1), the CPU 1 writes the data in the standard program area Ix1 stored in the mask ROM 3 by a call instruction. Jump to the start address of the control program (step S2). Then, a write control process of the EEP-ROM 4 is executed according to the write control program (step S3). Thus, the writing to the EEP-ROM 4 is performed via the EEP-ROM writing control circuit 7. While this writing is being performed, the EEP-ROM 4 is disconnected from the CPU 1.

 この後、書込が完了すると、CPU1は、たとえば書込制御回路7側から発せられるフラグあるいは割込要求に基づいて、書込の完了を判定する(ステップS4)。すると、CPU1は、マスクROM3からEEP−ROM4のプログラム領域M1にリターンし、ジャンプ時のアドレスの次の番地からユーザ・プログラムの読込みを再開する(ステップS5)。そして、処理の終了あるいは次のデータ書込要求が発生するまで、EEP−ROM4のユーザ・プログラムを実行する(ステップS6)。 After that, when the writing is completed, the CPU 1 determines the completion of the writing based on, for example, a flag or an interrupt request issued from the write control circuit 7 (step S4). Then, the CPU 1 returns from the mask ROM 3 to the program area M1 of the EEP-ROM 4, and resumes reading the user program from the address next to the address at the time of the jump (step S5). Then, the user program of the EEP-ROM 4 is executed until the processing is completed or the next data write request is issued (step S6).

 以上のようにして、ユーザ・プログラム領域M1とデータ領域M2とを1つのEEP−ROM4内に置くことができるようになっている。これとともに、両領域M1とM2の大きさの割合を任意に選ぶことができるので、EEP−ROM全体の記憶領域Mのサイズがそれほど大きくなくとも、たとえば図4に3つの例を示すように、データ領域M2のサイズを小さくする代わりにプログラム領域M1のサイズを大きくとったり、あるいはプログラム領域M1のサイズを小さくする代わりにデータ領域M2のサイズを大きくとったり、といったように記憶領域Mを融通し合って効率良く利用することができる。 As described above, the user program area M1 and the data area M2 can be stored in one EEP-ROM 4. At the same time, the size ratio between the two areas M1 and M2 can be arbitrarily selected. Therefore, even if the size of the storage area M of the entire EEPROM is not so large, for example, as shown in three examples in FIG. The storage area M is flexibly accommodated by increasing the size of the program area M1 instead of reducing the size of the data area M2, or increasing the size of the data area M2 instead of reducing the size of the program area M1. It can be used efficiently.

 これによって、ユーザの多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEEP−ROM4に半永久的に保存させることができるという利点を保持しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにする、という目的が達成される。 Thereby, the hardware configuration scale is maintained while maintaining the advantage that the user can immediately respond to various uses of the user and that the data Dx can be semipermanently stored in the EEP-ROM 4 as necessary. The object of the present invention is to achieve the reduction of the size of the hardware and the efficiency of using the hardware resources.

 ここで、EEP−ROMの書込が完了されたときのユーザ・プログラムへのリターンは、実施の形態のように書込制御回路7から発せられるフラグあるいは割込要求によらなくてもよい。たとえば、CPU1内の適当な作業レジスタが、EEP−ROMへの書込動作の開始と同時に動作開始されて、その動作中に一定周期で更新される一種のカウンタもしくはタイマとして利用され、かかる作業レジスタの内容が所定値に達したときに上記リターン動作が実行されるように構成されてもよい。つまり、CPU1が予め見込まれる所定の書込所要時間を計時し、この計時が完了した時点でEEP−ROMへの書込動作の完了をソフトウェア的にチェックする構成であってもよい。この場合、書込時間の設定とその後のリターン動作の制御は、タイマ回路のような専用回路によってハードウェア的に行わせるようにしてもよい。 Here, the return to the user program when the writing of the EEP-ROM is completed may not be based on the flag or the interrupt request issued from the write control circuit 7 as in the embodiment. For example, an appropriate work register in the CPU 1 is used as a kind of counter or timer that is started at the same time as the start of the writing operation to the EEP-ROM and is updated at a constant period during the operation. May be configured to execute the above-mentioned return operation when the content of the item reaches a predetermined value. In other words, a configuration may be employed in which the CPU 1 measures a predetermined required write time which is expected in advance, and when the time measurement is completed, the completion of the writing operation to the EEP-ROM is checked by software. In this case, the setting of the writing time and the control of the return operation thereafter may be performed by a dedicated circuit such as a timer circuit in hardware.

 上記した例では、ユーザ・プログラムは、特に制限されないものの、外部からの制御によってCPU1を停止し、外部から直接EEP−ROM4のユーザ・プログラム領域M1に対して書込を行う構成となっている。 In the example described above, the user program is configured to stop the CPU 1 by external control and to directly write to the user program area M1 of the EEP-ROM 4 from the outside, although there is no particular limitation.

 このユーザ・プログラムの書込は、マスクROM3のプログラムに従ってCPU1がI/Oユニット5を介して外部よりプログラムを受信し、順次EEP−ROM4のユーザ・プログラム領域M1に対して書き込む構成としてもよい。この例では、内蔵EEP−ROM4に対して外部から直接アクセスする手段を持たないために、機密保護機能が強化され、ICカード内に内蔵されるシングルチップ型マイクロ・コンピュータとしての適正を増大させることができる。 The writing of the user program may be configured so that the CPU 1 receives the program from the outside via the I / O unit 5 according to the program in the mask ROM 3, and sequentially writes the program into the user program area M1 of the EEP-ROM 4. In this example, since there is no means for directly accessing the built-in EEP-ROM 4 from the outside, the security function is strengthened and the suitability as a single-chip microcomputer built in the IC card is increased. it can.

 この場合、ユーザ・プログラム4に対する書込が既に行われているか否かは、EEP−ROM4内にフラグを有してその状態で判定すればよい。このフラグの状態に応じて、CPU1のリセット後のスタートアドレスを変更するような構成にしてもよい。 In this case, whether or not writing to the user program 4 has already been performed may be determined by having a flag in the EEP-ROM 4 and in that state. The configuration may be such that the start address after reset of the CPU 1 is changed according to the state of this flag.

 また、書込可能なROMとしては、EEP−ROMのような電気的に書込及び消去可能なROMだけではなく、紫外線消去型のEP−ROMも利用できる。 (4) As a writable ROM, not only an electrically writable and erasable ROM such as an EEP-ROM but also an ultraviolet-erasable EP-ROM can be used.

 上記の例では、特に制限はされないものの、書込は書込制御回路7によって行われ、一定時間の書込が行われている。 In the above example, although not particularly limited, writing is performed by the write control circuit 7 and writing is performed for a fixed time.

 EP−ROMの場合には、一般にEEP−ROMに比して書込時間が長い。このために、上記のような書込時間一定の方法ではICカードに内蔵した場合には応答時間の増加を招いてしまう。ここで、EP−ROM素子のプロセスバラツキが大きいことにより、ワーストケースを考慮して書込時間は設定されるために多くの場合、書込時間が必要以上に費やされてしまっている。 (4) In the case of an EP-ROM, writing time is generally longer than that of an EEP-ROM. For this reason, the above-described method with a fixed writing time causes an increase in response time when the IC card is incorporated in an IC card. Here, due to the large process variation of the EP-ROM element, the writing time is set in consideration of the worst case, so that in many cases, the writing time is spent more than necessary.

 そこで、本発明者は書込制御回路7に対してCPU1が起動をかけるとともにさらに、停止も可能とできる構成とすることを考えた。すなわち、書込制御回路7内にフラグPGMを設け、このフラグPGMをCPU1がセットすると書込が開始され、前記フラグをリセットすると書込が終了されるというものである。書込時間は、たとえば前記したようにソフトウェアによって計時されてもよいし、あるいはタイマ回路を内蔵しているものにあっては、これを利用してもよい。 Therefore, the present inventor has considered a configuration in which the CPU 1 activates the write control circuit 7 and can also stop it. That is, a flag PGM is provided in the write control circuit 7, and when the CPU 1 sets the flag PGM, the writing is started, and when the flag is reset, the writing is ended. The writing time may be measured by software, for example, as described above, or may be used when the timer circuit is built in.

 図9は上記の場合のマスクROM3内に格納されるべき書込制御プログラムの一実施の形態を示すフローチャートである。 FIG. 9 is a flowchart showing an embodiment of a write control program to be stored in the mask ROM 3 in the above case.

 まず、CPU1がEP−ROMに対する書込アドレス・データを設定し、EP−ROMはこれらをラッチする(ステップS1)。次にCPU1は特定レジスタNの内容をクリアし(ステップS2)、上記レジスタNに+1の加算を行った(ステップS3)後に、フラグPGMをセットする(ステップS4)。所定の単位時間たとえば1msの計時を行い(ステップS5)、その後にフラグPGMをリセットし(ステップS6)、単位時間の書込を終了する。 First, the CPU 1 sets write address data for the EP-ROM, and the EP-ROM latches them (step S1). Next, the CPU 1 clears the contents of the specific register N (step S2), adds +1 to the register N (step S3), and sets a flag PGM (step S4). A predetermined unit time, for example, 1 ms is measured (step S5), and thereafter, the flag PGM is reset (step S6), and the writing of the unit time is completed.

 この後、正しく書込が行われたか否かを判定する(ステップS7)。この判定は、EP−ROMの読出しを行い、この読出された内容と書込データを比較する。特に制限はされないが、この読出し時には前記ラッチされたデータを破壊しないように構成されている。この比較結果が不一致であればCPU1は前記レジスタNの値を判定して(ステップS11)、24以下であれば上記ステップS3に戻り再び単位時間の書込を実行する。上記単位時間の書込が25回行われても、すなわちN=25となっても不一致の場合は不良と判定して(ステップS12)終了する。 Then, it is determined whether or not the writing has been correctly performed (step S7). For this determination, the EP-ROM is read, and the read contents are compared with the write data. Although there is no particular limitation, it is configured such that the latched data is not destroyed during this reading. If the comparison results do not match, the CPU 1 determines the value of the register N (step S11). If the comparison result is 24 or less, the CPU 1 returns to step S3 and executes the unit time writing again. Even if the writing in the unit time is performed 25 times, that is, even if N = 25, if they do not match, it is determined to be defective (step S12), and the process ends.

 上記判定の結果が一致していれば、CPU1はフラグPGMをセットし(ステップS8)、さらに3×Nmsの計時を行った(ステップS9)後に、フラグPGMをクリアして(ステップS10)終了する。すなわち、上記判定結果が一致するまでに要した時間Nmsの3倍の時間による重ね書込が行われる。 If the result of the determination is a coincidence, the CPU 1 sets the flag PGM (step S8), further measures the time of 3 × Nms (step S9), clears the flag PGM (step S10), and ends the process. . That is, overwriting is performed for a time three times as long as the time Nms required until the determination results match.

 これによって、素子特性にあった高速かつ確実な書込を実現することができ、書込時間の短縮、さらに応答時間の短縮を図ることができる。 (4) Thereby, high-speed and reliable writing suitable for the element characteristics can be realized, and the writing time and the response time can be shortened.

 上記した方法によって、ユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEP−ROMに半永久的に保存させることができるという利点を有しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにし、さらに応答時間を短縮することができる。 According to the above-described method, there is an advantage that it is possible to immediately respond to various specification requirements and various applications of the user, and to store the data Dx in the EP-ROM semi-permanently as needed. It is possible to reduce the scale of the hardware configuration, increase the utilization efficiency of hardware resources, and further reduce the response time.

 以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は上記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。たとえば、書込制御プログラムをマスクROM3あるいはEEP−ROM4に予め格納し、EEP−ROM4の書込動作を行うときに、その格納された書込制御プログラムをRAM2へ転送してCPU1に実行させるような構成でもよい。 As described above, the invention made by the inventor has been specifically described based on the embodiment. However, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the gist of the invention. Needless to say. For example, a write control program is stored in the mask ROM 3 or the EEP-ROM 4 in advance, and when a write operation of the EEP-ROM 4 is performed, the stored write control program is transferred to the RAM 2 and executed by the CPU 1. A configuration may be used.

 また、ICカード用シングルチップ型マイクロ・コンピュータに適用した場合について説明したが、それに限定されるものではなく、たとえば、ボード型のマイクロ・コンピュータなどにも適用できる。 Also, the case where the present invention is applied to a single-chip microcomputer for an IC card has been described. However, the present invention is not limited to this. For example, the present invention can be applied to a board-type microcomputer.

 少なくとも、EEP−ROMにプログラムとデータの両方を記憶させる条件のものには適用できる。 At least, the present invention can be applied to the condition that both the program and the data are stored in the EEP-ROM.

この発明による技術が適用されたEEP−ROM内蔵型マイクロ・コンピュータの主要部を示すブロック図である。FIG. 1 is a block diagram showing a main part of an EEP-ROM built-in microcomputer to which the technology according to the present invention is applied. 図1に示したマイクロ・コンピュータの全体的な構成を示すブロック図である。FIG. 2 is a block diagram showing an overall configuration of the microcomputer shown in FIG. 図2に示したマイクロ・コンピュータをデータの流れに着目して示すブロック図である。FIG. 3 is a block diagram showing the microcomputer shown in FIG. 2 focusing on data flow. 図2に示したマイクロ・コンピュータ内CPUのアドレス空間の3つの状態を例示するアドレスマップである。FIG. 3 is an address map illustrating three states of an address space of a CPU in the microcomputer illustrated in FIG. 2; 図2に示したマイクロ・コンピュータの動作例を示すフローチャートである。3 is a flowchart illustrating an operation example of the microcomputer illustrated in FIG. 2. この発明に先立って検討されたEEP−ROM内蔵型マイクロ・コンピュータの構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of an EEP-ROM built-in microcomputer studied prior to the present invention. 図6に示したマイクロ・コンピュータをデータの流れに着目して示すブロック図である。FIG. 7 is a block diagram showing the microcomputer shown in FIG. 6 focusing on the flow of data. 図6に示したマイクロ・コンピュータ内CPUのアドレス空間の状態を例示するアドレスマップである。7 is an address map illustrating a state of an address space of a CPU in the microcomputer illustrated in FIG. 6. EP−ROMを内蔵した場合の書込制御プログラムを示すフローチャートである。9 is a flowchart illustrating a write control program when an EP-ROM is built-in.

符号の説明Explanation of reference numerals

 1 CPU
 2 RAM
 3 マスクROM
 4,41,42 EEP−ROM
 5 I/O
 6 周辺回路
 7 書込制御回路
10 マイクロ・コンピュータ
1 CPU
2 RAM
3 Mask ROM
4,41,42 EEP-ROM
5 I / O
6 Peripheral circuit 7 Write control circuit 10 Microcomputer

Claims (4)

 中央処理ユニットと、
 上記中央処理ユニットが実行する第1プログラムを格納する領域を有するマスクROMと、
 上記中央処理ユニットが実行する第2プログラムを格納する領域を有する電気的に書込及び消去可能なROMと、
 RAMと、
 外部からデータが入力されるIO回路とを有し、
 上記RAMと上記電気的に書込及び消去可能なROMは、異なるアドレス空間に配置され、
 上記中央処理ユニットは、上記電気的に書込及び消去可能なROMに上記IO回路から入力されたデータを書き込む場合において、上記第1プログラムに基づいて、上記IO回路から入力されたデータを上記RAMに格納し、上記RAMに用意された上記データを上記電気的に書込及び消去可能なROMに転送することにより書き込み、
 上記第2プログラムは、上記第1プログラムへジャンプする命令を有していることを特徴とするマイクロ・コンピュータ。
A central processing unit;
A mask ROM having an area for storing a first program executed by the central processing unit;
An electrically writable and erasable ROM having an area for storing a second program executed by the central processing unit;
RAM,
An IO circuit to which data is input from the outside,
The RAM and the electrically writable and erasable ROM are arranged in different address spaces,
The central processing unit, when writing data input from the IO circuit into the electrically writable and erasable ROM, stores the data input from the IO circuit into the RAM based on the first program. And by writing the data prepared in the RAM to the electrically writable and erasable ROM,
The said 2nd program has the instruction | indication which jumps to the said 1st program, The microcomputer characterized by the above-mentioned.
 中央処理ユニットと、
 上記中央処理ユニットが実行する第1プログラムを格納する領域を有するマスクROMと、
 上記中央処理ユニットが実行する第2プログラムを格納する領域を有する電気的に書込及び消去可能なROMと、
 RAMと、
 外部からデータが入力されるIO回路とを有し、
 上記RAMと上記電気的に書込及び消去可能なROMは、異なるアドレス空間に配置され、
 上記中央処理ユニットは、上記電気的に書込及び消去可能なROMに上記IO回路から入力されたデータを書き込む場合において、上記第1プログラムに基づいて、上記IO回路から入力されたデータを上記RAMに格納し、上記RAMに用意された上記データを上記電気的に書込及び消去可能なROMに転送することにより書き込み、
 上記第2プログラムは、上記中央処理ユニットが上記第1プログラムによって上記電気的に書込及び消去可能なROMにデータを書き込むための処理に移行するための命令を有していることを特徴とするマイクロ・コンピュータ。
A central processing unit;
A mask ROM having an area for storing a first program executed by the central processing unit;
An electrically writable and erasable ROM having an area for storing a second program executed by the central processing unit;
RAM,
An IO circuit to which data is input from the outside,
The RAM and the electrically writable and erasable ROM are arranged in different address spaces,
The central processing unit, when writing data input from the IO circuit into the electrically writable and erasable ROM, stores the data input from the IO circuit into the RAM based on the first program. And by writing the data prepared in the RAM to the electrically writable and erasable ROM,
The second program is characterized in that the central processing unit has an instruction for shifting to processing for writing data to the electrically writable and erasable ROM by the first program. Micro computer.
 中央処理ユニットと、
 上記中央処理ユニットが実行する第1プログラムを格納する領域を有するマスクROMと、
 上記中央処理ユニットが実行する第2プログラムを格納する領域を有する電気的に書込及び消去可能なROMと、
 RAMと、
 外部からデータが入力されるIO回路とを有し、
 上記RAMと上記電気的に書込及び消去可能なROMは、異なるアドレス空間に配置され、
 上記中央処理ユニットは、上記電気的に書込及び消去可能なROMに上記IO回路から入力されたデータを書き込む場合において、上記第1プログラムに基づいて、上記IO回路から入力されたデータを上記RAMに格納し、上記RAMに用意された上記データを上記電気的に書込及び消去可能なROMに転送することにより書き込み、
 上記第2プログラムは、上記中央処理ユニットが上記第1プログラムによって上記電気的に書込及び消去可能なROMにデータを書き込むための処理に移行するための命令を有しており、
 上記第1プログラムは、上記電気的に書込及び消去可能なROMへのデータの書込処理が完了した後に、上記中央処理ユニットが上記第2プログラムの実行へと復帰するための命令を有していることを特徴とするマイクロ・コンピュータ。
A central processing unit;
A mask ROM having an area for storing a first program executed by the central processing unit;
An electrically writable and erasable ROM having an area for storing a second program executed by the central processing unit;
RAM,
An IO circuit to which data is input from the outside,
The RAM and the electrically writable and erasable ROM are arranged in different address spaces,
The central processing unit, when writing data input from the IO circuit into the electrically writable and erasable ROM, stores the data input from the IO circuit into the RAM based on the first program. And by writing the data prepared in the RAM to the electrically writable and erasable ROM,
The second program has an instruction for causing the central processing unit to shift to a process for writing data in the electrically writable and erasable ROM by the first program,
The first program has an instruction for causing the central processing unit to return to the execution of the second program after the data writing process to the electrically writable and erasable ROM is completed. A microcomputer.
 中央処理ユニットと、
 上記中央処理ユニットによって実行されるプログラムの格納領域を有する電気的に書込及び消去可能なROMと、
 上記電気的に書込及び消去可能なROMに書込を行うための書込制御プログラムを格納する領域を有する記憶手段と、
 RAMと、
 入出力手段とを有するマイクロ・コンピュータであって、
 上記RAMと上記ROMは、異なるアドレス空間に配置され、
 上記中央処理ユニットは、上記書込制御プログラムに基づき、上記入出力手段を介して上記マイクロ・コンピュータ外より受信したデータを上記RAMに格納し、上記ROMに上記RAMに用意されたデータを書き込み、
 上記電気的に書込及び消去可能なROMに格納されたプログラムは、上記中央処理ユニットが上記書込制御プログラムによって上記電気的に書込及び消去可能なROMにプログラムあるいはデータを書き込むための処理に移行するための命令を有しており、
 上記書込制御プログラムは、上記電気的に書込及び消去可能なROMへのプログラムあるいはデータの書込処理が完了した後に、上記中央処理ユニットが上記電気的に書込及び消去可能なROMに格納されたプログラムの実行へと復帰するための命令を有していることを特徴とするマイクロ・コンピュータ。
A central processing unit;
An electrically writable and erasable ROM having a storage area for a program executed by the central processing unit;
Storage means having an area for storing a write control program for writing to the electrically writable and erasable ROM;
RAM,
A microcomputer having input / output means,
The RAM and the ROM are arranged in different address spaces,
The central processing unit stores data received from outside the microcomputer via the input / output means in the RAM based on the write control program, and writes data prepared in the RAM into the ROM.
The program stored in the electrically writable and erasable ROM is used by the central processing unit to write a program or data into the electrically writable and erasable ROM by the write control program. Have an order to migrate,
The write control program is stored in the electrically writable and erasable ROM by the central processing unit after the process of writing the program or data to the electrically writable and erasable ROM is completed. A computer having instructions for returning to execution of a programmed program.
JP2003407344A 2003-12-05 2003-12-05 Micro computer Expired - Lifetime JP3840510B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003407344A JP3840510B2 (en) 2003-12-05 2003-12-05 Micro computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003407344A JP3840510B2 (en) 2003-12-05 2003-12-05 Micro computer

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP11317935A Division JP2000200257A (en) 1999-01-01 1999-11-09 Microcomputer

Publications (2)

Publication Number Publication Date
JP2004094981A true JP2004094981A (en) 2004-03-25
JP3840510B2 JP3840510B2 (en) 2006-11-01

Family

ID=32064746

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003407344A Expired - Lifetime JP3840510B2 (en) 2003-12-05 2003-12-05 Micro computer

Country Status (1)

Country Link
JP (1) JP3840510B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007095241A (en) * 2005-09-30 2007-04-12 Citizen Watch Co Ltd Semiconductor memory device, its data writing method and data erasing method, and system ic

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007095241A (en) * 2005-09-30 2007-04-12 Citizen Watch Co Ltd Semiconductor memory device, its data writing method and data erasing method, and system ic

Also Published As

Publication number Publication date
JP3840510B2 (en) 2006-11-01

Similar Documents

Publication Publication Date Title
US7213117B2 (en) 1-chip microcomputer having controlled access to a memory and IC card using the 1-chip microcomputer
JP2682700B2 (en) IC card
JP2727520B2 (en) Memory card and operating method thereof
JPS63145531A (en) Microprocessor
KR100604877B1 (en) Apparatus and method for controlling memory address mapping in embedded system
EP0239283B1 (en) Microcomputer
JP3032207B2 (en) Micro computer
JPH06275084A (en) Nonvolatile semiconductor storage and data processor using the same
KR100310486B1 (en) Microcumputer
JP2001075941A (en) Microcomputer with built-in flash memory and operating method therefor
JP3923546B2 (en) IC card
JP2004094981A (en) Microcomputer
JP2000200257A (en) Microcomputer
JPH08129628A (en) Information recording medium with incorporated cpu
JP2003203063A (en) Microcomputer
JPS62131354A (en) Method for controlling information write on ic card
JP3168572B2 (en) IC card with CPU runaway detection function
JP2000276461A (en) Microcomputer
GB2304209A (en) Starting up a processor system
JP4203165B2 (en) IC card
JPH0855204A (en) Ic card with cpu and accessible address limiting method of ic card with cpu
JP4549731B2 (en) Multi-application IC card with command code that is commonly used by applications
JP2006302130A (en) Ic card and program for ic card
JP4026796B2 (en) IC card with command distribution function
JPH1050086A (en) Microcomputer having eeprom and its rewriting method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040622

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040823

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050322

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050523

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20050608

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060606

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060703

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070818

Year of fee payment: 1