JP2009110335A - Semiconductor device and data processing system - Google Patents

Semiconductor device and data processing system Download PDF

Info

Publication number
JP2009110335A
JP2009110335A JP2007282762A JP2007282762A JP2009110335A JP 2009110335 A JP2009110335 A JP 2009110335A JP 2007282762 A JP2007282762 A JP 2007282762A JP 2007282762 A JP2007282762 A JP 2007282762A JP 2009110335 A JP2009110335 A JP 2009110335A
Authority
JP
Japan
Prior art keywords
communication
register
transmission
data
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.)
Granted
Application number
JP2007282762A
Other languages
Japanese (ja)
Other versions
JP5179834B2 (en
Inventor
Makoto Shindo
誠 進藤
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2007282762A priority Critical patent/JP5179834B2/en
Publication of JP2009110335A publication Critical patent/JP2009110335A/en
Application granted granted Critical
Publication of JP5179834B2 publication Critical patent/JP5179834B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a semiconductor device for changing communication conditions of a transmitting/receiving circuit in a short time without burdening a central processing unit. <P>SOLUTION: The semiconductor device includes: changing registers 45, 44 for setting other communication condition data, in addition to communication condition setting registers 42, 44 having initial communication conditions set thereto, and adopts a transmitting/receiving control part 20 storing the values of changing registers in the communication condition setting registers to perform communication by detecting the completion of a transmitting state when the central processing unit 3 gives an instruction to change a communication state from transmission to reception or the like in advance. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、送受信回路における通信条件の設定を変更する技術に関し、例えばICカード用マイクロコンピュータにおけるUART(ユニバーサル・アシンクロナス・レシーバ・トランスミッタ)の通信条件の設定変更に適用して有効な技術に関する。   The present invention relates to a technique for changing the setting of communication conditions in a transmission / reception circuit, for example, a technique effective when applied to changing the setting of communication conditions of a UART (Universal Asynchronous Receiver / Transmitter) in a microcomputer for an IC card.

暗証番号(PIN)によるアクセス制御、暗号処理、秘密鍵保護等のセキュリティー処理を行なうICカード用マイクロコンピュータ(単にICカードマイコンとも記す)は調歩同期方式によるシリアル信号をパラレル信号に変換し且つその逆変換を行う外部インタフェース用の送受信回路として例えばUARTを有するものがある。UARTを備えたICカードについて記載された文献の例として特許文献1がある。   An IC card microcomputer (also simply referred to as an IC card microcomputer) that performs security processing such as access control using a personal identification number (PIN), encryption processing, and secret key protection converts a serial signal in an asynchronous manner into a parallel signal and vice versa. Some external interface transmission / reception circuits that perform conversion include, for example, a UART. Patent Document 1 is an example of a document that describes an IC card having a UART.

ICカードマイコンも処理データ量の増大やデータ処理の高速化が要請されるにしたがって外部インタフェース能力をそれに追従させることが必要になる。そこで、UARTと共に中央処理装置が搭載されたICカードマイコンにおいてはUARTによる転送レートや転送プロトコル等の通信条件をCPUによるレジスタ設定でプログラマブルにするものがある。通信条件を変更する場合、中央処理装置はメモリアクセスによって所要の通信条件データをリードし、リードした通信条件データをUARTのレジスタにロードする処理を、夫々の通信条件設定レジスタに対して行わなければならない。このとき、ICカードとその端末装置との間で通信を確立するのに遅い転送レートで行った後、ICカードが高速対応であれば、端末装置が高速転送への変更をICカードに要求し、ICカードがこれを承認すると、その後端末装置は高速インタフェースを開始してくる。このため、ICカードは高速インタフェース動作の要求に対する承認を端末装置に送信してから、端末装置からの高速インタフェースによる受信が開始されるまでの間に、通信条件を変更するために前記メモリアクセスやレジスタロードを行わなければならない。しかしながら、メモリアクセスやレジスタロードを高速化するには限界があり、その途中でデータが送信されてくると、正常にデータ受信を行うことが出来なくなる虞がある。一方、通信条件を変更してから端末装置に通信条件の承認を与えることも可能であるが、そうすると、前記承認が遅延することによって一旦確立された通信が解除されたり、インタフェース効率が低下する虞がある。   As IC card microcomputers are required to increase the amount of processing data and to speed up data processing, it is necessary to follow the external interface capability accordingly. Therefore, some IC card microcomputers in which a central processing unit is mounted together with UART make communication conditions such as transfer rate and transfer protocol by UART programmable by register setting by CPU. When changing the communication condition, the central processing unit must read the required communication condition data by memory access and load the read communication condition data into the UART register for each communication condition setting register. Don't be. At this time, after establishing a communication between the IC card and the terminal device at a slow transfer rate, if the IC card supports high speed, the terminal device requests the IC card to change to high speed transfer. If the IC card approves this, then the terminal device starts a high-speed interface. For this reason, the IC card transmits the approval for the request for the high-speed interface operation to the terminal device until the reception by the high-speed interface from the terminal device is started. A register load must be performed. However, there is a limit to speeding up memory access and register loading, and if data is transmitted in the middle, there is a possibility that data cannot be received normally. On the other hand, it is possible to give approval of the communication condition to the terminal device after changing the communication condition. However, if the approval is delayed, the established communication may be canceled or the interface efficiency may be reduced. There is.

特開平5−342435号公報Japanese Patent Laid-Open No. 5-342435

本発明の目的は、中央処理装置に負担をかけずに短時間で送受信回路の通信条件を変更することができる半導体装置を提供することにある。   An object of the present invention is to provide a semiconductor device capable of changing communication conditions of a transmission / reception circuit in a short time without imposing a burden on a central processing unit.

本発明の別の目的は、中央処理装置に負担をかけずに短時間でプロセッサ間の通信条件を変更することができるデータ処理システムを提供することにある。   Another object of the present invention is to provide a data processing system capable of changing communication conditions between processors in a short time without placing a burden on a central processing unit.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

すなわち、通信条件が初期設定される通信条件設定レジスタとは別に、別の通信条件データが設定可能にされる変更用レジスタを別に設け、中央処理装置により送信から受信等に通信状態を変更する指示が予め与えられているとき、送信状態の終了を検出することにより変更用レジスタの値を通信条件設定レジスタに格納して、通信を行う送受信制御部を採用する。   That is, in addition to the communication condition setting register in which the communication condition is initially set, a separate register for changing the communication condition data that can be set is provided, and an instruction to change the communication state from transmission to reception by the central processing unit. Is preliminarily given, a transmission / reception control unit for performing communication by storing the value of the change register in the communication condition setting register by detecting the end of the transmission state is employed.

本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば下記のとおりである。   The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、中央処理装置に負担をかけずに短時間で通信条件を変更することができる。   That is, communication conditions can be changed in a short time without imposing a burden on the central processing unit.

1.実施の形態の概要
先ず、本願において開示される発明の代表的な実施の形態について概要を説明する。代表的な実施の形態についての概要説明で括弧を付して参照する図面中の参照符号はそれが付された構成要素の概念に含まれるものを例示するに過ぎない。
1. First, an outline of a typical embodiment of the invention disclosed in the present application will be described. Reference numerals in the drawings that are referred to with parentheses in the outline description of the representative embodiment merely exemplify what is included in the concept of the component to which the reference numeral is attached.

〔1〕半導体装置(1)は、中央処理装置(3)と、前記中央処理装置の設定に従ってシリアル送受信処理が可能な送受信回路(16)とを有する。前記送受信回路は、前記中央処理装置により通信条件が設定される通信条件設定レジスタ(42,44)と、前記中央処理装置による設定データが前記通信条件設定レジスタに転送可能にされる変更用レジスタ(43、45)と、送受信制御部(20)とを有する。送受信制御部は、通信状態の切り換えが指示されているとき、先の通信状態による通信の終了を検出することにより前記変更用レジスタ設定値を前記通信条件レジスタに格納して、通信を実行することが可能とされる。   [1] The semiconductor device (1) includes a central processing unit (3) and a transmission / reception circuit (16) capable of serial transmission / reception processing according to the setting of the central processing unit. The transmission / reception circuit includes a communication condition setting register (42, 44) in which communication conditions are set by the central processing unit, and a change register (in which setting data by the central processing unit can be transferred to the communication condition setting register). 43, 45) and a transmission / reception control unit (20). The transmission / reception control unit stores the change register setting value in the communication condition register by executing the communication by detecting the end of communication due to the previous communication state when switching of the communication state is instructed. Is possible.

通信状態を変更するときに、中央処理装置は予め変更用レジスタに変更用の通信条件を設定しておくことにより、通信状態の切換え指示があると、送受信制御部が先の通信状態の終了に応答してレジスタ間転送を行うことによって通信条件を変更することができる。したがって、通信状態が切換えられるタイミングに同期して中央処理装置が新たな通信条件データをメモリ等からリードし、リードしたデータをレジスタにロードする処理を行なうことを要しない。従って、通信状態の切換えに際して、中央処理装置に負担をかけずに短時間で通信条件を変更することができる。   When changing the communication state, the central processing unit sets a change communication condition in the change register in advance, so that when there is an instruction to switch the communication state, the transmission / reception control unit terminates the previous communication state. The communication condition can be changed by performing inter-register transfer in response. Therefore, it is not necessary for the central processing unit to read new communication condition data from a memory or the like and load the read data into a register in synchronization with the timing at which the communication state is switched. Therefore, when switching the communication state, the communication condition can be changed in a short time without imposing a burden on the central processing unit.

〔2〕項1の半導体装置において、前記中央処理装置が通信条件設定レジスタに設定した通信条件は前記変更用レジスタにも並行して設定される。したがって中央処理装置が変更用レジスタの一部又は全部を書換えなければ、通信状態の切換えがあっても書換えられていない通信条件を後に通信状態にそのまま維持継続させることができる。したがって、通信状態を切換えるとき、通信条件を継続する場合も変更する場合も、変更用レジスタを書換えるか否かが相違するだけ、その他は同じ制御手順を採用すればよい。   [2] In the semiconductor device according to [1], the communication condition set in the communication condition setting register by the central processing unit is set in the change register in parallel. Therefore, if the central processing unit does not rewrite part or all of the change register, the communication condition that has not been rewritten even if the communication state is switched can be maintained and maintained in the communication state later. Therefore, when the communication state is switched, whether the communication condition is continued or changed, the same control procedure may be adopted except for whether or not the change register is rewritten.

〔3〕項1の半導体装置において、前記通信条件設定レジスタは、例えば通信レートを指定するデータが設定される通信レート設定レジスタ(UECR)、及び通信プロトコルを指定するデータが設定される通信プロトコル設定レジスタ(UMR)である。前記変更用レジスタは、例えば設定データが前記通信レート設定レジスタに転送可能にされる第1変更用レジスタ、及び設定データが前記通信プロトコル設定レジスタに転送可能にされる第2変更用レジスタである。   [3] In the semiconductor device of [1], the communication condition setting register includes, for example, a communication rate setting register (UECR) in which data specifying a communication rate is set, and a communication protocol setting in which data specifying a communication protocol is set Register (UMR). The change register is, for example, a first change register that allows setting data to be transferred to the communication rate setting register, and a second change register that enables setting data to be transferred to the communication protocol setting register.

〔4〕項3の半導体装置において、前記送受信制御部は、第1通信状態から第2通信状態に通信状態を切換える指示が前記中央処理装置により制御レジスタに設定されているとき、第1通信状態が終ることに応答して、前記第1変更用レジスタの設定値を前記通信レート設定レジスタに格納し、前記第2変更用レジスタの設定値を前記通信プロトコル設定レジスタに格納して、第2通信状態によるデータ通信を実行可能にする。   [4] In the semiconductor device of [3], the transmission / reception control unit is configured to switch the first communication state when an instruction to switch the communication state from the first communication state to the second communication state is set in the control register by the central processing unit. In response to the end of the communication, the setting value of the first change register is stored in the communication rate setting register, the setting value of the second change register is stored in the communication protocol setting register, and the second communication Enables data communication by status.

〔5〕項4の半導体装置において、例えば前記第1通信状態は送信状態であり、第2通信状態は受信状態である。   [5] In the semiconductor device of [4], for example, the first communication state is a transmission state, and the second communication state is a reception state.

〔6〕項5の半導体装置において前記送受信回路は例えば外部に対して半二重方式のシリアル送受信処理を行なうUARTである。   [6] In the semiconductor device according to [5], the transmission / reception circuit is, for example, a UART that performs serial transmission / reception processing of a half duplex system to the outside.

〔7〕項6の半導体装置において、前記送受信制御部が操作して送信終了を反映する転送エンドフラグ(TEND)を有する。前記送受信制御部は、送信が終ったことを検出してから前記転送エンドフラグに送信終了を反映させるまでの間に、前記第1変更用レジスタの設定値を前記通信レート設定レジスタに格納し、前記第2変更用レジスタの設定値を前記通信プロトコル設定レジスタに格納する処理を行なって、データ受信を待つ。   [7] The semiconductor device according to [6], further including a transfer end flag (TEND) that is operated by the transmission / reception control unit to reflect the end of transmission. The transmission / reception control unit stores the set value of the first change register in the communication rate setting register between the time when transmission is detected and the time when transmission end is reflected in the transfer end flag. Processing for storing the set value of the second change register in the communication protocol setting register is performed, and data reception is awaited.

〔8〕項4の半導体装置において、複数の前記第1変更用レジスタ(UMARa、UMARb)及び複数の第2変更用レジスタ(UEARa、UEARb)を有する。前記送受信制御部は、前記制御レジスタの設定値に従って、前記通信状態の切換え時に前記通信レート設定レジスタ及び通信プロトコル設定レジスタに値を格納する前記第1変更用レジスタ及び第2変更用レジスタを選択する。通信状態切換えに際して採用かのうな新たな通信条件の選択肢が増える。   [8] The semiconductor device according to [4], including a plurality of first change registers (UMARA, UMARb) and a plurality of second change registers (UEARa, UEARb). The transmission / reception control unit selects the first change register and the second change register that store values in the communication rate setting register and the communication protocol setting register when the communication state is switched according to the setting value of the control register. . New communication condition options that can be adopted when switching the communication state are increased.

〔9〕データ処理システムは、第1のデータプロセッサ(52)と、第2のデータプロセッサ(1)と、それらを接続するシリアル信号線(53)とを有する。第2のデータプロセッサは、第1の通信条件で前記第1のデータプロセッサに送信して第1のデータプロセッサからの第1の通信条件による応答に第2の通信条件への変更要求が含まれているとき、それに対する承認を第2の通信条件で第1のデータプロセッサに送信し、それに対する第1のデータプロセッサから第2の通信条件で応答が返されるまでの間に、通信条件を第1の通信条件から第2の通信条件に変更する。シリアル信号線は、第1のデータプロセッサと第2のデータプロセッサとを接続して前記第1の通信条件及び第2の通信条件による通信に用いられる。前記第2のデータプロセッサは、中央処理装置(3)と、前記中央処理装置の設定に従って前記シリアル信号線を介してシリアル送受信処理が可能な送受信回路(16)とを有する。前記送受信回路は、前記中央処理装置により通信条件が設定される通信条件設定レジスタ(42,44)と、前記中央処理装置による設定データが前記通信条件設定レジスタに転送可能にされる変更用レジスタ(43,45)と、送受信制御部(20)とを有する。送受信制御部は送信状態から受信状態への切換えが指示されているとき、送信状態の終了を検出することにより前記変更用レジスタの設定値を前記通信条件設定レジスタに格納して、受信状態に変更可能とする。   [9] The data processing system includes a first data processor (52), a second data processor (1), and a serial signal line (53) connecting them. The second data processor transmits to the first data processor under the first communication condition, and a response to the first communication condition from the first data processor includes a request for changing to the second communication condition. When the communication condition is transmitted to the first data processor with the second communication condition and a response is returned from the first data processor with the second communication condition, the communication condition is The communication condition is changed from the first communication condition to the second communication condition. The serial signal line connects the first data processor and the second data processor and is used for communication under the first communication condition and the second communication condition. The second data processor includes a central processing unit (3) and a transmission / reception circuit (16) capable of serial transmission / reception processing via the serial signal line in accordance with settings of the central processing unit. The transmission / reception circuit includes a communication condition setting register (42, 44) in which communication conditions are set by the central processing unit, and a change register (in which setting data by the central processing unit can be transferred to the communication condition setting register). 43, 45) and a transmission / reception control unit (20). When the transmission / reception control unit is instructed to switch from the transmission state to the reception state, it detects the end of the transmission state, stores the setting value of the change register in the communication condition setting register, and changes to the reception state. Make it possible.

第1データプロセッサから第2データプロセッサに対する通信状態を変更するときに、中央処理装置は予め変更用レジスタに変更用の通信条件を設定しておくことにより、通信状態の切換え指示があると、送受信制御部が先の通信状態の終了に応答してレジスタ間転送を行うことによって通信条件を変更することができる。したがって、通信状態が切換えられるタイミングに同期して中央処理装置が新たな通信条件データをメモリ等からリードし、リードしたデータをレジスタにロードする処理を行なうことを要しない。従って、通信状態の切換えに際して、中央処理装置に負担をかけずに短時間で通信条件を変更することができる。   When changing the communication state from the first data processor to the second data processor, the central processing unit sets a change communication condition in the change register in advance, so that if there is an instruction to switch the communication state, transmission / reception is performed. The communication condition can be changed by the controller performing transfer between registers in response to the end of the previous communication state. Therefore, it is not necessary for the central processing unit to read new communication condition data from a memory or the like and load the read data into a register in synchronization with the timing at which the communication state is switched. Therefore, when switching the communication state, the communication condition can be changed in a short time without imposing a burden on the central processing unit.

〔11〕項10のデータ処理システムにおいて前記第1のデータプロセッサはICカード(51)又はサブスクライブ・アイデンティティ・モジュール・カードに搭載されたICカード用マイクロコンピュータであり、第2のデータプロセッサはICカードが装着されるICカード端末装置(50)又は前記SIMカードが装着される端末装置のプロセッサである。例えばデータ処理システムは携帯電話機等の携帯端末システムに適用される。サブスクライブ・アイデンティティ・モジュール・カードは単にSIM(登録商標)カードとも称される。   [11] In the data processing system according to item 10, the first data processor is an IC card microcomputer mounted on an IC card (51) or a subscribing identity module card, and the second data processor is an IC card. It is an IC card terminal device (50) to which a card is attached or a processor of a terminal device to which the SIM card is attached. For example, the data processing system is applied to a mobile terminal system such as a mobile phone. The subscribe identity module card is also simply referred to as a SIM® card.

2.実施の形態の詳細
実施の形態について更に詳述する。以下、本発明を実施するための最良の形態を図面に基づいて詳細に説明する。なお、発明を実施するための最良の形態を説明するための全図において、同一の機能を有する部材には同一の符号を付し、その繰り返しの説明は省略する。
2. Details of Embodiments Embodiments will be further described in detail. Hereinafter, the best mode for carrying out the present invention will be described in detail with reference to the drawings. Note that members having the same function are denoted by the same reference symbols throughout the drawings for describing the best mode for carrying out the invention, and the repetitive description thereof will be omitted.

《ICカード用マイクロコンピュータ》
図2には本発明に係る半導体装置の一例であるICカード用マイクロコンピュータ(単にICカードマイコンとも称する)のブロック図が示される。同図に示されるICカードマイコン1は、例えば、単結晶シリコンのような1個の半導体基板に相補型MOS集積回路製造技術によって形成される。
<Microcomputer for IC card>
FIG. 2 is a block diagram of an IC card microcomputer (also simply referred to as an IC card microcomputer) which is an example of a semiconductor device according to the present invention. The IC card microcomputer 1 shown in the figure is formed on a single semiconductor substrate such as single crystal silicon by a complementary MOS integrated circuit manufacturing technique.

ICカードマイコン1は、データ入出力端子IO1,IO2、クロック入力端子CLK、リセット端子RES、電源端子Vcc、及びグランド端子Vssを有する。DBUSは内部データバス、ABUSは内部アドレスバスである。入出力回路(IOP)2は1ビットの端子IO1を用いてビットシリアルに外部インタフェースされる。クロック端子CLKに接続するクロックパルスジェネレータ(CPG)5は内部クロックCKを生成する。中央処理装置(CPU)3は内部データバスDBUSに対してパラレルデータを入出力し、内部アドレスバスABUSにアドレス信号を出力する。システムコントローラ(SYSCNT)6はリセット等の内部動作モードを制御する。内部バスDBUS,ABUSには、マスクROM(MROM)10、ランダムアクセスメモリ(RAM)11、不揮発性メモリ(EEPROM)12、タイマ(TMR)13、ランダム番号発生器(RNG)14、擬似乱数発生器(PRNG)15が接続される。その他に、反二重方式のシリアル送受信処理を行う送受信回路としてのUART16、剰余乗算コプロセッサ(MULP)17、CRC(Cyclic Redundancy Code)コードの生成とチェックを行うCRCコプロセッサ(CRCP)18、及び暗号化復号演算を行うDESコプロセッサ(DESP)19が接続される。   The IC card microcomputer 1 has data input / output terminals IO1, IO2, a clock input terminal CLK, a reset terminal RES, a power supply terminal Vcc, and a ground terminal Vss. DBUS is an internal data bus, and ABUS is an internal address bus. The input / output circuit (IOP) 2 is externally interfaced bit-serially using a 1-bit terminal IO1. A clock pulse generator (CPG) 5 connected to the clock terminal CLK generates an internal clock CK. The central processing unit (CPU) 3 inputs / outputs parallel data to / from the internal data bus DBUS and outputs an address signal to the internal address bus ABUS. A system controller (SYSCNT) 6 controls an internal operation mode such as reset. Internal buses DBUS and ABUS include a mask ROM (MROM) 10, a random access memory (RAM) 11, a nonvolatile memory (EEPROM) 12, a timer (TMR) 13, a random number generator (RNG) 14, and a pseudo random number generator. (PRNG) 15 is connected. In addition, a UART 16 as a transmission / reception circuit that performs anti-duplex serial transmission / reception processing, a remainder multiplication coprocessor (MULP) 17, a CRC coprocessor (CRCP) 18 that generates and checks a CRC (Cyclic Redundancy Code) code, and A DES coprocessor (DESP) 19 that performs encryption / decryption calculation is connected.

前記MROM10はCPU3の動作プログラム(暗号化プログラム、復号プログラム、インタフェース制御プログラム等)及びデータを格納するのに利用される。前記RAM11はCPU3のワーク領域又はデータの一時記憶領域とされる。EEPROM12にはセキュリティデータ等の格納に利用される。入出力回路2にICカードコマンドが供給されると、CPU3がこれをデコードし、当該コマンドの実行に必要な処理プログラムをCPU3に実行させる。ICカードマイコン1はリセット信号RESによってリセット動作が指示されると、内部が初期化され、CPU3はMROM10のプログラムの先頭番地から命令実行を開始する。ICカードマイコン1はクロック信号CLKに同期動作される。ICカードマイコン1は電子決済サービスなどに利用可能なISO/IEC15408の評価・認証機関による認証済みであっても、なくてもよい。   The MROM 10 is used to store an operation program (encryption program, decryption program, interface control program, etc.) and data of the CPU 3. The RAM 11 serves as a work area for the CPU 3 or a temporary storage area for data. The EEPROM 12 is used for storing security data and the like. When an IC card command is supplied to the input / output circuit 2, the CPU 3 decodes it and causes the CPU 3 to execute a processing program necessary for executing the command. When a reset operation is instructed by the reset signal RES, the IC card microcomputer 1 is initialized, and the CPU 3 starts executing instructions from the top address of the program in the MROM 10. The IC card microcomputer 1 is operated in synchronization with the clock signal CLK. The IC card microcomputer 1 may or may not be authenticated by an ISO / IEC 15408 evaluation / certification organization that can be used for electronic payment services.

《UART》
図1にはUART16の一例が示される。UART16は通信制御部(COMCNT)20、レジスタ回路(REGC)40、及び同期化回路(SYNC)30,31を備える。通信制御部20は外部クロックCLKに同期動作され、レジスタ回路40は内部クロックCKに同期動作される。同期化回路30,31は通信制御回路20とレジスタ回路40との間のデータのやりとりを同期化する。レジスタ回路4はCPU3のアドレス空間にマッピングされ、データバスDBUSを介してCPU3によるアクセスが可能にされる。
《UART》
FIG. 1 shows an example of the UART 16. The UART 16 includes a communication control unit (COMCNT) 20, a register circuit (REGC) 40, and synchronization circuits (SYNC) 30 and 31. The communication control unit 20 is operated in synchronization with the external clock CLK, and the register circuit 40 is operated in synchronization with the internal clock CK. The synchronization circuits 30 and 31 synchronize data exchange between the communication control circuit 20 and the register circuit 40. The register circuit 4 is mapped to the address space of the CPU 3 and can be accessed by the CPU 3 via the data bus DBUS.

通信制御部20は通信制御ロジック(COMLOG)25、シフトレジスタ(USR)21、CRCレジスタ(UCRC)22、etuパルスジェネレータ(ETUG)23、フラグジェネレータ(FLGG)24を有する。UART16は1ビットの図示を省略する信号線を介してデータ入出力端子IO1にシリアル接続され、半二重方式のシリアル送受信処理を行なう。シフトレジスタ21はデータ入出力端子IO1からのシリアル入力データをシフト入力し、また、データ入出力端子IO1に向けてデータをシフト出力する。CRCレジスタ22はCRCコードのシフト入力とCRCコードをシフト出力に用いられるレジスタである。etu(基本時間単位:Elementary Time Unit)はビットシリアルデータにおける1ビット分の転送時間を意味し、etuパルスジェネレータ23は1etuをCLKの何サイクルとするかを規定する。即ち1etuは1データ(1ビットデータ)の時間をクロック数で示す。フラグジェネレータ24は後述する内部フラグの操作を行う。   The communication control unit 20 includes a communication control logic (COMLOG) 25, a shift register (USR) 21, a CRC register (UCRC) 22, an etu pulse generator (ETUG) 23, and a flag generator (FLGG) 24. The UART 16 is serially connected to the data input / output terminal IO1 via a 1-bit signal line (not shown), and performs half-duplex serial transmission / reception processing. The shift register 21 shifts serial input data from the data input / output terminal IO1, and shifts data out to the data input / output terminal IO1. The CRC register 22 is a register used for the shift input of the CRC code and the shift output of the CRC code. etu (Basic Time Unit) means a transfer time for one bit in bit serial data, and the etu pulse generator 23 defines how many CLK cycles one etu is. That is, 1 etu indicates the time of 1 data (1 bit data) by the number of clocks. The flag generator 24 operates an internal flag described later.

レジスタ回路40はコントロールレジスタ(UCR)41、モードレジスタ(UMR)42、第1オートロードレジスタ(UMAR)43、ETUカウントレジスタ(UECR)44、第2オートロードレジスタ(UEAR)45、ステータスレジスタ(UCSR)46、及びデータレジスタ(UDR)47を有する。   The register circuit 40 includes a control register (UCR) 41, a mode register (UMR) 42, a first autoload register (UMAR) 43, an ETU count register (UECR) 44, a second autoload register (UEAR) 45, and a status register (UCSR). ) 46 and a data register (UDR) 47.

コントロールレジスタ(UCR)41はUAビット、RN_Tビット、T2Rビット及びIEビット等を有する。UAビットはUARTの状態を制御する。0:停止状態、1:動作状態(送受信動作を行える状態)を意味する。RN_TビットはUART16の送信又は受信モードを設定する。0:受信モード、1:送信モードを意味する。T2RビットはT=0プロトコルで送信モードから受信モードへ自動的に切り替える場合に設定される。0:送信モードから受信モードへの自動切り替えオフ、1:送信モードから受信モードへの自動切り替えオンを意味する。IEビットは割り込みイネーブルビットであり、ステータスレジスタ(UCSR)46のステータスフラグTDRE等が0から1にセットされたときのUART割り込み要求を設定する。0:UART割り込み要求を禁止、1:UART割り込み要求を許可する。これによる割込み要求は割込み信号UARTIRQによってCPUに供給される。   The control register (UCR) 41 has a UA bit, an RN_T bit, a T2R bit, an IE bit, and the like. The UA bit controls the state of UART. 0: Stopped state, 1: Operating state (state where transmission / reception operation can be performed). The RN_T bit sets the transmission or reception mode of the UART 16. 0: means reception mode, 1: means transmission mode. The T2R bit is set when the transmission mode is automatically switched to the reception mode with the T = 0 protocol. 0: Automatic switching off from transmission mode to reception mode, 1: Automatic switching on from transmission mode to reception mode. The IE bit is an interrupt enable bit, and sets a UART interrupt request when the status flag TDRE or the like of the status register (UCSR) 46 is set from 0 to 1. 0: Disable UART interrupt request, 1: Enable UART interrupt request. The interrupt request is supplied to the CPU by an interrupt signal UARTIRQ.

モードレジスタ(UMR)42はTビット等を有する。TビットはUART16のデータ転送プロトコルを設定する。0:T=0プロトコル、1:T=1プロトコルを意味する。プロトコルの相違は通信データ形式の相違、パリティーエラーを送信元に返すか否かなどの相違とされる。第1オートロードレジスタ(UMAR)43はT2R=1の設定によって送信モードから受信モードに自動で切換えられるとき、モードレジスタ(UMR)42の値が自動的にロードされるレジスタである。   The mode register (UMR) 42 has T bits and the like. The T bit sets the UART 16 data transfer protocol. 0: T = 0 protocol, 1: T = 1 protocol. Differences in protocol include differences in communication data format, whether or not a parity error is returned to the transmission source, and the like. The first autoload register (UMAR) 43 is a register in which the value of the mode register (UMR) 42 is automatically loaded when the transmission mode is automatically switched to the reception mode by setting T2R = 1.

ETUカウントレジスタ(UECR)44は1etuに相当する外部クロックCLKのクロック数、即ち転送レートが設定されるレジスタである。第2オートロードレジスタ(UEAR)45はT2R=1の設定によって送信モードから受信モードに自動で切換えられるとき、ETUカウントレジスタ(UECR)44の値が自動的にロードされるレジスタである。   An ETU count register (UECR) 44 is a register in which the number of external clocks CLK corresponding to 1 etu, that is, a transfer rate is set. The second autoload register (UEAR) 45 is a register in which the value of the ETU count register (UECR) 44 is automatically loaded when the transmission mode is automatically switched to the reception mode by setting T2R = 1.

データレジスタ(UDR)47はUART16が受信モードに設定されているときデータ入出力端子IO1から受信したシリアルデータを格納する。UART16は1バイトのシリアルデータの受信が終了するとシフトレジスタ(USR)21からUDR47へ受信したシリアルデータを転送して格納し、受信動作を完了する。この後、USR21は受信可能になる。このように、USR21とUDR47はダブルバッファになっているため連続した受信動作が可能とされる。また、UDR47はUART16が受信モードに設定されているときにはリード専用レジスタになるのでCPU3からライトすることはできない。データレジスタUDR47は、UART16が送信モードに設定されているときにはデータ入出力端子IO1からシリアル送信するデータを格納する8ビットのレジスタとされる。UART16はシフトレジスタ(USR)の空(エンプティ)を検出すると、UDR47に書き込まれた送信データをUSR21に転送してシリアル送信を開始する。USR21のシリアルデータ送信中にUDR47に次の送信データを書き込んでおくと、連続シリアル送信ができる。UDR47はUART16が送信モードに設定されているときには常にCPU3によるリード/ライト可能とされる。   The data register (UDR) 47 stores serial data received from the data input / output terminal IO1 when the UART 16 is set to the reception mode. When the reception of 1-byte serial data is completed, the UART 16 transfers and stores the received serial data from the shift register (USR) 21 to the UDR 47, and completes the receiving operation. Thereafter, the USR 21 can be received. Thus, since the USR 21 and the UDR 47 are double buffers, continuous reception operations are possible. Further, the UDR 47 becomes a read-only register when the UART 16 is set to the reception mode, and therefore cannot be written from the CPU 3. The data register UDR47 is an 8-bit register for storing data to be serially transmitted from the data input / output terminal IO1 when the UART 16 is set to the transmission mode. When the UART 16 detects that the shift register (USR) is empty, the transmission data written in the UDR 47 is transferred to the USR 21 to start serial transmission. If the next transmission data is written in the UDR 47 during serial data transmission of the USR 21, continuous serial transmission can be performed. The UDR 47 can always be read / written by the CPU 3 when the UART 16 is set to the transmission mode.

ステータスレジスタ(UCSR)46はTDREビット及びTENDビット等を有する。TDRE(トランスミットデータレジスタエンプティ)ビットは送信モード時、UARTデータレジスタ(UDR)47からUART16のシフトレジスタ(USR)21にデータ転送が行われUDRに次のシリアル送信データを書き込むことが可能になったことを示す。0:UDR47に有効な送信データが書き込まれていることを示す。1:UDR47に有効な送信データがないことを示す。TEND(トランスミットエンド)ビットはUART16が送信モードで送信キャラクタの最後尾ビットの送信時にUDR47に有効なデータがなく、送信を終了したことを示す。TENDビットは読み出し専用のフラグであり、COMCNT20が操作する。0:送信中であることを示す。1:送信を終了したことを示す。   The status register (UCSR) 46 has a TDRE bit, a TEND bit, and the like. In the transmission mode, the TDRE (Transmit Data Register Empty) bit is transferred from the UART data register (UDR) 47 to the shift register (USR) 21 of the UART 16 so that the next serial transmission data can be written to the UDR. It shows that. 0: Indicates that valid transmission data is written in the UDR 47. 1: Indicates that there is no valid transmission data in UDR 47. The TEND (Transmit End) bit indicates that there is no valid data in the UDR 47 when the last bit of the transmission character is transmitted in the transmission mode in the UART 16, and the transmission is terminated. The TEND bit is a read-only flag and is operated by the COMCNT 20. 0: Indicates that transmission is in progress. 1: Indicates that transmission has ended.

《送信モードから受信モードへの自動切換え》
以下、UART16における送信モードから受信モードへの自動切換えについて詳述する。FLGG24によるフラグ操作対象を除いてレジスタ回路40のレジスタはCPU3によって初期設定可にされる。転送レートが設定されるUECR44、および転送モードが設定されるUMR42がCPU3によって初期設定されるとき、レジスタ回路40はUECR44に設定されるデータをUEAR45にもセットし、UMR42に設定されるデータをUMAR43にもセットする。CPU3はその初期化制御プログラム等に従い必要に応じてUEAR45,UMAR43を個別の初期設定可能である。送信モードから受信モードへの自動切換えに際して転送レート又は/及び転送モードを変更することが必要な場合には、UEAR45にはCPU3が転送レート変更用のデータをロードし、UMAR43にはCPU3が転送モード変更用のデータをロードする。UEAR45,UMAR43に対する書き換えが行われていなければ、送信モードから受信モードへの自動切換えにおいて転送モードと転送レートは変更されない。前述のように送信モードから受信モードへの自動切換えは、T=0,T2R=1によって指示される。
<Automatic switching from transmission mode to reception mode>
Hereinafter, automatic switching from the transmission mode to the reception mode in the UART 16 will be described in detail. The registers of the register circuit 40 are initialized by the CPU 3 except for the flag operation target by the FLGG 24. When the CPU 3 initializes the UECR 44 in which the transfer rate is set and the UMR 42 in which the transfer mode is set, the register circuit 40 also sets the data set in the UECR 44 in the UEAR 45 and the data set in the UMR 42 Also set to. The CPU 3 can individually initialize the UEAR 45 and the UMAR 43 as necessary according to the initialization control program or the like. When it is necessary to change the transfer rate or / and transfer mode at the time of automatic switching from the transmission mode to the reception mode, the CPU 3 loads data for changing the transfer rate into the UEAR 45, and the CPU 3 transfers the transfer mode to the UMA 43. Load data for change. If the UEAR 45 and the UMAR 43 are not rewritten, the transfer mode and the transfer rate are not changed in the automatic switching from the transmission mode to the reception mode. As described above, the automatic switching from the transmission mode to the reception mode is instructed by T = 0 and T2R = 1.

図3には送信モードから受信モードへの自動切換えの動作タイミングが例示される。T=0,T2R=1が設定されていて、送信モードにおける転送レートは32CLK/etuとされる。UMR42には値T=0、UMAR43には値T=1、UECR44には値32CLK/etu、UEAR45には値16CLK/etが初期設定されている。送信動作において、COMLOG25は、UDR47に次の送信データが無く、USR21から最後のビットがシリアル出力されることによって送信動作が終ったことを検出すると、UMAR43の設定値をUMR42にロードし、UEAR45の設定値をUECR44にロードして、通信モードをT=1、通信レートを16CLK/etuに変更して、データ受信可能な受信状態に移行して、データの受信を待つ。   FIG. 3 illustrates the operation timing of automatic switching from the transmission mode to the reception mode. T = 0 and T2R = 1 are set, and the transfer rate in the transmission mode is 32 CLK / etu. The value T = 0 is set in the UMR 42, the value T = 1 in the UMA 43, the value 32CLK / etu is set in the UECR 44, and the value 16CLK / et is set in the UEAR 45. In the transmission operation, when the COMLOG 25 detects that there is no next transmission data in the UDR 47 and the last bit is serially output from the USR 21, the COMLOG 25 loads the setting value of the UMA 43 into the UMR 42, and the UEAR 45 The setting value is loaded into the UECR 44, the communication mode is changed to T = 1, the communication rate is changed to 16CLK / etu, the state is changed to a reception state where data can be received, and the reception of data is waited.

図4にはICカード用マイコン1を適用したデータ処理システムが例示される。同図に示されるデータ処理システムは例えばICカードシステムであり、カード端末装置50とICカード51が例示される。カード端末装置50はICカードのリード・ライト制御のためのプロセッサ52を備える。ICカード50はICカードマイコン1を備え、UART16がシリアル伝送線53を介してプロセッサ52のUART54に接続される。ICカードマイコン1はICカードの利用に際して必要な認証処理や秘匿データに対するセキュリティ処理に利用される。   FIG. 4 illustrates a data processing system to which the IC card microcomputer 1 is applied. The data processing system shown in the figure is an IC card system, for example, and a card terminal device 50 and an IC card 51 are exemplified. The card terminal device 50 includes a processor 52 for IC card read / write control. The IC card 50 includes the IC card microcomputer 1, and the UART 16 is connected to the UART 54 of the processor 52 via the serial transmission line 53. The IC card microcomputer 1 is used for authentication processing necessary for using the IC card and security processing for confidential data.

図5にはICカードとカード端末装置との間で通信を確立するときのフローチャートが例示される。カード端末装置にICカードが装着されてICカードがリセットされると、ICカードはカード端末装置にART(Answer To Reset)によって通信プロトコルや転送レートの情報を返す(S1)。例えばこの時の通信レートはICカード規格の最低である9600bpsとされる。カード端末装置は受取ったARTに基づいてICカードの通信能力を判定し、通信可能な最大転送レートへの変更をICカードに返す(S2)。例えば9600bpsから384Kbpsへの変更が要求される。ICカードがその変更要求への応答をATRでカード端末装置に返すと(S3)、それ以降は、カード端末装置から384Kbpsの転送レートでコマンドやデータが転送されてくる(S4)。ここで、ICカードマイコン1は処理S3でATRを返してからカード端末装置が新たなコマンドを送信してくるまでに、要するに、ATRを送信する送信状態からS4のコマンドやデータを受ける受信状態への切換えに際して、UART16の転送レートを変更しなければならない。このとき、ICカードは、前述のようにUMAR43,UEAR45に変更用のデータを予め格納しておき、S3の処理に際してT2R=1を設定しておけば、UART16はS3によるATRの送信終に応答してUMAR43,UEAR45の設定値をUMR42,UECR44にロードしレジスタ間転送処理を自立的に行ない、その間、CPU3には一切負担がかからない。従ってICカードマイコン1はS3の終了検出後、レジスタ間転送によって転送レートを変更して、S4によるコマンド及びデータの受信待ち状態(一つの受信状態)に即座に移行することができる。図6の動作フローチャートに例示されるように送信状態から受信状態に移行するのにCPU3によるメモリリードとレジスタロードの動作を要しない。斯様に、送信状態から受信状態への遷移に時間がかからず、しかもCPU3に負担を変えなくても済む。例えばUMAR43及びUEAR45がなければ、受信状態から送信状態への変更に際して、CPU3は、図7の動作フローに例示されるように、変更データをメモリからリードし、リードしたデータをUMR42,UECR44にロードするアクセス処理を行わなければならず、その間、通信動作は途切れることになる。   FIG. 5 illustrates a flowchart for establishing communication between the IC card and the card terminal device. When the IC card is mounted on the card terminal device and the IC card is reset, the IC card returns information on the communication protocol and transfer rate to the card terminal device by ART (Answer To Reset) (S1). For example, the communication rate at this time is 9600 bps which is the minimum of the IC card standard. The card terminal device determines the communication capability of the IC card based on the received ART, and returns the change to the maximum transfer rate at which communication is possible to the IC card (S2). For example, a change from 9600 bps to 384 Kbps is required. When the IC card returns a response to the change request to the card terminal apparatus by ATR (S3), thereafter, commands and data are transferred from the card terminal apparatus at a transfer rate of 384 Kbps (S4). Here, from the time when the IC card microcomputer 1 returns ATR in step S3 to the time when the card terminal device transmits a new command, in short, from the transmission state in which the ATR is transmitted to the reception state in which the command and data in S4 are received. At the time of switching, the transfer rate of the UART 16 must be changed. At this time, as described above, the IC card stores the data for change in the UMAR 43 and the UEAR 45 in advance, and if T2R = 1 is set in the process of S3, the UART 16 responds to the end of transmission of the ATR by S3. Then, the set values of UMAR 43 and UEAR 45 are loaded into the UMR 42 and UECR 44 and the inter-register transfer process is performed autonomously, and during that time, the CPU 3 is not burdened at all. Therefore, after detecting the end of S3, the IC card microcomputer 1 can change the transfer rate by inter-register transfer and immediately shift to the command and data reception waiting state (one reception state) by S4. As illustrated in the operation flowchart of FIG. 6, the CPU 3 does not need to perform memory read and register load operations to shift from the transmission state to the reception state. In this way, the transition from the transmission state to the reception state does not take time, and the burden on the CPU 3 does not have to be changed. For example, if there is no UMAL 43 and UEAR 45, when changing from the reception state to the transmission state, the CPU 3 reads the change data from the memory and loads the read data into the UMR 42 and UECR 44 as illustrated in the operation flow of FIG. Access processing must be performed, and the communication operation is interrupted during that time.

図8及び図9には送信モードから受信モードへの自動切り替え機能(UCRT2R=1時)を使用するときのUART16の処理フローが詳細に例示される。T2Rモードを開始するには先ず、CPU3はUCR41のUAビット、RN_Tビットを夫々0にクリアしてUART16を停止状態、受信モードに設定する(T1)。CPU3はUECR44に1etuのクック数を設定して転送レートの初期値を決める(T2)。個の初期値はUEAR45にもセットされる。送信状態から受信状態に変更されるときUECR44を自動変更する場合にはUEAR45に変更データを設定する(T4)。変更しない場合はUEAR45の値はUECR44の値と同じ値を維持する。次に、UCR41,UMR42に送受信モードを設定し(T5)、送信状態から受信状態に変更されるときUMR42を自動変更する場合にはUMAR43に変更データを設定する(T7)。変更しない場合はUMAR43の値はUMR42の値と同じ値を維持する。その後、CPU3はUCR41に対し、UA=1、RN_T=1、T2R=1を設定する(T8)。これにより、UART16は動作可能にされ、送信モードが設定され、送信終了後は受信モードへの自動切換え動作が指示される。これによって図9のT2Rによる送信モードが開始される。   8 and 9 illustrate in detail the processing flow of the UART 16 when the automatic switching function from the transmission mode to the reception mode (UCRT2R = 1) is used. To start the T2R mode, the CPU 3 first clears the UA bit and the RN_T bit of the UCR 41 to 0, and sets the UART 16 to the stop state and the reception mode (T1). The CPU 3 sets the number of 1 etu cooks in the UECR 44 and determines the initial value of the transfer rate (T2). Initial values are also set in the UEAR 45. When the UECR 44 is automatically changed when the transmission state is changed to the reception state, change data is set in the UEAR 45 (T4). If not changed, the value of UEAR 45 remains the same as the value of UECR 44. Next, the transmission / reception mode is set in the UCR 41 and the UMR 42 (T5). When the UMR 42 is automatically changed when the transmission state is changed to the reception state, change data is set in the UMA 43 (T7). If not changed, the value of UMAR 43 remains the same as the value of UMR 42. Thereafter, the CPU 3 sets UA = 1, RN_T = 1, and T2R = 1 for the UCR 41 (T8). As a result, the UART 16 becomes operable, the transmission mode is set, and an automatic switching operation to the reception mode is instructed after the transmission is completed. As a result, the transmission mode by T2R in FIG. 9 is started.

図9の送信モードでは、UCSR46のTDREフラグにより、UDR47に送信データが無いことを確認後、UDR47に送信データをライトしてUCSR46のTDREフラグを0にクリアする。これによって、送信中のデータ送信終了後にUDR47にライトされたデータがUSR21にライトされ、次の送信動作を開始する。この動作が全データ送信まで繰り返される(T9〜T12)。最後のデータ送信時は、送信中であることを示すUCSR46のTENDフラグをリードし、送信終了までポーリングする。T2Rモードでは例えば送信データのスタートビットから11.5etu前後で送信から受信に切換わるとすると、TENDフラグはUART16が受信状態に切換わった状態で0から1に変化されるようになる(T13,T14)。要するに、TENDフラグが0から1に変化されるまでの間に、図3に例示されるように、UMAR43の値をUMR42に、UEAR45の値をUECR44に転送する動作が完了される。UART16が受信モードに切換わった後は、CPU3がスリープ命令を実行し、ICカードマイコン1はスリープモードの状態で受信データのスタートビットの入力を待つ。スリープ状態でスタートビットを検出すると、ICカードマイコン1はUART16のもみ動作状態に復帰しCPU3等はスリープ状態を維持する。動作状態に復帰したUART16は受信動作を開始する。データ受信後にCPU3を復帰させるには、CPU3によるスリープ命令実行前にUCR41のIEビットに1を設定し、受信終了後にUART割込みがCPU3に発行されるようにすればよい(T4,T15)。   In the transmission mode of FIG. 9, after confirming that there is no transmission data in the UDR 47 by the TDRE flag of the USR 46, the transmission data is written to the UDR 47 and the TDRE flag of the USR 46 is cleared to zero. As a result, the data written to the UDR 47 after the end of data transmission during transmission is written to the USR 21, and the next transmission operation is started. This operation is repeated until all data is transmitted (T9 to T12). At the time of the last data transmission, the TEND flag of the UCSR 46 indicating that transmission is in progress is read and polling is performed until the transmission is completed. In the T2R mode, for example, if switching from transmission to reception is performed around 11.5 etu from the start bit of the transmission data, the TEND flag is changed from 0 to 1 in a state where the UART 16 is switched to the reception state (T13, T14). In short, until the TEND flag is changed from 0 to 1, the operation of transferring the value of UMAR 43 to UMR 42 and the value of UEAR 45 to UECR 44 is completed as illustrated in FIG. After the UART 16 is switched to the reception mode, the CPU 3 executes a sleep command, and the IC card microcomputer 1 waits for input of a start bit of reception data in the sleep mode. When the start bit is detected in the sleep state, the IC card microcomputer 1 returns to the scrubbing operation state of the UART 16, and the CPU 3 and the like maintain the sleep state. The UART 16 that has returned to the operating state starts the receiving operation. To restore the CPU 3 after receiving data, the IE bit of the UCR 41 is set to 1 before executing the sleep command by the CPU 3, and a UART interrupt is issued to the CPU 3 after the reception is completed (T4, T15).

図10には専らUMR42,UECR44とUMAR43,UEAR45との接続関係が例示される。UMAR43,UEAR45は夫々データバスDBUS経由でCPU3によりアクセスされ、UMR42,UECR44はセレクタ(SEL)60,61を介してデータバスDBUS又はUMAR43,UEAR45の出力に接続される。UMAR43,UEAR45からUMR42,UECR44への転送はCOMLOG25の制御に基づいてセレクタ60,61を経由して行われる。セレクタ60,61によるデータバスDBUSとレジスタUMR42,UMAR43,UECR45,UEAR44との選択はCPU3が実行する命令に基づいて制御されることになる。   FIG. 10 illustrates the connection relationship between UMR 42 and UECR 44, UMAL 43 and UEAR 45 exclusively. The UMAL 43 and UEAR 45 are respectively accessed by the CPU 3 via the data bus DBUS, and the UMR 42 and UECR 44 are connected to the outputs of the data bus DBUS or UMAL 43 and UEAR 45 via selectors (SEL) 60 and 61. Transfer from the UMAL 43 and UEAR 45 to the UMR 42 and UECR 44 is performed via the selectors 60 and 61 based on the control of the COMLOG 25. Selection of the data bus DBUS and the registers UMR42, UMAL43, UECR45, and UEAR44 by the selectors 60 and 61 is controlled based on an instruction executed by the CPU 3.

図11にはUMARをUMARa43AとUMARb43Bで構成し、UEARをUEARa45AとUEARb45Bで構成した場合の例が示される。UMR42はセレクタ(SEL)62を介してデータバスDBUS、UMARa43A又はUMARb43Bに接続可能にされ、UECRはセレクタ(SEL)63を介してデータバスDBUS、UEARa45A又はUEARb45Bに接続可能にされる。通信状態の切換えに際して選択可能な転送レート及び転送プロトコルの選択肢が増える。セレクタ62にUMARa43A又はUMARb43Bの何れを選択させるか、セレクタ63にUEARa45A又はUEARb45Bの何れを選択させるかの指示にはUCR41の特定ビットを用いればよい。選択タイミングはCOMLOG25が制御する。セレクタ62,63によるデータバスDBUSとレジスタUMR42,UMARa43A,UMARb43B,UECR44,UEARa45A,UEARb45Bとの選択はCPU3が実行する命令に基づいて制御されることになる。尚、図10及び図11においてその他の構成は図示を省略してあるが、実際には図2に例示するその他の回路構成を備えていることは言うまでもない。   FIG. 11 shows an example in which UMA is composed of UMARa 43A and UMALb 43B, and UEAR is composed of UEARa 45A and UEARb 45B. The UMR 42 can be connected to the data bus DBUS, UMARa 43A or UMARb 43B via the selector (SEL) 62, and the UECR can be connected to the data bus DBUS, UUERa 45A or UEARb 45B via the selector (SEL) 63. There are more choices of transfer rate and transfer protocol that can be selected when switching the communication state. A specific bit of the UCR 41 may be used to instruct the selector 62 to select UMARa 43A or UMARb 43B, and the selector 63 to select UEARa 45A or UEARb 45B. The selection timing is controlled by the COMLOG 25. Selection of the data bus DBUS and the registers UMR42, UMARa43A, UMARb43B, UECR44, UEARa45A, and UEARb45B by the selectors 62 and 63 is controlled based on an instruction executed by the CPU 3. 10 and FIG. 11, illustration of other configurations is omitted, but it goes without saying that other circuit configurations illustrated in FIG. 2 are actually provided.

以上本発明者によってなされた発明を実施形態に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   Although the invention made by the present inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited thereto and can be variously modified without departing from the gist thereof.

例えば半導体装置はICカードマイコンに限定されず、セキュリティ機能を備えていないマイクロコンピュータ、アクセラレータ、システムオンチップと称されるインテリジェント機能を供えた大規模集積回路等に広く適用することができる。マイクロコンピュータが有する回路モジュールが図2に限定されない。調歩同期方式による送受信回路はクロック同期による送受信機能を併せて備えてもよい。送受信回路はUARTに限定されない。UARTのレジスタ構成は図1に限定されず適宜変更可能である。ICカードはSIMカードなどであってもよい。SIMカードのカード端末装置は携帯電話機に代表される携帯端末装置が該当する。   For example, the semiconductor device is not limited to an IC card microcomputer, and can be widely applied to a microcomputer having no security function, an accelerator, a large-scale integrated circuit having an intelligent function called a system-on-chip, and the like. The circuit module included in the microcomputer is not limited to FIG. The start / reception system transmission / reception circuit may be provided with a clock synchronization transmission / reception function. The transmission / reception circuit is not limited to UART. The register configuration of the UART is not limited to that shown in FIG. The IC card may be a SIM card or the like. A SIM card card terminal device corresponds to a mobile terminal device represented by a mobile phone.

図1はUARTの一例を示すブロック図である。FIG. 1 is a block diagram showing an example of a UART. 図2は本発明に係る半導体装置の一例であるICカード用マイクロコンピュータのブロック図である。FIG. 2 is a block diagram of an IC card microcomputer as an example of a semiconductor device according to the present invention. 図3は送信モードから受信モードへの自動切換えの動作タイミングを例示するタイミングチャートである。FIG. 3 is a timing chart illustrating the operation timing of automatic switching from the transmission mode to the reception mode. 図4はICカード用マイコンを適用したデータ処理システムを例示するブロック図である。FIG. 4 is a block diagram illustrating a data processing system to which an IC card microcomputer is applied. 図5はICカードとカード端末装置との間で通信を確立するときの動作を示すフローチャートである。FIG. 5 is a flowchart showing an operation when establishing communication between the IC card and the card terminal device. 図6は送信状態から受信状態へ自動切換えを行う場合のフローチャートである。FIG. 6 is a flowchart in the case of performing automatic switching from the transmission state to the reception state. 図7はUMAR,UEARを持たない場合に送信状態から受信状態に切換えを行う場合のフローチャートである。FIG. 7 is a flowchart in the case of switching from the transmission state to the reception state when there is no UMAR or UEAR. 図8は送信モードから受信モードへの自動切り替え機能(UCRT2R=1時)を使用するときのT2Rモードを開始するときのフローチャートである。FIG. 8 is a flowchart for starting the T2R mode when the automatic switching function from the transmission mode to the reception mode (UCRT2R = 1) is used. 図9はT2Rによる送信モードのフローチャートである。FIG. 9 is a flowchart of a transmission mode by T2R. 図10はUMR,UECRとUMAR,UEARとの接続関係を専ら例示するブロック図である。FIG. 10 is a block diagram exclusively illustrating the connection relationship between UMR and UECR and UMAL and UEAR. 図11はUMARとUEARを複数組み設けた場合を例示するブロック図である。FIG. 11 is a block diagram illustrating a case where a plurality of sets of UMAR and UEAR are provided.

符号の説明Explanation of symbols

1 ICカード用マイクロコンピュータ(ICカードマイコン)
IO1,IO2 データ入出力端子
CLK クロック入力端子
RES リセット端子
内部データバス DBUS
5 クロックパルスジェネレータ(CPG)
3 中央処理装置(CPU)
6 システムコントローラ(SYSCNT)
10 マスクROM(MROM)
11 ランダムアクセスメモリ(RAM)
12 不揮発性メモリ(EEPROM)
13 タイマ(TMR)
16 UART
20 通信制御部(COMCNT)
40 レジスタ回路(REGC)
30,31 同期化回路(SYNC)
25 通信制御ロジック(COMLOG)
21 シフトレジスタ(USR)
22 CRCレジスタ(UCRC)22
23 etuパルスジェネレータ(ETUG)
24 フラグジェネレータ(FLGG)
41 コントロールレジスタ(UCR)
42 モードレジスタ(UMR)
43 第1オートロードレジスタ(UMAR)
44 ETUカウントレジスタ(UECR)
45 第2オートロードレジスタ(UEAR)
46 ステータスレジスタ(UCSR)
47 データレジスタ(UDR)
50 カード端末装置
51 ICカード
52 プロセッサ
43A UMARa
43B UMARb
45A UEARa
45B UEARb
1 IC card microcomputer (IC card microcomputer)
IO1, IO2 Data input / output terminal CLK Clock input terminal RES Reset terminal Internal data bus DBUS
5 Clock pulse generator (CPG)
3 Central processing unit (CPU)
6 System controller (SYSCNT)
10 Mask ROM (MROM)
11 Random access memory (RAM)
12 Nonvolatile memory (EEPROM)
13 Timer (TMR)
16 UART
20 Communication control unit (COMCNT)
40 register circuit (REGC)
30, 31 Synchronization circuit (SYNC)
25 Communication control logic (COMLOG)
21 Shift register (USR)
22 CRC register (UCRC) 22
23 etu pulse generator (ETUG)
24 Flag Generator (FLGG)
41 Control register (UCR)
42 Mode register (UMR)
43 First autoload register (UMAR)
44 ETU count register (UECR)
45 Second autoload register (UEAR)
46 Status register (UCSR)
47 Data register (UDR)
50 card terminal device 51 IC card 52 processor 43A UMARa
43B UMALb
45A UEARa
45B UEARb

Claims (10)

中央処理装置と、前記中央処理装置の設定に従ってシリアル送受信処理が可能な送受信回路とを有し、
前記送受信回路は、前記中央処理装置により通信条件が設定される通信条件設定レジスタと、
前記中央処理装置による設定データが前記通信条件設定レジスタに転送可能にされる変更用レジスタと、
通信状態の切り換えが指示されているとき、先の通信状態による通信の終了を検出することにより前記変更用レジスタ設定値を前記通信条件レジスタに格納して、通信を実行することが可能な送受信制御部と、を有する半導体装置。
A central processing unit, and a transmission / reception circuit capable of serial transmission / reception processing according to the setting of the central processing unit,
The transmission / reception circuit includes a communication condition setting register in which communication conditions are set by the central processing unit;
A change register that enables the setting data by the central processing unit to be transferred to the communication condition setting register;
Transmission / reception control capable of executing communication by storing the change register setting value in the communication condition register by detecting the end of communication due to the previous communication state when switching of the communication state is instructed A semiconductor device.
前記中央処理装置が通信条件設定レジスタに設定した通信条件は前記変更用レジスタにも並行して設定される、請求項1記載の半導体装置。   The semiconductor device according to claim 1, wherein the communication condition set in the communication condition setting register by the central processing unit is set in parallel to the change register. 前記通信条件設定レジスタは、通信レートを指定するデータが設定される通信レート設定レジスタ、及び通信プロトコルを指定するデータが設定される通信プロトコル設定レジスタであり、
前記変更用レジスタは、設定データが前記通信レート設定レジスタに転送可能にされる第1変更用レジスタ、及び設定データが前記通信プロトコル設定レジスタに転送可能にされる第2変更用レジスタである、請求項1記載の半導体装置。
The communication condition setting register is a communication rate setting register in which data specifying a communication rate is set, and a communication protocol setting register in which data specifying a communication protocol is set,
The change register is a first change register in which setting data can be transferred to the communication rate setting register, and a second change register in which setting data can be transferred to the communication protocol setting register. Item 14. A semiconductor device according to Item 1.
前記送受信制御部は、第1通信状態から第2通信状態に通信状態を切換える指示が前記中央処理装置により制御レジスタに設定されているとき、第1通信状態が終ることに応答して、前記第1変更用レジスタの設定値を前記通信レート設定レジスタに格納し、前記第2変更用レジスタの設定値を前記通信プロトコル設定レジスタに格納して、第2通信状態によるデータ通信を実行可能にする、請求項3記載の半導体装置。   The transmission / reception control unit responds to the end of the first communication state when an instruction to switch the communication state from the first communication state to the second communication state is set in the control register by the central processing unit. Storing a setting value of one change register in the communication rate setting register and storing a setting value of the second change register in the communication protocol setting register to enable execution of data communication in a second communication state; The semiconductor device according to claim 3. 前記第1通信状態は送信状態であり、第2通信状態は受信状態である、請求項4記載の半導体装置。   The semiconductor device according to claim 4, wherein the first communication state is a transmission state, and the second communication state is a reception state. 前記送受信回路は外部に対して半二重方式のシリアル送受信処理を行なうUARTである、請求項5記載の半導体装置。   6. The semiconductor device according to claim 5, wherein the transmission / reception circuit is a UART that performs a half-duplex serial transmission / reception process to the outside. 前記送受信制御部が操作して送信終了を反映する転送エンドフラグを有し、
前記送受信制御部は、送信が終ったことを検出してから前記転送エンドフラグに送信終了を反映させるまでの間に、前記第1変更用レジスタの設定値を前記通信レート設定レジスタに格納し、前記第2変更用レジスタの設定値を前記通信プロトコル設定レジスタに格納する処理を行なって、データ受信を待つ、請求項6記載の半導体装置。
The transmission / reception control unit has a transfer end flag that is operated to reflect the end of transmission,
The transmission / reception control unit stores the set value of the first change register in the communication rate setting register between the time when transmission is detected and the time when transmission end is reflected in the transfer end flag. The semiconductor device according to claim 6, wherein a process of storing a setting value of the second change register in the communication protocol setting register is performed and data reception is waited.
前記第1変更用レジスタ及び第2変更用レジスタを複数組有し、
前記送受信制御部は、前記制御レジスタの設定値に従って、前記通信状態の切換え時に前記通信レート設定レジスタ及び通信プロトコル設定レジスタに値を格納する前記第1変更用レジスタ及び第2変更用レジスタを選択する、請求項4記載の半導体装置。
A plurality of sets of the first change register and the second change register;
The transmission / reception control unit selects the first change register and the second change register that store values in the communication rate setting register and the communication protocol setting register when the communication state is switched according to the setting value of the control register. The semiconductor device according to claim 4.
第1のデータプロセッサと、
第1の通信条件で前記第1のデータプロセッサに送信して第1のデータプロセッサからの第1の通信条件による応答に第2の通信条件への変更要求が含まれているとき、それに対する承認を第2の通信条件で第1のデータプロセッサに送信し、それに対する第1のデータプロセから第2の通信条件で応答が返されるまでの間に、通信条件を第1の通信条件から第2の通信条件に変更する第2のデータプロセッサと、
第1のデータプロセッサと第2のデータプロセッサと接続して前記第1の通信条件及び第2の通信条件による通信のためのシリアル信号線とを有するデータ処理システムであって、
前記第2のデータプロセッサは、中央処理装置と、前記中央処理装置の設定に従って前記シリアル信号線を介してシリアル送受信処理が可能な送受信回路とを有し、
前記送受信回路は、前記中央処理装置により通信条件が設定される通信条件設定レジスタと、
前記中央処理装置による設定データが前記通信条件設定レジスタに転送可能にされる変更用レジスタと、
送信状態から受信状態への切換えが指示されているとき、送信状態の終了を検出することにより前記変更用レジスタの設定値を前記通信条件設定レジスタに格納して、受信状態に変更可能な送受信制御部と、を有するデータ処理システム。
A first data processor;
When a request to change to the second communication condition is included in the response to the first data processor sent from the first data processor under the first communication condition, the approval for the change Is transmitted to the first data processor under the second communication condition and the response is returned from the first communication condition to the second data condition until a response is returned from the first data processor to the first data processor. A second data processor that changes to the communication conditions of
A data processing system having a serial signal line connected to a first data processor and a second data processor for communication according to the first communication condition and the second communication condition,
The second data processor has a central processing unit and a transmission / reception circuit capable of serial transmission / reception processing via the serial signal line according to the setting of the central processing unit,
The transmission / reception circuit includes a communication condition setting register in which communication conditions are set by the central processing unit;
A change register that enables the setting data by the central processing unit to be transferred to the communication condition setting register;
When switching from the transmission state to the reception state is instructed, by detecting the end of the transmission state, the setting value of the change register is stored in the communication condition setting register, and transmission / reception control that can be changed to the reception state A data processing system.
前記第1のデータプロセッサはICカードに搭載されたICカード用マイクロコンピュータであり、第2のデータプロセッサは前記ICカードが装着されるICカード端末装置のプロセッサである、請求項10記載のデータ処理システム。   11. The data processing according to claim 10, wherein the first data processor is an IC card microcomputer mounted on an IC card, and the second data processor is a processor of an IC card terminal device to which the IC card is mounted. system.
JP2007282762A 2007-10-31 2007-10-31 Semiconductor device and data processing system Expired - Fee Related JP5179834B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007282762A JP5179834B2 (en) 2007-10-31 2007-10-31 Semiconductor device and data processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007282762A JP5179834B2 (en) 2007-10-31 2007-10-31 Semiconductor device and data processing system

Publications (2)

Publication Number Publication Date
JP2009110335A true JP2009110335A (en) 2009-05-21
JP5179834B2 JP5179834B2 (en) 2013-04-10

Family

ID=40778756

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007282762A Expired - Fee Related JP5179834B2 (en) 2007-10-31 2007-10-31 Semiconductor device and data processing system

Country Status (1)

Country Link
JP (1) JP5179834B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012247907A (en) * 2011-05-26 2012-12-13 Toyota Motor Corp Information processing apparatus
JP2014071528A (en) * 2012-09-27 2014-04-21 Dainippon Printing Co Ltd Communication system, ic card, processing program for ic card and communication method
CN106354674A (en) * 2015-07-15 2017-01-25 瑞萨电子株式会社 Semiconductor device and system
JP2021145338A (en) * 2015-04-14 2021-09-24 クアルコム,インコーポレイテッド Enhanced virtual gpio with multi-mode modulation

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0870336A (en) * 1994-08-30 1996-03-12 Toyoda Mach Works Ltd Programmable controller
JPH10105308A (en) * 1996-09-09 1998-04-24 Internatl Business Mach Corp <Ibm> Information transmission bus and method
JP2001094438A (en) * 1999-09-17 2001-04-06 Sanyo Electric Co Ltd Serial interface circuit
WO2003009533A1 (en) * 2001-07-11 2003-01-30 Fujitsu Limited Interface device and method of control thereof
JP2003324413A (en) * 2002-05-08 2003-11-14 Oki Electric Ind Co Ltd Serial data communication device and method of transmitting-receiving serial data
JP2005165508A (en) * 2003-12-01 2005-06-23 Renesas Technology Corp Direct memory access controller
JP2006277361A (en) * 2005-03-29 2006-10-12 Fujitsu Ltd Method for controlling serial interface

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0870336A (en) * 1994-08-30 1996-03-12 Toyoda Mach Works Ltd Programmable controller
JPH10105308A (en) * 1996-09-09 1998-04-24 Internatl Business Mach Corp <Ibm> Information transmission bus and method
JP2001094438A (en) * 1999-09-17 2001-04-06 Sanyo Electric Co Ltd Serial interface circuit
WO2003009533A1 (en) * 2001-07-11 2003-01-30 Fujitsu Limited Interface device and method of control thereof
JP2003324413A (en) * 2002-05-08 2003-11-14 Oki Electric Ind Co Ltd Serial data communication device and method of transmitting-receiving serial data
JP2005165508A (en) * 2003-12-01 2005-06-23 Renesas Technology Corp Direct memory access controller
JP2006277361A (en) * 2005-03-29 2006-10-12 Fujitsu Ltd Method for controlling serial interface

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012247907A (en) * 2011-05-26 2012-12-13 Toyota Motor Corp Information processing apparatus
JP2014071528A (en) * 2012-09-27 2014-04-21 Dainippon Printing Co Ltd Communication system, ic card, processing program for ic card and communication method
JP2021145338A (en) * 2015-04-14 2021-09-24 クアルコム,インコーポレイテッド Enhanced virtual gpio with multi-mode modulation
CN106354674A (en) * 2015-07-15 2017-01-25 瑞萨电子株式会社 Semiconductor device and system
JP2017021749A (en) * 2015-07-15 2017-01-26 ルネサスエレクトロニクス株式会社 Semiconductor device and system
US10409749B2 (en) 2015-07-15 2019-09-10 Renesas Electronics Corporation Semiconductor device and system provided with a communication interface

Also Published As

Publication number Publication date
JP5179834B2 (en) 2013-04-10

Similar Documents

Publication Publication Date Title
US7233541B2 (en) Storage device
US7401257B2 (en) Microcomputer and method for developing system program
US6299069B1 (en) Integrated circuit for embedding in smart cards, and method of issuing smart cards
US7708195B2 (en) Memory card
US8417864B2 (en) Cascade-able serial bus device with clock and management and cascade methods using the same
WO2006070906A1 (en) Card and host apparatus
US7181649B2 (en) Universal serial bus (USB) smart card having enhanced testing features and related system, integrated circuit, and methods
US6783078B1 (en) Universal serial bus (USB) smart card having read back testing features and related system, integrated circuit, and methods
JP2001236304A (en) Microcomputer
JPS62206658A (en) Memory controller
JP5179834B2 (en) Semiconductor device and data processing system
US7143224B2 (en) Smart card for performing advance operations to enhance performance and related system, integrated circuit, and methods
KR100241514B1 (en) Microcomputer
US7373522B2 (en) Smart card with enhanced security features and related system, integrated circuit, and methods
US20060095598A1 (en) Method and apparatus of extending answer to reset and subsequent communications between a smart card and a chip card interface device
US20040122984A1 (en) Data processor and data table update method
TW200811723A (en) Device, system and method for media card communication
US7020730B2 (en) Method for operating a microprocessor configuration and microprocessor configuration
JP5251353B2 (en) Information processing device
JPH1185724A (en) Cpu mode switch circuit
CN111258936A (en) DMA data transmission system and data transmission method
KR100341947B1 (en) Modular chip selection control circuits and associated circuits and methods
JP3713215B2 (en) Memory emulation apparatus and data supply method
JP2004102755A (en) Semiconductor integrated circuit
JPS6235950A (en) Inter-memory data transfer system

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20100527

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100903

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120224

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120301

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120427

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120927

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121126

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121227

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130110

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees