JP3395600B2 - Data transfer device - Google Patents

Data transfer device

Info

Publication number
JP3395600B2
JP3395600B2 JP27092997A JP27092997A JP3395600B2 JP 3395600 B2 JP3395600 B2 JP 3395600B2 JP 27092997 A JP27092997 A JP 27092997A JP 27092997 A JP27092997 A JP 27092997A JP 3395600 B2 JP3395600 B2 JP 3395600B2
Authority
JP
Japan
Prior art keywords
data
output
stop bit
data transfer
register
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
JP27092997A
Other languages
Japanese (ja)
Other versions
JPH11112598A (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 JP27092997A priority Critical patent/JP3395600B2/en
Publication of JPH11112598A publication Critical patent/JPH11112598A/en
Application granted granted Critical
Publication of JP3395600B2 publication Critical patent/JP3395600B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロプロセッ
サ等に使用され、シリアルデータの転送機能を持つデー
タ転送装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data transfer device used in a microprocessor or the like and having a serial data transfer function.

【0002】[0002]

【従来の技術】図4は従来のデータ転送装置のブロック
図を示す。図5にそのタイミングチャートを示す。
2. Description of the Related Art FIG. 4 shows a block diagram of a conventional data transfer device. FIG. 5 shows the timing chart.

【0003】図4において、データ転送装置4は、デー
タ出力レジスタ50とデータレジスタ41とストップビ
ット受信レジスタ42とストップビット受信レジスタ4
3とフレームモード選択回路44と情報記憶レジスタ4
5とフレームモード選択レジスタ46とから構成され、
データバス47に接続されている。ここで、フレームモ
ード選択レジスタ46は、1フレーム中のストップビッ
ト数を1ビットもしくは2ビットのどちらかを選択する
制御レジスタである。
In FIG. 4, the data transfer device 4 includes a data output register 50, a data register 41, a stop bit receiving register 42, and a stop bit receiving register 4.
3, frame mode selection circuit 44, and information storage register 4
5 and the frame mode selection register 46,
It is connected to the data bus 47. Here, the frame mode selection register 46 is a control register that selects either 1 bit or 2 bits as the number of stop bits in one frame.

【0004】データレジスタ41は、クロック信号40
1の立ち上がりエッジによってデータ入力線48からデ
ータを格納する。データ出力レジスタ50は、クロック
信号401の立ち下がりエッジを受けてデータ出力線4
9にデータを出力する。これにより、送信時とは逆のク
ロックのエッジでデータが受信されることになる。スト
ップビット受信レジスタ42は、クロック信号402に
よってデータ入力線48からデータを格納する。同様に
ストップビット受信レジスタ43は、クロック信号40
3を受けるとデータ入力線48からデータを格納する。
フレームモード選択レジスタ46は、書き込み制御信号
406(図中記号WE)によってデータバス47からデ
ータを格納し、フレームモード選択信号405を出力す
る。フレームモード選択回路44はフレームモード選択
信号405を受けるとストップビット受信レジスタ42
と43のデータの論理和を出力し、それ以外のときはス
トップビット受信レジスタ42のデータを出力する。情
報記憶レジスタ45は、クロック信号404によってフ
レームモード選択回路44の出力を格納し、データバス
47にデータを出力する。
The data register 41 has a clock signal 40.
Data is stored on the data input line 48 by the rising edge of 1. The data output register 50 receives the falling edge of the clock signal 401 and receives the data output line 4
The data is output to 9. As a result, data is received at the clock edge opposite to that at the time of transmission. The stop bit reception register 42 stores data from the data input line 48 according to the clock signal 402. Similarly, the stop bit reception register 43 receives the clock signal 40
When 3 is received, the data is stored from the data input line 48.
The frame mode selection register 46 stores data from the data bus 47 according to the write control signal 406 (symbol WE in the drawing) and outputs the frame mode selection signal 405. Upon receiving the frame mode selection signal 405, the frame mode selection circuit 44 receives the stop bit reception register 42.
And the data of 43 are output, and in other cases, the data of the stop bit reception register 42 is output. The information storage register 45 stores the output of the frame mode selection circuit 44 according to the clock signal 404 and outputs the data to the data bus 47.

【0005】ここで、クロック信号401、402、4
03、404と書き込み制御信号406は図示されない
マイクロプロセッサにより出力され、データバス47は
同マイクロプロセッサに接続されている。
Here, the clock signals 401, 402, 4
03 and 404 and the write control signal 406 are output by a microprocessor (not shown), and the data bus 47 is connected to the same microprocessor.

【0006】以上のように構成された従来のデータ転送
装置について、UART通信を行う場合の動作を送信と
受信に分けて説明する。
With respect to the conventional data transfer apparatus configured as described above, the operation when performing UART communication will be described separately for transmission and reception.

【0007】まず送信の場合について説明する。データ
レジスタ41には送信するデータをあらかじめセットし
ておき、セットしたデータをクロック信号401によっ
て1ビットずつデータ出力線に出力する。データ送信完
了後データに引き続きストップビットを設定された数だ
けデータ出力線に出力する(図5参照)。
First, the case of transmission will be described. Data to be transmitted is set in advance in the data register 41, and the set data is output to the data output line bit by bit by the clock signal 401. After the data transmission is completed, the stop bits are continuously output to the data output line by the set number (see FIG. 5).

【0008】次に受信の場合について説明する。まずフ
レームモード選択レジスタ46により1ストップビット
か2ストップビットのどちらかを選択する。データレジ
スタ41は、クロック信号401によってデータ入力線
からデータを1ビットずつシフトさせながら格納する。
データ受信完了後ストップビット受信レジスタ42は、
図5に示されている(G)のタイミングでクロック信号
402によってデータ入力線からデータを格納する。同
様にストップビット受信レジスタ43は、図5に示され
ている(H)のタイミングでクロック信号403によっ
てデータ入力線からデータを格納する。フレームモード
選択回路44は、ストップビット受信レジスタ42と4
3のデータの論理和かもしくはストップビット受信レジ
スタ42のデータを出力する。情報記憶レジスタ45は
通信終了時にマイクロプロセッサから出力されるクロッ
ク信号404によって図5の(I)のタイミングでフレ
ームモード選択回路44の出力を格納する。
Next, the case of reception will be described. First, the frame mode selection register 46 selects either one stop bit or two stop bits. The data register 41 stores data while shifting the data from the data input line by 1 bit by the clock signal 401.
After the data reception is completed, the stop bit reception register 42
Data is stored from the data input line by the clock signal 402 at the timing (G) shown in FIG. Similarly, the stop bit reception register 43 stores the data from the data input line by the clock signal 403 at the timing (H) shown in FIG. The frame mode selection circuit 44 includes stop bit reception registers 42 and 4
The logical sum of the data of 3 or the data of the stop bit reception register 42 is output. The information storage register 45 stores the output of the frame mode selection circuit 44 at the timing of (I) in FIG. 5 according to the clock signal 404 output from the microprocessor at the end of communication.

【0009】ここで従来のデータ転送装置が正常に受信
出来なかった場合の動作について説明する。図5の<通
信エラー時>は、データフレームが2ストップビットで
最初のストップビットが”L”であった場合のタイミン
グチャートを示す。データ受信後にストップビット受信
レジスタ42は、(G)のタイミングで前記”L”のス
トップビットを格納する。次に、ストップビット受信レ
ジスタ43は(H)のタイミングで2つ目のストップビ
ットを格納する。フレームモード選択回路44は、スト
ップビット受信レジスタ42と43の論理積を出力す
る。結果、情報記憶レジスタ45は、図5の(I)のタ
イミングで前記した”L”データを格納することにな
る。情報記憶レジスタ45は通信終了後も前記エラー情
報を保持しているので、通信終了後に情報記憶レジスタ
45のデータを読み出すことにより、マイクロプロセッ
サは通信が正常終了したか否かを判定することができ
る。
Here, the operation when the conventional data transfer device cannot receive normally will be described. <At communication error> in FIG. 5 is a timing chart when the data frame has 2 stop bits and the first stop bit is “L”. After receiving the data, the stop bit reception register 42 stores the "L" stop bit at the timing (G). Next, the stop bit reception register 43 stores the second stop bit at the timing of (H). The frame mode selection circuit 44 outputs a logical product of the stop bit reception registers 42 and 43. As a result, the information storage register 45 stores the "L" data at the timing of (I) in FIG. Since the information storage register 45 retains the error information even after the communication is completed, the microprocessor can determine whether the communication is completed normally by reading the data in the information storage register 45 after the communication is completed. .

【0010】[0010]

【発明が解決しようとする課題】しかしながら、上記従
来のUART通信はUART通信にしか用いることがで
きず、ICカードの通信に用いることができなかった。
However, the above-mentioned conventional UART communication can be used only for UART communication, and cannot be used for IC card communication.

【0011】すなわち、UART通信は一般的に従来例
に示したようなデータフォーマットをもった通信手段と
して扱われている。一方、ICカード通信は通信相手と
の間にフレーム同期を取るためのクロックを用いないこ
とから、UART通信の範疇に分類できる。
That is, the UART communication is generally treated as a communication means having a data format as shown in the conventional example. On the other hand, IC card communication does not use a clock for frame synchronization with a communication partner, and thus can be classified into the category of UART communication.

【0012】ところが、ICカード通信は、そのデータ
フォーマットの違いから、ここでは本来のUART通信
とは異なる通信手段として扱う。
However, the IC card communication is treated as a communication means different from the original UART communication because of the difference in the data format.

【0013】以下に、ICカード通信の通信プロトコル
と通信するデータのフォーマットについて説明する。
The format of data to be communicated with the IC card communication protocol will be described below.

【0014】ICカード通信は、通信起動時にICカー
ドからリーダライタに通信開始の連絡をするためのプロ
トコルATR(以下ATRとする)と、前記ATR後に
リーダライタと通信するためのプロトコルT=n(現在
nは0〜16まである)の2通りのプロトコルをもって
通信する。T=nはUARTのデータフォーマットで行
うが、前記ATRはUARTとは異なる。ただしATR
はICカードからのみ送信される。
In the IC card communication, a protocol ATR (hereinafter referred to as ATR) for informing the reader / writer of the communication start from the IC card at the time of starting the communication, and a protocol T = n (for communicating with the reader / writer after the ATR). Currently, n is 0 to 16). T = n is performed in the UART data format, but the ATR is different from the UART. However, ATR
Is transmitted only from the IC card.

【0015】図6にICカード通信のISOで規格化さ
れているATRのフォーマットの概略図を示す。
FIG. 6 shows a schematic diagram of an ATR format standardized by ISO for IC card communication.

【0016】UARTではデータ送信後ストップビット
を送信するが(図5参照)、ATRフォーマットではデ
ータ送信後はストップビットは送信せず、図6の
(J)、(K)で示されているようにリーダライタから
の再送要求データを受信する。リーダライタは、ICカ
ードからのデータを正常に受信できた場合は”H”を、
異常であった場合は”L”をICカードに送信する。前
記再送要求データは規格によりそのデータ幅(1ビット
もしくは2ビット)と前記再送要求データの受信タイミ
ングが定められている。以上のように、ICカード通信
を行うには前記ATRフォーマットを実現する必要があ
る。ところが、図4に示した従来のデータ転送装置では
1ビット目のストップビットが”L”であった場合情報
記憶レジスタにも”L”データが格納され通信が異常で
あったと判定されてしまう(図5通信エラー時参照)。
しかしながら、ATRでは規格上、図5の通信異常時の
ような通信は正常通信である。つまり、ATRではUA
RT時の1ビット目のストップビットは判定してはいけ
ない。このように、従来のデータ転送装置では、ATR
通信が実現できないためにICカード通信が行えない。
また、ATRの全データフォーマットに対応するために
は、前記再送要求データの受信タイミングを変更可能で
ある必要がある。
In the UART, the stop bit is transmitted after the data is transmitted (see FIG. 5), but in the ATR format, the stop bit is not transmitted after the data is transmitted, as shown in (J) and (K) of FIG. Then, the resend request data from the reader / writer is received. The reader / writer returns "H" if the data from the IC card can be received normally.
If it is abnormal, "L" is transmitted to the IC card. The data width (1 bit or 2 bits) of the retransmission request data and the reception timing of the retransmission request data are defined by the standard. As described above, it is necessary to realize the ATR format in order to perform IC card communication. However, in the conventional data transfer device shown in FIG. 4, when the first stop bit is "L", "L" data is also stored in the information storage register and it is determined that the communication is abnormal ( (See Fig. 5 Communication error).
However, in the ATR, according to the standard, communication such as when communication is abnormal in FIG. 5 is normal communication. That is, UA in ATR
Do not judge the first stop bit at RT. Thus, in the conventional data transfer device, the ATR
IC card communication cannot be performed because communication cannot be realized.
Further, in order to support all ATR data formats, it is necessary to be able to change the reception timing of the retransmission request data.

【0017】本発明は、僅かな回路と制御レジスタを設
けることで、上記のような複数のデータ通信に対応でき
るデータ転送装置を提供することを目的とする。
It is an object of the present invention to provide a data transfer device capable of coping with a plurality of data communications as described above by providing a small number of circuits and control registers.

【0018】[0018]

【課題を解決するための手段】この課題を解決するため
に本発明のデータ転送装置は、データ転送クロックの第
1の変化タイミングでシリアルデータをデータ端子に出
力するシリアルデータ出力手段と、第1のストップビッ
トを受信状態のときにデータ転送クロックの第2の変化
タイミングで所与のデータを格納し出力する第1のスト
ップビット受信手段と、第2のストップビットを受信状
態のときにデータ転送クロックの前記第2の変化タイミ
ングで前記所与のデータを格納し出力する第2のストッ
プビット受信手段と、前記第1のストップビット受信手
段と前記第2のストップビット受信手段とを用いて論理
演算を行いその結果を出力するフレームモード選択手段
と、前記フレームモード選択手段の出力と前記第2のス
トップビット受信手段の出力とを選択し出力する第1の
選択手段と、前記第1の選択手段を制御する第1の制御
手段と、データ転送終了時に前記第1の選択手段の出力
を格納し出力する情報記憶手段とを備え、拡張されたデ
ータ通信状態では、前記第1の選択手段に前記第2のス
トップビット受信手段の出力を選択出力させる。
In order to solve this problem, a data transfer apparatus of the present invention comprises a serial data output means for outputting serial data to a data terminal at a first change timing of a data transfer clock, and a first data output means. Stop bit receiving means for storing and outputting given data at the second change timing of the data transfer clock when the stop bit is in the receiving state, and data transfer when the second stop bit is in the receiving state Logic using second stop bit receiving means for storing and outputting the given data at the second change timing of the clock, the first stop bit receiving means and the second stop bit receiving means Frame mode selection means for performing calculation and outputting the result, output of the frame mode selection means and reception of the second stop bit First selecting means for selecting and outputting the output of the stage, first controlling means for controlling the first selecting means, and information for storing and outputting the output of the first selecting means at the end of data transfer A storage means, and in the extended data communication state, causes the first selection means to selectively output the output of the second stop bit reception means.

【0019】また、この課題を解決するために本発明の
データ転送装置はさらに、前記データ転送クロックの第
1の変化タイミングで前記データ端子の値を格納し出力
する第1のデータ格納手段と、前記データ端子の値と前
記第1のデータ格納手段の出力とのいずれかを選択して
出力する第2の選択手段と、前記第2の選択手段を制御
する第2の制御手段とを備え、前記データ端子から得ら
れる値は前記第2の選択手段の出力である。
In order to solve this problem, the data transfer apparatus of the present invention further comprises first data storage means for storing and outputting the value of the data terminal at a first change timing of the data transfer clock, A second selection unit that selects and outputs either the value of the data terminal or the output of the first data storage unit; and a second control unit that controls the second selection unit, The value obtained from the data terminal is the output of the second selecting means.

【0020】もしくは、この課題を解決するために本発
明のデータ転送装置はさらに、前記データ転送クロック
を遅延させて得られるクロックで前記データ端子の値を
格納し出力する第2のデータ格納手段と、前記データ端
子の値と前記第2のデータ格納手段の出力とのいずれか
を選択して出力する第3の選択手段と、前記第3の選択
手段を制御する第3の制御手段とを備え、前記データ端
子から得られる値は前記第3の選択手段の出力である。
Alternatively, in order to solve this problem, the data transfer device of the present invention further comprises second data storage means for storing and outputting the value of the data terminal with a clock obtained by delaying the data transfer clock. , A third selecting means for selecting and outputting either the value of the data terminal or the output of the second data storing means, and a third controlling means for controlling the third selecting means. , The value obtained from the data terminal is the output of the third selecting means.

【0021】[0021]

【発明の実施の形態】以下、本発明の実施の形態につい
て、図1、図2と図3を用いて説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to FIGS. 1, 2 and 3.

【0022】図1は、本発明の第1の実施の形態におけ
るデータ転送装置の構成を表わすブロック図を示す。図
2に正常通信時のタイミングチャートを図3に異常通信
時のタイミングチャートを示す。
FIG. 1 is a block diagram showing the configuration of a data transfer device according to the first embodiment of the present invention. FIG. 2 shows a timing chart during normal communication, and FIG. 3 shows a timing chart during abnormal communication.

【0023】図1において、データ転送装置1は、デー
タレジスタ11とストップビット受信レジスタ12とス
トップビット受信レジスタ13とフレームモード選択回
路14と情報記憶レジスタ15とセレクタ16とフレー
ムモード選択レジスタ17と通信モード切換レジスタ1
8と受信エッジ切換レジスタ19とデータ入力レジスタ
20とセレクタ21とデータ出力レジスタ25から構成
され、データバス22に接続されている。ここで、フレ
ームモード選択レジスタ17は、1フレーム中のストッ
プビット数を1ビットもしくは2ビットのどちらかを選
択する制御レジスタであり、通信モード切換レジスタ1
8は、通信フォーマットをUARTもしくはICカード
通信のどちらかを選択する制御レジスタである。また、
受信エッジ切換レジスタ19は入力データの受信タイミ
ングを切り替える制御レジスタである。
In FIG. 1, the data transfer device 1 communicates with a data register 11, a stop bit reception register 12, a stop bit reception register 13, a frame mode selection circuit 14, an information storage register 15, a selector 16, a frame mode selection register 17. Mode switching register 1
8, a reception edge switching register 19, a data input register 20, a selector 21, and a data output register 25, and they are connected to a data bus 22. Here, the frame mode selection register 17 is a control register that selects either 1 bit or 2 bits as the number of stop bits in one frame.
Reference numeral 8 is a control register for selecting either UART or IC card communication as the communication format. Also,
The reception edge switching register 19 is a control register that switches the reception timing of input data.

【0024】データレジスタ11は、データ転送クロッ
クであるクロック信号101の立ち上がりタイミングで
セレクタ21の出力を格納する。データ出力レジスタ2
5は、クロック信号101の立ち下がりエッジを受けて
データレジスタ11のデータを格納し、データ出力線4
9にデータを出力する。データ出力線24にデータを出
力する。これにより、送信時とは異なり、受信時はクロ
ックの逆のエッジでデータが受信されることになる。デ
ータ入力レジスタ20は、クロック信号101の立ち下
がりタイミングでデータ入力線23からデータを格納す
る。セレクタ21は、受信エッジ切換信号108を受け
ると前記データ入力レジスタ20のデータを出力し、そ
れ以外のときはデータ入力線23のデータを出力する。
ストップビット受信レジスタ12は、第1のストップビ
ットを受信状態の時に出力されるクロック信号102の
立ち上がりタイミングでセレクタ21の出力を格納す
る。同様にストップビット受信レジスタ13は、第2の
ストップビットを受信状態の時に出力されるクロック信
号103の立ち上がりタイミングでセレクタ21の出力
を格納する。ここで、クロック信号102およびクロッ
ク信号103の立ち上がりタイミングはクロック信号1
01の立ち上がりタイミングと一致している。フレーム
モード選択レジスタ17と通信モード切換レジスタ18
と受信エッジ切換レジスタ19は、書き込み制御信号1
06(図中記号WE)によってデータバス22からデー
タを格納し、それぞれフレームモード選択信号105と
通信モード切換信号107と受信エッジ切換信号108
を出力する。フレームモード選択回路14はフレームモ
ード選択信号105を受けるとストップビット受信レジ
スタ12と13のデータの論理積を出力し、それ以外の
ときはストップビット受信レジスタ12のデータを出力
する。セレクタ16は通信モード切換信号107を受け
るとストップビット受信レジスタ13のデータを出力
し、それ以外のときはフレームモード選択回路14のデ
ータを出力する。情報記憶レジスタ15は、エラー情報
を受信状態の時に出力されるクロック信号104によっ
てセレクタ16の出力を格納し、データバス22にデー
タを出力する。
The data register 11 stores the output of the selector 21 at the rising timing of the clock signal 101 which is the data transfer clock. Data output register 2
5 stores the data of the data register 11 in response to the falling edge of the clock signal 101, and the data output line 4
The data is output to 9. The data is output to the data output line 24. As a result, unlike during transmission, during reception, data is received at the opposite edge of the clock. The data input register 20 stores data from the data input line 23 at the falling timing of the clock signal 101. When the selector 21 receives the reception edge switching signal 108, it outputs the data of the data input register 20, and otherwise outputs the data of the data input line 23.
The stop bit reception register 12 stores the output of the selector 21 at the rising timing of the clock signal 102 output when the first stop bit is in the reception state. Similarly, the stop bit reception register 13 stores the output of the selector 21 at the rising timing of the clock signal 103 output when the second stop bit is in the reception state. Here, the rising timing of the clock signal 102 and the clock signal 103 is the clock signal 1
It coincides with the rising timing of 01. Frame mode selection register 17 and communication mode switching register 18
And the receiving edge switching register 19 write the control signal 1
06 (symbol WE in the figure) stores data from the data bus 22, and a frame mode selection signal 105, a communication mode switching signal 107, and a reception edge switching signal 108, respectively.
Is output. When the frame mode selection circuit 14 receives the frame mode selection signal 105, it outputs a logical product of the data in the stop bit reception registers 12 and 13, and otherwise outputs the data in the stop bit reception register 12. When the selector 16 receives the communication mode switching signal 107, it outputs the data of the stop bit reception register 13, and otherwise outputs the data of the frame mode selection circuit 14. The information storage register 15 stores the output of the selector 16 in response to the clock signal 104 output when the error information is received, and outputs the data to the data bus 22.

【0025】ここで、クロック信号101、102、1
03、104と書き込み制御信号106は図示されない
マイクロプロセッサにより出力され、データバス22は
同マイクロプロセッサに接続されている。また、データ
入力線23およびデータ出力線24はそれぞれ図示され
ないデータ端子と接続されており、データ転送装置1
は、図示されないリーダライタと前記データ端子によっ
て接続されている。
Here, the clock signals 101, 102, 1
03 and 104 and the write control signal 106 are output by a microprocessor (not shown), and the data bus 22 is connected to the same microprocessor. Further, the data input line 23 and the data output line 24 are respectively connected to data terminals (not shown), and the data transfer device 1
Are connected to a reader / writer (not shown) by the data terminal.

【0026】以上のように構成された本発明のデータ転
送装置について、ICカード通信を行う場合の動作につ
いて正常通信と異常通信の場合に分けて説明する。 (正常通信の場合)まず通信モード切換レジスタにより
ICカード通信を選択する。これによって、セレクタ1
6はストップビット受信レジスタ13のデータを出力す
ることになる。また、受信エッジ切換レジスタ19によ
り、データ入力線23もしくはデータ入力レジスタ20
のどちらのデータをセレクタ21から出力するかを選択
する。データ入力レジスタ20は、クロック信号101
によってデータ入力線23からデータを格納する。デー
タレジスタ11には送信するATRデータをあらかじめ
セットしておき、クロック信号101によってセットし
たデータを1ビットずつデータ出力線24に出力する。
ATRデータ送信完了後ストップビット受信レジスタ1
3は、図2に示されている(A)のタイミングでクロッ
ク信号103によってセレクタ21からデータを格納す
る。セレクタ16はストップビット受信レジスタ13の
データを出力し、情報記憶レジスタ15は通信終了時に
マイクロプロセッサから出力されるクロック信号104
によって図2の(B)のタイミングでセレクタ16の出
力を格納する。正常通信の場合、リーダライタは再送要
求を出さないので、図2の(A)のタイミングのセレク
タ21の出力は”H”であるため、通信終了後の情報記
憶レジスタ15のデータは”H”となる。 (異常通信の場合)本データ転送装置によって送信され
たATRデータをリーダライタが正常に受信出来なかっ
た場合、リーダライタから図3の(C)のタイミングで
1ビットもしくは2ビットのデータ幅に相当する、通信
エラーを示す再送要求データが送信されてくる。この場
合の動作について、前記再送要求データ幅が、(1)1
ビット(2)2ビットの場合に分けて説明する。 (1)再送要求データ=1ビット まず受信エッジ切換レジスタ19により、データ入力レ
ジスタ20のデータをセレクタ21から出力するように
設定しておく。これにより、送信と同じタイミングでデ
ータを受信することが可能となる。図3のATRデータ
送信期間の動作は、上記の正常通信の場合と同じであ
る。ATRデータ送信完了後の再送要求データ受信期間
において、データ入力レジスタ20は、再送要求データ
受信期間の中間(図3(E))のタイミングでクロック
信号101によってデータ入力線23から再送要求デー
タ”L”を格納する。従って、ストップビット受信レジ
スタ13は、図3の(D)のタイミングでクロック信号
103によってセレクタ21から”L”データを格納す
る。続いて情報記憶レジスタ15は、図3の(F)のタ
イミングでセレクタ16の出力”L”を格納する。 (2)再送要求データ=2ビット まず受信エッジ切換レジスタ19により、データ入力線
23のデータをセレクタ21から出力するように設定し
ておく。これにより、ストップビット受信レジスタ13
は、送信のクロックのエッジと逆のエッジタイミングで
データを受信することが可能となる。ATRデータ送信
期間の動作は、上記の正常通信および(1)の場合と同
じである。ATRデータ送信完了後の再送要求データ受
信期間において、ストップビット受信レジスタ13は、
再送要求データ受信期間の中間(図3(D))のタイミ
ングでクロック信号103によってデータ入力線23か
ら再送要求データ”L”を格納する。従って、情報記憶
レジスタ15は、セレクタ16を通して図3(F)のタ
イミングで”L”データを格納する。
With respect to the data transfer apparatus of the present invention configured as described above, the operation when performing IC card communication will be described separately for normal communication and abnormal communication. (For normal communication) First, IC card communication is selected by the communication mode switching register. This allows selector 1
6 outputs the data of the stop bit reception register 13. Further, the receiving edge switching register 19 allows the data input line 23 or the data input register 20.
Which data is to be output from the selector 21 is selected. The data input register 20 has a clock signal 101.
Data is stored from the data input line 23 by. ATR data to be transmitted is set in advance in the data register 11, and the data set by the clock signal 101 is output to the data output line 24 bit by bit.
Stop bit reception register 1 after completion of ATR data transmission
3 stores the data from the selector 21 by the clock signal 103 at the timing (A) shown in FIG. The selector 16 outputs the data of the stop bit reception register 13, and the information storage register 15 outputs the clock signal 104 output from the microprocessor at the end of communication.
The output of the selector 16 is stored at the timing shown in FIG. In the case of normal communication, since the reader / writer does not issue a resend request, the output of the selector 21 at the timing of FIG. 2A is "H", so the data of the information storage register 15 after the communication is "H". Becomes (In the case of abnormal communication) When the reader / writer cannot normally receive the ATR data transmitted by this data transfer device, it corresponds to a 1-bit or 2-bit data width from the reader / writer at the timing of (C) of FIG. Then, resend request data indicating a communication error is transmitted. Regarding the operation in this case, the retransmission request data width is (1) 1
Bit (2) The case of 2 bits will be described separately. (1) Retransmission request data = 1 bit First, the reception edge switching register 19 is set so that the data in the data input register 20 is output from the selector 21. As a result, it becomes possible to receive data at the same timing as transmission. The operation during the ATR data transmission period in FIG. 3 is the same as that in the case of the above normal communication. In the retransmission request data reception period after the completion of the ATR data transmission, the data input register 20 receives the retransmission request data “L” from the data input line 23 by the clock signal 101 at the timing of the middle of the retransmission request data reception period (FIG. 3E). Is stored. Therefore, the stop bit reception register 13 stores "L" data from the selector 21 by the clock signal 103 at the timing of (D) in FIG. Subsequently, the information storage register 15 stores the output "L" of the selector 16 at the timing of (F) in FIG. (2) Retransmission request data = 2 bits First, the reception edge switching register 19 is set so that the data of the data input line 23 is output from the selector 21. As a result, the stop bit reception register 13
Can receive data at the edge timing opposite to the edge of the transmission clock. The operation during the ATR data transmission period is the same as in the above normal communication and (1). During the retransmission request data reception period after the completion of ATR data transmission, the stop bit reception register 13
The retransmission request data “L” is stored from the data input line 23 by the clock signal 103 at the timing of the middle of the retransmission request data reception period (FIG. 3D). Therefore, the information storage register 15 stores the “L” data through the selector 16 at the timing of FIG.

【0027】異常通信エラーが生じた場合において、上
記(1)と(2)に述べたようにストップビット受信レ
ジスタ13のデータ入力線23からのデータの受信タイ
ミングを変更し、ストップビット受信レジスタ12のデ
ータを無視出来るようにすることで、再送要求データを
通信エラー情報として適正なタイミングで情報記憶レジ
スタ15に格納することが可能となる。
When an abnormal communication error occurs, the timing of receiving data from the data input line 23 of the stop bit receiving register 13 is changed as described in (1) and (2) above, and the stop bit receiving register 12 is changed. By making it possible to ignore the data of 1, the retransmission request data can be stored in the information storage register 15 as communication error information at an appropriate timing.

【0028】情報記憶レジスタ15は通信終了後も前記
エラー情報を保持しているので、通信終了後に情報記憶
レジスタ15のデータを読み出すことにより、マイクロ
プロセッサは通信が正常終了したか否かを判定すること
ができる。
Since the information storage register 15 retains the error information even after the communication is completed, the microprocessor determines whether or not the communication is normally completed by reading the data in the information storage register 15 after the communication is completed. be able to.

【0029】以上のように本発明の実施の形態によれ
ば、僅かな回路と制御レジスタを設け制御レジスタの設
定で回路を切り換えることにより、UARTおよびAT
R両方のデータフォーマットを扱うことができ、UAR
T通信とは異なるデータフォーマットであるICカード
通信が可能となる。また、従来はATRフォーマットの
送受信はマイクロコンピュータがソフトウエアを実行す
ることで実現しており、高速な通信を行うには非常に高
性能なマイクロコンピュータを用いる必要があったが、
本発明の実施の形態によれば、容易に高速な通信を実現
することができる。
As described above, according to the embodiment of the present invention, by providing a small number of circuits and control registers and switching the circuits by setting the control registers, the UART and the AT can be controlled.
Both R data formats can be handled, and UAR
IC card communication, which is a data format different from T communication, is possible. Further, in the past, transmission and reception of the ATR format was realized by the microcomputer executing software, and it was necessary to use a very high-performance microcomputer for high-speed communication.
According to the embodiments of the present invention, high-speed communication can be easily realized.

【0030】尚、以上の本発明の実施の形態では、デー
タ入力レジスタ20は、クロック信号101の立ち下が
りタイミングでデータ入力線23の値を格納している
が、クロック101を遅延させて得られたクロックを用
いて入力線23の値を格納してもよい。
In the above embodiment of the present invention, the data input register 20 stores the value of the data input line 23 at the falling timing of the clock signal 101, but it is obtained by delaying the clock 101. The value of the input line 23 may be stored using the clock.

【0031】[0031]

【発明の効果】以上のように本発明に係るデータ転送装
置は、データ転送クロックの第1の変化タイミングでシ
リアルデータをデータ端子に出力するシリアルデータ出
力手段と、第1のストップビットを受信状態のときにデ
ータ転送クロックの第2の変化タイミングで所与のデー
タを格納し出力する第1のストップビット受信手段と、
第2のストップビットを受信状態のときにデータ転送ク
ロックの前記第2の変化タイミングで前記所与のデータ
を格納し出力する第2のストップビット受信手段と、前
記第1のストップビット受信手段と前記第2のストップ
ビット受信手段とを用いて論理演算を行いその結果を出
力するフレームモード選択手段と、前記フレームモード
選択手段の出力と前記第2のストップビット受信手段の
出力とを選択し出力する第1の選択手段と、前記第1の
選択手段を制御する第1の制御手段と、データ転送終了
時に前記第1の選択手段の出力を格納し出力する情報記
憶手段とを備え、拡張されたデータ通信状態では、前記
第1の選択手段に前記第2のストップビット受信手段の
出力を選択出力させる。
As described above, the data transfer apparatus according to the present invention has the serial data output means for outputting serial data to the data terminal at the first change timing of the data transfer clock, and the receiving state of the first stop bit. First stop bit receiving means for storing and outputting given data at the second change timing of the data transfer clock at
Second stop bit receiving means for storing and outputting the given data at the second change timing of the data transfer clock when receiving the second stop bit, and the first stop bit receiving means Frame mode selecting means for performing a logical operation using the second stop bit receiving means and outputting the result, and selecting and outputting the output of the frame mode selecting means and the output of the second stop bit receiving means. And a first control means for controlling the first selection means, and an information storage means for storing and outputting the output of the first selection means at the end of data transfer. In the data communication state, the first selection means selectively outputs the output of the second stop bit reception means.

【0032】この構成によれば、従来のUART通信に
加えて、前記第1の選択手段に前記第2のストップビッ
ト受信手段の出力を選択出力させることによって、UA
RT通信とは異なるデータフォーマットであるICカー
ド通信が可能となる。また、通信をハードウエアで行う
ため容易に高速な通信を実現することができる。
According to this structure, in addition to the conventional UART communication, by causing the first selecting means to selectively output the output of the second stop bit receiving means, the UA
IC card communication, which is a data format different from RT communication, is possible. Moreover, since communication is performed by hardware, high-speed communication can be easily realized.

【0033】また、以上のように本発明に係るデータ転
送装置は、前記データ転送装置にさらに、前記データ転
送クロックの第1の変化タイミングで前記データ端子の
値を格納し出力する第1のデータ格納手段と、前記デー
タ端子の値と前記第1のデータ格納手段の出力とのいず
れかを選択して出力する第2の選択手段と、前記第2の
選択手段を制御する第2の制御手段とを備え、前記デー
タ端子から得られる値は前記第2の選択手段の出力であ
る。
Further, as described above, the data transfer device according to the present invention further includes the first data for storing and outputting the value of the data terminal at the first change timing of the data transfer clock. Storage means, second selection means for selecting and outputting either the value of the data terminal or the output of the first data storage means, and second control means for controlling the second selection means. And the value obtained from the data terminal is the output of the second selecting means.

【0034】この構成によれば、第2の選択手段が前記
データ端子の値と前記データ格納手段の出力とのいずれ
かを選択することによって、複数のATRフォーマット
の通信を実現することができる。
According to this configuration, the second selecting means selects one of the value of the data terminal and the output of the data storing means, so that communication in a plurality of ATR formats can be realized.

【0035】もしくは、以上のように本発明に係るデー
タ転送装置は、前記データ転送装置にさらに、前記デー
タ転送クロックを遅延させて得られるクロックで前記デ
ータ端子の値を格納し出力する第2のデータ格納手段
と、前記データ端子の値と前記第2のデータ格納手段の
出力とのいずれかを選択して出力する第3の選択手段
と、前記第3の選択手段を制御する第3の制御手段とを
備え、前記データ端子から得られる値は前記第3の選択
手段の出力である。
Alternatively, as described above, in the data transfer device according to the present invention, the second data transfer device further stores and outputs the value of the data terminal with a clock obtained by delaying the data transfer clock. Data storage means, third selection means for selecting and outputting any one of the value of the data terminal and the output of the second data storage means, and third control for controlling the third selection means. Means and the value obtained from the data terminal is the output of the third selecting means.

【0036】この構成によれば、前記データ転送装置と
異なる構成で同等の効果を得ることができる。
According to this structure, the same effect can be obtained with a structure different from that of the data transfer device.

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

【図1】本発明の実施の形態におけるデータ転送装置の
構成を示すブロック図
FIG. 1 is a block diagram showing a configuration of a data transfer device according to an embodiment of the present invention.

【図2】本発明の実施の形態におけるデータ転送装置の
動作を示すタイミングチャート
FIG. 2 is a timing chart showing the operation of the data transfer device according to the embodiment of the present invention.

【図3】本発明の実施の形態におけるデータ転送装置の
動作を示すタイミングチャート
FIG. 3 is a timing chart showing the operation of the data transfer device according to the embodiment of the present invention.

【図4】従来のデータ転送装置の構成を示すブロック図FIG. 4 is a block diagram showing a configuration of a conventional data transfer device.

【図5】従来のデータ転送装置の動作を示すタイミング
チャート
FIG. 5 is a timing chart showing the operation of a conventional data transfer device.

【図6】ATRのフォーマットの概略図FIG. 6 is a schematic diagram of the ATR format.

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

11 データレジスタ 12、13 ストップビット受信レジスタ 14 フレームモード選択回路 15 情報記憶レジスタ 16、21 セレクタ 17 フレームモード選択レジスタ 18 通信モード切換レジスタ 19 受信エッジ切換レジスタ 20 データ入力レジスタ 22 データバス 23 データ入力線 24 データ出力線 101、102、103、104 クロック信号 105 フレームモード選択信号 106 書き込み制御信号 107 通信モード切換信号 11 Data register 12, 13 Stop bit reception register 14 Frame mode selection circuit 15 Information storage register 16, 21 selector 17 Frame mode selection register 18 Communication mode switching register 19 Reception edge switching register 20 data input register 22 Data bus 23 Data input line 24 data output line 101, 102, 103, 104 clock signals 105 frame mode selection signal 106 write control signal 107 Communication mode switching signal

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 データ転送クロックの第1の変化タイミ
ングでシリアルデータをデータ端子に出力するシリアル
データ出力手段と、第1のストップビットを受信状態の
ときに前記データ転送クロックの第2の変化タイミング
で前記データ端子から得られる値を格納し出力する第1
のストップビット受信手段と、第2のストップビットを
受信状態のときにデータ転送クロックの前記第2の変化
タイミングで前記データ端子から得られる値を格納し出
力する第2のストップビット受信手段と、前記第1のス
トップビット受信手段と前記第2のストップビット受信
手段とを用いて論理演算を行いその結果を出力するフレ
ームモード選択手段と、前記フレームモード選択手段の
出力と前記第2のストップビット受信手段の出力とを選
択し出力する第1の選択手段と、前記第1の選択手段を
制御する第1の制御手段と、データ転送終了時に前記第
1の選択手段の出力を格納し出力する情報記憶手段とを
備え、拡張されたデータ通信状態では、前記第1の選択
手段に前記第2のストップビット受信手段の出力を選択
出力させることを特徴とするデータ転送装置。
1. A serial data output means for outputting serial data to a data terminal at a first change timing of a data transfer clock, and a second change timing of the data transfer clock when the first stop bit is in a receiving state. Stores and outputs a value obtained from the data terminal at
Stop bit receiving means, and second stop bit receiving means for storing and outputting a value obtained from the data terminal at the second change timing of the data transfer clock when the second stop bit is being received. Frame mode selecting means for performing a logical operation using the first stop bit receiving means and the second stop bit receiving means and outputting the result, an output of the frame mode selecting means and the second stop bit First selecting means for selecting and outputting the output of the receiving means, first controlling means for controlling the first selecting means, and storing and outputting the output of the first selecting means at the end of data transfer. An information storage unit, and in the extended data communication state, causing the first selection unit to selectively output the output of the second stop bit reception unit. Data transfer apparatus according to symptoms.
【請求項2】 前記データ転送装置はさらに、前記デー
タ転送クロックの第1の変化タイミングで前記データ端
子の値を格納し出力する第1のデータ格納手段と、前記
データ端子の値と前記第1のデータ格納手段の出力との
いずれかを選択して出力する第2の選択手段と、前記第
2の選択手段を制御する第2の制御手段とを備え、前記
データ端子から得られる値は前記第2の選択手段の出力
であることを特徴とする請求項1記載のデータ転送装
置。
2. The data transfer device further comprises first data storage means for storing and outputting a value of the data terminal at a first change timing of the data transfer clock, a value of the data terminal and the first data storage means. The second storage means for selecting and outputting any one of the outputs of the data storage means, and the second control means for controlling the second selection means. The data transfer apparatus according to claim 1, wherein the data is output from the second selecting means.
【請求項3】 前記データ転送装置はさらに、前記デー
タ転送クロックを遅延させて得られるクロックで前記デ
ータ端子の値を格納し出力する第2のデータ格納手段
と、前記データ端子の値と前記第2のデータ格納手段の
出力とのいずれかを選択して出力する第3の選択手段
と、前記第3の選択手段を制御する第3の制御手段とを
備え、前記データ端子から得られる値は前記第3の選択
手段の出力であることを特徴とする請求項1記載のデー
タ転送装置。
3. The data transfer device further comprises second data storage means for storing and outputting the value of the data terminal with a clock obtained by delaying the data transfer clock, the value of the data terminal and the second data storage means. The data obtained from the data terminal includes a third selection means for selecting and outputting any one of the outputs of the second data storage means and a third control means for controlling the third selection means. The data transfer device according to claim 1, wherein the data is output from the third selecting means.
【請求項4】 前記第2の変化タイミングに於ける前記
データ転送クロックの変化は、前記第1の変化タイミン
グに於ける前記データ転送クロックの変化と極性が異な
ることを特徴とする請求項1から請求項3までのいずれ
か記載のデータ転送装置。
4. The change of the data transfer clock at the second change timing has a polarity different from that of the change of the data transfer clock at the first change timing. The data transfer device according to claim 3.
JP27092997A 1997-10-03 1997-10-03 Data transfer device Expired - Fee Related JP3395600B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27092997A JP3395600B2 (en) 1997-10-03 1997-10-03 Data transfer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27092997A JP3395600B2 (en) 1997-10-03 1997-10-03 Data transfer device

Publications (2)

Publication Number Publication Date
JPH11112598A JPH11112598A (en) 1999-04-23
JP3395600B2 true JP3395600B2 (en) 2003-04-14

Family

ID=17492971

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27092997A Expired - Fee Related JP3395600B2 (en) 1997-10-03 1997-10-03 Data transfer device

Country Status (1)

Country Link
JP (1) JP3395600B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006312472A (en) * 2005-05-09 2006-11-16 Dainippon Printing Co Ltd Vertical sealing device for packaging material

Also Published As

Publication number Publication date
JPH11112598A (en) 1999-04-23

Similar Documents

Publication Publication Date Title
US20020108011A1 (en) Dual interface serial bus
US4630295A (en) Low power consumption CMOS shift register
EP0693729A1 (en) Multi-protocol data bus system
GB1581836A (en) Cpu-i/o bus interface for a data processing system
US7231467B2 (en) Method and apparatus for providing an inter integrated circuit interface with an expanded address range and efficient priority-based data throughput
CN100538675C (en) Center cell, memory module, accumulator system and to the method for its read and write
JPH1173479A (en) Chip card reader equipped with high-speed communication protocol
JP3395600B2 (en) Data transfer device
JPH11167560A (en) Data transfer system, switching circuit used to the transfer system, adapter, integrated circuit having the transfer system and data transfer method
US5724615A (en) Communication circuit receiving data selectably synchronized to the rising or falling edge of a timing signal provided from the data source
WO1996018910A1 (en) A method and apparatus for selecting modes of an integrated circuit
US6808113B2 (en) Clock frequency control method and device, and IC card reading/writing apparatus using the same
JP2958601B2 (en) Data communication method
US5590371A (en) Serial communication circuit on an LSI chip and communicating with another microcomputer on the chip
JPH11504741A (en) Method and apparatus for reducing latency on an interface by overlaying transmitted packets
JPS61270952A (en) Data transmitting system
KR100295683B1 (en) General call acknowledge apparatus and method for inter-integrated circuit
US5586272A (en) Asynchronous data transfers among a plurality of computer devices
JP2932851B2 (en) Asynchronous serial data transceiver
JPH08237414A (en) Facsimile transmission and reception method using bus for common use and its device
KR0169789B1 (en) Method and circuit for transmitting data of blocks
US20020099969A1 (en) Data input and output device using timer function
JPH06103898B2 (en) Parallel transmission method using functions for serial transmission
US6252815B1 (en) First in first out memory circuit
JPH03222539A (en) Start bit detection circuit

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080207

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090207

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100207

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100207

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110207

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees