JP3840510B2 - Micro computer - Google Patents
Micro computer Download PDFInfo
- Publication number
- JP3840510B2 JP3840510B2 JP2003407344A JP2003407344A JP3840510B2 JP 3840510 B2 JP3840510 B2 JP 3840510B2 JP 2003407344 A JP2003407344 A JP 2003407344A JP 2003407344 A JP2003407344 A JP 2003407344A JP 3840510 B2 JP3840510 B2 JP 3840510B2
- Authority
- JP
- Japan
- Prior art keywords
- rom
- data
- program
- eep
- processing unit
- 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 - Lifetime
Links
Images
Landscapes
- Stored Programmes (AREA)
- Microcomputers (AREA)
Description
この発明は、マイクロ・コンピュータ技術、さらにはEEP−ROM(エレクトリカリ・エレーサブル・アンド・プログラマブル・リード・オンリ・メモリ)のような電気的に書込または消去が可能なROMを内蔵したシングルチップ型マイクロ・コンピュータに適用して有効な技術に関するもので、たとえば、ICカードに内蔵されるマイクロ・コンピュータに利用して有効な技術に関するものである。 The present invention is a single-chip type having a built-in ROM that can be electrically written or erased, such as micro computer technology, and also 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, the present invention relates to a technology that is effective when used for a microcomputer built in an IC card.
最近、磁気カードなどに代わるものとして、いわゆるICカードが注目されている。このICカードは、たとえば特許文献1(特公昭56−19665号公報)などに記載されているように、ID(識別コード)などのデータを記憶させたP−ROM(紫外線消去型のプログラマブル・ROM)を内蔵することにより、たとえばキーの代わりをなす識別カードとして機能させることができる。 Recently, so-called IC cards have attracted attention as an alternative to magnetic cards. This IC card is, for example, a P-ROM (ultraviolet erasable programmable ROM) in which data such as an ID (identification code) is stored, as described in Patent Document 1 (Japanese Patent Publication No. 56-19665). ) Can be made to function as an identification card instead of a key, for example.
ここで、本発明者は、たとえば上述したごときICカードに内蔵するのに適したEEP−ROM内蔵型のシングルチップ型マイクロ・コンピュータについて検討した。以下は、公知とされた技術ではないが、本発明者によって検討された技術であり、その概要は次のとおりである。 Here, the present inventor has studied an EEP-ROM built-in type single chip microcomputer suitable for being built in an IC card as described above, for example. The following is not a publicly known technique, but is a technique examined 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 a configuration of the
このシングルチップ型マイクロ・コンピュータ10は、たとえばICカード内に内蔵されて使用される。そして、図7に示すように、外部とのデータDxの授受はすべてCPU1を介して行われるようになっている。図7は、図6に示したマイクロ・コンピュータ10をデータDxの流れに着目して示したものである。このマイクロ・コンピュータ10は適切なソフトウェアによる「鍵」を使用しない限り内蔵ソフトウェアを知ることができない構成とすることができ、ICカード内に内蔵されるシングルチップ型マイクロ・コンピュータとしての適正を持たせている。
This single-
ここで、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 equivalent EEP-
他方、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
しかし、全体的な処理はEEP−ROM41に書き込まれたユーザ・プログラムに従って行われる。
However, the overall processing is performed according to the user program written in the EEP-
図7において示されるようなEEP−ROM書込制御回路7は、たとえば一方のEEP−ROM41に書き込まれたプログラムに基づく制御を受けながら、他方のEEP−ROM42への書込動作を行う。この他方のEEP−ROM42は、書込が行われている間、CPU1から切り離される。
The EEP-ROM
以上のようにして、ユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEEP−ROMに半永久的に保存させることが可能なマイクロ・コンピュータ10が構成されている。
しかしながら、上述した技術には、次のような問題点があることが本発明者によって明らかとされた。 However, the inventor has revealed that the above-described technique 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
しかし、そのためには、互いに独立した2つのEEP−ROM41,42が必要であり、しかも各EEP−ROM41,42は、各方面のユーザからの種々多様な仕様要求に対応できるようにするために、それぞれに十分に大きな記憶領域M1,M2を用意できるものでなければならない。たとえば、データサイズは小さくてよいがプログラムサイズは大きく、あるいはプログラムサイズは小さくてよいがデータサイズは大きく、といったような2通りの要求のいずれにも対応できるようにするためには、結局、2つのEEP−ROM41,42のそれぞれの記憶容量をどちらも大きくせざるを得ない。さらに、2つのEEP−ROM41,42の各記憶容量を両方ともに大きくしても、そのどちらかは記憶容量が大きく余って有効に利用されない、という無駄が生じやすい。
However, in order to do so, two EEP-
なお、EEP−ROM41,42のそれぞれは、メモリアレイとともにセンスアンプ、ドライバ回路のようなデータ入出力のための回路やアドレスを選択するための回路からなる周辺回路を持つ。それ故に、EEP−ROMが複数個独立して形成された場合、センスアンプ、ドライバなどの周辺回路がそれぞれのEEP−ROM内に設けられることになるので、多くの回路要素が必要とされる。これに応じて、EEP−ROMの全体のサイズを大きくせざるを得なくなっている。
Each of the EEP-
そこで、本発明者は、EEP−ROM41に、EEP−ROM42の制御のためのプログラムを格納するとともにEEP−ROM42のプログラムによって参照されるべきデータを格納し、またEEP−ROM42に、EEP−ROM41の制御のためのプログラムとともにEEP−ROM41のプログラムによって参照されるデータを格納することも検討した。このようにすると、EEP−ROM41及び42のそれぞれにおけるプログラム格納エリアとデータ格納エリアとを可変にすることが可能になる。この場合、前述のようなメモリエリアもしくはサイズに関する問題は幾分緩和される。しかしながら、この場合であっても、各EEP−ROM41及び42が互いに独立的なセンスアンプやデコーダ回路のような周辺回路をそれぞれに持つので、EEP−ROM全体のサイズもしくは半導体チップ全体のサイズに関しての不利益は十分に除去されない。
Therefore, the inventor stores a program for controlling the EEP-
以上のように、上述したマイクロ・コンピュータでは、ユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEEP−ROMに半永久的に保存させることができるという利点を有するものの、それぞれに十分に大きな記憶容量を持つ2つの独立したEEP−ROM41,42が必要であった。このため、そのハードウェア的な構成負担が大きく、特に、シングルチップ型のものにあっては、その半導体チップサイズがどうしても大きくなってしまい、その割にハードウェア資源の利用効率が必ずしもよくない、という問題点のあることが本発明者によって始めて明らかとされた。特にICカードに内蔵する場合に半導体チップサイズの縮小はカード強度の向上のために強い要求があり、上記の半導体チップはこれに反するものとなっている。
As described above, the above-described microcomputer can immediately respond to various specification requirements and various uses of the user, and can store the data Dx semi-permanently in the EEP-ROM as necessary. However, two independent EEP-
本発明の目的は、上述したマイクロ・コンピュータの利点、すなわちユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータを必要に応じてEEP−ROMに半永久的に保存させることができるという利点を保持しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにする、という技術を提供することにある。特に、CPUの処理速度より、書込または消去の時間が長かったり、素子特性のバラツキの大きいEEP−ROMなどの電気的に書込(または消去)が可能なROMを内蔵した場合のように、素子特性にあった高速かつ確実な書込を実現することができ、書込時間の短縮、さらに応答時間の短縮が図れるようにする技術を提供するものである。 The object of the present invention is to provide the above-mentioned advantages of the microcomputer, that is, to meet the various specification requirements and various uses of the user immediately and to store the data semi-permanently in the EEP-ROM as needed. It is an object of the present invention to provide a technology that allows the hardware configuration scale to be reduced and the utilization efficiency of hardware resources to be increased while retaining the advantage of being able to perform the above-described process. In particular, as in the case of incorporating a ROM that can be electrically written (or erased) such as an EEP-ROM that has a longer writing or erasing time than the processing speed of the CPU or a large variation in element characteristics, The present invention provides a technique capable of realizing high-speed and reliable writing suitable for element characteristics, and shortening the writing time and further shortening the response time.
本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、下記のとおりである。 Of the inventions disclosed in this application, the outline of typical ones will be briefly described as follows.
すなわち、本発明のマイクロ・コンピュータは、中央処理ユニット(CPU)と、上記中央処理ユニットが実行する第1プログラムを格納する領域を有するマスクROMと、上記中央処理ユニットが実行する第2プログラムとデータとを格納する領域を有する電気的に書込及び消去可能なROM(EEP−ROMなど)と、RAMとを有し、上記第1プログラムは、上記RAMに用意されたデータを上記ROMに書き込むためのプログラムであり、上記第2プログラムは、上記第1プログラムへジャンプする命令を有しているものである。 That is, the microcomputer of 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 and data executed by the central processing unit. And an electrically writable and erasable ROM (EEP-ROM or the like) having a region for storing the data, and a RAM, and the first program writes data prepared in the RAM into the ROM. The second program has an instruction to jump to the first program.
さらに、本発明の他のマイクロ・コンピュータは、上記第2プログラムが、上記中央処理ユニットが上記第1プログラムによって上記電気的に書込及び消去可能なROMにデータを書き込むための処理に移行するための命令を有している、上記第1プログラムが、上記電気的に書込及び消去可能なROMへのデータの書込処理が完了した後に、上記中央処理ユニットが上記第2プログラムの実行へと復帰するための命令を有している、あるいはフラグを有して上記中央処理ユニットが、上記フラグに基づき、上記電気的に書込及び消去可能なROMへのデータの書込処理の完了を判定し、上記判定結果に基づき上記中央処理ユニットが上記第2プログラムの実行へと復帰する、などの特徴を組み合わせて有しているものである。 Further, according to another microcomputer of the present invention, the second program shifts to a process for the central processing unit to write data to the electrically writable and erasable ROM by the first program. After the first program having the instruction has completed the process of writing data to the electrically writable and erasable ROM, the central processing unit proceeds to the execution of the second program. The central processing unit having an instruction to return or having a flag determines completion of writing of data into the electrically writable and erasable ROM based on the flag In addition, 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 of the present invention is an electrically writable and erasable memory having a central processing unit (CPU), a storage area for programs executed by the central processing unit, and a data storage area. ROM (EEP-ROM, etc.), storage means (mask ROM, RAM, etc.) having an area for storing a write control program for writing to the electrically writable and erasable ROM, and input / output The central processing unit is provided in a storage area for the program in the electrically writable and erasable ROM based on the write control program. The program received from outside the microcomputer is written via the entry / output means and stored in the electrically writable / erasable ROM. Program is one that 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の上記プログラムの格納領域あるいは上記データの格納領域にプログラムあるいはデータを書き込み、そのプログラムあるいはデータを書き込むための処理に移行するための命令を有する、などの特徴を組み合わせて有しているものである。 Furthermore, another microcomputer of the present invention is configured so that the central processing unit performs the electrical control after the write control program has completed the process of writing the program to the electrically writable and erasable ROM. The central processing unit having a flag having an instruction for returning to the execution of the program stored in the ROM that can be written to and erased from is electrically written based on the flag. And determining completion of the program writing process to the erasable ROM, and the central processing unit returns to the execution of the program stored in the electrically writable and erasable ROM based on the determination result. The storage means is a RAM which has received the transfer of the write control program from the electrically writable and erasable ROM, or the electrically writable and erasable It has a combination of features such as writing a program or data in the program storage area or data storage area of the ROM, and having an instruction to shift to processing for writing the program or data. is there.
よって、前記マイクロ・コンピュータによれば、書込可能なROMにデータを書き込むのに際し、そのときだけCPUを別の記憶装置へジャンプさせて、そこに予め格納された所定の書込制御プログラムを実行させることにより、書込可能なROMへの書込動作中にもCPUに所定の書込制御処理を実行させることができる。これにより、ユーザ・プログラム領域とデータ領域とを1つの書込可能なROM内に置くことができ、さらに各領域の大きさの割合を任意に選ぶことができる。これによって、ユーザの多様な仕様要求に即座に応じられ、かつデータを必要に応じて上記ROMに半永久的に保存させることができるという利点を保持しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにする、という目的が達成される。特に、制御プログラムによってフラグを操作してROMの書込(または消去)を制御することにより、素子特性にあった高速かつ確実な書込を実現することができ、書込時間の短縮、さらに応答時間の短縮を図ることができる。 Therefore, according to the microcomputer, when data is written in the writable ROM, only when that is the case, the CPU jumps to another storage device and executes a predetermined write control program stored in the CPU. By doing so, it is possible to cause the CPU to execute a predetermined write control process even during a write operation to the writable ROM. As a result, the user program area and the data area can be placed in one writable ROM, and the ratio of the size of each area can be arbitrarily selected. As a result, the hardware configuration scale can be reduced while maintaining the advantages of being able to immediately respond to various specifications requirements of the user and storing data in the ROM semi-permanently as needed. The objective of enabling and improving the utilization efficiency of hardware resources is achieved. In particular, by controlling the writing (or erasing) of the ROM by manipulating the flag by the control program, high-speed and reliable writing suitable for the element characteristics can be realized, shortening the writing time and further response Time can be shortened.
本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば、下記のとおりである。 The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.
すなわち、EEP−ROM内蔵型のマイクロ・コンピュータにあって、ユーザの多様な仕様要求及び多様な用途に対して即座に応じることができる。 In other words, the microcomputer with built-in EEP-ROM can immediately respond to various specifications requirements and various uses of users.
以下、本発明の好適な実施の形態を図面に基づいて説明する。なお、各図中、同一符号は同一あるいは相当部分を示す。 DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments of the invention will be described with reference to the drawings. In each figure, the same numerals indicate the same or corresponding parts.
図1はこの発明による技術が適用されたマイクロ・コンピュータ10の主要部における一実施の形態を示す。
FIG. 1 shows an embodiment of the main part of a
同図にその主要部を示すマイクロ・コンピュータ10はシングルチップ型のものであって、CPU1とともに、ユーザ・プログラムIx2と要保存データの両方が任意の割合で書き込まれるEEP−ROM4を備える。これとともに、そのEEP−ROM4に書込を行うための書込制御プログラムが標準プログラムIx1の一部として予め固定的に格納されたいわゆるマスクROM3を備える。
The
マスクROM3は、書込制御プログラムのみを格納したものであってもよく、あるいはさらに前記した標準プログラム・ルーチンを格納したものであってもよい。ここで、書込制御プログラムはたとえば書込制御回路7に対する起動のためのプログラムあるいは書込の終了を検出するためのプログラムを含むようなものである。さらに書込データが多量である場合にはRAM2内の所定の領域に用意されたデータを順次EEP−ROM4に対して転送し、書込を行うものであってもよい。さらに、そのEEP−ROM4とマスクROM3はそれぞれ、上記CPU1のアドレス空間上にて、互いに異なるアドレス位置に配置されている。ここで、図1におけるスイッチは仮想的なものであって、CPU1の実行プログラムがEEP−ROM4に対する書込時にはコール命令によってマスクROM3に移り、書込終了後リターン命令によってEEP−ROM4に戻ることを示すものである。
The
この場合、EEP−ROM4内には、そのEEP−ROM4への書込制御プログラムの代わりに、マスクROM3内の特定ルーチンへのコール命令が書き込まれるようになっている。他方、マスクROM3内には、EEP−ROM4のための書込制御プログラムとともに、この書込制御プログラムの最後にEEP−ROM4へのリターン命令が書き込まれるようになっている。
In this case, a call instruction to a specific routine in the
図2は、図1に示したマイクロプロセッサ10の全体的な構成の一実施の形態を示す。
FIG. 2 shows an embodiment of the overall configuration of the
同図に示すように、上記マイクロ・コンピュータ10には、上述した構成要素すなわちCPU1、マスクROM3、及びEEP−ROM4の他に、CPU1の作業領域を提供するRAM2、外部に対してデータDxの受け渡しを行うI/O(入出力ユニット)5、周辺回路6、及びEEP−ROM書込制御回路7などが内蔵されている。これらを内蔵することにより、たとえばICカード内に内蔵されるシングルチップ型マイクロ・コンピュータとしての適性を持たせられている。マイクロ・コンピュータ10内の各部(1〜7)はアドレスバスLA及びデータバスLDによって相互に接続されている。各メモリや周辺回路に対する制御信号は省略されている。
As shown in the figure, in addition to the above-described components, that is, the
図3は、図2に示したマイクロ・コンピュータ10を、データDxの流れに着目して示す。同図に示すように、外部とのデータDxの授受は全てCPU1を介して行われるようになっている。これにより適切なソフトウェアによる「鍵」を使用しない限り、内蔵ソフトウェアを知ることができない構成とすることが可能である。
FIG. 3 shows the
図4は、上記CPU1のアドレス空間の状態の3つの例をそれぞれメモリ・マップによって示す。同図に示すように、上記EEP−ROM4による記憶領域M内には、ユーザ・プログラム領域M1と、データ領域M2の両方が任意の割合でもって割り当てられるようになっている。
FIG. 4 shows three examples of the state of the address space of the
図5は、上記CPU1がEEP−ROM4への書込制御を行う場合の処理動作例をフローチャートによって示す。
FIG. 5 is a flowchart showing an example of processing operation when the
図2において、CPU1は、ユーザ・プログラム領域M1に書き込まれたプログラムIx2を1命令ずつ読込みながら、所定の処理動作を実行する(ステップS6)。
In FIG. 2, the
ここで、その処理動作の過程にて要保存データDxをEEP−ROM4に書き込む必要が生じると(ステップS1)、CPU1は、コール命令によって、マスクROM3に格納された標準プログラム領域Ix1中の書込制御プログラムの先頭アドレスにジャンプする(ステップS2)。そして、その書込制御プログラムにしたがってEEP−ROM4の書込制御処理を実行する(ステップS3)。これにより、EEP−ROM書込制御回路7を介して、そのEEP−ROM4への書込が行われる。この書込が行われている間、EEP−ROM4はCPU1から切り離される。
Here, if it is necessary to write the required storage data Dx into the EEP-
この後、書込が完了すると、CPU1は、たとえば書込制御回路7側から発せられるフラグあるいは割込要求に基づいて、書込の完了を判定する(ステップS4)。すると、CPU1は、マスクROM3からEEP−ROM4のプログラム領域M1にリターンし、ジャンプ時のアドレスの次の番地からユーザ・プログラムの読込みを再開する(ステップS5)。そして、処理の終了あるいは次のデータ書込要求が発生するまで、EEP−ROM4のユーザ・プログラムを実行する(ステップS6)。
Thereafter, when the writing is completed, the
以上のようにして、ユーザ・プログラム領域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 placed in one EEP-
これによって、ユーザの多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEEP−ROM4に半永久的に保存させることができるという利点を保持しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにする、という目的が達成される。
As a result, it is possible to immediately respond to various uses of the user, and to maintain the advantage that the data Dx can be stored semi-permanently in the EEP-
ここで、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
上記した例では、ユーザ・プログラムは、特に制限されないものの、外部からの制御によってCPU1を停止し、外部から直接EEP−ROM4のユーザ・プログラム領域M1に対して書込を行う構成となっている。
In the example described above, the user program is not particularly limited, but is configured to stop the
このユーザ・プログラムの書込は、マスクROM3のプログラムに従ってCPU1がI/Oユニット5を介して外部よりプログラムを受信し、順次EEP−ROM4のユーザ・プログラム領域M1に対して書き込む構成としてもよい。この例では、内蔵EEP−ROM4に対して外部から直接アクセスする手段を持たないために、機密保護機能が強化され、ICカード内に内蔵されるシングルチップ型マイクロ・コンピュータとしての適正を増大させることができる。
The user program may be written in such a manner that the
この場合、ユーザ・プログラム4に対する書込が既に行われているか否かは、EEP−ROM4内にフラグを有してその状態で判定すればよい。このフラグの状態に応じて、CPU1のリセット後のスタートアドレスを変更するような構成にしてもよい。
In this case, whether or not writing to the
また、書込可能なROMとしては、EEP−ROMのような電気的に書込及び消去可能なROMだけではなく、紫外線消去型のEP−ROMも利用できる。 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
EP−ROMの場合には、一般にEEP−ROMに比して書込時間が長い。このために、上記のような書込時間一定の方法ではICカードに内蔵した場合には応答時間の増加を招いてしまう。ここで、EP−ROM素子のプロセスバラツキが大きいことにより、ワーストケースを考慮して書込時間は設定されるために多くの場合、書込時間が必要以上に費やされてしまっている。 In the case of EP-ROM, writing time is generally longer than that of EEP-ROM. For this reason, when the writing time is constant as described above, if the IC card is built in, the response time increases. Here, since the process variation of the EP-ROM element is large, the writing time is set in consideration of the worst case, and in many cases, the writing time is consumed more than necessary.
そこで、本発明者は書込制御回路7に対してCPU1が起動をかけるとともにさらに、停止も可能とできる構成とすることを考えた。すなわち、書込制御回路7内にフラグPGMを設け、このフラグPGMをCPU1がセットすると書込が開始され、前記フラグをリセットすると書込が終了されるというものである。書込時間は、たとえば前記したようにソフトウェアによって計時されてもよいし、あるいはタイマ回路を内蔵しているものにあっては、これを利用してもよい。
Therefore, the present inventor has considered that the
図9は上記の場合のマスクROM3内に格納されるべき書込制御プログラムの一実施の形態を示すフローチャートである。
FIG. 9 is a flowchart showing an embodiment of a write control program to be stored in the
まず、CPU1がEP−ROMに対する書込アドレス・データを設定し、EP−ROMはこれらをラッチする(ステップS1)。次にCPU1は特定レジスタNの内容をクリアし(ステップS2)、上記レジスタNに+1の加算を行った(ステップS3)後に、フラグPGMをセットする(ステップS4)。所定の単位時間たとえば1msの計時を行い(ステップS5)、その後にフラグPGMをリセットし(ステップS6)、単位時間の書込を終了する。
First, the
この後、正しく書込が行われたか否かを判定する(ステップS7)。この判定は、EP−ROMの読出しを行い、この読出された内容と書込データを比較する。特に制限はされないが、この読出し時には前記ラッチされたデータを破壊しないように構成されている。この比較結果が不一致であればCPU1は前記レジスタNの値を判定して(ステップS11)、24以下であれば上記ステップS3に戻り再び単位時間の書込を実行する。上記単位時間の書込が25回行われても、すなわちN=25となっても不一致の場合は不良と判定して(ステップS12)終了する。
Thereafter, it is determined whether or not writing has been correctly performed (step S7). This determination is performed by reading the EP-ROM and comparing the read contents with the write data. Although not particularly limited, the latched data is not destroyed at the time of reading. If the comparison result does not match, the
上記判定の結果が一致していれば、CPU1はフラグPGMをセットし(ステップS8)、さらに3×Nmsの計時を行った(ステップS9)後に、フラグPGMをクリアして(ステップS10)終了する。すなわち、上記判定結果が一致するまでに要した時間Nmsの3倍の時間による重ね書込が行われる。
If the result of the determination is coincident, the
これによって、素子特性にあった高速かつ確実な書込を実現することができ、書込時間の短縮、さらに応答時間の短縮を図ることができる。 As a result, high-speed and reliable writing suitable for the element characteristics can be realized, and the writing time can be shortened and further the response time can be shortened.
上記した方法によって、ユーザの多様な仕様要求及び多様な用途に対して即座に応じられ、かつデータDxを必要に応じてEP−ROMに半永久的に保存させることができるという利点を有しつつ、そのハードウェア的な構成規模の縮小を可能にし、かつハードウェア資源の利用効率を高められるようにし、さらに応答時間を短縮することができる。 With the above-described method, it is possible to immediately respond to various specification requirements and various uses of the user, and to have the advantage that the data Dx can be semi-permanently stored in the EP-ROM as necessary. The hardware configuration scale can be reduced, the utilization efficiency of hardware resources can be increased, and the response time can be shortened.
以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は上記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。たとえば、書込制御プログラムをマスクROM3あるいはEEP−ROM4に予め格納し、EEP−ROM4の書込動作を行うときに、その格納された書込制御プログラムをRAM2へ転送してCPU1に実行させるような構成でもよい。
As mentioned above, the invention made by the present 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 scope of the invention. Needless to say. For example, a write control program is stored in advance in the
また、ICカード用シングルチップ型マイクロ・コンピュータに適用した場合について説明したが、それに限定されるものではなく、たとえば、ボード型のマイクロ・コンピュータなどにも適用できる。 Further, the case where the present invention is applied to a single chip type microcomputer for IC card has been described, but the present invention is not limited thereto, and can be applied to, for example, a board type microcomputer.
少なくとも、EEP−ROMにプログラムとデータの両方を記憶させる条件のものには適用できる。 The present invention can be applied at least to a condition where both the program and data are stored in the EEP-ROM.
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 EEPROM-ROM
5 I / O
6
Claims (4)
上記中央処理装置によって実行されるプログラムを格納するプログラム領域とデータ領域とを有し、電気的に書込および消去可能な不揮発性メモリと、
RAMと、
外部とのデータの入出力が可能な入出力回路とを有し、
上記不揮発性メモリと上記RAMとは、異なるアドレス空間に配置され、
上記不揮発性メモリは、書込を行うための書込制御プログラムが格納され、
上記書込制御プログラムは、上記RAMへ転送可能で、
上記中央処理装置は、上記RAMへ転送された上記書込制御プログラムを実行することによって上記入出力回路を介して入力されたデータを、上記不揮発性メモリに書込可能であることを特徴とするマイクロ・コンピュータ。 A central processing unit;
A non-volatile memory having a program area and a data area for storing a program executed by the central processing unit, and electrically writable and erasable;
RAM,
An input / output circuit capable of inputting / outputting data from / to the outside;
The nonvolatile memory and the RAM are arranged in different address spaces,
The nonvolatile memory stores a write control program for performing writing,
The write control program can be transferred to the RAM,
The central processing unit can write data input via the input / output circuit to the nonvolatile memory by executing the write control program transferred to the RAM. Micro computer.
外部からデータを入出力可能な入出力回路と、
上記中央処理装置が実行するプログラムおよびデータを格納し、上記中央処理装置がアクセス可能なアドレス空間に割り付けられているメモリとを有し、
上記メモリは、不揮発性メモリが割り付けられている第1アドレス空間と、揮発性メモリが割り付けられている第2アドレス空間とを有し、
上記第1アドレス空間は、上記不揮発性メモリに対しデータおよびプログラムの書込制御を行うための書込制御プログラムを格納し、
上記不揮発性メモリの書込動作を行うとき、上記書込制御プログラムを上記第2アドレス空間に格納し、上記中央処理装置は、上記第2アドレス空間に格納された書込制御プログラムを実行することによって、上記入出力回路を介して入力されたデータの書込動作を行い、又は、上記中央処理装置は、上記第2アドレス空間に格納された書込制御プログラムを実行することによって、上記第2アドレス空間に格納されたデータを上記第1アドレス空間に書込動作を行うことが可能であることを特徴とするマイクロ・コンピュータ。 A central processing unit;
An input / output circuit capable of inputting and outputting data from the outside;
Storing a program and data executed by the central processing unit, and having a memory allocated to an address space accessible by the central processing unit,
The memory has a first address space to which a nonvolatile memory is allocated, and a second address space to which a volatile memory is allocated,
The first address space stores a write control program for performing write control of data and programs to the nonvolatile memory,
When performing a write operation of the nonvolatile memory, the write control program is stored in the second address space, and the central processing unit executes the write control program stored in the second address space The central processing unit executes the write control program stored in the second address space by performing the write operation of the data input via the input / output circuit. A microcomputer capable of writing data stored in an address space into the first address space .
外部からデータを入出力可能な入出力回路と、
上記中央処理装置によって実行されるプログラムを格納するプログラム領域とデータ領域とを有し、電気的に書込および消去可能な不揮発性メモリと、
RAMとを有し、
上記不揮発性メモリと上記RAMとは、上記中央処理装置によってアクセス可能なアドレス空間に配置され、
上記不揮発性メモリは、上記不揮発性メモリの書込制御を行うための書込制御プログラムを格納し、
上記書込制御プログラムの実行に基づいて上記不揮発性メモリに対し書込まれるデータもしくはプログラムは、上記入出力回路を介して入力される、もしくは、上記RAMに格納されているデータであって、
上記不揮発性メモリに対し書込制御を行うとき、上記書込制御プログラムを上記RAMに格納し、上記中央処理装置は上記RAMに格納された書込制御プログラムを実行することによって、上記データの書込制御を行うことが可能であることを特徴とするマイクロ・コンピュータ。 A central processing unit;
An input / output circuit capable of inputting and outputting data from the outside;
A non-volatile memory having a program area and a data area for storing a program executed by the central processing unit, and electrically writable and erasable;
RAM,
The nonvolatile memory and the RAM are arranged in an address space accessible by the central processing unit,
The nonvolatile memory stores a writing control program for performing writing control of the nonvolatile memory,
Data or a program written to the nonvolatile memory based on the execution of the write control program is data input via the input / output circuit or stored in the RAM,
When performing write control on the nonvolatile memory, the write control program is stored in the RAM, and the central processing unit executes the write control program stored in the RAM, thereby writing the data. A microcomputer characterized in that it is possible to carry out the control of the recording .
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 JP2004094981A (en) | 2004-03-25 |
JP3840510B2 true 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) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4896479B2 (en) * | 2005-09-30 | 2012-03-14 | シチズンホールディングス株式会社 | Data erasing method of semiconductor memory device |
-
2003
- 2003-12-05 JP JP2003407344A patent/JP3840510B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JP2004094981A (en) | 2004-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100375217B1 (en) | Microcontroller incorporating an electrically rewritable non-volatile memory | |
EP0991081B1 (en) | Emulated EEPROM memory device and corresponding method | |
KR19980042796A (en) | Microcomputer comprising flash EEPROM and method of erasing flash EEPROM | |
JP2009054275A (en) | Flash memory device for storing multi-bit and single-bit data, method for programming the same, and memory system using the same | |
EP0239283B1 (en) | Microcomputer | |
JP3840510B2 (en) | Micro computer | |
KR100310486B1 (en) | Microcumputer | |
JPWO2006040798A1 (en) | Semiconductor integrated circuit device and electronic system | |
US20050243616A1 (en) | Non-volatile semiconductor storage device | |
JP2650474B2 (en) | Integrated circuit | |
JP3032207B2 (en) | Micro computer | |
JP2865807B2 (en) | Semiconductor storage system | |
JPS62131354A (en) | Method for controlling information write on ic card | |
JP2000200257A (en) | Microcomputer | |
JP2005107608A (en) | Electronic device, nonvolatile memory, and method for rewriting data of nonvolatile memory | |
JPH10143434A (en) | Semiconductor integrated circuit | |
JP2000276461A (en) | Microcomputer | |
JP2003203063A (en) | Microcomputer | |
KR100965079B1 (en) | Non volatiel memory device | |
JPH11259357A (en) | Semiconductor integrated device and nonvolatile memory writing system | |
JP3866269B2 (en) | Microcomputer | |
JP4810108B2 (en) | IC card and control method thereof | |
JPS62289999A (en) | Data writing method | |
JP4018085B2 (en) | Nonvolatile memory, memory card using the same, information processing apparatus, and software write protection control method for nonvolatile memory | |
JPH0697442B2 (en) | Micro computer |
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 |