JP4449332B2 - IC card connection device - Google Patents

IC card connection device Download PDF

Info

Publication number
JP4449332B2
JP4449332B2 JP2003124052A JP2003124052A JP4449332B2 JP 4449332 B2 JP4449332 B2 JP 4449332B2 JP 2003124052 A JP2003124052 A JP 2003124052A JP 2003124052 A JP2003124052 A JP 2003124052A JP 4449332 B2 JP4449332 B2 JP 4449332B2
Authority
JP
Japan
Prior art keywords
data
parity
transmission
card
reception
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 - Fee Related
Application number
JP2003124052A
Other languages
Japanese (ja)
Other versions
JP2004326685A (en
Inventor
幹彦 山田
宏敏 上原
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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2003124052A priority Critical patent/JP4449332B2/en
Publication of JP2004326685A publication Critical patent/JP2004326685A/en
Application granted granted Critical
Publication of JP4449332B2 publication Critical patent/JP4449332B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
ICカードから送られてくるデータを受信するICカード接続装置に関する。
【0002】
【従来の技術】
ICカード接続装置(リーダ・ライタ)の従来の一般的な構成を図13に示す。ICカードに関する規格には、IEC/ISO7816がある。図13において、100はCPUである。201は送信バッファであり、CPUから送られてくる送信データを一時的に格納する。202はパリティ生成部であり、送信データのパリティを算出し付加する。203はパラレル/シリアル変換部であり、スタートビット、送信データおよびパリティビットをシリアル送出する。204は再送信要求信号生成部であり、受信データにパリティエラーがある場合に再送信要求信号を生成し、ICカードに送出する。211は送受信切替部であり、ICカードとの通信において送信と受信を切り替える。212はシリアル/パラレル変換部であり、ICカードからシリアルに送られてくるスタートビット、データ、パリティビットを受信する。213はパリティ検査部であり、受信したデータのパリティを検査し、パリティエラーがある場合には再送信要求信号生成部204に通知する。401は受信バッファであり、受信したデータがCPUに読み込まれるまで一時的に格納する。このように構成された従来のICカード接続装置のデータ受信について説明する。
【0003】
ICカードから送られてくるデータのフォーマットを図14に示す。ICカードのデータ端子は未通信時ハイインピーダンス状態を保持し、プルアップ抵抗により信号レベルHighに固定されている。ICカードのデータ伝送は信号レベルLowのスタートビットから始まり、続いてデータ8ビット(Da、Db、Dc、Dd、De、Df、Dg、Dh)、パリティビットから構成される。パリティビットは、データ8ビットの信号レベルHighの個数を数え、その個数が偶数ならば信号レベルLowを、奇数ならば信号レベルHighとなるように設定されている。尚、このように付与されるパリティを偶パリティと呼ぶ。ICカードはパリティビット送出後、データ端子をハイインピーダンス状態に戻す。データ端子はプルアップ抵抗によって信号レベルHighに固定される。これに対して受信側のICカード接続装置は、受信したデータ8ビットから算出されるパリティビットの値と受信したパリティビットの値を比較する。パリティビットが正しい場合、受信側は次のデータの受信に備える。パリティビットが正しくない場合、パリティエラーが発生したと判断し、スタートビットの先端から(10.5±0.2)etuから最小1etu、最大2etuの間、誤り信号としてデータ端子を信号レベルLowにする。送信側はスタートビットから(11±0.2)etu後にデータ端子を検査し、次の動作を行う。
【0004】
・データ端子が信号レベルHighの場合、正常に受信されたと判断する
・データ端子が信号レベルLowの場合、つまり誤り信号を受信した場合、伝送が正しく行われなかったと判断し、データの再送を行う。
【0005】
ICカードはユーザが携帯して使用することが考えられるが、端子が露出しているため摩耗や腐食などによって端子が劣化しやすく、汚れ、水、静電気などの影響を受けやすい。したがって、ICカード接続装置にはこのような外乱要因に対してICカードとのデータの送受信を正しく確実に行うことが求められている。また、広くICカードが普及するためには、上記の機能を安価に実現するとともに、ICカード接続装置の制御を行うCPUの処理負荷を軽減する必要がある。
【0006】
従来のICカード接続装置では、受信バッファにデータを格納した後、次のデータの受信を完了するまでに受信バッファのデータをCPUが読み出さなければ、受信バッファのデータが次のデータで上書きされて正しく読み出すことができない。このように、一定の時間内にCPUが受信データの読み出しを行うことを保証する必要がある。なお、この場合にCPUが受信データを読み出す必要がある時間間隔は、受信データのボーレートに依存する。
【0007】
また、図16は、送信側の伝送レートに対して受信タイミングがずれた場合に正しくデータを受信できない例を示している。送信側はスタートビットSの「0」の後、ビット列「00001010」およびパリティビットPの「1」を送信している。これに対して、受信側は図示したサンプリングタイミングでビット列「00000101」を受信する。この図の場合、パリティビットが一致するため、パリティエラーは発生しない。従来はこのような伝送誤りを検出する機能はなく、間違ったデータを受信していた。このような伝送誤りは、キャラクタ保護期間の信号レベルを検査することによって、検出できる場合が多く、キャラクタ保護期間に信号レベルLowが検出されることをここではフレームエラーと呼ぶ。
【0008】
これに対して、例えば特許文献1におけるICカード接続装置のように、CPUによる受信データの読み出しが、次のデータの受信完了に間に合わない場合の対策が提案されてきた。これに対しては、受信データをCPUが読み取るまで一時的に蓄えておく受信バッファの容量を大きくすれば、CPUの時間応答性の制約を小さくすることができる。
【0009】
【特許文献1】
特開平9−179948号公報
【0010】
【発明が解決しようとする課題】
しかしながら上記従来の構成では、複数の受信データにパリティエラーやフレームエラーがある場合に、それをCPUに対してどのように通知するかという問題点を有していた。
【0011】
また、受信エラーによって再送信要求を繰り返す状況においては、不正な受信データが連続して受信バッファに格納され、バッファがオーバーフローする恐れがあるという問題点を有していた。
【0012】
【課題を解決するための手段】
この目的を達成するために、本発明のICカード接続装置は、複数バイト分の受信データ、および各受信データに対応したパリティ検査結果やフレーム検査結果を対にして格納する受信バッファを備え、CPUが受信バッファから一対の受信データ、パリティ検査結果、フレーム検査結果を容易に読み出すことを可能とし、受信データが正しく受信されたものかを容易に判断することができる。このように本発明のICカード接続装置はパリティエラーやフレームエラーが発生しても、確実に正しいデータを受信できることを特徴としたものである。
【0013】
本発明によれば、CPUが受信データを読み出す時間的制約を大きく緩和するとともに、ICカードとの間の確実なデータ伝送を実現することができる。
【0014】
【発明の実施の形態】
本発明の請求項1に記載の発明は、外部端子付きICカードに対する送信・受信を切り替える送受信切替部と、シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、入力データを元に算出されるパリティと受信したパリティとを比較するパリティ検査部と、パリティエラーの場合にICカードに対して再送信を要求する再送信要求信号生成部と、受信データおよびパリティ検査の結果を格納する受信バッファと、CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、パリティ検査の結果を参照して受信バッファに書き込むアドレスであるライトポインタを制御する書き込み制御部を有し、パリティエラーの場合にはライトポインタを進めないことを特徴とするICカード接続装置である。
【0015】
本発明の請求項2に記載の発明は、前記受信バッファがFIFOメモリで構成されることを特徴とするICカード接続装置である。
【0016】
本発明の請求項3に記載の発明は、外部端子付きICカードに対する送信・受信を切り替える送受信切替部と、シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、入力データを元に算出されるパリティと受信したパリティとを比較するパリティ検査部と、ICカードに対して再送信を要求する再送信要求信号生成部と、受信データおよびパリティ検査の結果を格納する受信バッファと、CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、CPUが指定した同一データに対する再送信要求回数の上限を保持するリトライ回数上限レジスタと、同一データに対するパリティエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記パリティエラーを検出した回数を比較する比較部と、ライトポインタを制御する書き込み制御部をさらに有し、同一データに対するパリティエラーが規定した回数に達しない場合は再送信を要求し、ライトポインタを進めない、一方、規定回数を超えた場合は再送信を要求せず、ライトポインタを進めることを特徴とするICカード接続装置である。
【0017】
本発明の請求項4に記載の発明は、ICカードに対する送信・受信を切り替える送受信切替部と、シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、キャラクタ保護期間に入力信号レベルを検査するフレーム検査部と、キャラクタ保護期間に入力信号がLowレベルとなるエラーであるフレームエラーである場合にICカードに対して再送信を要求する再送信要求信号生成部と、受信データおよびフレーム検査の結果を格納する受信バッファと、CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、フレーム検査の結果を参照して受信バッファのライトポインタを制御する書き込み制御部を有し、フレームエラーの場合にはライトポインタを進めないことを特徴とするICカード接続装置である。
【0018】
本発明の請求項5に記載の発明は、前記受信バッファがFIFOメモリで構成されることを特徴とするICカード接続装置である。
【0019】
本発明の請求項6に記載の発明は、ICカードに対する送信・受信を切り替える送受信切替部と、シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、キャラクタ保護期間に入力信号レベルを検査するフレーム検査部と、ICカードに対して再送信を要求する再送信要求信号生成部と、受信データおよびフレーム検査の結果を格納する受信バッファと、CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、CPUが指定した同一データに対する再送信要求回数の上限を保持するリトライ回数上限レジスタと、同一データに対するフレームエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記フレームエラーを検出した回数を比較する比較部と、ライトポインタを制御する書き込み制御部をさらに有し、同一データに対するフレームエラーが規定した回数に達しない場合は再送信を要求し、ライトポインタを進めない、一方、規定回数を超えた場合は再送信を要求せず、ライトポインタを進めることを特徴とするICカード接続装置である。
【0020】
本発明の請求項7に記載の発明は、ICカードに対する送信・受信を切り替える送受信切替部と、シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、入力データを元に算出されるパリティと受信したパリティとを比較し、またキャラクタ保護期間に入力信号レベルを検査するパリティ/フレーム検査部と、パリティエラーまたはフレームエラーの場合にICカードに対して再送信を要求する再送信要求信号生成部と、受信データおよびパリティ検査の結果およびフレーム検査の結果を格納する受信バッファと、CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、パリティ検査の結果およびフレーム検査の結果を参照して受信バッファのライトポインタを制御する書き込み制御部を有し、パリティエラーまたはフレームエラーの場合にはライトポインタを進めないことを特徴とするICカード接続装置である。
【0021】
本発明の請求項8に記載の発明は、前記受信バッファがFIFOメモリで構成されることを特徴とするICカード接続装置である。
【0022】
本発明の請求項9に記載の発明は、ICカードに対する送信・受信を切り替える送受信切替部と、シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、入力データを元に算出されるパリティと受信したパリティとを比較し、またキャラクタ保護期間に入力信号レベルを検査するパリティ/フレーム検査部と、ICカードに対して再送信を要求する再送信要求信号生成部と、受信データおよびパリティ検査の結果およびフレーム検査の結果を格納する受信バッファと、CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、CPUが指定した同一データに対する再送信要求回数の上限を保持するリトライ回数上限レジスタと、同一データに対するパリティエラーまたはフレームエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記エラーを検出した回数を比較する比較部と、ライトポインタを制御する書き込み制御部をさらに有し、同一データに対するパリティエラーまたはフレームエラーが規定した回数に達しない場合は再送信を要求し、ライトポインタを進めない、一方、規定回数を超えた場合は再送信を要求せず、ライトポインタを進めることを特徴とするICカード接続装置である。
【0029】
以下、本発明の実施の形態について、図1から図16を用いて説明する。
【0030】
(実施の形態1)
図1は、ICカードから送られてくるデータをパリティ検査の結果と一対にして受信バッファに格納するICカード接続装置を示す。図1において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に格納する送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。213は受信したパリティビットと受信データから算出されるパリティとを比較するパリティ検査部である。214は受信データとパリティ検査の結果を一対にして一時的に蓄えておく受信バッファである。500はICカードである。
【0031】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。ICカードからシリアルに送られてくるデータは、図14のようにスタートビットで始まり、データ8ビット、パリティビットで構成され、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、パリティ検査部213において、受信データ8ビットから算出されるパリティと受信したパリティが一致するかを検査する。その後、受信データおよびパリティ検査の結果は受信バッファ214に格納される。パリティが一致しない場合は、再送信要求部204に通知され、再送信要求部204はICカード500に対して再送信要求信号を送出する。
【0032】
次に、受信バッファ214の構成について、図2を用いて説明する。図2は受信データ8ビットとパリティ検査の結果1ビットを一対とした合計9ビットを1ワードとするFIFO(First In First Out)メモリで構成され、ライトポインタWPが示すアドレスに受信データおよびパリティ検査の結果が書き込まれ、リードポインタRPが示すアドレスからCPU100がデータRDを読み出す。CPU100は、読み出したデータRDのパリティ検査結果のビットによって、受信データが正しいか否かを判断することができる。
【0033】
(実施の形態2)
図3は、ICカードから送られてくるデータおよびパリティ検査の結果を一対にして格納する受信バッファと、パリティ検査の結果を参照してその受信バッファに対する書き込みを制御する書き込み制御部とを備え、受信エラーによって再送信要求を繰り返す状況において不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防ぐことを特徴とするICカード接続装置を示す。図3において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に蓄える送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。213は受信したパリティビットと受信データから算出されるパリティとを比較するパリティ検査部である。214は受信データとパリティ検査の結果を一対にして一時的に蓄えておく受信バッファである。215はパリティ検査の結果を参照して、受信バッファに対する書き込みを制御する書き込み制御部である。500はICカードである。
【0034】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。ICカードからシリアルに送られてくるデータは、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、パリティ検査部213において、受信データ8ビットから算出されるパリティと受信したパリティが一致するかを検査する。その後、受信データおよびパリティ検査の結果は受信バッファ214に格納される。パリティが一致しない場合、再送信要求部204に通知され、再送信要求部204はICカード500に対して再送信要求信号を送出し、書き込み制御部215はライトポインタWPをインクリメントしない。パリティが一致する場合、書き込み制御部215はライトポインタWPをインクリメントし、次の受信データの書き込みに備える。
【0035】
(実施の形態3)
図4は、ICカードから送られてくるデータおよびパリティ検査の結果を一対にして格納する受信バッファと、同一データの受信における再送信要求回数の上限を規定するリトライ回数上限レジスタと、同一データの受信におけるパリティエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記パリティエラーを検出した回数を比較する比較部と、前記比較結果にもとづいてライトポインタを制御する書き込み制御部とを備え、受信エラーによる再送信要求を一定回数以上繰り返さないとともに、不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防ぐことを特徴とするICカード接続装置を示す。図4において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に蓄える送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。213は受信したパリティビットと受信データから算出されるパリティとを比較するパリティ検査部である。301は同一データの受信における再送信要求回数の上限を規定するリトライ回数上限レジスタである。303は同一データの受信におけるパリティエラーを検出した回数をカウントするエラー検出カウンタである。302は前記リトライ回数上限と前記パリティエラーを検出した回数を比較する比較部である。215は前記比較結果にもとづいてライトポインタを制御する書き込み制御部である。500はICカードである。
【0036】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。CPU100は、ICカード接続装置200がデータ受信を開始する前に、同一データに対する再送信要求を行う回数の上限値をリトライ回数上限レジスタ301に設定する。エラー検出カウンタ303はカウンタ値を0にクリアされる。
【0037】
データ受信開始後、ICカードからシリアルに送られてくるデータは、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、パリティ検査部213において、受信データ8ビットから算出されるパリティと受信したパリティが一致するかを検査する。その後、受信データおよびパリティ検査の結果は受信バッファ214に格納される。パリティが一致しない場合、エラー検出カウンタ303に通知され、エラー検出カウンタ303はカウンタ値をインクリメントする。比較部302において、エラー検出カウンタの値とリトライ回数上限レジスタの値が比較され、(エラー検出カウンタの値<リトライ回数上限レジスタの値)が成り立つ場合は、再送信要求部204にパリティエラーが通知され、再送信要求部204はICカード500に対して再送信要求信号を送出する。また、書き込み制御部215はライトポインタWPをインクリメントしない。これによって、不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防止する。(エラー検出カウンタの値=リトライ回数上限レジスタの値)が成り立つ場合は、再送信要求部204にパリティエラーを通知せず、再送信要求部204はICカード500に対して再送信要求信号を送出しない。これによって、再送信要求を無限に繰り返すことを防止する。
【0038】
また、書き込み制御部215はライトポインタWPをインクリメントし、次の受信データの書き込みに備える。
【0039】
(実施の形態4)
図5は、ICカードから送られてくるデータをフレーム検査の結果と一対にして受信バッファに格納するICカード接続装置を示す。図5において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に格納する送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。216はキャラクタ保護期間におけるデータラインの信号レベルを検査するフレーム検査部である。217は受信データとフレーム検査の結果を一対にして一時的に蓄えておく受信バッファである。500はICカードである。
【0040】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。ICカードからシリアルに送られてくるデータは送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、フレーム検査部216において、キャラクタ保護期間におけるデータラインの信号レベルを検査する。その後、受信データおよびフレーム検査の結果は受信バッファ217に格納される。フレームエラーの場合は、再送信要求部204に通知され、再送信要求部204はICカード500に対して再送信要求信号を送出する。
【0041】
次に、受信バッファ217の構成について、図6を用いて説明する。図6は受信データ8ビットとフレーム検査の結果1ビットを一対とした合計9ビットを1ワードとするFIFOメモリで構成され、ライトポインタWPが示すアドレスに受信データおよびフレーム検査の結果が書き込まれ、リードポインタRPが示すアドレスからCPU100がデータRDを読み出す。CPU100は、読み出したデータRDのフレーム検査結果のビットによって、受信データが正しいか否かを判断することができる。
【0042】
(実施の形態5)
図7は、ICカードから送られてくるデータおよびフレーム検査の結果を一対にして格納する受信バッファと、フレーム検査の結果を参照してその受信バッファに対する書き込みを制御する書き込み制御部とを備え、受信エラーによって再送信要求を繰り返す状況において不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防ぐことを特徴とするICカード接続装置を示す。図7において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に蓄える送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。216はキャラクタ保護期間におけるデータラインの信号レベルを検査するフレーム検査部である。217は受信データとフレーム検査の結果を一対にして一時的に蓄えておく受信バッファである。215はフレーム検査の結果を参照して、受信バッファに対する書き込みを制御する書き込み制御部である。500はICカードである。
【0043】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。ICカードからシリアルに送られてくるデータは、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、フレーム検査部216において、キャラクタ保護期間におけるデータラインの信号レベルを検査する。その後、受信データおよびフレーム検査の結果は受信バッファ217に格納される。フレームエラーの場合、再送信要求部204に通知され、再送信要求部204はICカード500に対して再送信要求信号を送出し、書き込み制御部215はライトポインタWPをインクリメントしない。フレームエラーでない場合、書き込み制御部215はライトポインタWPをインクリメントし、次の受信データの書き込みに備える。
【0044】
(実施の形態6)
図8は、ICカードから送られてくるデータおよびフレーム検査の結果を一対にして格納する受信バッファと、同一データの受信における再送信要求回数の上限を規定するリトライ回数上限レジスタと、同一データの受信におけるフレームエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記フレームエラーを検出した回数を比較する比較部と、前記比較結果にもとづいてライトポインタを制御する書き込み制御部とを備え、受信エラーによる再送信要求を一定回数以上繰り返さないとともに、不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防ぐことを特徴とするICカード接続装置を示す。図8において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に蓄える送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。216はキャラクタ保護期間におけるデータラインの信号レベルを検査するフレーム検査部である。217は受信データとフレーム検査の結果を一対にして一時的に蓄えておく受信バッファである。301は同一データの受信における再送信要求回数の上限を規定するリトライ回数上限レジスタである。303は同一データの受信におけるフレームエラーを検出した回数をカウントするエラー検出カウンタである。302は前記リトライ回数上限と前記フレームエラーを検出した回数を比較する比較部である。215は前記比較結果にもとづいてライトポインタを制御する書き込み制御部である。500はICカードである。
【0045】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。CPU100は、ICカード接続装置200がデータ受信を開始する前に、同一データに対する再送信要求を行う回数の上限値をリトライ回数上限レジスタ301に設定する。エラー検出カウンタ303はカウンタ値を0にクリアされる。
【0046】
データ受信開始後、ICカードからシリアルに送られてくるデータは、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、フレーム検査部216において、キャラクタ保護期間におけるデータラインの信号レベルを検査する。その後、受信データおよびフレーム検査の結果は受信バッファ217に格納される。フレームエラーの場合、エラー検出カウンタ303に通知され、エラー検出カウンタ303はカウンタ値をインクリメントする。比較部302において、エラー検出カウンタの値とリトライ回数上限レジスタの値が比較され、(エラー検出カウンタの値<リトライ回数上限レジスタの値)が成り立つ場合は、再送信要求部204にフレームエラーが通知され、再送信要求部204はICカード500に対して再送信要求信号を送出する。また、書き込み制御部215はライトポインタWPをインクリメントしない。これによって、不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防止する。(エラー検出カウンタの値=リトライ回数上限レジスタの値)が成り立つ場合は、再送信要求部204にフレームエラーを通知せず、再送信要求部204はICカード500に対して再送信要求信号を送出しない。これによって、再送信要求を無限に繰り返すことを防止する。
【0047】
また、書き込み制御部215はライトポインタWPをインクリメントし、次の受信データの書き込みに備える。
【0048】
(実施の形態7)
図9は、ICカードから送られてくるデータをパリティ検査の結果およびフレーム検査の結果と一対にして受信バッファに格納するICカード接続装置を示す。図9において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に格納する送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。218は受信したパリティビットと受信データから算出されるパリティとを比較するとともに、キャラクタ保護期間におけるデータラインの信号レベルを検査するフレーム/パリティ検査部である。219は受信データとパリティ検査の結果とフレーム検査の結果を一対にして一時的に蓄えておく受信バッファである。500はICカードである。
【0049】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。ICカードからシリアルに送られてくるデータは送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、フレーム/パリティ検査部218において、受信データ8ビットから算出されるパリティと受信したパリティが一致するかを検査するとともに、キャラクタ保護期間におけるデータラインの信号レベルを検査する。その後、受信データおよびフレーム検査の結果は受信バッファ219に格納される。パリティエラーまたはフレームエラーの場合は、再送信要求部204に通知され、再送信要求部204はICカード500に対して再送信要求信号を送出する。
【0050】
次に、受信バッファ219の構成について、図10を用いて説明する。図6は受信データ8ビットとパリティ検査の結果1ビットとフレーム検査の結果1ビットを一対とした合計10ビットを1ワードとするFIFOメモリで構成され、ライトポインタWPが示すアドレスに受信データおよびパリティ検査の結果およびフレーム検査の結果が書き込まれ、リードポインタRPが示すアドレスからCPU100がデータRDを読み出す。CPU100は、読み出したデータRDのパリティ検査結果のビットおよびフレーム検査結果のビットによって、受信データが正しいか否かを判断することができる。
【0051】
(実施の形態8)
図11は、ICカードから送られてくるデータおよびパリティ検査の結果およびフレーム検査の結果を一対にして格納する受信バッファと、パリティ検査およびフレーム検査の結果を参照してその受信バッファに対する書き込みを制御する書き込み制御部とを備え、受信エラーによって再送信要求を繰り返す状況において不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防ぐことを特徴とするICカード接続装置を示す。図11において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に蓄える送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。218は受信したパリティビットと受信データから算出されるパリティとを比較するとともに、キャラクタ保護期間におけるデータラインの信号レベルを検査するフレーム/パリティ検査部である。219は受信データとパリティ検査の結果とフレーム検査の結果を一対にして一時的に蓄えておく受信バッファである。215はフレーム/パリティ検査の結果を参照して、受信バッファに対する書き込みを制御する書き込み制御部である。500はICカードである。
【0052】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。ICカードからシリアルに送られてくるデータは、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、フレーム/パリティ検査部218において、受信データ8ビットから算出されるパリティと受信したパリティが一致するかを検査するとともに、キャラクタ保護期間におけるデータラインの信号レベルを検査する。その後、受信データおよびパリティ検査の結果およびフレーム検査の結果は受信バッファ219に格納される。パリティエラーまたはフレームエラーの場合は、再送信要求部204に通知され、再送信要求部204はICカード500に対して再送信要求信号を送出し、書き込み制御部215はライトポインタWPをインクリメントしない。パリティエラーまたはフレームエラーでない場合、書き込み制御部215はライトポインタWPをインクリメントし、次の受信データの書き込みに備える。
【0053】
(実施の形態9)
図12は、ICカードから送られてくるデータおよびパリティ検査の結果およびフレーム検査の結果を一対にして格納する受信バッファと、同一データの受信における再送信要求回数の上限を規定するリトライ回数上限レジスタと、同一データの受信におけるパリティエラーまたはフレームエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記受信エラーを検出した回数を比較する比較部と、前記比較結果にもとづいてライトポインタを制御する書き込み制御部とを備え、受信エラーによる再送信要求を一定回数以上繰り返さないとともに、不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防ぐことを特徴とするICカード接続装置を示す。図12において、100はCPUである。200はICカード接続装置である。201は送信データを一時的に蓄える送信バッファである。202は送信データからパリティビットを生成するパリティ生成部である。203はスタートビット、送信データ8ビット、パリティビットをシリアルに送信するパラレル/シリアル変換部である。204はICカードに対して再送信要求信号を発行する再送信要求部である。211は、ICカードへのデータ送信とICカードからのデータ受信とを切り替える送受信切替部である。212はICカードからシリアルに送られてくるデータを受信するシリアル/パラレル変換部である。218は受信したパリティビットと受信データから算出されるパリティとを比較するとともに、キャラクタ保護期間におけるデータラインの信号レベルを検査するフレーム/パリティ検査部である。219は受信データとパリティ検査の結果とフレーム検査の結果を一対にして一時的に蓄えておく受信バッファである。301は同一データの受信における再送信要求回数の上限を規定するリトライ回数上限レジスタである。303は同一データの受信におけるパリティエラーまはたフレームエラーを検出した回数をカウントするエラー検出カウンタである。302は前記リトライ回数上限と前記受信エラーを検出した回数を比較する比較部である。215は前記比較結果にもとづいてライトポインタを制御する書き込み制御部である。500はICカードである。
【0054】
以上のように構成されたICカード接続装置について、以下にその動作を述べる。CPU100は、ICカード接続装置200がデータ受信を開始する前に、同一データに対する再送信要求を行う回数の上限値をリトライ回数上限レジスタ301に設定する。エラー検出カウンタ303はカウンタ値を0にクリアされる。
【0055】
データ受信開始後、ICカードからシリアルに送られてくるデータは、送受信切替部211を経て、シリアル/パラレル変換部212において受信される。続いて、フレーム/パリティ検査部218において、受信データ8ビットから算出されるパリティと受信したパリティが一致するかを検査するとともに、キャラクタ保護期間におけるデータラインの信号レベルを検査する。その後、受信データおよびパリティ検査の結果およびフレーム検査の結果は受信バッファ219に格納される。パリティエラーまたはフレームエラーの場合、エラー検出カウンタ303に通知され、エラー検出カウンタ303はカウンタ値をインクリメントする。比較部302において、エラー検出カウンタの値とリトライ回数上限レジスタの値が比較され、(エラー検出カウンタの値<リトライ回数上限レジスタの値)が成り立つ場合は、再送信要求部204に受信エラーが通知され、再送信要求部204はICカード500に対して再送信要求信号を送出する。また、書き込み制御部215はライトポインタWPをインクリメントしない。これによって、不正な受信データが連続して受信バッファに格納されることによるバッファのオーバーフローを防止する。(エラー検出カウンタの値=リトライ回数上限レジスタの値)が成り立つ場合は、再送信要求部204に受信エラーを通知せず、再送信要求部204はICカード500に対して再送信要求信号を送出しない。これによって、再送信要求を無限に繰り返すことを防止する。
【0056】
また、書き込み制御部215はライトポインタWPをインクリメントし、次の受信データの書き込みに備える。
【0057】
【発明の効果】
上記のように本発明によれば、従来のICカード接続装置では検出できなかったフレームエラーや受信オーバーランを検出し、パリティエラー検出時の再送信要求を行う機能を利用して再送信を要求し、同一データを再度受信することによって、ICカードから送られてくるデータを確実に受信することができる。
【図面の簡単な説明】
【図1】本発明の実施の形態1におけるICカード接続装置のシステム図
【図2】本発明の実施の形態1における受信バッファの構成図
【図3】本発明の実施の形態2におけるICカード接続装置のシステム図
【図4】本発明の実施の形態3におけるICカード接続装置のシステム図
【図5】本発明の実施の形態4におけるICカード接続装置のシステム図
【図6】本発明の実施の形態4における受信バッファの構成図
【図7】本発明の実施の形態5におけるICカード接続装置のシステム図
【図8】本発明の実施の形態6におけるICカード接続装置のシステム図
【図9】本発明の実施の形態7におけるICカード接続装置のシステム図
【図10】本発明の実施の形態7における受信バッファの構成図
【図11】本発明の実施の形態8におけるICカード接続装置のシステム図
【図12】本発明の実施の形態9におけるICカード接続装置のシステム図
【図13】従来のICカード接続装置のシステム図
【図14】従来の通常のICカードの伝送データフォーマット図
【図15】従来の受信エラー時の再送信要求信号を含むICカードの伝送データフォーマット図
【図16】従来のICカードとICカード接続装置間のデータ伝送におけるタイミング図
【符号の説明】
100 CPU
200 ICカード接続装置
201 送信バッファ
202 パリティ生成部
203 パラレル/シリアル変換部
204 再送信要求信号生成部
211 送受信切替部
212 シリアル/パラレル変換部
213 パリティ検査部
214 受信バッファ
215 書き込み制御部
216 フレーム検査部
217 受信バッファ
218 フレーム/パリティ検査部
219 受信バッファ
301 リトライ回数上限レジスタ
302 比較部
303 エラー検出カウンタ
401 受信バッファ
500 ICカード
RD1 CPU100が受信バッファ214から読み出したデータ
RD2 CPU100が受信バッファ217から読み出したデータ
RD3 CPU100が受信バッファ219から読み出したデータ
RP CPU100が受信バッファからデータを読み出すアドレス
WP 受信バッファにデータを書き込むアドレス
TD CPU100が送信バッファ201に書き込む送信データ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an IC card connection device that receives data sent from an IC card.
[0002]
[Prior art]
FIG. 13 shows a conventional general configuration of an IC card connection device (reader / writer). There is IEC / ISO7816 as a standard for IC cards. In FIG. 13, reference numeral 100 denotes a CPU. Reference numeral 201 denotes a transmission buffer that temporarily stores transmission data transmitted from the CPU. A parity generation unit 202 calculates and adds parity of transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data, and a parity bit. A retransmission request signal generator 204 generates a retransmission request signal when there is a parity error in the received data, and sends it to the IC card. A transmission / reception switching unit 211 switches between transmission and reception in communication with the IC card. A serial / parallel conversion unit 212 receives a start bit, data, and parity bit sent serially from the IC card. A parity check unit 213 checks the parity of the received data, and notifies the retransmission request signal generation unit 204 if there is a parity error. A reception buffer 401 temporarily stores received data until it is read by the CPU. The data reception of the conventional IC card connecting apparatus configured as described above will be described.
[0003]
The format of data sent from the IC card is shown in FIG. The data terminal of the IC card maintains a high impedance state when not communicating, and is fixed to the signal level High by a pull-up resistor. Data transmission of the IC card starts with a start bit having a signal level of Low, followed by 8 bits of data (Da, Db, Dc, Dd, De, Df, Dg, Dh) and a parity bit. The parity bit is set so that the number of signal levels High of 8-bit data is counted. If the number is even, the signal level is Low, and if it is odd, the signal level is High. The parity given in this way is called even parity. After sending the parity bit, the IC card returns the data terminal to the high impedance state. The data terminal is fixed to the signal level High by a pull-up resistor. On the other hand, the IC card connection device on the receiving side compares the value of the parity bit calculated from the received 8 bits of data with the value of the received parity bit. If the parity bit is correct, the receiving side prepares for reception of the next data. If the parity bit is not correct, it is determined that a parity error has occurred, and the data terminal is set to the signal level Low as an error signal from (10.5 ± 0.2) etu to the minimum 1 etu and the maximum 2 etu from the leading end of the start bit. To do. The transmission side checks the data terminal after (11 ± 0.2) etu from the start bit, and performs the following operation.
[0004]
-If the data terminal is at the signal level High, it is determined that the data has been received normally.
When the data terminal is at the signal level low, that is, when an error signal is received, it is determined that transmission has not been performed correctly, and data is retransmitted.
[0005]
Although it is conceivable that the user carries the IC card with the user, the terminal is easily exposed to deterioration due to wear or corrosion because the terminal is exposed, and is easily affected by dirt, water, static electricity, and the like. Therefore, the IC card connection device is required to correctly and reliably transmit and receive data to and from the IC card against such disturbance factors. In order for IC cards to become widespread, it is necessary to realize the above functions at low cost and to reduce the processing load on the CPU that controls the IC card connection device.
[0006]
In the conventional IC card connection device, after the data is stored in the reception buffer, if the CPU does not read the data in the reception buffer until the reception of the next data is completed, the data in the reception buffer is overwritten with the next data. It cannot be read correctly. Thus, it is necessary to ensure that the CPU reads the received data within a certain time. In this case, the time interval at which the CPU needs to read the received data depends on the baud rate of the received data.
[0007]
FIG. 16 shows an example in which data cannot be received correctly when the reception timing is shifted with respect to the transmission rate on the transmission side. The transmission side transmits a bit string “00001010” and a parity bit P “1” after the start bit S “0”. On the other hand, the receiving side receives the bit string “00000101” at the illustrated sampling timing. In the case of this figure, since the parity bits match, no parity error occurs. Conventionally, there is no function for detecting such a transmission error, and wrong data is received. Such a transmission error can often be detected by examining the signal level in the character protection period. The detection of the signal level Low in the character protection period is referred to as a frame error here.
[0008]
On the other hand, for example, as in the IC card connection device in Patent Document 1, a countermeasure has been proposed in the case where reading of received data by the CPU is not in time for completion of reception of the next data. On the other hand, if the capacity of the reception buffer that temporarily stores the received data until the CPU reads it is increased, it is possible to reduce the restriction on the time response of the CPU.
[0009]
[Patent Document 1]
JP-A-9-179948
[0010]
[Problems to be solved by the invention]
However, the conventional configuration has a problem of how to notify the CPU when there is a parity error or a frame error in a plurality of received data.
[0011]
Further, in the situation where the retransmission request is repeated due to a reception error, there is a problem that illegal reception data is continuously stored in the reception buffer and the buffer may overflow.
[0012]
[Means for Solving the Problems]
In order to achieve this object, an IC card connection device of the present invention comprises a reception buffer for storing a plurality of bytes of received data and a parity check result and a frame check result corresponding to each received data, and a CPU. Makes it possible to easily read a pair of received data, a parity check result, and a frame check result from the receive buffer, and to easily determine whether the received data has been correctly received. As described above, the IC card connection device of the present invention is characterized in that correct data can be reliably received even if a parity error or a frame error occurs.
[0013]
According to the present invention, it is possible to greatly relieve the time restriction for the CPU to read the received data, and to realize reliable data transmission with the IC card.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
  The invention described in claim 1 of the present inventionA transmission / reception switching unit that switches transmission / reception with respect to an IC card with an external terminal, a parallel / serial conversion unit that converts serially input data into 1-byte parallel data, and a parity that is calculated based on the input data A parity check unit that compares the received parity with the received parity, a retransmission request signal generation unit that requests retransmission to the IC card in the case of a parity error, a reception buffer that stores reception data and a result of the parity check, A transmission buffer that stores transmission data input from the CPU, a parity generation unit that calculates parity under the transmission data, a serial / parallel converter that converts parallel input data into serial data, and outputs Refers to the result of the parity check and controls the write pointer that is the address to be written to the receive buffer. It has a write control unit that, when the parity error is an IC card connecting device, characterized in that not proceed with the write pointer.
[0015]
  The invention according to claim 2 of the present invention isAn IC card connection device, wherein the reception buffer is composed of a FIFO memory.
[0016]
  The invention according to claim 3 of the present invention isA transmission / reception switching unit that switches transmission / reception with respect to an IC card with an external terminal, a parallel / serial conversion unit that converts serially input data into 1-byte parallel data, and a parity that is calculated based on the input data A parity check unit that compares the received data and the received parity, a retransmission request signal generation unit that requests retransmission to the IC card, a reception buffer that stores received data and a result of the parity check, and a CPU A transmission buffer that stores transmission data, a parity generation unit that calculates parity under the transmission data, a serial / parallel converter that converts parallel input data into serial data, and outputs the same data, as specified by the CPU The same data as the retry count upper limit register that holds the upper limit of the number of retransmission requests for data An error detection counter that counts the number of detected parity errors, a comparison unit that compares the retry count upper limit with the number of detected parity errors, and a write control unit that controls a write pointer, If the parity error does not reach the specified number of times, a re-transmission is requested and the write pointer is not advanced. On the other hand, if the specified number of times is exceeded, the re-transmission is not requested and the write pointer is advanced. It is a connection device.
[0017]
  The invention according to claim 4 of the present invention isA transmission / reception switching unit that switches between transmission and reception for an IC card, a parallel / serial conversion unit that converts serially input data into 1-byte parallel data, and a frame inspection that inspects the input signal level during the character protection period , A retransmission request signal generation unit for requesting retransmission to the IC card when the input signal becomes a low level error during the character protection period, and the received data and the result of the frame inspection are stored Receiving buffer, a transmission buffer for storing transmission data input from the CPU, a parity generation unit for calculating parity under the transmission data, and a serial / data for converting parallel input data to serial data and outputting it Refer to the result of the frame check and the parallel converter and the write buffer write port It has a write control unit for controlling the printer, when the frame error is an IC card connecting device, characterized in that not proceed with the write pointer.
[0018]
  The invention according to claim 5 of the present invention isAn IC card connection device, wherein the reception buffer is composed of a FIFO memory.
[0019]
  The invention according to claim 6 of the present invention providesA transmission / reception switching unit that switches between transmission and reception for an IC card, a parallel / serial conversion unit that converts serially input data into 1-byte parallel data, and a frame inspection that inspects the input signal level during the character protection period Unit, a retransmission request signal generation unit that requests retransmission to the IC card, a reception buffer that stores reception data and a result of frame inspection, a transmission buffer that stores transmission data input from the CPU, and a transmission Holds the parity generator that calculates the parity under the data, the serial / parallel converter that converts the parallel input data into serial data, and the upper limit of the number of retransmission requests for the same data specified by the CPU Retry count upper limit register and the number of times a frame error is detected for the same data An error detection counter that counts the upper limit of the number of retries and a comparison unit that compares the number of times the frame error has been detected, and a write control unit that controls the write pointer. If it does not reach, the IC card connecting device is characterized by requesting re-transmission and not proceeding with the write pointer, whereas when exceeding the prescribed number of times, it does not request re-transmission and advances the write pointer.
[0020]
  The invention according to claim 7 of the present invention providesA transmission / reception switching unit that switches transmission / reception to / from an IC card, a parallel / serial conversion unit that converts serially input data into 1-byte parallel data, and outputs a parity calculated based on the input data A parity / frame checker that compares the parity and checks the input signal level during the character protection period; a retransmission request signal generator that requests retransmission to the IC card in the case of a parity error or a frame error; A reception buffer for storing reception data, a result of parity check and a result of frame check, a transmission buffer for storing transmission data input from the CPU, a parity generation unit for calculating parity under the transmission data, and input in parallel Serial / parallel conversion that converts the output data into serial data and outputs it And a write control unit that controls the write pointer of the reception buffer with reference to the result of the parity check and the result of the frame check, and the write pointer cannot be advanced in the case of a parity error or a frame error. IC card connection device.
[0021]
  The invention according to claim 8 of the present invention providesAn IC card connection device, wherein the reception buffer is composed of a FIFO memory.
[0022]
  The invention according to claim 9 of the present invention providesA transmission / reception switching unit that switches transmission / reception to / from an IC card, a parallel / serial conversion unit that converts serially input data into 1-byte parallel data, and outputs a parity calculated based on the input data A parity / frame checking unit that compares the parity and checks the input signal level during the character protection period, a retransmission request signal generating unit that requests retransmission to the IC card, and a result of the received data and the parity check and A reception buffer for storing the result of frame inspection, a transmission buffer for storing transmission data input from the CPU, a parity generation unit for calculating parity under the transmission data, and converting data input in parallel to serial data Output to the same data specified by the CPU. A retry count upper limit register that holds the upper limit of the number of transmission requests, an error detection counter that counts the number of times that a parity error or a frame error has been detected for the same data, and a comparison unit that compares the retry count upper limit with the number of times the error has been detected And a write control unit for controlling the write pointer. If the specified number of parity errors or frame errors for the same data does not reach the specified number of times, a retransmission is requested and the write pointer is not advanced. In this case, the IC card connecting device is characterized in that it does not request retransmission and advances the write pointer.
[0029]
Hereinafter, embodiments of the present invention will be described with reference to FIGS.
[0030]
(Embodiment 1)
FIG. 1 shows an IC card connection apparatus that stores data sent from an IC card in a reception buffer as a pair with a parity check result. In FIG. 1, 100 is a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A parity check unit 213 compares the received parity bit with the parity calculated from the received data. A reception buffer 214 temporarily stores received data and parity check results as a pair. Reference numeral 500 denotes an IC card.
[0031]
The operation of the IC card connecting apparatus configured as described above will be described below. Data sent serially from the IC card starts with a start bit as shown in FIG. 14, is composed of 8 bits of data and a parity bit, and is received by the serial / parallel converter 212 via the transmission / reception switching unit 211. Subsequently, the parity check unit 213 checks whether the parity calculated from the 8-bit received data matches the received parity. Thereafter, the reception data and the result of the parity check are stored in the reception buffer 214. If the parity does not match, the retransmission request unit 204 is notified, and the retransmission request unit 204 sends a retransmission request signal to the IC card 500.
[0032]
Next, the configuration of the reception buffer 214 will be described with reference to FIG. FIG. 2 is composed of a FIFO (First In First Out) memory in which 8 bits of received data and 1 bit of the parity check result are paired, and a total of 9 bits is 1 word, and the received data and parity check are performed at the address indicated by the write pointer WP. The CPU 100 reads the data RD from the address indicated by the read pointer RP. The CPU 100 can determine whether or not the received data is correct based on the parity check result bit of the read data RD.
[0033]
(Embodiment 2)
FIG. 3 includes a reception buffer that stores a pair of data sent from the IC card and the result of the parity check, and a write control unit that controls writing to the reception buffer with reference to the result of the parity check. An IC card connection device is provided that prevents buffer overflow due to illegal reception data being continuously stored in a reception buffer in a situation where a retransmission request is repeated due to a reception error. In FIG. 3, reference numeral 100 denotes a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A parity check unit 213 compares the received parity bit with the parity calculated from the received data. A reception buffer 214 temporarily stores received data and parity check results as a pair. A write control unit 215 controls writing to the reception buffer with reference to the result of the parity check. Reference numeral 500 denotes an IC card.
[0034]
The operation of the IC card connecting apparatus configured as described above will be described below. Data sent serially from the IC card is received by the serial / parallel conversion unit 212 via the transmission / reception switching unit 211. Subsequently, the parity check unit 213 checks whether the parity calculated from the 8-bit received data matches the received parity. Thereafter, the reception data and the result of the parity check are stored in the reception buffer 214. If the parity does not match, the retransmission request unit 204 is notified, the retransmission request unit 204 sends a retransmission request signal to the IC card 500, and the write control unit 215 does not increment the write pointer WP. If the parities match, the write control unit 215 increments the write pointer WP to prepare for the writing of the next received data.
[0035]
(Embodiment 3)
FIG. 4 shows a reception buffer that stores a pair of data sent from an IC card and a parity check result, a retry count upper limit register that defines the upper limit of the number of retransmission requests in reception of the same data, and the same data An error detection counter that counts the number of times a parity error is detected in reception, a comparison unit that compares the upper limit of the number of retries and the number of times the parity error is detected, and a write control unit that controls a write pointer based on the comparison result; The IC card connecting device is characterized in that the retransmission request due to a reception error is not repeated more than a certain number of times, and the overflow of illegal reception data is continuously stored in the reception buffer to prevent buffer overflow. In FIG. 4, 100 is a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A parity check unit 213 compares the received parity bit with the parity calculated from the received data. Reference numeral 301 denotes a retry count upper limit register that defines the upper limit of the number of retransmission requests in reception of the same data. Reference numeral 303 denotes an error detection counter that counts the number of times a parity error is detected in reception of the same data. A comparison unit 302 compares the upper limit of the number of retries with the number of times the parity error is detected. A write control unit 215 controls the write pointer based on the comparison result. Reference numeral 500 denotes an IC card.
[0036]
The operation of the IC card connecting apparatus configured as described above will be described below. The CPU 100 sets an upper limit value of the number of times of performing a retransmission request for the same data in the retry number upper limit register 301 before the IC card connection device 200 starts data reception. The error detection counter 303 is cleared to zero.
[0037]
After the start of data reception, data sent serially from the IC card is received by the serial / parallel conversion unit 212 via the transmission / reception switching unit 211. Subsequently, the parity check unit 213 checks whether the parity calculated from the 8-bit received data matches the received parity. Thereafter, the reception data and the result of the parity check are stored in the reception buffer 214. If the parity does not match, the error detection counter 303 is notified, and the error detection counter 303 increments the counter value. The comparison unit 302 compares the value of the error detection counter with the value of the retry count upper limit register. If (error detection counter value <retry count upper limit register value) holds, a parity error is notified to the retransmission request unit 204. Then, the retransmission request unit 204 sends a retransmission request signal to the IC card 500. Further, the write control unit 215 does not increment the write pointer WP. This prevents buffer overflow due to illegal received data being continuously stored in the reception buffer. If (the value of the error detection counter = the value of the retry count upper limit register) holds, the retransmission request unit 204 does not notify the parity error, and the retransmission request unit 204 sends a retransmission request signal to the IC card 500. do not do. This prevents the retransmission request from being repeated indefinitely.
[0038]
In addition, the write control unit 215 increments the write pointer WP to prepare for the writing of the next received data.
[0039]
(Embodiment 4)
FIG. 5 shows an IC card connection apparatus that stores data sent from an IC card in a reception buffer as a pair with a frame inspection result. In FIG. 5, reference numeral 100 denotes a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A frame inspection unit 216 inspects the signal level of the data line during the character protection period. A reception buffer 217 temporarily stores a pair of reception data and frame inspection results. Reference numeral 500 denotes an IC card.
[0040]
The operation of the IC card connecting apparatus configured as described above will be described below. Data sent serially from the IC card is received by the serial / parallel converter 212 via the transmission / reception switching unit 211. Subsequently, the frame inspection unit 216 inspects the signal level of the data line during the character protection period. Thereafter, the reception data and the result of the frame inspection are stored in the reception buffer 217. In the case of a frame error, the retransmission request unit 204 is notified, and the retransmission request unit 204 sends a retransmission request signal to the IC card 500.
[0041]
Next, the configuration of the reception buffer 217 will be described with reference to FIG. FIG. 6 is composed of a FIFO memory in which 8 bits of received data and 1 bit of the result of frame inspection are paired and 1 word is a total of 9 bits, and the received data and the result of frame inspection are written to the address indicated by the write pointer WP. The CPU 100 reads the data RD from the address indicated by the read pointer RP. The CPU 100 can determine whether the received data is correct based on the bit of the frame inspection result of the read data RD.
[0042]
(Embodiment 5)
FIG. 7 includes a reception buffer that stores a pair of data sent from the IC card and a result of frame inspection, and a write control unit that controls writing to the reception buffer with reference to the result of frame inspection. An IC card connection device is provided that prevents buffer overflow due to illegal reception data being continuously stored in a reception buffer in a situation where a retransmission request is repeated due to a reception error. In FIG. 7, reference numeral 100 denotes a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A frame inspection unit 216 inspects the signal level of the data line during the character protection period. A reception buffer 217 temporarily stores a pair of reception data and frame inspection results. A write control unit 215 controls writing to the reception buffer with reference to the result of the frame check. Reference numeral 500 denotes an IC card.
[0043]
The operation of the IC card connecting apparatus configured as described above will be described below. Data sent serially from the IC card is received by the serial / parallel conversion unit 212 via the transmission / reception switching unit 211. Subsequently, the frame inspection unit 216 inspects the signal level of the data line during the character protection period. Thereafter, the reception data and the result of the frame inspection are stored in the reception buffer 217. In the case of a frame error, the retransmission request unit 204 is notified, the retransmission request unit 204 sends a retransmission request signal to the IC card 500, and the write control unit 215 does not increment the write pointer WP. If it is not a frame error, the write control unit 215 increments the write pointer WP to prepare for the writing of the next received data.
[0044]
(Embodiment 6)
FIG. 8 shows a reception buffer that stores a pair of data sent from an IC card and a result of frame inspection, a retry count upper limit register that defines an upper limit of the number of retransmission requests in reception of the same data, An error detection counter that counts the number of times a frame error is detected in reception, a comparison unit that compares the upper limit of the number of retries and the number of times the frame error is detected, and a write control unit that controls a write pointer based on the comparison result; The IC card connecting device is characterized in that the retransmission request due to a reception error is not repeated more than a certain number of times, and the overflow of illegal reception data is continuously stored in the reception buffer to prevent buffer overflow. In FIG. 8, reference numeral 100 denotes a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A frame inspection unit 216 inspects the signal level of the data line during the character protection period. A reception buffer 217 temporarily stores a pair of reception data and frame inspection results. Reference numeral 301 denotes a retry count upper limit register that defines the upper limit of the number of retransmission requests in reception of the same data. Reference numeral 303 denotes an error detection counter that counts the number of times a frame error is detected in reception of the same data. A comparison unit 302 compares the upper limit of the number of retries with the number of detections of the frame error. A write control unit 215 controls the write pointer based on the comparison result. Reference numeral 500 denotes an IC card.
[0045]
The operation of the IC card connecting apparatus configured as described above will be described below. The CPU 100 sets an upper limit value of the number of times of performing a retransmission request for the same data in the retry number upper limit register 301 before the IC card connection device 200 starts data reception. The error detection counter 303 is cleared to zero.
[0046]
After the start of data reception, data sent serially from the IC card is received by the serial / parallel conversion unit 212 via the transmission / reception switching unit 211. Subsequently, the frame inspection unit 216 inspects the signal level of the data line during the character protection period. Thereafter, the reception data and the result of the frame inspection are stored in the reception buffer 217. In the case of a frame error, the error detection counter 303 is notified, and the error detection counter 303 increments the counter value. The comparison unit 302 compares the value of the error detection counter with the value of the retry count upper limit register, and if (error detection counter value <retry count upper limit register value) holds, a frame error is notified to the retransmission request unit 204. Then, the retransmission request unit 204 sends a retransmission request signal to the IC card 500. Further, the write control unit 215 does not increment the write pointer WP. This prevents buffer overflow due to illegal received data being continuously stored in the reception buffer. If (the value of the error detection counter = the value of the retry count upper limit register) holds, the retransmission request unit 204 does not notify the frame error to the retransmission request unit 204, and the retransmission request unit 204 sends a retransmission request signal to the IC card 500. do not do. This prevents the retransmission request from being repeated indefinitely.
[0047]
In addition, the write control unit 215 increments the write pointer WP to prepare for the writing of the next received data.
[0048]
(Embodiment 7)
FIG. 9 shows an IC card connection apparatus that stores data sent from an IC card in a reception buffer as a pair with a parity check result and a frame check result. In FIG. 9, reference numeral 100 denotes a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A frame / parity check unit 218 compares the received parity bit with the parity calculated from the received data and checks the signal level of the data line in the character protection period. A reception buffer 219 temporarily stores received data, a parity check result, and a frame check result as a pair. Reference numeral 500 denotes an IC card.
[0049]
The operation of the IC card connecting apparatus configured as described above will be described below. Data sent serially from the IC card is received by the serial / parallel converter 212 via the transmission / reception switching unit 211. Subsequently, the frame / parity check unit 218 checks whether the parity calculated from the 8-bit received data matches the received parity, and checks the signal level of the data line in the character protection period. Thereafter, the reception data and the result of the frame inspection are stored in the reception buffer 219. In the case of a parity error or a frame error, the retransmission request unit 204 is notified, and the retransmission request unit 204 sends a retransmission request signal to the IC card 500.
[0050]
Next, the configuration of the reception buffer 219 will be described with reference to FIG. FIG. 6 is a FIFO memory in which 8 bits of received data, 1 bit of the parity check result and 1 bit of the frame check are paired, and a total of 10 bits are one word, and the received data and parity are indicated at the address indicated by the write pointer WP. The inspection result and the frame inspection result are written, and the CPU 100 reads the data RD from the address indicated by the read pointer RP. The CPU 100 can determine whether the received data is correct based on the parity check result bit and the frame check result bit of the read data RD.
[0051]
(Embodiment 8)
FIG. 11 shows a reception buffer that stores a pair of data sent from an IC card, a parity check result, and a frame check result, and controls writing to the receive buffer with reference to the parity check and frame check results An IC card connection device comprising: a write control unit configured to prevent buffer overflow caused by illegally received data being continuously stored in a reception buffer in a situation where a retransmission request is repeated due to a reception error . In FIG. 11, 100 is a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A frame / parity check unit 218 compares the received parity bit with the parity calculated from the received data and checks the signal level of the data line in the character protection period. A reception buffer 219 temporarily stores received data, a parity check result, and a frame check result as a pair. A write control unit 215 controls writing to the reception buffer with reference to the result of the frame / parity check. Reference numeral 500 denotes an IC card.
[0052]
The operation of the IC card connecting apparatus configured as described above will be described below. Data sent serially from the IC card is received by the serial / parallel conversion unit 212 via the transmission / reception switching unit 211. Subsequently, the frame / parity check unit 218 checks whether the parity calculated from the 8-bit received data matches the received parity, and checks the signal level of the data line in the character protection period. Thereafter, the reception data, the parity check result, and the frame check result are stored in the reception buffer 219. In the case of a parity error or a frame error, the retransmission request unit 204 is notified, the retransmission request unit 204 sends a retransmission request signal to the IC card 500, and the write control unit 215 does not increment the write pointer WP. If it is not a parity error or a frame error, the write control unit 215 increments the write pointer WP to prepare for the writing of the next received data.
[0053]
(Embodiment 9)
FIG. 12 shows a reception buffer that stores data sent from an IC card, a parity check result, and a frame check result as a pair, and a retry count upper limit register that defines the upper limit of the number of retransmission requests in receiving the same data. An error detection counter that counts the number of times that a parity error or frame error has been detected in reception of the same data, a comparison unit that compares the upper limit of the number of retries and the number of times the reception error is detected, and a write based on the comparison result A write control unit that controls the pointer, and it does not repeat a retransmission request due to a reception error more than a certain number of times, and prevents overflow of the buffer due to illegal reception data being continuously stored in the reception buffer. 1 shows an IC card connecting device. In FIG. 12, reference numeral 100 denotes a CPU. Reference numeral 200 denotes an IC card connection device. A transmission buffer 201 temporarily stores transmission data. A parity generation unit 202 generates a parity bit from transmission data. A parallel / serial conversion unit 203 serially transmits a start bit, transmission data 8 bits, and a parity bit. A re-transmission request unit 204 issues a re-transmission request signal to the IC card. A transmission / reception switching unit 211 switches data transmission to the IC card and data reception from the IC card. A serial / parallel converter 212 receives data sent serially from the IC card. A frame / parity check unit 218 compares the received parity bit with the parity calculated from the received data and checks the signal level of the data line in the character protection period. A reception buffer 219 temporarily stores received data, a parity check result, and a frame check result as a pair. Reference numeral 301 denotes a retry count upper limit register that defines the upper limit of the number of retransmission requests in reception of the same data. Reference numeral 303 denotes an error detection counter that counts the number of times a parity error or a frame error is detected in reception of the same data. Reference numeral 302 denotes a comparison unit that compares the upper limit of the number of retries with the number of times the reception error is detected. A write control unit 215 controls the write pointer based on the comparison result. Reference numeral 500 denotes an IC card.
[0054]
The operation of the IC card connecting apparatus configured as described above will be described below. The CPU 100 sets an upper limit value of the number of times of performing a retransmission request for the same data in the retry number upper limit register 301 before the IC card connection device 200 starts data reception. The error detection counter 303 is cleared to zero.
[0055]
After the start of data reception, data sent serially from the IC card is received by the serial / parallel conversion unit 212 via the transmission / reception switching unit 211. Subsequently, the frame / parity check unit 218 checks whether the parity calculated from the 8-bit received data matches the received parity, and checks the signal level of the data line in the character protection period. Thereafter, the reception data, the parity check result, and the frame check result are stored in the reception buffer 219. In the case of a parity error or a frame error, the error detection counter 303 is notified, and the error detection counter 303 increments the counter value. The comparison unit 302 compares the value of the error detection counter with the value of the retry count upper limit register, and if (error detection counter value <retry count upper limit register value) holds, the retransmission request unit 204 is notified of a reception error. Then, the retransmission request unit 204 sends a retransmission request signal to the IC card 500. Further, the write control unit 215 does not increment the write pointer WP. This prevents buffer overflow due to illegal received data being continuously stored in the reception buffer. If (the value of the error detection counter = the value of the retry count upper limit register) holds, the retransmission request unit 204 does not notify the reception error, and the retransmission request unit 204 sends a retransmission request signal to the IC card 500. do not do. This prevents the retransmission request from being repeated indefinitely.
[0056]
In addition, the write control unit 215 increments the write pointer WP to prepare for the writing of the next received data.
[0057]
【The invention's effect】
As described above, according to the present invention, a frame error and a reception overrun that cannot be detected by a conventional IC card connecting apparatus are detected, and a retransmission is requested using a function for performing a retransmission request when a parity error is detected. By receiving the same data again, the data sent from the IC card can be reliably received.
[Brief description of the drawings]
FIG. 1 is a system diagram of an IC card connection device according to a first embodiment of the present invention.
FIG. 2 is a configuration diagram of a reception buffer according to the first embodiment of the present invention.
FIG. 3 is a system diagram of an IC card connection device according to a second embodiment of the present invention.
FIG. 4 is a system diagram of an IC card connection device according to a third embodiment of the present invention.
FIG. 5 is a system diagram of an IC card connection device according to a fourth embodiment of the present invention.
FIG. 6 is a configuration diagram of a reception buffer according to the fourth embodiment of the present invention.
FIG. 7 is a system diagram of an IC card connection device according to a fifth embodiment of the present invention.
FIG. 8 is a system diagram of an IC card connection device according to a sixth embodiment of the present invention.
FIG. 9 is a system diagram of an IC card connection device according to a seventh embodiment of the present invention.
FIG. 10 is a configuration diagram of a reception buffer in Embodiment 7 of the present invention.
FIG. 11 is a system diagram of an IC card connection device according to an eighth embodiment of the present invention.
FIG. 12 is a system diagram of an IC card connection device according to a ninth embodiment of the present invention.
FIG. 13 is a system diagram of a conventional IC card connection device.
FIG. 14 is a transmission data format diagram of a conventional normal IC card.
15 is a transmission data format diagram of an IC card including a retransmission request signal at the time of a conventional reception error.
FIG. 16 is a timing chart in data transmission between a conventional IC card and an IC card connecting device.
[Explanation of symbols]
100 CPU
200 IC card connection device
201 Send buffer
202 Parity generator
203 Parallel / serial converter
204 Retransmission request signal generator
211 Transmission / reception switching unit
212 Serial / parallel converter
213 Parity check unit
214 Receive buffer
215 Write controller
216 Frame inspection part
217 Receive buffer
218 frame / parity check section
219 Receive buffer
301 Retry count upper limit register
302 comparison unit
303 Error detection counter
401 Receive buffer
500 IC card
RD1 Data read from the reception buffer 214 by the CPU 100
RD2 Data read from the reception buffer 217 by the CPU 100
RD3 Data read from the reception buffer 219 by the CPU 100
Address from which the RP CPU 100 reads data from the reception buffer
Address to write data to WP receive buffer
Transmission data to be written to the transmission buffer 201 by the TD CPU 100

Claims (9)

外部端子付きICカードに対する送信・受信を切り替える送受信切替部と、
シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、
入力データを元に算出されるパリティと受信したパリティとを比較するパリティ検査部と、
パリティエラーの場合にICカードに対して再送信を要求する再送信要求信号生成部と、
受信データおよびパリティ検査の結果を格納する受信バッファと、
CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、
パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、
パリティ検査の結果を参照して受信バッファに書き込むアドレスであるライトポインタを制御する書き込み制御部を有し、パリティエラーの場合にはライトポインタを進めないことを特徴とするICカード接続装置。
A transmission / reception switching unit for switching transmission / reception to / from an IC card with an external terminal;
A parallel / serial converter for converting serially input data into 1-byte parallel data and outputting the data;
A parity check unit that compares the parity calculated based on the input data with the received parity;
A retransmission request signal generator for requesting retransmission to the IC card in the case of a parity error;
A receive buffer for storing received data and parity check results;
A transmission buffer for storing transmission data input from the CPU, a parity generation unit for calculating parity under the transmission data,
A serial / parallel converter that converts the data input in parallel into serial data and outputs it;
An IC card connection device comprising: a write control unit that controls a write pointer that is an address to be written to a reception buffer with reference to a result of a parity check, and the write pointer cannot be advanced in the case of a parity error.
前記受信バッファがFIFOメモリで構成されることを特徴とする請求項1に記載のICカード接続装置。2. The IC card connection device according to claim 1, wherein the reception buffer is configured by a FIFO memory. 外部端子付きICカードに対する送信・受信を切り替える送受信切替部と、A transmission / reception switching unit for switching transmission / reception to / from an IC card with an external terminal;
シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、A parallel / serial converter for converting serially input data into 1-byte parallel data and outputting the data;
入力データを元に算出されるパリティと受信したパリティとを比較するパリティ検査部と、A parity check unit that compares the parity calculated based on the input data with the received parity;
ICカードに対して再送信を要求する再送信要求信号生成部と、A retransmission request signal generator for requesting retransmission to the IC card;
受信データおよびパリティ検査の結果を格納する受信バッファと、A receive buffer for storing received data and parity check results;
CPUから入力される送信データを格納する送信バッファと、送信データを下にパリティを算出するパリティ生成部と、A transmission buffer for storing transmission data input from the CPU, a parity generation unit for calculating parity under the transmission data,
パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、A serial / parallel converter that converts the data input in parallel into serial data and outputs it;
CPUが指定した同一データに対する再送信要求回数の上限を保持するリトライ回数上限レジスタと、A retry count upper limit register that holds an upper limit of the number of retransmission requests for the same data designated by the CPU;
同一データに対するパリティエラーを検出した回数をカウントするエラー検出カウンタと、前記リトライ回数上限と前記パリティエラーを検出した回数を比較する比較部と、An error detection counter that counts the number of times that a parity error has been detected for the same data, a comparison unit that compares the upper limit of the number of retries and the number of times the parity error is detected,
ライトポインタを制御する書き込み制御部をさらに有し、同一データに対するパリティエラーが規定した回数に達しない場合は再送信を要求し、ライトポインタを進めない、一方、規定回数を超えた場合は再送信を要求せず、ライトポインタを進めることを特徴とするICカード接続装置。A write control unit that controls the write pointer is further provided. If the parity error for the same data does not reach the specified number of times, a re-transmission is requested and the write pointer cannot be advanced. The IC card connection device is characterized by advancing the write pointer without requesting
ICカードに対する送信・受信を切り替える送受信切替部と、A transmission / reception switching unit that switches between transmission and reception for an IC card;
シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、A parallel / serial converter for converting serially input data into 1-byte parallel data and outputting the data;
キャラクタ保護期間に入力信号レベルを検査するフレーム検査部と、A frame inspection unit for inspecting the input signal level during the character protection period;
キャラクタ保護期間に入力信号がLowレベルとなるエラーであるフレームエラーである場合にICカードに対して再送信を要求する再送信要求信号生成部と、A retransmission request signal generator for requesting retransmission to the IC card in the case of a frame error, which is an error that causes the input signal to be low level during the character protection period
受信データおよびフレーム検査の結果を格納する受信バッファと、A receive buffer for storing received data and frame inspection results;
CPUから入力される送信データを格納する送信バッファと、A transmission buffer for storing transmission data input from the CPU;
送信データを下にパリティを算出するパリティ生成部と、A parity generator for calculating the parity under the transmission data;
パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、A serial / parallel converter that converts the data input in parallel into serial data and outputs it;
フレーム検査の結果を参照して受信バッファのライトポインタを制御する書き込み制御部を有し、フレームエラーの場合にはライトポインタを進めないことを特徴とするICカード接続装置。An IC card connection device comprising a write control unit for controlling a write pointer of a reception buffer with reference to a result of frame inspection, and not allowing the write pointer to advance in the case of a frame error.
前記受信バッファがFIFOメモリで構成されることを特徴とする請求項4に記載のICカード接続装置。5. The IC card connection device according to claim 4, wherein the reception buffer is configured by a FIFO memory. ICカードに対する送信・受信を切り替える送受信切替部と、A transmission / reception switching unit that switches between transmission and reception for an IC card;
シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、A parallel / serial converter for converting serially input data into 1-byte parallel data and outputting the data;
キャラクタ保護期間に入力信号レベルを検査するフレーム検査部と、A frame inspection unit for inspecting the input signal level during the character protection period;
ICカードに対して再送信を要求する再送信要求信号生成部と、A retransmission request signal generator for requesting retransmission to the IC card;
受信データおよびフレーム検査の結果を格納する受信バッファと、A receive buffer for storing received data and frame inspection results;
CPUから入力される送信データを格納する送信バッファと、A transmission buffer for storing transmission data input from the CPU;
送信データを下にパリティを算出するパリティ生成部と、A parity generator for calculating the parity under the transmission data;
パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、A serial / parallel converter that converts the data input in parallel into serial data and outputs it;
CPUが指定した同一データに対する再送信要求回数の上限を保持するリトライ回数上限レジスタと、A retry count upper limit register that holds an upper limit of the number of retransmission requests for the same data designated by the CPU;
同一データに対するフレームエラーを検出した回数をカウントするエラー検出カウンタと、An error detection counter that counts the number of frame errors detected for the same data;
前記リトライ回数上限と前記フレームエラーを検出した回数を比較する比較部と、A comparison unit that compares the upper limit of the number of retries and the number of times the frame error is detected;
ライトポインタを制御する書き込み制御部をさらに有し、同一データに対するフレームエラーが規定した回数に達しない場合は再送信を要求し、ライトポインタを進めない、一方、規定回数を超えた場合は再送信を要求せず、ライトポインタを進めることを特徴とするICカード接続装置。A write control unit that controls the write pointer is further provided. If the frame error for the same data does not reach the specified number of times, a re-transmission is requested and the write pointer cannot be advanced. The IC card connection device is characterized by advancing the write pointer without requesting
ICカードに対する送信・受信を切り替える送受信切替部と、A transmission / reception switching unit that switches between transmission and reception for an IC card;
シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、A parallel / serial converter for converting serially input data into 1-byte parallel data and outputting the data;
入力データを元に算出されるパリティと受信したパリティとを比較し、またキャラクタ保護期間に入力信号レベルを検査するパリティ/フレーム検査部と、A parity / frame checking unit that compares the parity calculated based on the input data with the received parity and checks the input signal level during the character protection period;
パリティエラーまたはフレームエラーの場合にICカードに対して再送信を要求する再送信要求信号生成部と、A retransmission request signal generator for requesting retransmission to the IC card in the case of a parity error or a frame error;
受信データおよびパリティ検査の結果およびフレーム検査の結果を格納する受信バッファと、A reception buffer for storing reception data, a parity check result, and a frame check result;
CPUから入力される送信データを格納する送信バッファと、A transmission buffer for storing transmission data input from the CPU;
送信データを下にパリティを算出するパリティ生成部と、A parity generator for calculating the parity under the transmission data;
パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、A serial / parallel converter that converts the data input in parallel into serial data and outputs it;
パリティ検査の結果およびフレーム検査の結果を参照して受信バッファのライトポインタを制御する書き込み制御部を有し、パリティエラーまたはフレームエラーの場合にはライトポインタを進めないことを特徴とするICカード接続装置。An IC card connection characterized by having a write control unit for controlling the write pointer of the reception buffer with reference to the result of the parity check and the result of the frame check, and the write pointer cannot be advanced in the case of a parity error or a frame error apparatus.
前記受信バッファがFIFOメモリで構成されることを特徴とする請求項7に記載のICカード接続装置。8. The IC card connection device according to claim 7, wherein the reception buffer is configured by a FIFO memory. ICカードに対する送信・受信を切り替える送受信切替部と、A transmission / reception switching unit that switches between transmission and reception for an IC card;
シリアルで入力されるデータを1バイトのパラレルデータに変換して出力するパラレル/シリアル変換部と、A parallel / serial converter for converting serially input data into 1-byte parallel data and outputting the data;
入力データを元に算出されるパリティと受信したパリティとを比較し、またキャラクタ保護期間に入力信号レベルを検査するパリティ/フレーム検査部と、A parity / frame checking unit that compares the parity calculated based on the input data with the received parity and checks the input signal level during the character protection period;
ICカードに対して再送信を要求する再送信要求信号生成部と、A retransmission request signal generator for requesting retransmission to the IC card;
受信データおよびパリティ検査の結果およびフレーム検査の結果を格納する受信バッファと、A reception buffer for storing reception data, a parity check result, and a frame check result;
CPUから入力される送信データを格納する送信バッファと、A transmission buffer for storing transmission data input from the CPU;
送信データを下にパリティを算出するパリティ生成部と、A parity generator for calculating the parity under the transmission data;
パラレルで入力されるデータをシリアルデータに変換して出力するシリアル/パラレル変換器と、A serial / parallel converter that converts the data input in parallel into serial data and outputs it;
CPUが指定した同一データに対する再送信要求回数の上限を保持するリトライ回数上限レジスタと、A retry count upper limit register that holds an upper limit of the number of retransmission requests for the same data designated by the CPU;
同一データに対するパリティエラーまたはフレームエラーを検出した回数をカウントするエラー検出カウンタと、An error detection counter that counts the number of times a parity error or frame error is detected for the same data;
前記リトライ回数上限と前記エラーを検出した回数を比較する比較部と、A comparison unit for comparing the retry count upper limit and the number of times the error is detected;
ライトポインタを制御する書き込み制御部をさらに有し、A write controller for controlling the write pointer;
同一データに対するパリティエラーまたはフレームエラーが規定した回数に達しない場合は再送信を要求し、ライトポインタを進めない、一方、規定回数を超えた場合は再送信を要求せず、ライトポインタを進めることを特徴とするICカード接続装置。If the specified number of parity errors or frame errors for the same data does not reach the specified number of times, request retransmission and do not advance the write pointer. On the other hand, if the specified number of times is exceeded, do not request retransmission and advance the write pointer. An IC card connection device characterized by the above.
JP2003124052A 2003-04-28 2003-04-28 IC card connection device Expired - Fee Related JP4449332B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003124052A JP4449332B2 (en) 2003-04-28 2003-04-28 IC card connection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003124052A JP4449332B2 (en) 2003-04-28 2003-04-28 IC card connection device

Publications (2)

Publication Number Publication Date
JP2004326685A JP2004326685A (en) 2004-11-18
JP4449332B2 true JP4449332B2 (en) 2010-04-14

Family

ID=33501758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003124052A Expired - Fee Related JP4449332B2 (en) 2003-04-28 2003-04-28 IC card connection device

Country Status (1)

Country Link
JP (1) JP4449332B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI475667B (en) * 2005-03-28 2015-03-01 Semiconductor Energy Lab Memory device and manufacturing method the same

Also Published As

Publication number Publication date
JP2004326685A (en) 2004-11-18

Similar Documents

Publication Publication Date Title
US20240070000A1 (en) Memory Controller With Error Detection And Retry Modes Of Operation
US7840873B2 (en) Partial CRC insertion in data packets for early forwarding
US7881303B2 (en) Command packet packing to mitigate CRC overhead
US20080163007A1 (en) System To Detect And Identify Errors In Control Information, Read Data And/Or Write Data
KR101251100B1 (en) Efficient in-band reliability with separate cyclic redundancy code frames
US8010860B2 (en) Method and architecture to prevent corrupt data propagation from a PCI express retry buffer
US8281189B2 (en) SATA primitive prediction and correction
US7701846B2 (en) Bad data packet capture device
US20070038783A1 (en) Communication device, host apparatus, and communication method
US9459960B2 (en) Controller device for use with electrically erasable programmable memory chip with error detection and retry modes of operation
JP4449332B2 (en) IC card connection device
JP3522597B2 (en) IC card connection device
CN101488825B (en) Error detection method and system for data transmission
KR100604842B1 (en) Method for optimizing UDMA transfer signals using CRC errors
JP4455393B2 (en) Programmable logic controller
JPH0535616A (en) Data transfer system
JP4649304B2 (en) COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD
KR100266255B1 (en) Apparatus for detecting errors in sending data
KR100292059B1 (en) Data retransmission system at the exchange
US20070121496A1 (en) System and method for amplitude optimization in high-speed serial transmissions
JPH09326782A (en) Serial communication method
JPH05257726A (en) Parity check diagnostic device
JP2007201786A (en) Transmission error detection system, and transmitter
JPS5920130B2 (en) Excess data transfer restriction method
KR20050044197A (en) Apparatus and method for pci dma error processing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060418

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20060512

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090515

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090519

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090713

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090804

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090929

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20091119

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: 20100105

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100118

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

Free format text: PAYMENT UNTIL: 20130205

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140205

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees