JPH0435780B2 - - Google Patents
Info
- Publication number
- JPH0435780B2 JPH0435780B2 JP60272756A JP27275685A JPH0435780B2 JP H0435780 B2 JPH0435780 B2 JP H0435780B2 JP 60272756 A JP60272756 A JP 60272756A JP 27275685 A JP27275685 A JP 27275685A JP H0435780 B2 JPH0435780 B2 JP H0435780B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- block
- card
- writing
- information
- 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
- 238000000034 method Methods 0.000 claims description 7
- 230000010365 information processing Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 4
- 238000013500 data storage Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Debugging And Monitoring (AREA)
Description
【発明の詳細な説明】
<産業上の利用分野>
本発明は、情報処理を実行するマイクロプロセ
ツサと、情報を格納する書き換え可能な不揮発性
メモリとを内蔵するICカードに於ける情報書き
込み制御方法に関するものである。[Detailed Description of the Invention] <Industrial Application Field> The present invention is directed to information writing control in an IC card that incorporates a microprocessor that executes information processing and a rewritable nonvolatile memory that stores information. It is about the method.
<従来の技術>
従来、上記メモリへの情報書き込みに於いてエ
ラーが発生した場合は、ICカード内のマイクロ
プロセツサは、エラー発生を外部装置(リーダ
ー/ライター等)に知らせることにより、外部装
置がその領域を避け、適当な代用領域を定め、そ
こに所望の情報を書き込む処理を行つていた。<Conventional technology> Conventionally, when an error occurs while writing information to the memory, the microprocessor in the IC card notifies the external device (reader/writer, etc.) of the error occurrence. The process was to avoid that area, determine an appropriate substitute area, and write the desired information there.
<発明が解決しようとする問題点>
そのため、外部装置に対する処理負担が大きく
なるという欠点を持つていた。本発明は上記問題
点を解決することを目的としているものである。<Problems to be Solved by the Invention> This has the drawback of increasing the processing load on the external device. The present invention aims to solve the above problems.
<問題点を解決するための手段>
メモリの記憶領域を複数のブロツクに区分して
管理し、該メモリへの情報書き込み中にエラーが
発生したときは、当該エラー発生ブロツクの全記
憶領域に特定コードを書き込んだ後、次のブロツ
クに再度情報書き込みを実行する。<Means for solving the problem> The storage area of the memory is managed by dividing it into multiple blocks, and when an error occurs while writing information to the memory, the entire storage area of the block where the error occurred is specified. After writing the code, write information to the next block again.
<実施例>
以下、実施例に基づいて本発明を詳細に説明す
る。<Examples> Hereinafter, the present invention will be described in detail based on Examples.
第3図はICカードとリーダー/ライター2の
結合時の状態を示すブロツク図である。ICカー
ド1は、マイクロプロセツサ11と紫外線消去可
能なROM(EPROM)12とを内蔵する。また、
13及び21は、それぞれ、ICカード1及びリ
ーダー/ライター2の端子部である。更に述べる
ならば、C1カード(I/O)はデータを直列転
送するための入出力端子、C2(CLK)は動作
クロツクの入力端子、C3(RST)はリセツト
信号入力端子、C4(Vcc)は電源入力端子、C
5(GND)はグランド端子、C6(Vpp)は
EPROMへの書き込み電源入力端子である。ま
た、DBはデータ、バス、ABはアドレス・バス、
CBはコントロール・バスである。 FIG. 3 is a block diagram showing the state when the IC card and the reader/writer 2 are combined. The IC card 1 includes a microprocessor 11 and an ultraviolet erasable ROM (EPROM) 12. Also,
13 and 21 are terminal portions of the IC card 1 and the reader/writer 2, respectively. To explain further, the C1 card (I/O) is an input/output terminal for serially transferring data, C2 (CLK) is an input terminal for the operation clock, C3 (RST) is a reset signal input terminal, and C4 (Vcc) is an input terminal for the operation clock. Power input terminal, C
5 (GND) is the ground terminal, C6 (Vpp) is
This is the power input pin for writing to EPROM. Also, DB is data bus, AB is address bus,
CB is the control bus.
第4図は上記EPROM12の記憶領域構成図で
あり、その記録領域は、複数のブロツク121,
122,…,12K-1及び12kに区分されている。
各ブロツクのバイト数は同一である。 FIG. 4 is a storage area configuration diagram of the EPROM 12, and the recording area consists of a plurality of blocks 12 1 ,
It is divided into 12 2 ,..., 12 K-1 and 12k.
Each block has the same number of bytes.
第1図は、マイクロプロセツサ11中の制御
ROM(図示せず)内に格納されている書き込み
処理プログラムを示すフローチヤートである。ま
た、第2図は、同じくマイクロプロセツサ11中
の制御ROM内に格納されている読み出し処理プ
ログラムを示すフローチヤートである。両図に於
いて、Aはアドレス指定カウンタ、BはAの指定
するアドレスに書き込まれたデータ、B′はAの
指定するアドレスに書き込むべきデータ、Cはデ
ータ・バイト数カウンタ、C′は所望のデータ・バ
イト数、Nはブロツク番号カウンタ、addrはブ
ロツクNの先頭アドレスを、それぞれ示す。 FIG. 1 shows the control in the microprocessor 11.
3 is a flowchart showing a write processing program stored in a ROM (not shown). FIG. 2 is a flowchart showing a read processing program stored in the control ROM in the microprocessor 11 as well. In both figures, A is the address specification counter, B is the data written to the address specified by A, B' is the data to be written to the address specified by A, C is the data byte number counter, and C' is the desired number. , N is the block number counter, and addr is the start address of block N, respectively.
本実施例に於いては、書き込み処理及び読み出
し処理ともにブロツク単位で行なわれる。 In this embodiment, both write processing and read processing are performed in units of blocks.
まず、書き込み処理について説明する。 First, write processing will be explained.
情報書き込みが指示されると、ブロツクNの先
頭アドレス、すなわち、次に情報を書き込むべき
ブロツクの先頭アドレスaddrがアドレス指定カ
ウンタAに設定される。また、所望のデータ・バ
イト数C′(1ブロツクあたりのバイト数。各カー
ドについて固有の値)がデータ・バイト数カウン
タCに入力される。次いで、最初のデータの書き
込みが実行される。引き続いて、今書き込まれた
データの読み出しが実行され、B=B′か否か、
すなわち、データ書き込みが正しく行なわれたか
否かがチエツクされる。正しく書き込みが行なわ
れていたのであれば、すなわち、エラーが発生し
ていなければ、アドレス指定カウンタAのカウン
タ・アツプ及びデータ・バイト数カウンタCのカ
ウンタ・ダウンが実行され、C≠0であれば、次
のデータの書き込みが行われ、以下、同様の処理
が実行される。そして、C=0が検出されれば、
書き込み処理を終了する。 When information writing is instructed, the start address of block N, that is, the start address addr of the block into which information is to be written next, is set in address designation counter A. Further, a desired number of data bytes C' (number of bytes per block, a unique value for each card) is input to a data byte number counter C. Next, the first data write is performed. Subsequently, reading of the data just written is executed, and it is determined whether B=B' or not.
That is, it is checked whether data writing has been performed correctly. If writing was performed correctly, that is, if no error occurred, the counter up of address specification counter A and the counter down of data byte number counter C are executed, and if C≠0, , the next data is written, and similar processing is performed thereafter. Then, if C=0 is detected,
Finish the write process.
この書き込み処理の途中で、エラーが発生する
と、すなわち、書き込まれたデータが本来書き込
むべきデータと異なつていることが検出される
と、当該エラー発生ブロツクの先頭アドレス
addrが再びアドレス指定カウンタAに設定され、
また、上記所望のデータ・バイト数C′がデータ・
バイト数カウンタCに再設定される。そして、以
降の処理が実行されることによつて、当該ブロツ
クの全領域にバイト・データ“(00)16”が書き込
まれる。ICカードに於いて扱われるデータはア
スキー・データであり、バイト・データ値“(00)
16”はデータとして利用されることは無い。その
後、次のブロツク(N+1)に対して、前述した
と同様の書き込み処理が実行される。もし、ブロ
ツクN内に1バイトも“(00)16”を書き込めなか
つた場合は、そのカードを無効とする処理を行な
う。 If an error occurs during this write process, that is, if it is detected that the written data is different from the data that should have been written, the start address of the block where the error occurred will be
addr is set to addressing counter A again,
Also, if the desired number of data bytes C′ is
Byte number counter C is reset. Then, by executing the subsequent processing, byte data "(00) 16 " is written in the entire area of the block. The data handled in IC cards is ASCII data, and the byte data value is "(00)".
16 ” is never used as data. After that, the same write process as described above is executed for the next block (N+1). If there is even a single byte in block N, “(00) 16 ” cannot be written, the card is invalidated.
次に、読み出し処理について説明する。 Next, read processing will be explained.
読み出しの際は、読み出したバイト・データを
“(00)16”と比較し、一致した場合は、マイクロ
プロセツサは、アドレス指定カウンタAに次のブ
ロツク(N+1)の先頭アドレスを設定し、所望
のデータを読み出す。 When reading, the read byte data is compared with "(00) 16 ", and if they match, the microprocessor sets the start address of the next block (N+1) in address designation counter A and selects the desired address. Read the data.
以上のように、データ処理を行なうためのマイ
クロプロセツサとデータを格納するための紫外線
消去可能なROM(EPROM)とを内蔵したICカー
ドに於いて、データ格納用EPROMの記憶領域を
複数のブロツクに分けて管理し、書き込みエラー
に対する処理として、当該エラーが発生したブロ
ツクに対して、すべてのビツトに論理“0”を書
き込み、再度、次のブロツクに所望のデータを書
き込む。ICカードに於いて扱われるデータはア
スキー・データであり、バイト・データ値“(00)
16”はデータとして利用されることはない。読み
出し処理の際、ICカード内のマイクロプロセツ
サは、ブロツク内のデータをすべてバイト・デー
タ値“(00)16”と比較し、1文字でも見つけ出し
た場合は無効のデータ・ブロツクと判断して、所
望のデータを得るため次のブロツクを読み出す。 As described above, in an IC card that has a built-in microprocessor for data processing and an ultraviolet erasable ROM (EPROM) for storing data, the storage area of the data storage EPROM is divided into multiple blocks. In response to a write error, logic "0" is written to all bits of the block where the error occurred, and desired data is written again to the next block. The data handled in IC cards is ASCII data, and the byte data value is "(00)".
16 ” is never used as data. During the read process, the microprocessor in the IC card compares all the data in the block with the byte data value “(00) 16 ” and finds even one character. If so, it is determined that the data block is invalid, and the next block is read to obtain the desired data.
上記実施例に於いては、ICカード内のデータ
格納用メモリとしてEPROMを用いているが、
EPROMの代わりにEEPROMを用いてもよい。
EPROMの場合は、ビツトの値“1”を“0”に
することはできるが、“0”を“1”にすること
はできない。これに対して、EEPROMの場合は
両方とも可能である。そのため、ブロツクを無効
と判断するためのバイト・データは、EPROMの
場合“(00)16”に限定されるが、EEPROMの場
合は、アスキー・データで使わないデータ値であ
れば何を用いても良い。 In the above embodiment, EPROM is used as the data storage memory in the IC card.
EEPROM may be used instead of EPROM.
In the case of EPROM, the bit value "1" can be changed to "0", but "0" cannot be changed to "1". On the other hand, with EEPROM, both are possible. Therefore, the byte data used to judge a block as invalid is limited to "(00) 16 " in the case of EPROM, but in the case of EEPROM, any data value that is not used in ASCII data can be used. Also good.
<発明の効果>
以上詳細に説明したように、本発明によれば、
外部装置の処理負担を軽減することができ、また
ブロツク単位でのデータの信頼性を確保すること
ができるものである。<Effects of the Invention> As explained in detail above, according to the present invention,
The processing load on the external device can be reduced, and the reliability of data on a block-by-block basis can be ensured.
第1図は本発明の一実施例に於ける書き込み処理
プログラムを示すフローチヤート、第2図は同実
施例に於ける読み出し処理プログラムを示すフロ
ーチヤート、第3図は同実施例に於けるICカー
ドとリーダー/ライターの結合時の状態を示すブ
ロツク図、第4図は同実施例に於けるデータ格納
用EPROMの記憶領域構成図である。
1……ICカード、2……リーダー/ライター、
11……マイクロプロセツサ、12……
EPROM、13,21……端子部、121,…,
12K……ブロツク。
FIG. 1 is a flow chart showing a write processing program in one embodiment of the present invention, FIG. 2 is a flow chart showing a read processing program in the same embodiment, and FIG. 3 is a flow chart showing an IC in the same embodiment. FIG. 4 is a block diagram showing the state when the card and the reader/writer are combined, and is a storage area configuration diagram of the data storage EPROM in the same embodiment. 1...IC card, 2...Reader/writer,
11...Microprocessor, 12...
EPROM, 13, 21... terminal section, 12 1 ,...,
12 K ...Block.
Claims (1)
情報を格納する書き換え可能な不揮発性メモリと
を内蔵するICカードに於いて、 上記メモリの記憶領域を複数のブロツクに区分
して管理し、該メモリへの情報書き込み中にエラ
ーが発生したときは、当該エラー発生ブロツクの
全記憶領域に特定コードを書き込んだ後、次のブ
ロツクに再度情報書き込みを実行することを特徴
とする、ICカードに於ける情報書き込み制御方
法。[Claims] 1. A microprocessor that executes information processing;
In an IC card that has a built-in rewritable nonvolatile memory that stores information, the storage area of the memory is managed by dividing it into multiple blocks, and if an error occurs while writing information to the memory, A method for controlling information writing in an IC card, which comprises writing a specific code to the entire storage area of the block in which the error has occurred, and then writing information to the next block again.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP60272756A JPS62131354A (en) | 1985-12-03 | 1985-12-03 | Method for controlling information write on ic card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP60272756A JPS62131354A (en) | 1985-12-03 | 1985-12-03 | Method for controlling information write on ic card |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS62131354A JPS62131354A (en) | 1987-06-13 |
JPH0435780B2 true JPH0435780B2 (en) | 1992-06-12 |
Family
ID=17518312
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP60272756A Granted JPS62131354A (en) | 1985-12-03 | 1985-12-03 | Method for controlling information write on ic card |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS62131354A (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0254118A (en) * | 1988-08-18 | 1990-02-23 | Hioki Ee Corp | Memory control method |
JPH0283644A (en) * | 1988-09-21 | 1990-03-23 | Anritsu Corp | Electronic equipment using nonvolatile memory |
JPH03221972A (en) * | 1990-01-29 | 1991-09-30 | Tokyo Electric Co Ltd | Electrophotographic device |
JP2703415B2 (en) * | 1991-03-27 | 1998-01-26 | 三洋電機株式会社 | Data writing / reading method for IC memory |
US6256642B1 (en) * | 1992-01-29 | 2001-07-03 | Microsoft Corporation | Method and system for file system management using a flash-erasable, programmable, read-only memory |
JP2744162B2 (en) * | 1992-01-31 | 1998-04-28 | 三洋電機株式会社 | Solid-state recording and playback device |
-
1985
- 1985-12-03 JP JP60272756A patent/JPS62131354A/en active Granted
Also Published As
Publication number | Publication date |
---|---|
JPS62131354A (en) | 1987-06-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7908424B2 (en) | Memory card and data rewriting method | |
US20060026340A1 (en) | Memory card, card controller mounted on the memory card, and device for processing the memory card | |
JPS62190584A (en) | Portable electronic device | |
JPS6325893A (en) | Programming of data on electrically programmable rom | |
EP3057100B1 (en) | Memory device and operating method of same | |
JPH0435780B2 (en) | ||
JPS59135698A (en) | Eeprom device | |
JP3471842B2 (en) | Data management device, data storage device, and data management method | |
JPS63106996A (en) | Semiconductor integrated circuit device | |
JP3512252B2 (en) | Information recording medium with built-in CPU | |
JP2808358B2 (en) | IC card | |
JP3088866B2 (en) | IC card | |
JP2864288B2 (en) | Error checking method for IC card | |
JP3130588B2 (en) | Storage media | |
JPH0778231A (en) | Memory card | |
JP3088867B2 (en) | IC card | |
JP3168572B2 (en) | IC card with CPU runaway detection function | |
JP4211890B2 (en) | How to change memory card data in a transaction | |
US5222232A (en) | Apparatus and method for monitoring prom access in a microcomputer | |
JPS62289999A (en) | Data writing method | |
JP2850049B2 (en) | IC card | |
JP3120804B2 (en) | IC card and IC card system | |
JP2598056B2 (en) | Portable electronic devices | |
JP3113267B2 (en) | IC card | |
JP3634417B2 (en) | IC card |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
EXPY | Cancellation because of completion of term |