JPH0765135A - Reader writer for ic card - Google Patents

Reader writer for ic card

Info

Publication number
JPH0765135A
JPH0765135A JP5232481A JP23248193A JPH0765135A JP H0765135 A JPH0765135 A JP H0765135A JP 5232481 A JP5232481 A JP 5232481A JP 23248193 A JP23248193 A JP 23248193A JP H0765135 A JPH0765135 A JP H0765135A
Authority
JP
Japan
Prior art keywords
card
data
register
host device
communication
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.)
Pending
Application number
JP5232481A
Other languages
Japanese (ja)
Inventor
Seiji Hirano
誠治 平野
Shuichi Matsumura
秀一 松村
Takashi Ikegami
敬 池上
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.)
Toppan Inc
Original Assignee
Toppan 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 Toppan Printing Co Ltd filed Critical Toppan Printing Co Ltd
Priority to JP5232481A priority Critical patent/JPH0765135A/en
Publication of JPH0765135A publication Critical patent/JPH0765135A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the time of a communication process between host equipment and an IC card which have different transmission formats by holding communication data whose amount corresponds to the difference between the transmission formats in a buffer means. CONSTITUTION:A detecting means 312 in an interface device 310 detects the difference between the transmission formats of the host equipment 100 and the IC card 200. A buffer control means 313 holds the communication data in the buffer means 311 by the data amount corresponding to the difference between those transmission formats. The IC card reader writer 300 buffers data from the host equipment 100 in the buffer means 311 at need and sends the data to the IC card 200. When data are sent from the IC card 200 to the host equipment 100, the data from the IC card 200 are brought under buffer control when necessary.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はICカード用リーダライ
タ、特にICカード側のインタフェースでの伝送フォー
マットとホスト機器側のそれとが異なる場合におけるト
ランスペアレントのデータ通信を可能としたICカード
用リーダライタに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an IC card reader / writer, and more particularly to an IC card reader / writer capable of transparent data communication when the transmission format of an interface on the IC card side and that on the host device side are different. .

【0002】[0002]

【従来の技術】最近のICカードシステムにおいて使用
されるICカード用リーダライタには、トランスペアレ
ントタイプと、バッファリングタイプとがある。前者
は、ホスト機器からICカードにデータ通信を行う場
合、ホスト機器に対するRS−232Cインタフェース
の動作電圧レベルと、ICカードに対するTTLインタ
フェースの動作電圧レベルとの間で、その動作電圧につ
いてレベル変換処理だけを行うものである。したがっ
て、このタイプのリーダライタでは、後者に比較してホ
スト機器とICカードとの間のデータ通信の処理速度が
向上することとなる。後者は、この場合、ホスト機器か
らのデータをリーダライタ内のメモリにバッファリング
し、その後、そのバッファリングしたデータをICカー
ドに送信する。また、ICカードからのデータも同様に
バッファリングした後、ホスト機器へ送信するものであ
る。
2. Description of the Related Art IC card reader / writers used in recent IC card systems are classified into a transparent type and a buffering type. In the former case, when data communication is performed from the host device to the IC card, only level conversion processing is performed for the operating voltage between the operating voltage level of the RS-232C interface for the host device and the operating voltage level of the TTL interface for the IC card. Is to do. Therefore, in this type of reader / writer, the processing speed of data communication between the host device and the IC card is improved as compared with the latter case. In the latter case, the latter buffers the data from the host device in the memory in the reader / writer, and then transmits the buffered data to the IC card. Further, the data from the IC card is similarly buffered and then transmitted to the host device.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記ト
ランスペアレントタイプのリーダライタでは、通信仕様
(伝送フォーマット)がICカードのそれに依存して制
限されてしまうという課題があった。リーダライタにお
いて、ホスト機器側インタフェースの伝送フォーマット
がICカード側のそれと異なる場合は通信が不能となる
からである。
However, the above-mentioned transparent type reader / writer has a problem that the communication specification (transmission format) is limited depending on that of the IC card. This is because, in the reader / writer, if the transmission format of the host device side interface is different from that of the IC card side, communication will be disabled.

【0004】一方、バッファリングタイプでも、通信デ
ータをバッファメモリに格納する作業により通信処理時
間が、トランスペアレントタイプの場合の約2倍かかっ
てしまうという問題があった。
On the other hand, the buffering type also has a problem that the communication processing time is about twice as long as that of the transparent type due to the operation of storing the communication data in the buffer memory.

【0005】そこで、本発明は、異なる伝送フォーマッ
トを有するホスト機器とICカードとの間のデータ通信
に対しても通信処理時間を短縮することができるICカ
ード用リーダライタを提供することを、その目的として
いる。
Therefore, the present invention provides a reader / writer for an IC card, which can shorten the communication processing time even for data communication between a host device having a different transmission format and an IC card. Has an aim.

【0006】[0006]

【課題を解決するための手段】請求項1に記載した発明
は、図1に示すように、ホスト機器100およびICカ
ード200に接続されるとともに、これらのそれぞれに
対してデータ通信が可能であるICカード用リーダライ
タ300において、上記ホスト機器100および/また
はICカード200に接続されるインタフェース装置3
10を備え、このインタフェース装置310は、通信デ
ータを一時保持するバッファ手段311と、上記ホスト
機器100とICカード200との間のデータ通信に際
して、ホスト機器100との間の伝送フォーマットとI
Cカード200との間のそれとの差異を検出する検出手
段312と、上記ホスト機器100との間の伝送フォー
マットとICカード200との間のそれとの差異に対応
したデータ量の通信データを上記バッファ手段311に
より保持させるバッファ制御手段313とを有するIC
カード用リーダライタである。
The invention described in claim 1 is connected to a host device 100 and an IC card 200 as shown in FIG. 1, and is capable of data communication with each of them. In the IC card reader / writer 300, the interface device 3 connected to the host device 100 and / or the IC card 200.
The interface device 310 includes a buffer unit 311 for temporarily holding communication data, a transmission format between the host device 100 and the IC card 200 when data communication between the host device 100 and the IC card 200, and I
The detection means 312 for detecting the difference between the C card 200 and the IC card 200, and the buffer for transferring the communication data of the data amount corresponding to the difference between the transmission format between the host device 100 and the IC card 200. IC having buffer control means 313 held by means 311
It is a card reader / writer.

【0007】[0007]

【作用】本発明に係るICカード用リーダライタは、ホ
スト機器100からのデータを受信しながら、このデー
タをICカード200に送信する。例えばホスト機器1
00に対する伝送フォーマットがICカード200に対
するそれと異なる場合、必要に応じて、ホスト機器10
0からのデータをバッファ手段311にバッファリング
し、ICカード200に送信する。例えばホスト機器1
00およびICカード200からの各ATR情報を比較
することにより、伝送フォーマットの違いを検出する。
そして、これらの伝送フォーマットの差異に対応したデ
ータ量の通信データを上記バッファ手段311により保
持させる。また、全てのデータの送受が終了した時点
で、ICカード200からのレスポンスを受信しなが
ら、これをホスト機器100に送信する。この場合にも
必要に応じてICカード200からのデータをバッファ
制御する。
The IC card reader / writer according to the present invention receives data from the host device 100 and transmits the data to the IC card 200. For example, host device 1
If the transmission format for 00 is different from that for the IC card 200, if necessary, the host device 10
The data from 0 is buffered in the buffer means 311 and transmitted to the IC card 200. For example, host device 1
00 and each ATR information from the IC card 200 are compared to detect a difference in transmission format.
Then, the buffer means 311 holds the communication data of the data amount corresponding to the difference of these transmission formats. Further, when the transmission / reception of all data is completed, this is transmitted to the host device 100 while receiving the response from the IC card 200. In this case as well, the data from the IC card 200 is buffer-controlled as necessary.

【0008】[0008]

【実施例】以下、本発明に係るICカード用のリーダラ
イタの一実施例を図2〜図11を参照して説明する。図
2、図3に基づいて、まず、リーダライタ300の構成
を説明する。このリーダライタ(R/W)300はRS
−232C、および、TXD(送信データ),RXD
(受信データ),GNDの各ピン、配線を介してホスト
機器100に接続されている。ホスト機器100として
モデムに対応する必要がある場合、CTS(送信可),
RTS(送信要求)の各ピン、配線を介してその制御を
行う構成である。ホスト機器100に対するインタフェ
ースであるRS−232C(例えば12V)とTTLレ
ベル(例えば5V)との動作電圧のレベル変換にはレベ
ル変換用回路MAX232を使用している。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a reader / writer for an IC card according to the present invention will be described below with reference to FIGS. First, the configuration of the reader / writer 300 will be described with reference to FIGS. 2 and 3. This reader / writer (R / W) 300 is an RS
-232C, TXD (transmission data), RXD
(Reception data), each pin of GND, and wiring are connected to the host device 100. When it is necessary to support a modem as the host device 100, CTS (transmission is possible),
The control is performed via each pin of RTS (transmission request) and wiring. The level conversion circuit MAX232 is used for level conversion of the operating voltage between RS-232C (for example, 12 V) which is an interface to the host device 100 and TTL level (for example, 5 V).

【0009】このリーダライタ300は、ICカード2
00に対して電源供給用ポートVCC,接地用ポートGN
D,クロック信号供給用ポートCLK、データ送受信用
ポートI/O、リセット信号供給用ポートRSTを介し
て接続されることとなる。また、リーダライタ300は
上記CPU、MAX232、CLKの他にバッファ用の
RAMを有している。
This reader / writer 300 is an IC card 2
00 for power supply port VCC and ground port GN
D, the clock signal supply port CLK, the data transmission / reception port I / O, and the reset signal supply port RST. Further, the reader / writer 300 has a RAM for buffer in addition to the CPU, MAX232, and CLK.

【0010】本実施例に係るCPUとしては、日立製作
所製のH8系シリーズ(例えばH8/520)を用い
る。CPUにおいてSCI(シリアルコミュニケーショ
ンインタフェース)1は、ホスト機器100側の通信イ
ンタフェースを、SCI2はICカード側インタフェー
スをそれぞれ示している。ホスト機器100側の通信イ
ンタフェースSCI1は、上記TXD、RXD、P2
0、P21の各ピンを含んで構成されている。また、I
Cカード側インタフェースSCI2は、上記TXD、R
XD、P30、P31、P32の各ピンを含んで構成さ
れている。
As the CPU according to this embodiment, an H8 series manufactured by Hitachi Ltd. (for example, H8 / 520) is used. In the CPU, SCI (serial communication interface) 1 indicates a communication interface on the host device 100 side, and SCI 2 indicates an IC card side interface. The communication interface SCI1 on the host device 100 side is the above TXD, RXD, P2.
0 and P21 pins are included. Also, I
The C card side interface SCI2 is the above TXD, R
It is configured to include each pin of XD, P30, P31, and P32.

【0011】図4に上記ICカードシステムでの伝送フ
ォーマットの例を示す。(A)はISOに準拠したIC
カードの伝送フォーマットであり、「NAD(ノードア
ドレス)」は送信元と受信先のアドレスを示している。
「PCB(プロトコル制御バイト)」は、通信制御バイ
トで通信エラー時の再送要求等の通信レイヤの制御に使
用される。「LEN」は「INFORMATION部」
(データ部)の長さを示している。「EDC」は「NA
D」から「INFORMATION部」の最後のバイト
迄のEXORをとるもので、通信エラーの検出に使用さ
れるコードである。(B)はこのタイプのICカードか
らのATR(アンサー・ツー・リセット)情報のフォー
マットである。
FIG. 4 shows an example of a transmission format in the IC card system. (A) is an IC based on ISO
This is the transmission format of the card, and "NAD (node address)" indicates the addresses of the transmission source and the reception destination.
"PCB (protocol control byte)" is a communication control byte and is used for controlling the communication layer such as a retransmission request at the time of a communication error. "LEN" means "INFORMATION section"
The length of (data part) is shown. "EDC" is "NA
EXOR is performed from the "D" to the last byte of the "INFORMATION section", which is a code used for detecting a communication error. (B) is a format of ATR (answer-to-reset) information from the IC card of this type.

【0012】同図において、(C)は別のタイプのIC
カードに用いられる伝送フォーマットである。「SR
A」はスタートフラグ(3Ah)を、「LEN」は通信
データ長、すなわち「INFORMATION部」のバ
イト数と「BCC」とを足した長さを、「BCC」は通
信エラー検出用で「LEN」から「INFORMATI
ON部」の最後のバイト迄のEXORを示している。
(D)はこのタイプのICカードによるATR情報のフ
ォーマットを示している。
In the figure, (C) is another type of IC.
It is a transmission format used for cards. "SR
"A" is the start flag (3Ah), "LEN" is the communication data length, that is, the sum of the number of bytes in the "INFORMATION section" and "BCC", and "BCC" is "LEN" for detecting a communication error. From "INFORMATI
It shows EXOR up to the last byte of "ON part".
(D) shows the format of ATR information by this type of IC card.

【0013】上記構成のリーダライタでの動作を図5〜
図11のフローチャートに基づいて説明する。
The operation of the reader / writer having the above configuration will be described with reference to FIGS.
This will be described based on the flowchart of FIG.

【0014】各ICカードのプロトコルは、リードライ
タ処理でのICカードのリセット時に設定される。図5
に基づいてICカードのリセットコマンドの処理を説明
する。リードライタ300からICカード200に対し
てVcc,CLKを供給した後、まず、RSTよりリセ
ット信号を送り(S501)、ICカード200からの
ATR情報を受信する(S502)。このとき、ICP
F(ICカードプロトコルフラグ)は0にセットする
(S503)。このATR情報の先頭1バイトが「3F
h」の場合(S504でYES)、ICPFに1をセッ
トする(S505)。図4の(B)の場合である。この
フラグ「ICPF」はICカード200の伝送フォーマ
ットをリーダライタ300に判別させるためである。
The protocol of each IC card is set when the IC card is reset in the read / write process. Figure 5
The processing of the IC card reset command will be described based on FIG. After supplying Vcc and CLK from the read / writer 300 to the IC card 200, first, a reset signal is sent from the RST (S501) and ATR information from the IC card 200 is received (S502). At this time, ICP
F (IC card protocol flag) is set to 0 (S503). The first 1 byte of this ATR information is "3F
In the case of "h" (YES in S504), 1 is set in ICPF (S505). This is the case of FIG. This flag “ICPF” is for making the reader / writer 300 discriminate the transmission format of the IC card 200.

【0015】図6にメインフローチャートを示す。リー
ダライタ300では電源が投入されると、ホスト機器1
00側の通信インタフェースSCI1の初期化を行い
(S601)、次いで、ICカード200側のインタフ
ェースSCI2の初期化を行う(S602)。例えば通
信速度、パリティ、ストップビット、キャラクタ構成な
どの転送フォーマットをそれぞれ設定する。また、イン
タフェースSCI1の送信データレジスタ(TDR1)
と受信データレジスタ(RDR1)を動作可能状態にす
る(TE=1,RE=1)。さらに、インタフェースS
CI2の受信データレジスタ(RDR2)を動作可能状
態とする(RE=1)。
FIG. 6 shows a main flowchart. When the reader / writer 300 is powered on, the host device 1
The communication interface SCI1 on the 00 side is initialized (S601), and then the interface SCI2 on the IC card 200 side is initialized (S602). For example, transfer formats such as communication speed, parity, stop bit, and character configuration are set. Also, the transmission data register (TDR1) of the interface SCI1
Then, the reception data register (RDR1) is made operable (TE = 1, RE = 1). Furthermore, the interface S
The reception data register (RDR2) of CI2 is enabled (RE = 1).

【0016】そして、受信ポインタのアドレス初期値
(RDPT)をレジスタ2(R2)に、送信ポインタの
アドレス初期値(TDPT)をレジスタ3(R3)にセ
ットする(S603)。さらに、レジスタ4(R4)に
「2」をセットする(S604)。
Then, the address initial value (RDPT) of the reception pointer is set in the register 2 (R2), and the address initial value (TDPT) of the transmission pointer is set in the register 3 (R3) (S603). Further, "2" is set in the register 4 (R4) (S604).

【0017】ここで、上記ICPFが1であるか否かを
チェックする(S605)。ICPFが1の場合は、伝
送フォーマット例1(図4(A))に示すフォーマット
を有するICカード200との間でのデータ通信を行う
ものであるので、レジスタ4(R4)を1だけインクリ
メントする(S606)。これ以外のICカード200
では例えば図4の(C)のフォーマットを有するもので
あるので、レジスタ4をインクリメントせずにホスト機
器100からのデータ受信ルーチンに進む(S60
7)。このICPFによりレジスタ4に受信すべきデー
タの長さを3バイト(NAD,PCB,LEN)または
2バイト(SRA,LEN)にセットする。ホスト受信
ルーチンは図8に示す。
Here, it is checked whether or not the ICPF is 1 (S605). When the ICPF is 1, since data communication is performed with the IC card 200 having the format shown in the transmission format example 1 (FIG. 4A), the register 4 (R4) is incremented by 1. (S606). Other IC card 200
Since it has the format of FIG. 4C, for example, the routine proceeds to the data receiving routine from the host device 100 without incrementing the register 4 (S60).
7). With this ICPF, the length of the data to be received in the register 4 is set to 3 bytes (NAD, PCB, LEN) or 2 bytes (SRA, LEN). The host reception routine is shown in FIG.

【0018】そして、このホスト機器100からの受信
データがリーダライタ300宛のものであるか否かを判
断し(S608)、リーダライタ(R/W)宛のデータ
ではない場合、これはICカード200からのデータを
ホスト機器100に送信すべき場合である。このため、
受信ポインタのアドレス初期値(RDPT)をレジスタ
2(R2)に、送信ポインタのアドレス初期値(TDP
T)をレジスタ3(R3)にセットする(S609)。
そして、ホスト機器100への送信ルーチンを実行する
(S610)。このホスト機器100への送信ルーチン
は図9に示す。
Then, it is judged whether the received data from the host device 100 is addressed to the reader / writer 300 (S608), and if it is not the data addressed to the reader / writer (R / W), this is an IC card. This is the case where the data from 200 should be transmitted to the host device 100. For this reason,
The address initial value (RDPT) of the reception pointer is stored in the register 2 (R2) and the address initial value (TDP) of the transmission pointer is stored.
T) is set in the register 3 (R3) (S609).
Then, the transmission routine to the host device 100 is executed (S610). A transmission routine to the host device 100 is shown in FIG.

【0019】リーダライタ300宛のデータである場合
(S608でYES)、リーダライタ300での処理を
実行し(S611)、処理後の内容をリーダライタ30
0からホスト機器100側に送信する(S612)。そ
して、データの受信待ちの状態に戻る(S603に戻
る)。
If the data is addressed to the reader / writer 300 (YES in S608), the process in the reader / writer 300 is executed (S611), and the contents after the process are read by the reader / writer 30.
It is transmitted from 0 to the host device 100 side (S612). Then, the process returns to the state of waiting for data reception (return to S603).

【0020】上記ステップS607に示すホスト機器1
00からのデータを受信し、ICカード200に送信す
るホスト受信ルーチンを図8に示す。まず、ホスト側イ
ンタフェースSCI1のフラグであるレシーブデータレ
ジスタフル(RDRF1)が1になっているかを判定
し、1であると1バイト受信しているから(S801で
YES)、受信したデータが格納された受信データレジ
スタ(RDR1)からデータをレジスタ1(R1)にセ
ットする(S802)。
Host device 1 shown in step S607.
FIG. 8 shows a host reception routine for receiving the data from 00 and transmitting it to the IC card 200. First, it is determined whether the receive data register full (RDRF1), which is a flag of the host-side interface SCI1, is 1, and if it is 1, 1 byte is received (YES in S801), and the received data is stored. Data is set in the register 1 (R1) from the received data register (RDR1) (S802).

【0021】そして、このデータ(伝送フォーマットの
「NAD」)がリーダライタ300宛のものがICカー
ド200宛のものかを判断する(S803)。受信用の
レジスタ1(R1)のデータがリーダライタ(R/W)
宛の場合(S803でYES)、リーダライタ(R/
W)における受信処理(ICカードのリセットなど)を
実行し(S815)、ホスト機器100にレスポンスを
送信し、受信に戻る。
Then, it is determined whether this data (transmission format "NAD") is addressed to the reader / writer 300 or the IC card 200 (S803). Data in register 1 (R1) for reception is a reader / writer (R / W)
In the case of addressing (YES in S803), the reader / writer (R /
The reception process (IC card reset, etc.) in W) is executed (S815), a response is transmitted to the host device 100, and the process returns to reception.

【0022】受信データがICカード200宛の場合
(S803でNO)、ICカード側インタフェースSC
I2の送信データレジスタ(TDR2)を動作可能状態
にする(S804)。すなわち、TE(トランスミット
イネーブル)=1としてICカード200に対してデー
タを送信可能とする。また、通信カウンタ(TCT)を
クリアする。そして、1バイト送信ルーチンを実行する
(S805)。そのルーチンを図7に示す。
When the received data is addressed to the IC card 200 (NO in S803), the IC card side interface SC
The I2 transmission data register (TDR2) is set to the operable state (S804). That is, data can be transmitted to the IC card 200 by setting TE (Transmit Enable) = 1. In addition, the communication counter (TCT) is cleared. Then, the 1-byte transmission routine is executed (S805). The routine is shown in FIG.

【0023】次のステップS806はHRITルーチン
(ホスト機器受信ICカード送信)を示し、このルーチ
ンおよびステップS807では、データの先頭から3バ
イト(NAD,PCB,LEN)を受信し、ICカード
200に送信する。ステップS807では通信カウンタ
(TCT)の値が3になったかを判定している。カウン
タが3になるまでは、上記ホスト機器100側からのデ
ータを受信するルーチンを実行する(S806)。3バ
イトのデータの受信/送信が完了すると(S807でY
ES)、上記受信用レジスタ(R1)に対して全データ
数の長さを示すために2バイト分だけ加算する(S80
8)。すなわち、「LEN」を受信するとレジスタ(R
1)の値を(R1+2)とする(S808)。
The next step S806 shows an HRIT routine (host device reception IC card transmission). In this routine and step S807, 3 bytes (NAD, PCB, LEN) from the beginning of the data are received and transmitted to the IC card 200. To do. In step S807, it is determined whether the value of the communication counter (TCT) has reached 3. Until the counter reaches 3, a routine for receiving data from the host device 100 side is executed (S806). When the reception / transmission of 3-byte data is completed (Y in S807)
ES), 2 bytes are added to the reception register (R1) to indicate the length of the total number of data (S80).
8). That is, when "LEN" is received, the register (R
The value of 1) is set to (R1 + 2) (S808).

【0024】そして、ICPFが1であるか否かをここ
で判断し(S809)、そうであればレジスタR1の値
を2だけ進める(S810)。この結果、レジスタR1
の値は4だけ加算される。ICPFが0の場合(図4例
2のフォーマットに対応するICカード)はレジスタ
(R1)への加算は行わない。
Then, it is determined here whether the ICPF is 1 (S809), and if so, the value of the register R1 is advanced by 2 (S810). As a result, register R1
The value of is incremented by 4. When the ICPF is 0 (IC card corresponding to the format of Example 2 in FIG. 4), addition to the register (R1) is not performed.

【0025】そして、レジスタ(R0)にこのレジスタ
(R1)の値をセットしておく(S811)。さらに、
HRITルーチンを実行し(S812)、また、カウン
タTCTの値がこのレジスタR0の値と等しくなったか
を判定する(S813)。全バイト数をICカード20
0に対して送信するものである。「インフォメーション
部」と「EDC」を受信してから、これをICカード2
00へ送信し、通信カウンタ(TCT)がレジスタ0
(R0)の値と等しくなると(S813でYES)、イ
ンタフェースSCI2のフラグTEを0として(S81
4)、ICカード200からのデータを受信可能として
メインルーチンにリターンする。
Then, the value of the register (R1) is set in the register (R0) (S811). further,
The HRIT routine is executed (S812), and it is determined whether the value of the counter TCT is equal to the value of the register R0 (S813). IC card 20 for all bytes
It is transmitted to 0. After receiving the "Information section" and "EDC", use this for the IC card 2
00, and the communication counter (TCT) registers 0
When it becomes equal to the value of (R0) (YES in S813), the flag TE of the interface SCI2 is set to 0 (S81).
4) The data from the IC card 200 can be received, and the process returns to the main routine.

【0026】図7に示す1バイト送信ルーチンは、ま
ず、トランスミットデータレジスタエンプティ(TDR
E2)が1か否かを判断し(S701)、このフラグが
1であれば(S701でYES)、レジスタ1(R1)
のデータを送信データレジスタ(TDR2)にセットす
る(S702)。次いで、トランスミットデータレジス
タエンプティ(TDRE2)に0をセットし(S70
3)、さらに、通信カウンタ(TCT)を1だけインク
リメントする(S704)。トランスミットデータレジ
スタエンプティ(TDRE2)が0ならば(S701で
NO)、レジスタ1(R1)の値をレジスタ2(R2)
のアドレスにセットし、レジスタ2(R2)をインクリ
メント(@R2+)する(S705)。そして、ホスト
機器100からのデータ受信ルーチン(図8のS80
6)に戻る。
In the 1-byte transmission routine shown in FIG. 7, first, the transmit data register empty (TDR
It is determined whether E2) is 1 (S701), and if this flag is 1 (YES in S701), register 1 (R1)
Of the data is set in the transmission data register (TDR2) (S702). Next, 0 is set in the transmit data register empty (TDRE2) (S70
3) Further, the communication counter (TCT) is incremented by 1 (S704). If the transmit data register empty (TDRE2) is 0 (NO in S701), the value of register 1 (R1) is set to register 2 (R2).
The register 2 (R2) is incremented (@ R2 +) (S705). Then, a data reception routine from the host device 100 (S80 of FIG. 8)
Return to 6).

【0027】HRITルーチンを図9に示す。このルー
チンは、ホスト機器100からデータを受信し、このデ
ータをICカード200に送信するものである。まず、
レシーブデータレジスタフル(RDRF1)が1か否か
を判断する(S901)。受信データレジスタRDRが
フルの場合、このフラグが1になるため(S901でY
ES)、受信データレジスタ(RDR1)の値をレジス
タ1(R1)にセットする(S902)。そして、レシ
ーブデータレジスタフル(RDRF1)のフラグをクリ
アする(S903)。次に、トランスミットデータレジ
スタエンプティ(TDRE2)が1か否かを判定する
(S904)。ICカード200に対してデータ送信が
可能か否かをチェックするものである。1ならば(S9
04でYES)送信可能であり、レジスタ2(R2)の
受信ポインタの値をレジスタ3(R3)の送信ポインタ
の値と比較する(S905)。これはバッファに送信す
べきデータがあるか否かを判定するものである。
The HRIT routine is shown in FIG. This routine is for receiving data from the host device 100 and transmitting this data to the IC card 200. First,
It is determined whether the receive data register full (RDRF1) is 1 (S901). When the reception data register RDR is full, this flag becomes 1 (Y in S901).
ES) and the value of the reception data register (RDR1) are set in the register 1 (R1) (S902). Then, the receive data register full (RDRF1) flag is cleared (S903). Next, it is determined whether or not the transmit data register empty (TDRE2) is 1 (S904). It is to check whether data can be transmitted to the IC card 200. If 1 (S9
(YES in 04) Transmission is possible, and the value of the reception pointer of the register 2 (R2) is compared with the value of the transmission pointer of the register 3 (R3) (S905). This is to determine whether or not there is data to be transmitted in the buffer.

【0028】これらのポインタの示す値が異なる場合
(S905においてNO)、レジスタ1(R1)の示す
データをバッファ(@R2+)に退避し(S906)、
レジスタ3(R3)のアドレスからレジスタ1(R1)
にセットする(S907)。そして、ステップS908
に進む。
When the values indicated by these pointers are different (NO in S905), the data indicated by the register 1 (R1) is saved in the buffer (@ R2 +) (S906),
Register 1 (R1) from address of register 3 (R3)
(S907). Then, step S908
Proceed to.

【0029】受信ポインタの値と送信ポインタの値が同
じである場合(S905でYES)、すなわち、バッフ
ァに送信すべきデータがない場合、ステップS908に
進み、レジスタ3(R3)をインクリメント(@R3
+)してからレジスタ1(R1)を受信データレジスタ
(TDR2)にセットする。さらに、通信カウンタ(T
CT)をインクリメントし(S909)、トランスミッ
トデータレジスタエンプティ(TDRE2)をクリアし
て(S910)、ホスト側受信ルーチン(S807)に
戻る。1バイト送信が終了したこととなる。
When the value of the reception pointer is the same as the value of the transmission pointer (YES in S905), that is, when there is no data to be transmitted in the buffer, the process proceeds to step S908 and the register 3 (R3) is incremented (@ R3).
Then, the register 1 (R1) is set in the reception data register (TDR2). Furthermore, the communication counter (T
CT) is incremented (S909), the transmit data register empty (TDRE2) is cleared (S910), and the process returns to the host side reception routine (S807). This means that 1-byte transmission has been completed.

【0030】上記ステップS904において、トランス
ミットデータレジスタエンプティ(TDRE2)が0な
らば、送信データレジスタTDRがフルなので、ICカ
ード200に送信していない状態か、送信中の状態であ
る。この場合、レジスタ1(R1)の受信データをバッ
ファ(@R2+)にセットして(S911)、ホスト側
受信ルーチン(S807)に戻る。すなわち、レジスタ
R2のアドレスにレジスタR1のデータをため込み、受
信データのバッファリングするものである。
In step S904, if the transmit data register empty (TDRE2) is 0, it means that the transmission data register TDR is full, so that the IC card 200 is not transmitting or is transmitting. In this case, the reception data of the register 1 (R1) is set in the buffer (@ R2 +) (S911), and the process returns to the host side reception routine (S807). That is, the data of the register R1 is stored in the address of the register R2 and the received data is buffered.

【0031】また、上記ステップS901においてレシ
ーブデータレジスタフル(RDRF1)が0である場
合、トランスミットデータレジスタエンプティ(TDR
E2)が1であれば(S912でYES)、レジスタ2
(R2)の値とレジスタ3(R3)の値とを比較する
(S913)。受信ポインタの内容と送信ポインタのそ
れとを比較するものである。これらの値が異なる場合
(S913でNO)、ステップS907に進み、レジス
タ3(R3)の先頭アドレス(@R3+)からの1バイ
トのデータをレジスタ1(R1)をセットする。さら
に、レジスタ1(R1)の値を送信データレジスタ(T
DR2)にセットし(S908)、通信カウンタ(TC
T)をインクリメントし(S909)、トランスミット
データレジスタエンプティ(TDRE2)に0をセット
して(S910)ホスト側受信ルーチン(S807)に
戻る。ICカード200側に1バイト送信したものであ
る。
When the receive data register full (RDRF1) is 0 in step S901, the transmit data register empty (TDR) is set.
If E2) is 1 (YES in S912), register 2
The value of (R2) is compared with the value of register 3 (R3) (S913). The contents of the reception pointer are compared with those of the transmission pointer. If these values are different (NO in S913), the flow advances to step S907 to set 1-byte data from the start address (@ R3 +) of the register 3 (R3) in the register 1 (R1). Further, the value of the register 1 (R1) is set to the transmission data register (T
DR2) (S908), communication counter (TC
T) is incremented (S909), 0 is set in the transmit data register empty (TDRE2) (S910), and the process returns to the host side reception routine (S807). One byte is transmitted to the IC card 200 side.

【0032】図10はICカード200からのデータを
受信するルーチンを示している。この場合、まず、通信
カウンタ(TCT)をクリアし(S1001)、3バイ
ト(NAD,PCB,LEN)をIRHTルーチン(I
Cカード受信ホスト送信ルーチン)で受信し、ホスト機
器100へ送信する(S1002,S1003)。
FIG. 10 shows a routine for receiving data from the IC card 200. In this case, first, the communication counter (TCT) is cleared (S1001), and 3 bytes (NAD, PCB, LEN) are set in the IRHT routine (I
It is received by the C card reception host transmission routine) and transmitted to the host device 100 (S1002, S1003).

【0033】「LEN」を受信するとレジスタ(R1)
の値を(R1+2)とし(S1004)、ICPFが1
か否かをチェックする(S1005)。伝送フォーマッ
トによりICカード200の種類をチェックするもので
ある。ICカード200がISOタイプ(図4(A))
であれば(S1005でYES)、レジスタ(R1)の
値にさらに2を加算する(S1006)。
When "LEN" is received, the register (R1)
Is set to (R1 + 2) (S1004) and ICPF is set to 1
It is checked whether or not (S1005). The type of the IC card 200 is checked by the transmission format. IC card 200 is ISO type (Fig. 4 (A))
If so (YES in S1005), 2 is further added to the value of the register (R1) (S1006).

【0034】そして、レジスタ1(R1)のデータをレ
ジスタ(R0)にセットする(S1007)。さらに、
IRHTルーチンを実行し、「インフォメーション部」
と「EDC」とを受信してホスト機器100へ送信する
(S1008)。通信カウンタ(TCT)が(R0)に
なると送信終了であるから(S1009でYES)、メ
インルーチンに戻る。
Then, the data of the register 1 (R1) is set in the register (R0) (S1007). further,
Execute the IRHT routine and execute "Information section"
And "EDC" are received and transmitted to the host device 100 (S1008). When the communication counter (TCT) reaches (R0), the transmission is completed (YES in S1009), and the process returns to the main routine.

【0035】上記IRHTルーチンを図11に示す。フ
ラグ(RDRF2)が1になると(S1101でYE
S)、レジスタ(RDR2)のデータを送信用のレジス
タ(R1)にセットし(S1102)、このフラグ(R
DRF2)をクリアしておく(S1103)。このフラ
グ(RDRF2)はICカード200からデータを受信
しているか否かを示すものである。
The IRHT routine is shown in FIG. When the flag (RDRF2) becomes 1 (YE in S1101)
S), the data of the register (RDR2) is set in the register (R1) for transmission (S1102), and this flag (R
DRF2) is cleared (S1103). This flag (RDRF2) indicates whether or not data is received from the IC card 200.

【0036】次に、フラグ(TDRE1)が1ならば
(S1104)、ホスト機器100に対してデータの送
信が可能であるから、レジスタ(R2)の受信ポインタ
の値とレジスタ(R3)の送信ポインタの値とを比較し
(S1106)、同じであればバッファに送信データが
ない状態であるから、レジスタ(R1)のデータを送信
データレジスタTDR1にセットする(S1107)。
そして、通信カウンタTCTをインクリメントし(S1
108)、フラグTDRE1をクリアする(S110
9)。このステップS1107により1バイトデータを
ホスト機器100に送信するものである。
Next, if the flag (TDRE1) is 1 (S1104), data can be transmitted to the host device 100, so the value of the receive pointer of the register (R2) and the transmit pointer of the register (R3). Is compared (S1106), and if they are the same, there is no transmission data in the buffer, so the data in the register (R1) is set in the transmission data register TDR1 (S1107).
Then, the communication counter TCT is incremented (S1
108) and clear the flag TDRE1 (S110).
9). By this step S1107, 1-byte data is transmitted to the host device 100.

【0037】ポインタの値が異なる場合(S1106で
NO)、レジスタ(R1)の値をバッファ(@R2+)
に退避する(S1110)。そして、レジスタ(R3)
のアドレスからレジスタ(R1)にセットし、レジスタ
(R3)をインクリメント(@R3+)する(S111
1)。そして、ステップS1107に進み、レジスタ
(R1)のデータを受信データレジスタ(TDR1)に
セットし、カウンタ(TCT)をインクリメントし(S
1108)、フラグ(TDRE1)をクリアして(S1
109)からリターンする。
When the pointer value is different (NO in S1106), the value of the register (R1) is buffered (@ R2 +).
(S1110). And the register (R3)
Is set in the register (R1) from the address of and the register (R3) is incremented (@ R3 +) (S111).
1). Then, the process proceeds to step S1107, the data of the register (R1) is set in the reception data register (TDR1), and the counter (TCT) is incremented (S
1108), clear the flag (TDRE1) (S1
109) and return.

【0038】また、フラグ(TDRE1)が0ならば
(S1104でNO)、レジスタ(R1)のデータをバ
ッファ(@R2+)にバッファリングしてリターンする
(S1105)。データの送信中である場合はデータを
バッファリングするものである。
If the flag (TDRE1) is 0 (NO in S1104), the data in the register (R1) is buffered in the buffer (@ R2 +) and the process returns (S1105). When the data is being transmitted, the data is buffered.

【0039】また、上記ステップS1101において、
フラグ(RDRF2)が0になると、フラグ(TDRE
1)が1か否かをチェックする(S1112)。フラグ
(TDRE)が1になると、送信ポインタの値と受信ポ
インタの値を比較し(S1113)、これらの値が異な
る場合(S1113でNO)、バッファ(@R3+)の
先頭アドレスから1バイトをレジスタ(R1)にセット
し(S1111)、レジスタ(R1)をレジスタ(TD
R1)にセットし(S1107)、カウンタ(TCT)
をインクリメントしてから(S1108)フラグ(TD
RE1)に0をセットし(S1109)、リターンす
る。
In step S1101 described above,
When the flag (RDRF2) becomes 0, the flag (TDRE
It is checked whether 1) is 1 (S1112). When the flag (TDRE) becomes 1, the value of the transmission pointer and the value of the reception pointer are compared (S1113). If these values are different (NO in S1113), 1 byte is registered from the start address of the buffer (@ R3 +). Set to (R1) (S1111) and register (R1) to register (TD
R1) (S1107), counter (TCT)
Is incremented (S1108) and the flag (TD
0 is set in RE1) (S1109) and the process returns.

【0040】[0040]

【発明の効果】本発明に係るICカード用リーダライタ
では、ICカード側のインタフェースとホスト機器側の
それとではその伝送フォーマットが異なるICカードシ
ステムに対して、データ通信の処理速度、および、シス
テム全体の処理速度を低下させることなく、データ通信
を可能とするインタフェースを提供することができる。
例えば異なる伝送フォーマットを有する各種のICカー
ドに対して高速のデータ通信処理を行うことができる。
With the IC card reader / writer according to the present invention, the processing speed of data communication and the entire system can be improved with respect to an IC card system having a different transmission format between the interface on the IC card side and that on the host device side. It is possible to provide an interface that enables data communication without reducing the processing speed of.
For example, high-speed data communication processing can be performed on various IC cards having different transmission formats.

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

【図1】本発明に係るICカードシステムを示すブロッ
ク図である。
FIG. 1 is a block diagram showing an IC card system according to the present invention.

【図2】本発明の一実施例に係るICカードシステムを
示すブロック図である。
FIG. 2 is a block diagram showing an IC card system according to an embodiment of the present invention.

【図3】本発明の一実施例に係るICカード用のリーダ
ライタの概略構成を示すブロック図である。
FIG. 3 is a block diagram showing a schematic configuration of a reader / writer for an IC card according to an embodiment of the present invention.

【図4】本発明の一実施例に係る通信データのフォーマ
ットを示す図である。
FIG. 4 is a diagram showing a format of communication data according to an embodiment of the present invention.

【図5】本発明の一実施例に係るICカードのリセット
コマンドの処理を示すフローチャートである。
FIG. 5 is a flowchart showing processing of a reset command of an IC card according to an embodiment of the present invention.

【図6】本発明の一実施例に係るリーダライタでのメイ
ンルーチンを示すフローチャートである。
FIG. 6 is a flowchart showing a main routine in the reader / writer according to the embodiment of the present invention.

【図7】本発明の一実施例に係るリーダライタでの1バ
イト送信ルーチンを示すフローチャートである。
FIG. 7 is a flowchart showing a 1-byte transmission routine in the reader / writer according to the embodiment of the present invention.

【図8】本発明の一実施例に係るホスト機器からのデー
タ受信ルーチンを示すフローチャートである。
FIG. 8 is a flowchart showing a data reception routine from a host device according to an embodiment of the present invention.

【図9】本発明の一実施例に係るホスト機器からデータ
を受信しICカードにそのデータを送信する手順を示す
フローチャートである。
FIG. 9 is a flowchart showing a procedure of receiving data from the host device and transmitting the data to the IC card according to the embodiment of the present invention.

【図10】本発明の一実施例に係るICカードからデー
タを受信する手順を示すフローチャートである。
FIG. 10 is a flowchart showing a procedure for receiving data from the IC card according to the embodiment of the present invention.

【図11】本発明の一実施例に係るICカード受信ホス
ト機器送信ルーチンを示すフローチャートである。
FIG. 11 is a flowchart showing an IC card reception host device transmission routine according to an embodiment of the present invention.

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

100 ホスト機器 200 ICカード 300 リーダライタ 310 インタフェース装置 311 バッファ手段 312 検出手段 313 バッファ制御手段 100 Host Device 200 IC Card 300 Reader / Writer 310 Interface Device 311 Buffer Means 312 Detecting Means 313 Buffer Control Means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 ホスト機器およびICカードに接続され
るとともに、これらのそれぞれに対してデータ通信が可
能であるICカード用リーダライタにおいて、 上記ホスト機器および/またはICカードに接続される
インタフェース装置を備え、 このインタフェース装置は、 通信データを一時保持するバッファ手段と、 上記ホスト機器とICカードとの間のデータ通信に際し
て、ホスト機器との間の伝送フォーマットとICカード
との間のそれとの差異を検出する検出手段と、 上記ホスト機器との間の伝送フォーマットとICカード
との間のそれとの差異に対応したデータ量の通信データ
を上記バッファ手段により保持させるバッファ制御手段
とを有することを特徴とするICカード用リーダライ
タ。
1. A reader / writer for an IC card, which is connected to a host device and an IC card and is capable of performing data communication with each of them, and an interface device connected to the host device and / or the IC card. This interface device includes a buffer means for temporarily holding communication data, and a difference between a transmission format between the host device and the IC card and that between the IC card and the host device in data communication between the host device and the IC card. And a buffer control means for causing the buffer means to hold communication data having a data amount corresponding to the difference between the transmission format with the host device and that with the IC card. IC card reader / writer.
JP5232481A 1993-08-24 1993-08-24 Reader writer for ic card Pending JPH0765135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5232481A JPH0765135A (en) 1993-08-24 1993-08-24 Reader writer for ic card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5232481A JPH0765135A (en) 1993-08-24 1993-08-24 Reader writer for ic card

Publications (1)

Publication Number Publication Date
JPH0765135A true JPH0765135A (en) 1995-03-10

Family

ID=16939989

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5232481A Pending JPH0765135A (en) 1993-08-24 1993-08-24 Reader writer for ic card

Country Status (1)

Country Link
JP (1) JPH0765135A (en)

Similar Documents

Publication Publication Date Title
EP1411705B1 (en) Interface apparatus
US4451886A (en) Bus extender circuitry for data transmission
TW469373B (en) System and method of preforming a memory transaction on a low pin count bus
EP1046111B1 (en) Data transferring in source-synchronous and common clock protocols
US5875313A (en) PCI bus to IEEE 1394 bus translator employing write pipe-lining and sequential write combining
EP1764703A1 (en) A system for providing access to multiple data buffers of a data retaining and processing device
US4396995A (en) Adapter for interfacing between two buses
JP2587190B2 (en) Channel paging mechanism between systems
US6125405A (en) Memory card or chip card reader system
JP4001511B2 (en) IC card and control method thereof
JPH0765135A (en) Reader writer for ic card
CN112732511B (en) High-performance high-speed synchronous 422 simulator board card based on HDLC protocol
EP0261947A1 (en) Computer system
JP3293689B2 (en) Reader / writer for IC card
US5163049A (en) Method for assuring data-string-consistency independent of software
JPH01213774A (en) Portable storage medium processor
KR930000017B1 (en) Barcode communication interface system
JP3435780B2 (en) Communication method, transmitting device and receiving device
KR0176087B1 (en) Processor Data Processing Circuit of System Controller
US5764907A (en) Computer to microcomputer interface
JP3120794B2 (en) ATM device and ATM physical layer control processing method
EP0629954A1 (en) Adapter for transferring blocks of data having a variable length on a system bus
SU693364A1 (en) Device for interfacing with main
KR100812705B1 (en) Method for Linking Host Data in Programmable Logic ControllerPLC
JP2853607B2 (en) Communication system between jobs