JPH06259616A - Self-diagnostic method for information recording medium incorporated with cpu - Google Patents

Self-diagnostic method for information recording medium incorporated with cpu

Info

Publication number
JPH06259616A
JPH06259616A JP5072966A JP7296693A JPH06259616A JP H06259616 A JPH06259616 A JP H06259616A JP 5072966 A JP5072966 A JP 5072966A JP 7296693 A JP7296693 A JP 7296693A JP H06259616 A JPH06259616 A JP H06259616A
Authority
JP
Japan
Prior art keywords
register
cpu
normal
diagnosis
line
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
JP5072966A
Other languages
Japanese (ja)
Other versions
JP3529402B2 (en
Inventor
Kazuyoshi Irisawa
和義 入澤
Hirotsugu Harima
博嗣 針間
Teruaki Jo
輝明 城
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP07296693A priority Critical patent/JP3529402B2/en
Publication of JPH06259616A publication Critical patent/JPH06259616A/en
Application granted granted Critical
Publication of JP3529402B2 publication Critical patent/JP3529402B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PURPOSE:To report a correct diagnostic result to the outside regardless of the occurrence of a defect in registers. CONSTITUTION:Actual data is read out from a register after being written to confirm one normal register (S10), and contents of this confirmed normal register are transferred to another register, and contents of both registers are compared with each other to diagnose another register (S30) Next, the normal register is used to diagnose a RAM (S40), and the normal register is used to transmit the diagnostic result to the outside (S50). If all registers are defective, the potential level of an I/O line is directly controlled by a CPU to report the diagnostic result.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、CPUを内蔵した情報
記録媒体の自己診断方法、特に、揮発性メモリについて
の自己診断を行う方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a self-diagnosis method for an information recording medium having a built-in CPU, and more particularly to a self-diagnosis method for a volatile memory.

【0002】[0002]

【従来の技術】磁気カードに代わる新しい情報記録媒体
として、ICカードが注目を集めている。特に、CPU
を内蔵したICカードは、高度なセキュリティを有する
ため、種々の分野での利用が期待されている。一般にI
Cカードは、RAM,ROM,EEPROMといった3
種類のメモリを内蔵しており、いずれも内蔵CPUによ
ってアクセスされる。ICカードに対するデータの授受
は、リーダライタ装置によって行われる。リーダライタ
装置からICカードに対して所定の命令を与えると、こ
の命令はICカード内のCPUによって実行される。た
とえば、データの書込命令であれば、リーダライタ装置
からICカードへ与えたデータがICカード内のメモリ
に書き込まれ、データの読出命令であれば、ICカード
内のメモリから読み出されたデータがリーダライタ装置
へ転送される。
2. Description of the Related Art IC cards have attracted attention as a new information recording medium replacing magnetic cards. Especially CPU
Since the IC card having a built-in card has a high degree of security, it is expected to be used in various fields. Generally I
C card has 3 such as RAM, ROM, EEPROM
It has built-in types of memory, both of which are accessed by the built-in CPU. The reader / writer device exchanges data with the IC card. When a given command is given from the reader / writer device to the IC card, this command is executed by the CPU in the IC card. For example, in the case of a data write command, the data given to the IC card from the reader / writer device is written in the memory in the IC card, and in the case of a data read command, the data read from the memory in the IC card. Is transferred to the reader / writer device.

【0003】ICカードのような携帯可能な情報記録媒
体は、通常、ポケットやハンドバッグの中に入れて持ち
運ばれ、物理的に過酷な条件で取り扱われることが多
い。このため、内蔵されたハードウエアは物理的な損傷
を受ける可能性が高い。このようなハードウエア上の損
傷の有無を定期的に確認するために、CPUを内蔵した
ICカードでは、自己診断機能が付加されている。たと
えば、揮発性メモリであるRAMに対する自己診断は、
通常、CPUによってRAMの各アドレスに所定のデー
タを書き込み、続いて、このデータを読み出して、これ
が正しいデータであるか否かを判定することによって行
われる。このような書き込み/読み出しテストを行う
と、RAMにもともと記憶されていたデータが失われて
しまうことになる。そこで、このようなRAMに対する
自己診断は、リセット時に行うのが一般的である。RA
MはCPUのワークエリアとして用いられるメモリであ
るため、リセット時には記憶内容が失われても問題はな
い。
[0003] A portable information recording medium such as an IC card is usually carried in a pocket or a handbag and often handled under physically severe conditions. Therefore, the built-in hardware is likely to be physically damaged. In order to regularly check the presence or absence of such hardware damage, an IC card with a built-in CPU has a self-diagnosis function. For example, self-diagnosis for RAM, which is a volatile memory,
Usually, this is performed by writing predetermined data to each address of the RAM by the CPU, then reading this data, and determining whether this is correct data. When such a writing / reading test is performed, the data originally stored in the RAM is lost. Therefore, such a self-diagnosis for the RAM is generally performed at reset. RA
Since M is a memory used as a work area of the CPU, there is no problem even if the stored contents are lost at the time of reset.

【0004】ICカードに対するアクセスを行う場合の
一般的な手順は、まず、ICカードをリーダライタ装置
に挿入する操作から始まる。ICカードをリーダライタ
装置に挿入すると、リーダライタ装置からICカードに
対してリセット信号が与えられる。すなわち、ICカー
ドに内蔵されたCPUに対してリセットがかかることに
なる。CPUは所定のリセットルーチンを実行するが、
通常、このリセットルーチンの一部として、RAMに対
する自己診断が行われる。
A general procedure for accessing the IC card starts with an operation of inserting the IC card into the reader / writer device. When the IC card is inserted into the reader / writer device, the reader / writer device gives a reset signal to the IC card. That is, the CPU built in the IC card is reset. The CPU executes a predetermined reset routine,
Normally, a self-diagnosis is performed on the RAM as part of this reset routine.

【0005】[0005]

【発明が解決しようとする課題】上述したRAMに対す
る書き込み/読み出しテストを行うには、レジスタを用
いる必要がある。ところが、このレジスタ自体に支障が
生じていると、RAMに対する正しいテストを行うこと
ができない。しかも、レジスタ自体の支障は、RAMの
特定アドレスの支障よりもむしろ重大な欠陥となる。ま
た、自己診断によって何らかの欠陥が発見されても、最
終的に外部(リーダライタ装置側)に対してその診断結
果の報告がなされなければ意味をなさない。従来の自己
診断方法は、レジスタ自体に欠陥が生じることを想定し
ていないため、レジスタ自体に欠陥が生じていた場合に
は正しい自己診断を行うことができず、これを外部に報
告することもできない。
In order to perform the above-mentioned write / read test for the RAM, it is necessary to use a register. However, if this register itself has a problem, the RAM cannot be correctly tested. Moreover, the trouble of the register itself becomes a serious defect rather than the trouble of the specific address of the RAM. Even if some defect is found by the self-diagnosis, it does not make sense unless the diagnosis result is finally reported to the outside (reader / writer device side). Since the conventional self-diagnosis method does not assume that the register itself has a defect, if the register itself has a defect, the correct self-diagnosis cannot be performed and it may be reported to the outside. Can not.

【0006】そこで本発明は、レジスタに欠陥が生じて
いた場合であっても、外部に対して正しい診断結果を報
告することのできるCPUを内蔵した情報記録媒体の自
己診断方法を提供することを目的とする。
Therefore, the present invention provides a self-diagnosis method for an information recording medium having a built-in CPU, which can report a correct diagnosis result to the outside even if the register has a defect. To aim.

【0007】[0007]

【課題を解決するための手段】[Means for Solving the Problems]

(1) 本願第1の発明は、少なくとも揮発性メモリと、
このメモリをアクセスする機能をもったCPUと、を内
蔵する情報記録媒体について、CPUによって揮発性メ
モリの動作を診断する自己診断方法において、CPUの
ために用意された複数のレジスタの中から、正常に動作
する1つのレジスタを確認し、少なくとも1つの正常な
レジスタが確認された場合には、この正常なレジスタも
しくは新たに確認された正常なレジスタを用いて、他の
レジスタおよび揮発性メモリについての診断を行い、こ
の診断結果を正常なレジスタを用いて所定のI/Oライ
ンを介して外部に伝達し、正常なレジスタが1つも確認
されなかった場合には、CPUによってI/Oラインの
電位レベルを直接制御することによって、診断結果を外
部に伝達するようにしたものである。
(1) The first invention of the present application is at least a volatile memory,
In a self-diagnosis method of diagnosing the operation of a volatile memory by the CPU, with respect to an information recording medium having a CPU having a function of accessing this memory, a normal operation is performed from a plurality of registers prepared for the CPU. Check one register that works in the above, and if at least one normal register is found, use this normal register or newly confirmed normal register to check other registers and volatile memory. Diagnosis is performed and the diagnosis result is transmitted to the outside through a predetermined I / O line using a normal register. When no normal register is confirmed, the potential of the I / O line is detected by the CPU. The diagnostic result is transmitted to the outside by directly controlling the level.

【0008】(2) 本願第2の発明は、上述の第1の発
明において、I/Oラインの電位レベルを直接制御する
のに、I/Oラインをハイレベルに保つ命令、ローレベ
ルに保つ命令、および待ち時間を設定する命令、を用い
るようにしたものである。
(2) In the second invention of the present application, in the above-mentioned first invention, in order to directly control the potential level of the I / O line, a command to keep the I / O line at a high level, and a command to keep it at a low level. The instruction and the instruction for setting the waiting time are used.

【0009】[0009]

【作 用】本発明の診断方法では、まず、正常なレジス
タが少なくとも1つあることが確認される。正常なレジ
スタの存在が確認されたら、この正常なレジスタを用い
て他のレジスタあるいは揮発性メモリについての診断が
行われ、その結果が正常なレジスタを用いて外部に報告
される。一方、正常なレジスタが1つも存在しなかった
場合には、レジスタを用いた診断結果の報告を行うこと
ができないので、CPUによってI/Oラインの電位レ
ベルを直接制御することによって、診断結果を外部に報
告する。このような方法により、レジスタに欠陥が生じ
ていた場合であっても、外部に対して正しい診断結果を
報告することができるようになる。
[Operation] In the diagnostic method of the present invention, first, it is confirmed that there is at least one normal register. When the existence of the normal register is confirmed, the normal register is used to diagnose another register or the volatile memory, and the result is reported to the outside using the normal register. On the other hand, if there is no normal register, the diagnosis result cannot be reported using the register. Therefore, the CPU directly controls the potential level of the I / O line to display the diagnosis result. Report to the outside. By such a method, it becomes possible to report a correct diagnosis result to the outside even if the register has a defect.

【0010】[0010]

【実施例】以下、本発明を図示する実施例に基づいて説
明する。図1は一般的なICカード10をリーダライタ
装置20に接続した状態を示すブロック図である。IC
カード10内には、リーダライタ装置20と接続するた
めのI/O装置11と、CPU12と、RAM13と、
ROM14と、EEPROM15と、が内蔵されてい
る。I/O装置11とリーダライタ装置20とは、I/
Oライン30によって接続されている。このI/Oライ
ン30は、リーダライタ装置20からICカード10へ
向かっての信号伝送路として利用されるとともに、その
逆方向、すなわちICカード10からリーダライタ装置
20へ向かっての信号伝送路としても利用される。CP
U12は、I/Oライン30を介してリーダライタ装置
20から与えられる命令を受け取り、これを実行する。
なお、リーダライタ装置20とICカード10との間に
は、I/Oライン30の他に、電源供給ライン、クロッ
ク供給ライン、リセットラインなどが接続されている
が、図1では図示を省略している。
The present invention will be described below based on illustrated embodiments. FIG. 1 is a block diagram showing a state in which a general IC card 10 is connected to a reader / writer device 20. IC
In the card 10, an I / O device 11 for connecting to the reader / writer device 20, a CPU 12, a RAM 13,
The ROM 14 and the EEPROM 15 are built in. The I / O device 11 and the reader / writer device 20 are
It is connected by an O line 30. The I / O line 30 is used as a signal transmission path from the reader / writer device 20 to the IC card 10, and in the opposite direction, that is, as a signal transmission path from the IC card 10 to the reader / writer device 20. Is also used. CP
The U12 receives an instruction given from the reader / writer device 20 via the I / O line 30 and executes it.
In addition to the I / O line 30, a power supply line, a clock supply line, a reset line, etc. are connected between the reader / writer device 20 and the IC card 10, but they are not shown in FIG. ing.

【0011】3種類のメモリのうち、RAM13は揮発
性のメモリであって、CPU12のワークエリアとして
利用される。ROM14およびEEPROM15は、い
ずれも不揮発性のメモリであるが、ROM14は読出し
専用であるのに対し、EEPROMは随時書き換えを行
うことができる。このため、ROM14には、CPU1
2に実行させるプログラムが用意され、EEPROM1
5には、このICカード10を特定の用途に利用する場
合に必要な種々の情報(ファイルディレクトリ、ユーザ
データなど)が記録される。
Of the three types of memories, the RAM 13 is a volatile memory and is used as a work area for the CPU 12. The ROM 14 and the EEPROM 15 are both non-volatile memories, but the ROM 14 is read-only, whereas the EEPROM can be rewritten at any time. Therefore, the ROM 14 has a CPU 1
2 has a program to be executed by the EEPROM 1
Various information (file directory, user data, etc.) necessary for using this IC card 10 for a specific purpose is recorded in 5.

【0012】CPU12は、RAM13に対する自己診
断を行う機能を有する。この実施例では、CPU12
は、リーダライタ装置20からI/Oライン30を通じ
て自己診断命令が与えられるか、あるいは、リーダライ
タ装置20からリセットライン(図示されていない)を
通じてリセット信号が与えられた場合に、ROM14内
に用意された自己診断プログラムに基づいて、RAM1
3に対する自己診断処理を実施する。この自己診断処理
の特徴は、RAM13に対する書き込み/読み出しテス
トを行う前に、まず、レジスタについての診断を行う点
にある。図2に示すように、CPU12の主たる構成要
素は、中枢となる論理演算ユニットALUと複数のレジ
スタA〜Fである。本発明の自己診断処理では、まず、
このレジスタA〜Fについての診断をRAM13の診断
に先立って行う。
The CPU 12 has a function of performing self-diagnosis on the RAM 13. In this embodiment, the CPU 12
Prepared in the ROM 14 when a self-diagnosis command is given from the reader / writer device 20 through the I / O line 30 or a reset signal is given from the reader / writer device 20 through a reset line (not shown). RAM1 based on the self-diagnosis program
The self-diagnosis process for 3 is performed. The feature of this self-diagnosis processing is that the diagnosis of the register is first performed before the write / read test for the RAM 13. As shown in FIG. 2, the main constituent elements of the CPU 12 are a central logical operation unit ALU and a plurality of registers A to F. In the self-diagnosis processing of the present invention, first,
The diagnosis of the registers A to F is performed before the diagnosis of the RAM 13.

【0013】それでは、本発明による自己診断方法の手
順を、図3の流れ図に基づいて説明する。まず、ステッ
プS10において、1つの正常なレジスタを確認する処
理を行う。これは、図2に示すレジスタA〜Fの中か
ら、どれでも1つだけ正常であると確認できれば、どの
ような方法を採ってもよい。ここでは、このステップS
10を実施するための具体的な手順の一例を図4に示す
流れ図に基づいて説明する。まず、図4の流れ図のステ
ップS11において、レジスタの番号を示すためのパラ
メータiを初期値1に設定する。続いて、ステップS1
2において、i番目のレジスタに実データXをストアす
る。実データXは、ROM14内のプログラム内に記述
されている所定のデータである。i=1であれば、レジ
スタAに実データXがストアされることになる。次にス
テップS13において、i番目のレジスタの内容と実デ
ータXとが比較される。ここで、両者が一致していれ
ば、このi番目のレジスタは正常であると判断できる。
そこで、両者が一致していれば、ステップS14からス
テップS15へと分岐して、i番目のレジスタを正常と
確認し、この手順を終了する。一方、両者が一致してい
ない場合は、このi番目のレジスタには何らかの支障が
生じていることになる。そこで、ステップS14からス
テップS16へと分岐し、パラメータiを更新してから
ステップS17を経てステップS12へと戻る。こうし
て、次のレジスタについても、同様に正常か否かが判断
される。正常なレジスタが1つでも確認されれば、ステ
ップS15を経て、この手順は終了する。N個のレジス
タすべてについて支障が生じていた場合には、i>Nに
なった時点で、ステップS17からステップS18へと
分岐して、正常なレジスタが確認できなかったとの判断
がなされる。もちろん、この図4の手順は、図3におけ
るステップS10を行う手順の一例として示したもので
あり、要するに、1つの正常なレジスタを確認するため
の処理であれば、どのような処理を行ってもかまわな
い。
Now, the procedure of the self-diagnosis method according to the present invention will be described with reference to the flowchart of FIG. First, in step S10, a process of confirming one normal register is performed. Any method may be adopted as long as it can be confirmed that only one of the registers A to F shown in FIG. 2 is normal. Here, this step S
An example of a specific procedure for implementing step 10 will be described based on the flowchart shown in FIG. First, in step S11 of the flowchart of FIG. 4, the parameter i for indicating the register number is set to the initial value 1. Then, step S1
In 2, the actual data X is stored in the i-th register. The actual data X is predetermined data described in the program in the ROM 14. If i = 1, the actual data X will be stored in the register A. Next, in step S13, the contents of the i-th register and the actual data X are compared. Here, if they match, it can be determined that the i-th register is normal.
Therefore, if they match, the process branches from step S14 to step S15 to confirm that the i-th register is normal, and this procedure is terminated. On the other hand, if they do not match, this means that some trouble has occurred in the i-th register. Therefore, the process branches from step S14 to step S16, updates the parameter i, and then returns to step S12 via step S17. In this way, it is similarly determined whether or not the next register is normal. If at least one normal register is confirmed, the procedure ends after step S15. When trouble has occurred in all N registers, when i> N, the process branches from step S17 to step S18, and it is determined that a normal register cannot be confirmed. Of course, the procedure of FIG. 4 is shown as an example of the procedure of performing step S10 in FIG. I don't care.

【0014】さて、図3の流れ図において、ステップS
10が完了すると、次のステップS20において、1つ
の正常なレジスタが確認できたか否かが判断される。確
認できた場合には、ステップS30において、この確認
できた正常なレジスタを用いて、残りの別なレジスタに
ついての診断を行う。このステップS30を実施するた
めの具体的な手順の一例を図5に示す流れ図に基づいて
説明する。まず、図5の流れ図のステップS31におい
て、残りのレジスタの番号を示すためのパラメータjを
初期値i+1に設定する。これは、既にステップS10
において、i番目のレジスタまでについての診断が終わ
っているため、ここでは、i+1番目のレジスタからN
番目のレジスタについての診断を行うためである。たと
えば、図2に示すように6つのレジスタA〜Fが存在し
(N=6)、ステップS10の手順において、レジスタ
A(i=1)が異常であるために、次のレジスタB(i
=2)が最初の正常なレジスタと確認された場合、ステ
ップS30の手順では、残りのレジスタC(j=3)〜
レジスタF(j=6)までについて診断を行えばよい。
Now, in the flow chart of FIG. 3, step S
When step 10 is completed, it is determined in the next step S20 whether or not one normal register has been confirmed. If it can be confirmed, in step S30, the normal register that has been confirmed is used to diagnose other remaining registers. An example of a specific procedure for carrying out step S30 will be described based on the flowchart shown in FIG. First, in step S31 of the flowchart of FIG. 5, the parameter j for indicating the number of the remaining registers is set to the initial value i + 1. This is already done in step S10.
Since the diagnosis up to the i-th register has been completed at, in this case, from the i + 1-th register to N
This is to diagnose the second register. For example, as shown in FIG. 2, there are six registers A to F (N = 6), and since the register A (i = 1) is abnormal in the procedure of step S10, the next register B (i
= 2) is confirmed as the first normal register, in the procedure of step S30, the remaining registers C (j = 3) to
The diagnosis may be performed up to the register F (j = 6).

【0015】まず、ステップS32において、i番目の
レジスタ(ステップS10において正常と確認されたレ
ジスタ)の内容をj番目のレジスタに転送する処理が行
われる。上述の例では、正常と確認されたレジスタBの
内容をレジスタCに転送する処理が行われることにな
る。具体的には、レジスタBには、実データXが残って
いるため、この実データXがレジスタCに転送される。
次にステップS33において、i番目のレジスタの内容
とj番目のレジスタの内容とが比較される。ここで、両
者が一致していれば、このj番目のレジスタは正常であ
ると判断できる。そこで、両者が一致していれば、ステ
ップS34からステップS35へと分岐して、j番目の
レジスタを正常と確認する。一方、両者が一致していな
い場合は、このj番目のレジスタには何らかの支障が生
じていることになる。そこで、ステップS34からステ
ップS36へと分岐して、j番目のレジスタを異常と確
認する。次に、ステップS37において、パラメータj
を更新してからステップS38を経てステップS32へ
と戻る。こうして、残りのレジスタについても、同様に
正常か否かが判断され、N個のレジスタすべてについて
の診断が完了したら、ステップS38を経てこの手順を
完了する。もちろん、この図5の手順は、図3における
ステップS30を行う手順の一例として示したものであ
り、要するに、ステップS10で確認された正常なレジ
スタを用いて、別なレジスタを診断することができる処
理であれば、どのような処理を行ってもかまわない。た
とえば、レジスタAが正常であることが確認されたので
あれば、レジスタA→レジスタBと転送を行い、更に、
レジスタB→レジスタC、レジスタC→レジスタD、レ
ジスタD→レジスタE、レジスタE→レジスタF、とい
うような転送を次々と行ってゆき、最後に、レジスタF
の内容とレジスタAの内容とが一致していた場合には、
すべてのレジスタが正常であると判断するような方法も
可能である。
First, in step S32, a process of transferring the contents of the i-th register (register confirmed as normal in step S10) to the j-th register is performed. In the above example, the process of transferring the content of the register B confirmed to be normal to the register C is performed. Specifically, since the actual data X remains in the register B, this actual data X is transferred to the register C.
Next, in step S33, the contents of the i-th register and the contents of the j-th register are compared. Here, if the two match, it can be determined that the j-th register is normal. Therefore, if they match, the process branches from step S34 to step S35 to confirm that the j-th register is normal. On the other hand, if the two do not match, this means that some trouble has occurred in the j-th register. Therefore, the process branches from step S34 to step S36 to confirm that the j-th register is abnormal. Next, in step S37, the parameter j
Is updated, the process returns to step S32 through step S38. In this way, it is similarly determined whether or not the remaining registers are normal, and when the diagnosis of all N registers is completed, this procedure is completed through step S38. Of course, the procedure of FIG. 5 is shown as an example of the procedure of performing step S30 in FIG. 3, and in short, another register can be diagnosed using the normal register confirmed in step S10. As long as it is processing, any processing may be performed. For example, if it is confirmed that the register A is normal, transfer from register A to register B, and
Register B → Register C, Register C → Register D, Register D → Register E, Register E → Register F, and so on.
If the contents of and the contents of register A match,
A method of determining that all the registers are normal is also possible.

【0016】ところで、図4に示す手順も、図5に示す
手順も、いずれもレジスタが正常か否かを診断すること
を目的とする点では同じである。ただ、前者は診断対象
となるレジスタに実データXをストアしてこれを確認す
るという手法を採るのに対し、後者は診断対象となるレ
ジスタに正常なレジスタの内容を転送してこれを確認す
るという手法を採っている。これは、レジスタにデータ
を書き込む場合、「別なレジスタの内容を転送する」と
いう方法の方が、「実データXをストアする」という方
法に比べ、命令コードのバイト数が少なくなり、効率良
く実行できるためである。すなわち、正常なレジスタが
発見されないうちは、「実データXをストアする」とい
う方法以外に選択の余地がないが、正常なレジスタが1
つ発見された後は、「この正常なレジスタの内容を転送
する」という効率的な方法を採った方が、実行時間の短
縮が図れるのである。
By the way, both the procedure shown in FIG. 4 and the procedure shown in FIG. 5 are the same in that the purpose is to diagnose whether or not the register is normal. However, the former adopts the method of storing the actual data X in the register to be diagnosed and confirming it, while the latter transfers the content of the normal register to the register to be diagnosed and confirms it. The method is adopted. This is because when writing data to a register, the method of "transferring the contents of another register" reduces the number of bytes of the instruction code more efficiently than the method of "storing the actual data X". This is because it can be executed. That is, unless a normal register is found, there is no choice other than the method of "storing the actual data X", but the normal register is 1
After one is found, the execution time can be shortened by adopting the efficient method of "transferring the contents of this normal register".

【0017】こうして、図3の流れ図におけるステップ
S30が完了し、すべてのレジスタの診断が完了した
ら、続くステップS40において、正常なレジスタを用
いたRAMの診断が行われる。このRAMの書き込み/
読み出しテストは、従来から一般に行われている方法で
ある。すなわち、RAM13の各アドレスに、レジスタ
の内容を書き込み、これを読み出すテストを行ってゆ
く。読み出した内容がもともとのレジスタの内容と一致
していれば、そのアドレスは正常であると判断できる。
このRAMの診断は、前段階のレジスタの診断によって
正常であることが確認されたレジスタを用いて行われる
ため、レジスタの支障による誤った診断が行われること
はない。
In this way, when step S30 in the flowchart of FIG. 3 is completed and diagnosis of all registers is completed, RAM diagnosis using normal registers is performed in subsequent step S40. Writing to this RAM /
The read test is a method generally used conventionally. That is, the contents of the register are written to each address of the RAM 13 and a test for reading the contents is performed. If the read contents match the contents of the original register, it can be determined that the address is normal.
Since the diagnosis of the RAM is performed by using the register which is confirmed to be normal by the diagnosis of the register in the previous stage, there is no erroneous diagnosis due to the trouble of the register.

【0018】RAMの診断が完了したら、最後のステッ
プS50において、診断結果を外部に伝達する処理が行
われる。すなわち、CPU12は、I/O装置11に対
して、診断結果を示すデータを外部へ出力するよう命令
する。I/O装置11は、この命令を受けて、I/Oラ
イン30上に診断結果を出力し、これはリーダライタ装
置20に伝達される。もちろん、こうして報告される診
断結果には、RAM13についての診断結果だけでな
く、各レジスタについての診断結果も含まれている。な
お、CPU12は、正常と確認されたレジスタを用いて
診断結果の報告を行うので、レジスタの異常により、診
断結果の報告に支障が及ぶことはない。
When the RAM diagnosis is completed, in the final step S50, a process of transmitting the diagnosis result to the outside is performed. That is, the CPU 12 commands the I / O device 11 to output the data indicating the diagnosis result to the outside. In response to this command, the I / O device 11 outputs a diagnostic result on the I / O line 30, which is transmitted to the reader / writer device 20. Of course, the diagnostic result thus reported includes not only the diagnostic result for the RAM 13 but also the diagnostic result for each register. Since the CPU 12 reports the diagnosis result by using the register confirmed as normal, the abnormality of the register does not hinder the report of the diagnosis result.

【0019】以上、正常なレジスタが少なくとも1つ存
在する場合の手順について説明したが、すべてのレジス
タに支障が生じることも起こり得る。このような場合、
I/Oライン30を介する通常の方法による診断結果の
報告を行うことはできない。なぜなら、CPU12がそ
のような報告を行うためには、レジスタを用いる必要が
あるからである。レジスタを用いることができなけれ
ば、CPU12は、I/Oライン30に診断結果を示す
データを送出することができない。従来は、このような
事態が生じると、ICカード10側からは何の応答もな
くなり、リーダライタ装置20側では、何の情報も得ら
れないまま、このICカード10に対するアクセスを中
断せざるを得なかった。本発明では、このような事態が
生じると、図3の流れ図におけるステップS20で否定
的な判断がなされ、ステップS60へと分岐する。この
ステップS60では、CPU12によって、I/Oライ
ン30の電位レベルを直接制御して、診断結果を外部へ
伝達する処理が実施される。一般に、CPU12には、
I/Oライン30の電位レベルを直接制御するための命
令が用意されている。そこで、ROM14内の自己診断
プログラムの一部に、このような電位レベルの直接制御
命令を組み合わせた診断結果の伝達ルーチンを用意して
おけば、レジスタを用いずに診断結果の報告が可能にな
る。
Although the procedure in the case where at least one normal register exists has been described above, it is possible that all registers will be disturbed. In such cases,
It is not possible to report the diagnostic result by the usual method via the I / O line 30. This is because the CPU 12 needs to use a register in order to make such a report. If the register cannot be used, the CPU 12 cannot send the data indicating the diagnosis result to the I / O line 30. Conventionally, when such a situation occurs, there is no response from the IC card 10 side, and the reader / writer device 20 side must interrupt access to the IC card 10 without obtaining any information. I didn't get it. In the present invention, when such a situation occurs, a negative determination is made in step S20 in the flowchart of FIG. 3, and the process branches to step S60. In step S60, the CPU 12 directly controls the potential level of the I / O line 30 to transmit the diagnosis result to the outside. Generally, the CPU 12
A command for directly controlling the potential level of the I / O line 30 is prepared. Therefore, if a diagnostic result transmission routine in which such a direct control command for the potential level is combined is prepared as a part of the self-diagnosis program in the ROM 14, the diagnostic result can be reported without using a register. .

【0020】このような伝達ルーチンの一例を図6に示
す。1行目の「SERIAL IN 」なる命令は、プログラムス
タート時に実行される命令であり、この命令の実行によ
り、I/Oライン30は入力モード(リーダライタ装置
20からICカード10の方向に情報を伝達するモー
ド)になる。この入力モードでは、I/Oライン30の
電位は「N(Neutral)」となり、リーダライタ
装置20からの信号伝達がなければ、I/Oライン30
はハイインピーダンス状態になる。2行目〜6行目に記
述されたルーチンが診断結果の伝達ルーチンである。2
行目の「SERIAL HIGH OUT 」なる命令は、I/Oライン
30の電位を「H(High)」に設定して出力モード
(ICカード10からリーダライタ装置20の方向に情
報を伝達するモード)にする命令であり、4行目の「SE
RIAL LOW OUT」なる命令は、I/Oライン30の電位を
「L(Low)」に設定して出力モードにする命令であ
る。また、3行目および5行目の「DELAY #AA 」および
「DELAY #BB 」なる命令は、#AAおよび#BBに相当
する待ち時間をとる命令であり、6行目「SERIAL IN」
なる命令は、I/Oライン30を再び入力モードにする
命令である。このような命令の組み合わせからなるルー
チンを実行すれば、I/Oライン30上の信号は、図7
のようになる。この図7における〜は、図6に示す
ルーチンの〜に対応している。「すべてのレジスタ
が異常」という診断結果を、このような信号で示すこと
にしておけば、レジスタを用いずに、診断結果をリーダ
ライタ装置20側へ伝達することができる。なお、図6
に示したルーチンの各命令は、説明の便宜上のものであ
り、各命令のコードは用いるCPUによって固有のもの
である。
FIG. 6 shows an example of such a transmission routine. The command "SERIAL IN" on the first line is a command executed when the program is started. By executing this command, the I / O line 30 is in the input mode (information is transferred from the reader / writer device 20 to the IC card 10). It becomes a transmission mode). In this input mode, the potential of the I / O line 30 becomes “N (Neutral)”, and if there is no signal transmission from the reader / writer device 20, the I / O line 30
Becomes a high impedance state. The routines described in the second to sixth lines are diagnostic result transmission routines. Two
The command "SERIAL HIGH OUT" in the line sets the potential of the I / O line 30 to "H (High)" and outputs the output mode (mode for transmitting information from the IC card 10 to the reader / writer device 20). Is the command to
The command “RIAL LOW OUT” is a command to set the potential of the I / O line 30 to “L (Low)” and set the output mode. The commands "DELAY #AA" and "DELAY #BB" on the 3rd and 5th lines are waiting commands corresponding to #AA and #BB, and the "SERIAL IN" command on the 6th line.
Is an instruction to put the I / O line 30 into the input mode again. If the routine consisting of such a combination of instructions is executed, the signal on the I / O line 30 will be as shown in FIG.
become that way. 7 in FIG. 7 correspond to those in the routine shown in FIG. If the diagnostic result "all registers are abnormal" is indicated by such a signal, the diagnostic result can be transmitted to the reader / writer device 20 side without using the register. Note that FIG.
Each instruction of the routine shown in is for convenience of explanation, and the code of each instruction is unique to the CPU used.

【0021】以上、本発明を図示する実施例に基づいて
説明したが、本発明はこの実施例のみに限定されるもの
ではなく、この他にも種々の態様で実施可能である。た
とえば、上述の実施例は、ICカードに本発明を適用し
た例であるが、本発明は、CPUを内蔵した情報記録媒
体に広く適用可能である。また、上述の実施例では、R
AMの自己診断について述べたが、本発明はレジスタを
含めた一般的な揮発性メモリの診断に広く適用可能であ
る。
The present invention has been described above based on the illustrated embodiment, but the present invention is not limited to this embodiment and can be implemented in various modes other than this. For example, the above-described embodiment is an example in which the present invention is applied to an IC card, but the present invention can be widely applied to an information recording medium having a built-in CPU. Further, in the above embodiment, R
Although the self-diagnosis of AM has been described, the present invention is widely applicable to the diagnosis of general volatile memory including registers.

【0022】[0022]

【発明の効果】以上のとおり本発明に係るCPUを内蔵
した情報記録媒体の自己診断方法によれば、まず、レジ
スタについての診断を行い、正常なレジスタを用いて揮
発性メモリの診断を行うようにし、更に、すべてのレジ
スタが不良の場合には、直接I/Oラインを制御して診
断結果の報告を行うようにしたため、レジスタに欠陥が
生じていた場合であっても、外部に対して正しい診断結
果を報告することができるようになる。
As described above, according to the self-diagnosis method of the information recording medium having the built-in CPU according to the present invention, first, the register is diagnosed, and the volatile memory is diagnosed by using the normal register. In addition, when all the registers are defective, the I / O line is directly controlled to report the diagnosis result. You will be able to report correct diagnostic results.

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

【図1】一般的なICカード10をリーダライタ装置2
0に接続した状態を示すブロック図である。
FIG. 1 illustrates a general IC card 10 and a reader / writer device 2
It is a block diagram which shows the state connected to 0.

【図2】一般的なCPUの概略構成を示すブロック図で
ある。
FIG. 2 is a block diagram showing a schematic configuration of a general CPU.

【図3】本発明に係る自己診断方法の手順を示す流れ図
である。
FIG. 3 is a flowchart showing a procedure of a self-diagnosis method according to the present invention.

【図4】図3に示す流れ図におけるステップS10の詳
細な手順を示す流れ図である。
FIG. 4 is a flowchart showing a detailed procedure of step S10 in the flowchart shown in FIG.

【図5】図3に示す流れ図におけるステップS30の詳
細な手順を示す流れ図である。
5 is a flowchart showing a detailed procedure of step S30 in the flowchart shown in FIG.

【図6】図3に示す流れ図におけるステップS60を行
うための具体的なプログラムルーチンの一例を示す図で
ある。
6 is a diagram showing an example of a specific program routine for performing step S60 in the flowchart shown in FIG.

【図7】図6に示すルーチンによってI/Oライン30
上に出力される信号を示す図である。
FIG. 7 shows an I / O line 30 according to the routine shown in FIG.
It is a figure which shows the signal output above.

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

10…ICカード 11…I/O装置 12…CPU 13…RAM 14…ROM 15…EEPROM 20…リーダライタ装置 30…I/Oライン 10 ... IC card 11 ... I / O device 12 ... CPU 13 ... RAM 14 ... ROM 15 ... EEPROM 20 ... Reader / writer device 30 ... I / O line

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 少なくとも揮発性メモリと、このメモリ
をアクセスする機能をもったCPUと、を内蔵する情報
記録媒体について、前記CPUによって前記揮発性メモ
リの動作を診断する自己診断方法において、 前記CPUのために用意された複数のレジスタの中か
ら、正常に動作する1つのレジスタを確認し、 少なくとも1つの正常なレジスタが確認された場合に
は、この正常なレジスタもしくは新たに確認された正常
なレジスタを用いて、他のレジスタおよび揮発性メモリ
についての診断を行い、この診断結果を正常なレジスタ
を用いて所定のI/Oラインを介して外部に伝達し、 正常なレジスタが1つも確認されなかった場合には、前
記CPUによって前記I/Oラインの電位レベルを直接
制御することによって、診断結果を外部に伝達すること
を特徴とするCPUを内蔵した情報記録媒体の自己診断
方法。
1. A self-diagnosis method for diagnosing the operation of the volatile memory by the CPU for an information recording medium having at least a volatile memory and a CPU having a function of accessing the memory, Check one register that operates normally from the multiple registers prepared for, and if at least one normal register is confirmed, check this normal register or newly confirmed normal register. Diagnosis of other registers and volatile memory is performed using the registers, and the diagnosis result is transmitted to the outside through a predetermined I / O line using normal registers, and even one normal register is confirmed. If not, the CPU directly controls the potential level of the I / O line to transmit the diagnostic result to the outside. A self-diagnosis method for an information recording medium having a built-in CPU, which is characterized by reaching.
【請求項2】 請求項1に記載の自己診断方法におい
て、 I/Oラインの電位レベルを直接制御するのに、I/O
ラインをハイレベルに保つ命令、ローレベルに保つ命
令、および待ち時間を設定する命令、を用いることを特
徴とするCPUを内蔵した情報記録媒体の自己診断方
法。
2. The self-diagnosis method according to claim 1, wherein I / O is used to directly control the potential level of the I / O line.
A self-diagnosis method for an information recording medium having a built-in CPU, characterized in that an instruction for keeping a line at a high level, an instruction for keeping a line at a low level, and an instruction for setting a waiting time are used.
JP07296693A 1993-03-08 1993-03-08 Self-diagnosis method for information recording medium incorporating CPU Expired - Fee Related JP3529402B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07296693A JP3529402B2 (en) 1993-03-08 1993-03-08 Self-diagnosis method for information recording medium incorporating CPU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP07296693A JP3529402B2 (en) 1993-03-08 1993-03-08 Self-diagnosis method for information recording medium incorporating CPU

Publications (2)

Publication Number Publication Date
JPH06259616A true JPH06259616A (en) 1994-09-16
JP3529402B2 JP3529402B2 (en) 2004-05-24

Family

ID=13504639

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07296693A Expired - Fee Related JP3529402B2 (en) 1993-03-08 1993-03-08 Self-diagnosis method for information recording medium incorporating CPU

Country Status (1)

Country Link
JP (1) JP3529402B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014010467A (en) * 2012-06-27 2014-01-20 Toshiba Tec Corp Integrated circuit initialization apparatus, electronic equipment, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014010467A (en) * 2012-06-27 2014-01-20 Toshiba Tec Corp Integrated circuit initialization apparatus, electronic equipment, and program

Also Published As

Publication number Publication date
JP3529402B2 (en) 2004-05-24

Similar Documents

Publication Publication Date Title
US6237091B1 (en) Method of updating firmware without affecting initialization information
EP0464433A2 (en) Microcontroller device having remotely programmable EPROM & method of programming
RU2269814C2 (en) Method for reliable recording of pointer for circular memory
JP2000123599A (en) Non-volatile semiconductor memory ic and its burn-in test method
US4127768A (en) Data processing system self-test enabling technique
EP0615193A1 (en) Memory card device
US4882673A (en) Method and apparatus for testing an integrated circuit including a microprocessor and an instruction cache
US5657301A (en) Automatic changer system capable of rewriting a control program for controlling the system
US20030084232A1 (en) Device and method capable of changing codes of micro-controller
US4488257A (en) Method for confirming incorporation of a memory into microcomputer system
JPH0735816A (en) Pattern memory circuit for integrated circuit tester
JP3529402B2 (en) Self-diagnosis method for information recording medium incorporating CPU
JPH1023558A (en) Remote management system and user management method used for it
US5070448A (en) Method for testing a microprogrammed input/output interface using steal techniques
US5146458A (en) Data transfer checking system
JPH04222997A (en) Data recording method on memory card and memory card system
JPS6368928A (en) Program storing system
JPH06259609A (en) Management method for ic card issue process
JPS60181947A (en) Memory diagnosing system
JPH04152488A (en) Ic card
JP3052385B2 (en) Microcomputer
CN113590153A (en) Firmware upgrading method, system, equipment and medium for CPLD
JPH03271837A (en) Test system for mt system test program
JPH03130996A (en) Initial setting system for eeprom
JPS61262945A (en) Storage device

Legal Events

Date Code Title Description
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: 20040224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040225

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090305

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees