JP5166927B2 - Processing equipment - Google Patents

Processing equipment Download PDF

Info

Publication number
JP5166927B2
JP5166927B2 JP2008067068A JP2008067068A JP5166927B2 JP 5166927 B2 JP5166927 B2 JP 5166927B2 JP 2008067068 A JP2008067068 A JP 2008067068A JP 2008067068 A JP2008067068 A JP 2008067068A JP 5166927 B2 JP5166927 B2 JP 5166927B2
Authority
JP
Japan
Prior art keywords
interface
clock
processing apparatus
iso
swp
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
JP2008067068A
Other languages
Japanese (ja)
Other versions
JP2009020861A (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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2008067068A priority Critical patent/JP5166927B2/en
Priority to TW97118903A priority patent/TW200912601A/en
Priority to US12/136,988 priority patent/US8015428B2/en
Priority to CN2008101099555A priority patent/CN101324931B/en
Publication of JP2009020861A publication Critical patent/JP2009020861A/en
Application granted granted Critical
Publication of JP5166927B2 publication Critical patent/JP5166927B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Power Sources (AREA)

Description

本発明は、データ転送のための複数のインタフェースを有する処理装置およびそのクロック制御方法に関し、特にISO7816に準拠したICカード等の処理装置に適用して有効な技術に関するものである。   The present invention relates to a processing apparatus having a plurality of interfaces for data transfer and a clock control method therefor, and more particularly to a technique effective when applied to a processing apparatus such as an IC card conforming to ISO7816.

外部端子付きICカードの規格であるISO7816において、ISO7816−2に準拠した外部端子を有する処理装置では、ISO7816−3に準拠したデータ転送に加え、ISO7816−12に準拠したUSB(Universal Serial Bus)転送も行うことができる。ここで、ISO7816−12では、外部端末が処理装置にクロックを供給するという仕様ではないため、ISO7816−12に準拠したUSB転送を行う場合、原則として処理装置内部で生成したクロックを用いて処理装置を動作させる必要がある。   In ISO7816, which is an IC card standard with an external terminal, in a processing apparatus having an external terminal conforming to ISO7816-2, in addition to data transfer conforming to ISO7816-3, USB (Universal Serial Bus) transfer conforming to ISO7816-12 Can also be done. Here, ISO 7816-12 does not have a specification in which an external terminal supplies a clock to the processing device. Therefore, when USB transfer conforming to ISO 7816-12 is performed, in principle, the processing device uses a clock generated inside the processing device. Need to work.

また、ISO7816−3に準拠したデータ転送では、外部端末と処理装置間のデータ転送に使用するクロックに関する仕様は定めているが、処理装置内部で使用するクロックに関する仕様は規定されていない。処理装置内部で生成したクロックを利用する場合、オシレータやPLLなどのモジュールを動作させる必要があるため、外部端末から供給されるクロックのみを利用して動作する場合と比べて消費電力が増大するため、外部端末から供給されるクロックを利用して動作する場合がある。   In addition, in data transfer conforming to ISO 7816-3, specifications relating to a clock used for data transfer between an external terminal and a processing device are defined, but specifications relating to a clock used in the processing device are not defined. When using a clock generated inside the processing device, it is necessary to operate a module such as an oscillator or PLL, which increases power consumption compared to operating using only a clock supplied from an external terminal. In some cases, the operation is performed using a clock supplied from an external terminal.

ISO7816−3に準拠したデータ転送とISO7816−12に準拠したUSB転送とは、使用する外部端子が重複しないため同時に行うことが可能である。ここで、例えばISO7816−3に準拠したデータ転送中にISO7816−12に準拠したUSB転送を活性化する場合、処理装置が利用するクロックを外部クロックから内部クロックに切り替える必要が生じる。しかし、処置装置の動作中にクロックを切り替えると、ノイズなどの影響により処理装置内のCPUなどが誤動作する恐れがある。   Data transfer conforming to ISO 7816-3 and USB transfer conforming to ISO 7816-12 can be performed simultaneously because the external terminals used do not overlap. Here, for example, when USB transfer conforming to ISO 7816-12 is activated during data transfer conforming to ISO 7816-3, it is necessary to switch the clock used by the processing device from an external clock to an internal clock. However, if the clock is switched during the operation of the treatment apparatus, the CPU in the processing apparatus may malfunction due to the influence of noise or the like.

そこで本発明の目的は、外部クロックに同期してデータ転送を行うインタフェースと、外部クロックを利用せずに内部クロックを用いてデータ転送を行うインタフェースとを有する処理装置、特にISO7816の規格に準拠する外部端子を有し、ISO7816−3とISO7816−12とに準拠したインタフェースを有する処理装置において、外部端末との間でデータ転送を行うために使用するインタフェースに応じて、処理装置が利用するクロックを切り替えることができる処理装置およびそのクロック制御方法を提供することにある。   Therefore, an object of the present invention is to comply with the standard of ISO 7816, which is a processing apparatus having an interface for transferring data in synchronization with an external clock and an interface for transferring data using an internal clock without using the external clock. In a processing apparatus having an external terminal and having an interface compliant with ISO 7816-3 and ISO 7816-12, a clock used by the processing apparatus is selected according to the interface used for data transfer with the external terminal. An object of the present invention is to provide a processing device capable of switching and a clock control method thereof.

本発明の前記ならびにその他の目的と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。   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.

本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。   Of the inventions disclosed in the present application, the outline of typical ones will be briefly described as follows.

本発明は、外部端末から供給される外部クロックに同期して前記外部端末との間でデータ転送を行う第1のインタフェースおよびその制御回路と、クロックを生成するクロック生成回路と、前記クロック生成回路で生成された内部クロックを用いて前記外部端末との間でデータ転送を行う第2のインタフェースおよびその制御回路とを有する処理装置およびそのクロック制御方法であって、該処理装置が前記外部端末との間でデータ転送を行うために使用するインタフェースに応じて、該処理装置内のCPUおよびその他のモジュールが利用するシステムクロックを、前記外部クロックと前記内部クロックとの間で切り替えるクロック制御回路を有し、前記システムクロックを前記外部クロックと前記内部クロックとの間で切り替える際に、前記CPUをスリープ状態にした後に切り替え、切り替えが完了した後に前記CPUのスリープ状態を解除して動作を再開させることを特徴とするものである。   The present invention provides a first interface for transferring data to and from the external terminal in synchronization with an external clock supplied from an external terminal, its control circuit, a clock generation circuit for generating a clock, and the clock generation circuit A processing device having a second interface for transferring data to and from the external terminal using the internal clock generated in step (b) and a control circuit for the second interface, and a clock control method for the processing device. A clock control circuit that switches a system clock used by the CPU and other modules in the processing device between the external clock and the internal clock according to an interface used for data transfer between the external clock and the internal clock. And when switching the system clock between the external clock and the internal clock, Switch after the serial CPU to sleep, is characterized in that to resume the operation to release the sleep state of the CPU after the switching is completed.

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

本発明によれば、一つの処理装置で複数のインタフェースによるデータ転送、特にISO7816−3に準拠したデータ転送とISO7816−12に準拠したUSB転送を行う際に、使用するインタフェースに応じて処理装置が利用するクロックを動的に切り替えることが可能となり、ISO7816−3に準拠したデータ転送とISO7816−12に準拠したUSB転送の両方を同時に行うことが可能となる。   According to the present invention, when data transfer by a plurality of interfaces is performed by one processing device, in particular, data transfer conforming to ISO7816-3 and USB transfer conforming to ISO7816-12, the processing device is selected according to the interface to be used. The clock to be used can be dynamically switched, and both data transfer conforming to ISO7816-3 and USB transfer conforming to ISO7816-12 can be performed simultaneously.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一部には原則として同一の符号を付し、その繰り返しの説明は省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that components having the same function are denoted by the same reference symbols throughout the drawings for describing the embodiment, and the repetitive description thereof will be omitted.

<実施の形態1>
本発明の実施の形態1である処理装置について説明する。図1は、本実施の形態の処理装置の内部構成の例を示した図である。また、図2は、本実施の形態の処理装置の外部端子の配置例を示した図である。
<Embodiment 1>
A processing apparatus according to the first embodiment of the present invention will be described. FIG. 1 is a diagram illustrating an example of the internal configuration of the processing apparatus according to the present embodiment. FIG. 2 is a diagram showing an arrangement example of the external terminals of the processing apparatus according to the present embodiment.

図1において、処理装置100は、ISO7816互換の外部インタフェースとして、EX_CLK110、EX_RESET111、UART_I/O112、D+113、D−114、Vcc115、GND116を有し、また、内部オシレータ120、クロック制御回路130、CPU141、UART制御回路142、USB制御回路143を有する構成となっている。   In FIG. 1, the processing apparatus 100 has EX_CLK110, EX_RESET111, UART_I / O112, D + 113, D-114, Vcc115, and GND116 as external interfaces compatible with ISO7816, and also includes an internal oscillator 120, a clock control circuit 130, a CPU 141, The configuration includes a UART control circuit 142 and a USB control circuit 143.

処理装置100としては、主にICカードチップやセキュリティ機能付きメモリカード等が該当するが、複数のデータ転送のインタフェースを有する装置であればこれらに限られない。また、1つのチップではなく、各回路または各回路の集まり毎に別々のチップとして構成されていてもよい。   The processing device 100 mainly corresponds to an IC card chip, a memory card with a security function, or the like, but is not limited thereto as long as it has a plurality of data transfer interfaces. Further, instead of one chip, each circuit or a group of circuits may be configured as a separate chip.

EX_CLK110は、外部端末から処理装置100へISO7816に準拠した処理を行うために必要なクロック信号を入力するための外部インタフェースであり、ISO7816では図2におけるC3端子203が割り当てられている。以下では、EX_CLK110経由で供給されるクロックを外部クロックと記載する。EX_RESET111は、外部端末から処理装置100へリセット信号を入力するための外部インタフェースであり、ISO7816では図2におけるC2端子202が割り当てられている。以下では、EX_RESET111経由のリセットを外部リセットと記載する。   EX_CLK 110 is an external interface for inputting a clock signal necessary for performing processing conforming to ISO 7816 from the external terminal to the processing apparatus 100. In ISO 7816, the C3 terminal 203 in FIG. 2 is assigned. Hereinafter, a clock supplied via EX_CLK 110 is referred to as an external clock. EX_RESET 111 is an external interface for inputting a reset signal from the external terminal to the processing apparatus 100. In ISO 7816, the C2 terminal 202 in FIG. 2 is assigned. Hereinafter, a reset via EX_RESET 111 is referred to as an external reset.

UART_I/O112は、外部端末と処理装置100との間でAPDU(Application Protocol Data Unit)を送受信するための外部インタフェースであり、ISO7816ではC7端子207が割り当てられている。D+113およびD−114は、ISO7816−12に準拠したUSB転送において、外部端末と処理装置100との間でコマンドやデータを転送するために用いられ、ISO7816ではD+113としてC4端子204、D−114としてC8端子208が割り当てられている。   The UART_I / O 112 is an external interface for transmitting and receiving an APDU (Application Protocol Data Unit) between the external terminal and the processing apparatus 100, and a C7 terminal 207 is assigned in ISO7816. D + 113 and D-114 are used for transferring commands and data between the external terminal and the processing apparatus 100 in USB transfer in conformity with ISO 7816-12. In ISO 7816, as D + 113, the C4 terminal 204 and D-114 are used. A C8 terminal 208 is assigned.

Vcc115は、処理装置100への入力電圧を取得する外部インタフェースであり、ISO7816ではC1端子201が割り当てられている。GND116は、処理装置100へのグランド線であり、ISO7816ではC5端子205が割り当てられている。なお、ISO7816−3に準拠したデータ転送およびISO7816−12に準拠したUSB転送において、どの外部端子がどの外部インタフェースに割り当たっていても、その割り当てが明らかであれば、本実施の形態における処理装置100およびクロック制御方法の本質には影響しない。   Vcc 115 is an external interface for acquiring an input voltage to the processing apparatus 100, and a C1 terminal 201 is assigned in ISO7816. The GND 116 is a ground line to the processing apparatus 100, and the C5 terminal 205 is assigned in ISO 7816. In the data transfer conforming to ISO 7816-3 and the USB transfer conforming to ISO 7816-12, if any external terminal is assigned to which external interface and the assignment is clear, the processing device according to the present embodiment 100 and does not affect the nature of the clock control method.

UART制御回路142は、ISO7816−3の規定で定められたAPDU転送を実現する回路である。以下では、外部クロックに同期してISO7816−3に準拠したAPDU転送を行うインタフェースをISO7816インタフェースと記載する。USB制御回路143は、ISO7816−12の規定で定められたUSB仕様に準拠したデータ転送を実現する回路である。以下では、ISO7816−12の規定で定められたUSB仕様に準拠したデータ転送を行うインタフェースをUSBインタフェースと記載する。また、以下では、UART制御回路142およびUSB制御回路143の総称としてインタフェース制御回路と記載する場合がある。   The UART control circuit 142 is a circuit that realizes APDU transfer defined by ISO 7816-3. Hereinafter, an interface that performs APDU transfer conforming to ISO 7816-3 in synchronization with an external clock is referred to as an ISO 7816 interface. The USB control circuit 143 is a circuit that realizes data transfer conforming to the USB specification defined by the regulations of ISO7816-12. Hereinafter, an interface that performs data transfer in conformity with the USB specification defined in the ISO 7816-12 standard is referred to as a USB interface. Hereinafter, the UART control circuit 142 and the USB control circuit 143 may be collectively referred to as an interface control circuit.

各インタフェース制御回路の機能を、CPU141により行うように実装することも可能である。ただし、各インタフェース制御回路を独自に有し、これらを動作させるための電力がCPU141を動作させるための電力とは別に制御可能な場合には、データ転送の際にどちらかのインタフェースが選択された際、他方のインタフェース制御回路への電力供給を停止することで、処理装置100の消費電力を低減させることができる。   The functions of each interface control circuit can be implemented so as to be performed by the CPU 141. However, if each interface control circuit has its own and the power for operating these can be controlled separately from the power for operating the CPU 141, either interface is selected during data transfer. At this time, the power consumption of the processing apparatus 100 can be reduced by stopping the power supply to the other interface control circuit.

USBインタフェースによるデータ転送の場合でも外部クロックを利用することは可能であるが、その動作周波数が4MHz程度と低速であるため、大容量のデータを扱うUSBインタフェースによるデータ転送には適さない。さらに、USBインタフェースによる処理中に継続して外部端末から外部クロックが供給されるという保証もない。   Even in the case of data transfer by the USB interface, it is possible to use the external clock, but since the operating frequency is as low as about 4 MHz, it is not suitable for data transfer by the USB interface that handles a large amount of data. Furthermore, there is no guarantee that an external clock is continuously supplied from an external terminal during processing by the USB interface.

そこで、本実施の形態の処理装置100では、クロック生成回路として内部オシレータ120を設け、USBインタフェースによる処理の際には内部オシレータ120により生成したクロックを使用する構成とする。なお、内部オシレータ120は、処理装置100の内部に限られず、処理装置100の外部から接続する構成であってもよい。以下では、内部オシレータ120が生成したクロックを内部クロックと記載する。   Therefore, the processing apparatus 100 according to the present embodiment is configured such that the internal oscillator 120 is provided as a clock generation circuit, and the clock generated by the internal oscillator 120 is used in the processing by the USB interface. The internal oscillator 120 is not limited to the inside of the processing apparatus 100, and may be configured to be connected from the outside of the processing apparatus 100. Hereinafter, the clock generated by the internal oscillator 120 is referred to as an internal clock.

図3は、処理装置100のような、ISO7816インタフェースとUSBインタフェースを持つICカードの初期動作の流れの一例を示した図である。まず、電圧投入前、ステップ300にて、EX_CLK110をLow状態、EX_RESET111をLow状態、UART_I/O112をHigh状態、D+113をHigh状態、D−114をHigh状態に設定する。電圧投入後、規定された動作電圧に達した後、D+113とD−114とが少なくとも10msの間Low状態であるかどうかを判定する(ステップ301)。ステップ301での判定条件を満たしている場合のみ、以下で述べるUSBインタフェース活性化手順を行う。   FIG. 3 is a diagram illustrating an example of an initial operation flow of an IC card having an ISO 7816 interface and a USB interface, such as the processing apparatus 100. First, before voltage application, in step 300, EX_CLK 110 is set to a low state, EX_RESET 111 is set to a low state, UART_I / O 112 is set to a high state, D + 113 is set to a high state, and D-114 is set to a high state. After the voltage is applied, after reaching the specified operating voltage, it is determined whether D + 113 and D-114 are in a low state for at least 10 ms (step 301). Only when the determination conditions in step 301 are satisfied, the USB interface activation procedure described below is performed.

USBインタフェース活性化手順では、まず、処理装置100は、USBインタフェースがUSB仕様におけるFull SpeedもしくはHigh Speedに対応している場合はD+113をHigh状態にし、Low Speedのみに対応している場合はD−114をHigh状態にする(ステップ302)。次に、D+113もしくはD−114がHigh状態になったことにより、処理装置100と接続している外部端末は、USBインタフェースを持つ処理装置100が接続されたことを検知し、High状態になっているD+113もしくはD−114をLow状態にする(ステップ303)。   In the USB interface activation procedure, first, the processing apparatus 100 sets D + 113 to the High state when the USB interface supports Full Speed or High Speed in the USB specification, and D- when the USB interface supports only Low Speed. 114 is set to a high state (step 302). Next, when D + 113 or D-114 is in the High state, the external terminal connected to the processing device 100 detects that the processing device 100 having the USB interface is connected, and enters the High state. D + 113 or D-114 that is present is set to the low state (step 303).

ステップ301〜ステップ303の各処理が正常に行われた場合のみ、USBインタフェースが活性化され、処理装置100はUSBインタフェースでデータ転送を行う装置として動作する。ステップ301〜ステップ303の各処理が正常に行われなかった場合は、外部装置からEX_CLK110経由で動作周波数4MHz程度の外部クロックが供給される/されているかどうかを判定する(ステップ311)。外部クロックが供給される/されている場合には、以下で述べるISO7816インタフェース活性化手順を行う。   Only when the processes in steps 301 to 303 are normally performed, the USB interface is activated, and the processing device 100 operates as a device that performs data transfer with the USB interface. If each of the processes of Step 301 to Step 303 is not normally performed, it is determined whether or not an external clock having an operation frequency of about 4 MHz is supplied / externally from the external device via EX_CLK 110 (Step 311). When an external clock is supplied / is supplied, the ISO 7816 interface activation procedure described below is performed.

ISO7816インタフェース活性化手順では、まず、外部クロックが供給されてから400クロックの間に、外部端末がEX_RESET111をHigh状態にする(ステップ312)。次に、EX_RESET111がHigh状態になってから40,000クロックの間に、処理装置100は、UART_I/O112経由でATR(Answer To Reset)を外部端末に送信する(ステップ313)。   In the ISO 7816 interface activation procedure, first, the external terminal sets the EX_RESET 111 to the high state for 400 clocks after the external clock is supplied (step 312). Next, during 40,000 clocks after EX_RESET 111 becomes High, the processing apparatus 100 transmits an ATR (Answer To Reset) to the external terminal via the UART_I / O 112 (step 313).

ステップ311〜ステップ313の各処理が正常に行われた場合のみ、ISO7816インタフェースが活性化され、処理装置100はISO7816インタフェースでデータ転送を行う装置として動作する。ステップ301〜ステップ303の各処理およびステップ311〜ステップ313の各処理が正常に行われなかった場合は、処理装置100は、D+113とD−114とが少なくとも10msの間Low状態になるか(ステップ301)、またはEX_CLK110経由で外部クロックが供給されるか(ステップ311)のどちらかの条件が成立するのを待つ。   Only when the processes in steps 311 to 313 are normally performed, the ISO 7816 interface is activated, and the processing apparatus 100 operates as an apparatus that performs data transfer through the ISO 7816 interface. If the processes in steps 301 to 303 and the processes in steps 311 to 313 are not performed normally, the processing apparatus 100 determines that D + 113 and D-114 are in a low state for at least 10 ms (steps). 301) or whether an external clock is supplied via EX_CLK 110 (step 311).

以上に示すような各インタフェースの活性化の処理を行うため、処理装置100は、図1に示すようにクロック制御回路130を有する構成となっている。クロック制御回路130は、処理装置100が外部端末との間でデータ転送を行うために使用するインタフェースに応じて、CPU141や各インタフェース制御回路などに供給するクロックやリセットの選択を行うモジュールである。以下では、CPU141や各インタフェース制御回路などに供給するクロックをシステムクロックと記載する。   In order to perform the activation process of each interface as described above, the processing apparatus 100 is configured to include a clock control circuit 130 as shown in FIG. The clock control circuit 130 is a module that selects a clock or reset to be supplied to the CPU 141, each interface control circuit, or the like according to an interface used by the processing apparatus 100 to transfer data to / from an external terminal. Hereinafter, a clock supplied to the CPU 141, each interface control circuit, and the like is referred to as a system clock.

図4は、本実施の形態におけるクロック制御回路130に含まれるモジュールの構成例を示した図である。クロック制御回路130は、クロック切り替え回路410、リセット制御回路420、USB検出回路430を有する構成となっている。クロック切り替え回路410は、EX_CLK110経由で外部端末から供給される外部クロック411と、内部オシレータ120で生成した内部クロック412とから、CPU141や各インタフェース制御回路などに供給するシステムクロック413を選択するモジュールである。   FIG. 4 is a diagram showing a configuration example of modules included in the clock control circuit 130 in the present embodiment. The clock control circuit 130 includes a clock switching circuit 410, a reset control circuit 420, and a USB detection circuit 430. The clock switching circuit 410 is a module that selects a system clock 413 to be supplied to the CPU 141, each interface control circuit, and the like from an external clock 411 supplied from an external terminal via EX_CLK 110 and an internal clock 412 generated by the internal oscillator 120. is there.

また、クロック切り替え回路410は、外部クロック検出信号414および内部クロックスタート信号415を、リセット制御回路420に供給する。ここで、外部クロック検出信号414は、EX_CLK110経由で外部クロック411が供給されたことを検知するとHigh状態にする信号である。また、内部クロックスタート信号415は、内部オシレータ120で生成した内部クロック412をCPU141や各インタフェース制御回路などに供給する際にHigh状態にする信号である。   In addition, the clock switching circuit 410 supplies the external clock detection signal 414 and the internal clock start signal 415 to the reset control circuit 420. Here, the external clock detection signal 414 is a signal that is brought into a High state when it is detected that the external clock 411 is supplied via EX_CLK 110. The internal clock start signal 415 is a signal that is brought into a high state when the internal clock 412 generated by the internal oscillator 120 is supplied to the CPU 141 or each interface control circuit.

さらに、クロック切り替え回路410は、CPU141からスリープ信号416を入力し、またCPU141やその他のモジュールにクロック切り替え信号417を出力する構成となっているが、これら信号については後述する。   Further, the clock switching circuit 410 is configured to receive a sleep signal 416 from the CPU 141 and to output a clock switching signal 417 to the CPU 141 and other modules. These signals will be described later.

リセット制御回路420は、CPU141や各インタフェース制御回路などに供給するリセットを制御するモジュールである。リセット制御回路420が供給するリセットとして、システムリセット422、UARTリセット423、USBリセット424がある。システムリセット422は、処理装置100内の全モジュールに対してリセットを供給する信号である。UARTリセット423は、ISO7816インタフェース経由で転送するデータの処理のために必要なモジュールのみにリセットを供給する信号である。USBリセット424は、USBインタフェース経由で転送するデータの処理のために必要なモジュールのみにリセットを供給する信号である。   The reset control circuit 420 is a module that controls reset supplied to the CPU 141, each interface control circuit, and the like. As resets supplied by the reset control circuit 420, there are a system reset 422, a UART reset 423, and a USB reset 424. The system reset 422 is a signal that supplies reset to all modules in the processing apparatus 100. The UART reset 423 is a signal for supplying a reset only to a module necessary for processing data transferred via the ISO7816 interface. The USB reset 424 is a signal for supplying a reset only to a module necessary for processing data transferred via the USB interface.

USB検出回路430は、D+113およびD−114の信号線の状態を監視し、D+113とD−114の両方の信号線が少なくとも10msの間Low状態であることを検知すると、USB検出信号431をHigh状態にするモジュールである。USB検出信号431は、CPU141およびその他のモジュールにUSBインタフェースによりデータが転送されることを通知するための信号である。   The USB detection circuit 430 monitors the state of the signal lines D + 113 and D-114. When the USB detection circuit 430 detects that both the signal lines D + 113 and D-114 are in the Low state for at least 10 ms, the USB detection signal 431 is High. It is a module to put into a state. The USB detection signal 431 is a signal for notifying the CPU 141 and other modules that data is transferred through the USB interface.

内部オシレータ120は、USB検出信号431がHigh状態になるとクロックの生成を開始する。ただし、クロックはその発振が安定するまでCPU141などに供給するのを待つ必要がある。通常、発振器の仕様などからクロックが安定するまでの時間を知ることが可能なので、その時間を基に作成した専用ハードウェアタイマなどを利用して発振が安定するのを待ち、安定後にCPU141などに供給する。当該タイマは、クロック切り替え回路410や内部オシレータ120内にあってもよい。   The internal oscillator 120 starts generating a clock when the USB detection signal 431 is in a high state. However, it is necessary to wait for the clock to be supplied to the CPU 141 or the like until the oscillation is stabilized. Normally, it is possible to know the time until the clock is stabilized from the specifications of the oscillator, etc., and wait for the oscillation to stabilize using a dedicated hardware timer or the like created based on that time. Supply. The timer may be in the clock switching circuit 410 or the internal oscillator 120.

以下に、本実施の形態の処理装置100におけるUSBインタフェースの活性化方法およびISO7816インタフェースの活性化方法について説明する。図5は、本実施の形態の処理装置100におけるUSBインタフェースの活性化手順およびISO7816インタフェースの活性化手順の例を表したフロー図である。また、図6は、本実施の形態の処理装置100におけるUSBインタフェースの活性化手順のタイミングチャートの例である。また、図7は、本実施の形態の処理装置100におけるISO7816インタフェースの活性化手順のタイミングチャートの例である。   Hereinafter, a USB interface activation method and an ISO 7816 interface activation method in the processing apparatus 100 according to the present embodiment will be described. FIG. 5 is a flowchart showing an example of the USB interface activation procedure and the ISO 7816 interface activation procedure in the processing apparatus 100 according to the present embodiment. FIG. 6 is an example of a timing chart of the USB interface activation procedure in the processing apparatus 100 according to the present embodiment. FIG. 7 is an example of a timing chart of the activation procedure of the ISO 7816 interface in the processing apparatus 100 according to the present embodiment.

まず、図6、図7において、電圧投入前に、EX_CLK110をLow状態、EX_RESET111をLow状態、UART_I/O112をHigh状態、D+113をHigh状態、D−114をHigh状態にそれぞれ設定する(タイミング610、タイミング710)。図5における電圧投入後(ステップ501)、USB検出回路430が、D+113とD−114とが少なくとも10msの間Low状態であることを検知した場合(ステップ502)、USBインタフェース活性化手順を開始する。このとき、USB検出回路430はUSB検出信号431をHigh状態にする(タイミング620)。   First, in FIG. 6 and FIG. 7, before voltage application, EX_CLK 110 is set to a low state, EX_RESET 111 is set to a low state, UART_I / O 112 is set to a high state, D + 113 is set to a high state, and D-114 is set to a high state (timing 610, Timing 710). After the voltage application in FIG. 5 (step 501), when the USB detection circuit 430 detects that D + 113 and D-114 are in a low state for at least 10 ms (step 502), the USB interface activation procedure is started. . At this time, the USB detection circuit 430 sets the USB detection signal 431 to a high state (timing 620).

USB検出回路430は、内部オシレータ120とは別のオシレータで生成したクロックを利用して動作する。ただし、消費電力を低減するため、その動作周波数は数MHz程度とする。また、当該クロックは内部オシレータ120で生成したクロックであってもよい。ただし、その場合は電圧投入時に内部オシレータ120を起動する必要がある。   The USB detection circuit 430 operates using a clock generated by an oscillator different from the internal oscillator 120. However, the operating frequency is about several MHz in order to reduce power consumption. The clock may be a clock generated by the internal oscillator 120. However, in that case, it is necessary to start the internal oscillator 120 when the voltage is applied.

内部オシレータ120は、USB検出信号431がHigh状態になったことを検知すると、内部クロック412を生成する(ステップ511、タイミング620)。その後、内部オシレータ120内のタイマを利用して、内部クロック412の発振が安定するのを待ち、安定した後、クロック切り替え回路410を経由して、CPU141および各インタフェース制御回路などに内部クロック412をシステムクロック413として供給する(ステップ512)。このとき、クロック切り替え回路410は、内部クロックスタート信号415をHigh状態にする(タイミング630)。なお、UART制御回路142には内部クロック412を供給しなくてもよい。   When the internal oscillator 120 detects that the USB detection signal 431 is in a high state, the internal oscillator 120 generates an internal clock 412 (step 511, timing 620). Thereafter, the timer in the internal oscillator 120 is used to wait for the oscillation of the internal clock 412 to stabilize. After the stabilization, the internal clock 412 is sent to the CPU 141 and each interface control circuit via the clock switching circuit 410. This is supplied as the system clock 413 (step 512). At this time, the clock switching circuit 410 sets the internal clock start signal 415 to a high state (timing 630). The UART control circuit 142 need not be supplied with the internal clock 412.

次に、リセット制御回路420は、USB検出信号431がHigh状態であり、かつ内部クロックスタート信号415がHigh状態あることを確認した後、システムリセット422をHigh状態にする(ステップ513、タイミング640)。なお、システムリセット422ではなく、USBリセット424をHigh状態にしてもよい。   Next, after confirming that the USB detection signal 431 is in the high state and the internal clock start signal 415 is in the high state, the reset control circuit 420 sets the system reset 422 to the high state (step 513, timing 640). . Instead of the system reset 422, the USB reset 424 may be in a high state.

システムリセット422がHigh状態になった後、USB制御回路143は、処理装置100がFull SpeedもしくはHigh Speedに対応している場合はD+113をHigh状態にし、Low Speedのみに対応している場合はD−114をHigh状態にする(ステップ514、タイミング650)。なお、以降の説明においては、本実施の形態の処理装置100はHigh Speedに対応しているものとする。   After the system reset 422 is in the high state, the USB control circuit 143 sets D + 113 to the high state when the processing device 100 supports full speed or high speed, and sets the D + 113 to only low speed when the processing device 100 supports low speed. -114 is set to the high state (step 514, timing 650). In the following description, it is assumed that the processing apparatus 100 according to the present embodiment is compatible with High Speed.

USB制御回路143の代わりに専用ハードウェアがD+113もしくはD−114をHigh状態にする構成であってもよい。専用ハードウェアを用いる場合は、内部クロック412の供給がなくても動作可能であるため、処理装置100全体の消費電力を低減するため、内部クロック412の生成・供給(ステップ511、S512)やリセット処理(ステップ513)は、できるだけ遅いタイミングであるステップ515の後に行うことが望ましい。   Instead of the USB control circuit 143, the dedicated hardware may be configured to put D + 113 or D-114 in a high state. When dedicated hardware is used, the operation is possible without the supply of the internal clock 412. Therefore, the internal clock 412 is generated and supplied (steps 511 and S512) and reset in order to reduce the power consumption of the entire processing apparatus 100. The processing (step 513) is desirably performed after step 515 which is as late as possible.

D+113がHigh状態になったことにより、外部端末はUSBインタフェースを持つ処理装置100が接続されたことを検知し、High状態になったD+113をLow状態にする(ステップ515、タイミング660)。以上の処理が正常に行われた場合のみ、USBインタフェースが活性化され、処理装置100はUSBインタフェースでデータ転送を行う装置として動作することができる。   When D + 113 is in the High state, the external terminal detects that the processing apparatus 100 having the USB interface is connected, and sets D + 113 in the High state to the Low state (step 515, timing 660). Only when the above processing is normally performed, the USB interface is activated, and the processing device 100 can operate as a device that performs data transfer with the USB interface.

ステップ502で、USB検出回路430がD+113とD−114とが10msの間Low状態になったことを検知せず、さらにステップ521で、クロック切り替え回路410がEX_CLK110経由で外部クロック411が供給されたことを検知した場合、ISO7816インタフェース活性化手順を開始する。このとき、クロック切り替え回路410は、USB検出信号431がLow状態であることを確認した後、外部クロック411をシステムクロック413として供給し、外部クロック検出信号414をHigh状態にする(タイミング720)。   In step 502, the USB detection circuit 430 does not detect that D + 113 and D-114 have been in a low state for 10 ms, and in step 521, the clock switching circuit 410 is supplied with the external clock 411 via EX_CLK110. If this is detected, the ISO 7816 interface activation procedure is started. At this time, after confirming that the USB detection signal 431 is in the Low state, the clock switching circuit 410 supplies the external clock 411 as the system clock 413 and sets the external clock detection signal 414 to the High state (timing 720).

次に、リセット制御回路420は、外部クロック検出信号414がHigh状態になってから400クロック以内にEX_RESET111経由の外部リセット421がHigh状態になったことを検知したら、システムリセット422をHigh状態にする(ステップ522、タイミング730)。なお、システムリセット422ではなく、UARTリセット423をHigh状態にしてもよい。また、ISO7816インタフェース活性化手順への移行は、外部クロック411の検知からではなく、外部リセット421がHigh状態になったことを検知してからでもよい。   Next, when the reset control circuit 420 detects that the external reset 421 via the EX_RESET 111 is in the high state within 400 clocks after the external clock detection signal 414 is in the high state, the reset control circuit 420 sets the system reset 422 to the high state. (Step 522, timing 730). Note that instead of the system reset 422, the UART reset 423 may be in a high state. Further, the transition to the ISO 7816 interface activation procedure may be performed not after detecting the external clock 411 but when detecting that the external reset 421 is in a high state.

システムリセット422がHigh状態になった後、UART制御回路142は、40,000クロック以内にATR(Answer To Reset)をUART_I/O112経由で外部端末に送信する(ステップ523、タイミング740)。以上の処理が正常に行われた場合のみ、ISO7816インタフェースが活性化され、処理装置100はISO7816インタフェースでデータ転送を行う装置として動作することができる。なお、ISO7816インタフェースが活性化したときは、USB制御回路143に外部クロック411を供給しなくてもよい。   After the system reset 422 enters the high state, the UART control circuit 142 transmits an ATR (Answer To Reset) to the external terminal via the UART_I / O 112 within 40,000 clocks (step 523, timing 740). Only when the above processing is normally performed, the ISO 7816 interface is activated, and the processing device 100 can operate as a device that performs data transfer with the ISO 7816 interface. When the ISO 7816 interface is activated, the external clock 411 may not be supplied to the USB control circuit 143.

以上の処理は、クロック制御回路130の他に、UART制御回路142やUSB制御回路143を利用することにより、全てハードウェアで行うことが可能であるが、以下では、CPU141に内蔵されたROM等に搭載したファームウェアを用いて、USBインタフェースおよびISO7816インタフェースの活性化を行う方法の例について説明する。   The above processing can be performed entirely by hardware by using the UART control circuit 142 and the USB control circuit 143 in addition to the clock control circuit 130, but in the following, a ROM built in the CPU 141, etc. An example of a method for activating the USB interface and the ISO7816 interface using the firmware installed in FIG.

図15は、本実施の形態の処理装置100における、USBインタフェースおよびISO7816インタフェースの活性化の際に使用するレジスタの構成例の一部を示した図である。また、図16は、本実施の形態の処理装置100におけるファームウェアを用いたUSBインタフェースの活性化手順およびISO7816インタフェースの活性化手順の例を表したフロー図である。   FIG. 15 is a diagram illustrating a part of a configuration example of registers used when the USB interface and the ISO 7816 interface are activated in the processing apparatus 100 according to the present embodiment. FIG. 16 is a flowchart showing an example of a USB interface activation procedure and an ISO 7816 interface activation procedure using firmware in the processing apparatus 100 according to the present embodiment.

図15において、CLK_SELECT1501は、システムクロック413の供給源を示すビットである。例えば、“0”の場合は供給源が外部クロック411であることを示し、“1”の場合は供給源が内部クロック412であることを示す。RESET_SELECT1502は、外部リセット421の有効/無効を示すビットである。例えば、“0”の場合は外部リセット421が無効であることを示し、“1”の場合は有効であることを示す。MODE_SELECT1503は、使用可能なインタフェースを示すビットである。例えば、“01”の場合はISO7816インタフェースが使用可能であることを示し、“10”の場合はUSBインタフェースが使用可能であることを示す。さらに、“11”の場合は両方のインタフェースが使用可能であることを示す。   In FIG. 15, CLK_SELECT 1501 is a bit indicating a supply source of the system clock 413. For example, “0” indicates that the supply source is the external clock 411, and “1” indicates that the supply source is the internal clock 412. RESET_SELECT 1502 is a bit indicating whether the external reset 421 is valid / invalid. For example, “0” indicates that the external reset 421 is invalid, and “1” indicates that it is valid. MODE_SELECT 1503 is a bit indicating an available interface. For example, “01” indicates that the ISO 7816 interface can be used, and “10” indicates that the USB interface can be used. Further, “11” indicates that both interfaces can be used.

DPPU1511は、例えば、“1”を設定するとD+113もしくはD−114をプルアップするビットである。USB_DETECT1512は、D+113およびD−114が少なくとも10ms間Low状態であることをUSB検出回路430が検知すると“1”が設定されるビットである。USB_MODE1513は、USBインタフェースの速度を示すビットである。例えば、“0”の場合はLow Speedであることを示し、“1”の場合はFull Speedであることを示す。   The DPPU 1511 is, for example, a bit that pulls up D + 113 or D-114 when “1” is set. USB_DETECT 1512 is a bit that is set to “1” when the USB detection circuit 430 detects that D + 113 and D-114 are in a low state for at least 10 ms. USB_MODE 1513 is a bit indicating the speed of the USB interface. For example, “0” indicates Low Speed, and “1” indicates Full Speed.

DP1521は、D+113の状態を示すビットである。例えば、“0”の場合はD+113がLow状態であることを示し、“1”の場合はHigh状態であることを示す。DM1522は、D−114の状態を示すビットである。例えば、“0”の場合はD−114がLow状態であることを示し、“1”の場合はHigh状態であることを示す。   DP1521 is a bit indicating the state of D + 113. For example, “0” indicates that D + 113 is in a low state, and “1” indicates that it is in a high state. DM1522 is a bit indicating the state of D-114. For example, “0” indicates that D-114 is in a low state, and “1” indicates that it is in a high state.

図16において、電圧投入前は、CLK_SELECT1501には“0”、RESET_SELECT1502には“1”、MODE_SELECT1503には“01”が設定されており、また、DPPU1511には“0”、USB_DETECT1512には“0”がそれぞれ設定されている(ステップ1600)。なお、USB_MODE1513、DP1521、DM1522には、処理装置100の仕様によって異なる値が設定され得るが、本実施の形態の処理装置100では全て“1”が設定されているものとする。   In FIG. 16, before voltage application, CLK_SELECT 1501 is set to “0”, RESET_SELECT 1502 is set to “1”, MODE_SELECT 1503 is set to “01”, DPPU 1511 is set to “0”, and USB_DETECT 1512 is set to “0”. Are set (step 1600). Note that different values can be set in the USB_MODE 1513, DP1521, and DM1522, depending on the specifications of the processing apparatus 100, but it is assumed that all the processing apparatuses 100 of the present embodiment are set to “1”.

電圧投入後、CPU141に対してリセット割り込みが発生すると(ステップ1601)、ファームウェアは、リセット割り込み関数内でMODE_SELECT1503の値を確認する(ステップ1602)。なお、MODE_SELECT1503の値はリセット制御回路420が設定するものとする。MODE_SELECT1503の値が“10”の場合、ファームウェアはDPPU1511に“1”を設定し、D+113をHigh状態にする(ステップ1611)。その後、ファームウェアは、DP1521の値が“0”であるかどうかを監視し(ステップ1612)、“0”になった場合は、処理装置100はUSBインタフェースで動作する。   When a reset interrupt occurs to the CPU 141 after voltage application (step 1601), the firmware checks the value of MODE_SELECT 1503 in the reset interrupt function (step 1602). Note that the value of MODE_SELECT 1503 is set by the reset control circuit 420. If the value of MODE_SELECT 1503 is “10”, the firmware sets “1” in DPPU 1511 and sets D + 113 to the High state (step 1611). Thereafter, the firmware monitors whether the value of DP 1521 is “0” (step 1612). If the value is “0”, the processing device 100 operates with the USB interface.

なお、D+113がLow状態になったときに、USB検出回路430もしくはUSB制御回路143がCPU141に対して割り込みを発生させるようにしてもよい。以上のような処理が正常に行われた場合のみ、USBインタフェースが活性化され、処理装置100はUSBインタフェースでデータ転送を行う装置として動作することができる。   Note that the USB detection circuit 430 or the USB control circuit 143 may generate an interrupt to the CPU 141 when D + 113 is in the Low state. Only when the above processing is normally performed, the USB interface is activated, and the processing device 100 can operate as a device that performs data transfer through the USB interface.

また、ステップ1602においてMODE_SELECT1503の値が“01”の場合、ファームウェアは、40,000クロック以内にリセット割り込み関数内でATRをUART_I/O112経由で外部端末に送信する(ステップ1621)。以上のような処理が正常に行われた場合のみ、ISO7816インタフェースが活性化され、処理装置100はISO7816インタフェースでデータ転送を行う装置として動作することができる。   If the value of MODE_SELECT 1503 is “01” in step 1602, the firmware transmits ATR to the external terminal via the UART_I / O 112 within the reset interrupt function within 40,000 clocks (step 1621). Only when the above processing is performed normally, the ISO 7816 interface is activated, and the processing device 100 can operate as a device that performs data transfer with the ISO 7816 interface.

以上の処理により、一つの処理装置100において、ISO7816インタフェースおよびUSBインタフェースを活性化することができ、複数のインタフェースでのデータ転送に対応することが可能となる。ここで、図2に示したように、ISO7816インタフェースによるデータ転送に使用する外部端子と、USBインタフェースによるデータ転送に使用する外部端子とは重複していない。そのため、物理的には両方のインタフェースを同時に使用することも可能である。   Through the above processing, the ISO 7816 interface and the USB interface can be activated in one processing apparatus 100, and data transfer through a plurality of interfaces can be supported. Here, as shown in FIG. 2, the external terminals used for data transfer by the ISO7816 interface do not overlap with the external terminals used for data transfer by the USB interface. Therefore, physically both interfaces can be used simultaneously.

しかし、上述の初期動作時の処理の結果、処理装置100は、ISO7816インタフェースで動作しているときは外部クロック411で動作し、USBインタフェースで動作しているときは内部クロック412で動作している。そのため、両方のインタフェースを同時に使用する場合は、システムクロック413を外部クロック411もしくは内部クロック412のどちらかに統一する必要がある。   However, as a result of the processing during the initial operation described above, the processing device 100 operates with the external clock 411 when operating with the ISO 7816 interface, and operates with the internal clock 412 when operating with the USB interface. . Therefore, when both interfaces are used simultaneously, it is necessary to unify the system clock 413 as either the external clock 411 or the internal clock 412.

前述のように、USBインタフェースによるデータ転送の場合でも外部クロック411を利用することは可能であるが、その動作周波数が4MHz程度と低速であるため、大容量のデータを扱うUSBインタフェースによるデータ転送には適さない。そこで、本実施の形態の処理装置100では、両方のインタフェースを使用する際は、システムクロック413として内部クロック412を使用して動作するものとする。ただし、外部クロック411が高速な場合などは、システムクロック413として外部クロック411を使用する構成とすることも可能である。   As described above, it is possible to use the external clock 411 even in the case of data transfer by the USB interface, but since the operating frequency is as low as about 4 MHz, the data transfer by the USB interface that handles a large amount of data is possible. Is not suitable. Therefore, the processing apparatus 100 according to the present embodiment operates using the internal clock 412 as the system clock 413 when both interfaces are used. However, when the external clock 411 is at a high speed, the external clock 411 may be used as the system clock 413.

ここで、処理装置100がISO7816インタフェースで動作している最中にUSBインタフェースを活性化する場合、システムクロック413を外部クロック411から内部クロック412に切り替える必要が生じる。しかし、処理装置100の動作中に外部クロック411から内部クロック412に切り替えると、切り替えの際にノイズが生じ、CPU141が誤動作する可能性があるという問題点がある。   Here, when the USB interface is activated while the processing apparatus 100 is operating with the ISO 7816 interface, the system clock 413 needs to be switched from the external clock 411 to the internal clock 412. However, when switching from the external clock 411 to the internal clock 412 during the operation of the processing apparatus 100, there is a problem that noise is generated at the time of switching and the CPU 141 may malfunction.

そこで本実施の形態の処理装置100では、図4に示すように、クロック制御回路130に、スリープ信号416およびクロック切り替え信号417を有する構成としている。スリープ信号416は、CPU141がスリープ状態に移行する際にHigh状態にする信号であり、クロック切り替え信号417は、クロック切り替え回路410がシステムクロック413を外部クロック411から内部クロック412に切り替えた際にHigh状態にする信号である。   Therefore, in the processing apparatus 100 of the present embodiment, as shown in FIG. 4, the clock control circuit 130 has a sleep signal 416 and a clock switching signal 417. The sleep signal 416 is a signal that is set to a high state when the CPU 141 shifts to the sleep state, and the clock switching signal 417 is a high signal when the clock switching circuit 410 switches the system clock 413 from the external clock 411 to the internal clock 412. It is a signal to make a state.

以下に、本実施の形態の処理装置100における、USBインタフェースにて動作中にISO7816インタフェースの活性化を行う方法、およびISO7816インタフェースにて動作中にUSBインタフェースの活性化を行う方法について説明する。   Hereinafter, a method for activating the ISO 7816 interface while operating with the USB interface and a method for activating the USB interface while operating with the ISO 7816 interface in the processing apparatus 100 of the present embodiment will be described.

図8は、本実施の形態の処理装置100の、USBインタフェースにて動作中におけるISO7816インタフェースの活性化手順、およびISO7816インタフェースにて動作中におけるUSBインタフェースの活性化手順の例を表したフロー図である。また、図9は、本実施の形態の処理装置100の、USBインタフェースにて動作中におけるISO7816インタフェースの活性化手順のタイミングチャートの例である。また、図10は、本実施の形態の処理装置100の、ISO7816インタフェースにて動作中におけるUSBインタフェースの活性化手順のタイミングチャートの例である。   FIG. 8 is a flowchart showing an example of the activation procedure of the ISO 7816 interface during the operation with the USB interface and the activation procedure of the USB interface during the operation with the ISO 7816 interface of the processing apparatus 100 according to the present embodiment. is there. FIG. 9 is an example of a timing chart of the activation procedure of the ISO 7816 interface during the operation of the USB interface of the processing apparatus 100 according to the present embodiment. FIG. 10 is an example of a timing chart of the USB interface activation procedure during operation using the ISO 7816 interface of the processing apparatus 100 according to the present embodiment.

まず、処理装置100がUSBインタフェースで動作しているとき、クロック切り替え回路410がEX_CLK110経由で外部クロック411が供給されたことを検知すると(ステップ801)、ISO7816インタフェース活性化手順を開始する。このとき、クロック切り替え回路410は、外部クロック検出信号414をHigh状態にする(タイミング910)。   First, when the processing device 100 is operating with the USB interface, when the clock switching circuit 410 detects that the external clock 411 is supplied via EX_CLK 110 (step 801), the ISO 7816 interface activation procedure is started. At this time, the clock switching circuit 410 sets the external clock detection signal 414 to a high state (timing 910).

このとき、クロック切り替え回路410は、UART制御回路142には内部クロック412を供給する。ただし、UART制御回路142内にはUART_I/O112経由で外部端末とデータ転送を行うモジュールがあり、これらモジュールは外部クロック411にて動作する必要があるため、クロック切り替え回路410は、これらモジュールに対してのみ外部クロック411を供給するものとする。   At this time, the clock switching circuit 410 supplies the internal clock 412 to the UART control circuit 142. However, in the UART control circuit 142, there are modules that perform data transfer with an external terminal via the UART_I / O 112, and these modules need to operate with the external clock 411. Only the external clock 411 is supplied.

リセット制御回路420は、外部クロック検出信号414がHigh状態なってから400クロック以内に、EX_RESET111経由の外部リセット421がHigh状態になったことを検知すると(ステップ802)、UARTリセット423をHigh状態にする(タイミング920)。UARTリセット423がHigh状態になった後、UART制御回路142は、40,000クロック以内にATRをUART_I/O112経由で外部端末に送信する(ステップ803、タイミング930)。なお、UARTリセット423ではなく、システムリセット422をHigh状態にしてもよい。   When the reset control circuit 420 detects that the external reset 421 via the EX_RESET 111 is in the high state within 400 clocks after the external clock detection signal 414 is in the high state (step 802), the reset control circuit 420 sets the UART reset 423 to the high state. (Timing 920). After the UART reset 423 enters the high state, the UART control circuit 142 transmits the ATR to the external terminal via the UART_I / O 112 within 40,000 clocks (step 803, timing 930). Note that the system reset 422 may be set to the high state instead of the UART reset 423.

以上の処理が正常に行われた場合のみ、USBインタフェースでの動作中にISO7816インタフェースが活性化され、処理装置100は、USBインタフェースとISO7816インタフェースの両方を同時に使用して動作することができる。   Only when the above processing is normally performed, the ISO 7816 interface is activated during the operation with the USB interface, and the processing apparatus 100 can operate using both the USB interface and the ISO 7816 interface at the same time.

処理装置100がISO7816インタフェースで動作しているとき、USB検出回路430が、D+113とD−114とが少なくとも10msの間Low状態であることを検知すると(ステップ811)、USB活性化手順を開始する。このとき、USB検出回路430は、USB検出信号431をHigh状態にする(タイミング1010)。   When the processing apparatus 100 is operating with the ISO 7816 interface, when the USB detection circuit 430 detects that D + 113 and D-114 are in a low state for at least 10 ms (step 811), the USB activation procedure is started. . At this time, the USB detection circuit 430 sets the USB detection signal 431 to a high state (timing 1010).

内部オシレータ120は、USB検出信号431がHigh状態になったことを検知すると、内部クロック412を生成する(ステップ812、タイミング1010)。クロック切り替え回路410は、内部クロック412が安定した後、内部クロックスタート信号415をHigh状態にし、また、外部クロック411および内部クロック412の両方が供給されたことを確認した後、クロック切り替え信号417をHigh状態にする(タイミング1020)。また、リセット制御回路420は、内部クロックスタート信号415がHigh状態になったことを検知すると、USBリセット424をHigh状態にする(タイミング1020)。なお、USBリセット424をHigh状態にするタイミングは、後述するタイミング1040の後であってもよい。   When the internal oscillator 120 detects that the USB detection signal 431 is in a high state, the internal oscillator 120 generates an internal clock 412 (step 812, timing 1010). After the internal clock 412 is stabilized, the clock switching circuit 410 sets the internal clock start signal 415 to the High state, and after confirming that both the external clock 411 and the internal clock 412 are supplied, the clock switching signal 417 is output. A high state is set (timing 1020). In addition, when the reset control circuit 420 detects that the internal clock start signal 415 is in a high state, the reset control circuit 420 sets the USB reset 424 in a high state (timing 1020). Note that the timing at which the USB reset 424 is set to the high state may be after timing 1040 to be described later.

CPU141は、クロック切り替え信号417がHigh状態になったことを検知すると、スリープ状態に移行するために必要な処理(レジスタの設定や現在の状態の保存等)およびUSBインタフェースの処理に関するリセット処理を行う。必要な処理が完了した後、スリープ信号416をHigh状態にし、スリープ状態に移行する(ステップ813、タイミング1030)。   When the CPU 141 detects that the clock switching signal 417 is in the high state, the CPU 141 performs processing necessary for shifting to the sleep state (register setting, saving of the current state, etc.) and reset processing related to the USB interface processing. . After the necessary processing is completed, the sleep signal 416 is set to the high state and the sleep state is entered (step 813, timing 1030).

クロック切り替え回路410は、スリープ信号416がHigh状態になったことを検知すると、システムクロック413を外部クロック411から内部クロック412へと切り替える(ステップ814、タイミング1040)。システムクロック413を切り替えた後、CPU141に割り込み信号を送信し、CPU141の動作を再開させる(ステップ815)。その際に、クロック切り替え回路410は、クロック切り替え信号417およびスリープ信号416をLow状態にする(タイミング1040)。   When the clock switching circuit 410 detects that the sleep signal 416 is in a high state, the clock switching circuit 410 switches the system clock 413 from the external clock 411 to the internal clock 412 (step 814, timing 1040). After switching the system clock 413, an interrupt signal is transmitted to the CPU 141 to restart the operation of the CPU 141 (step 815). At that time, the clock switching circuit 410 sets the clock switching signal 417 and the sleep signal 416 to the Low state (timing 1040).

CPU141の動作再開後、USB制御回路143はD+113をHigh状態にする(ステップ816、タイミング1050)。なお、USB制御回路143の代わりに専用ハードウェアがD+113をHigh状態にしてもよい。また、USBリセット424をHigh状態にするタイミングがタイミング1020ではなくタイミング1040の後である場合は、USBリセット424がHigh状態になった後に、USB制御回路143がD+113をHigh状態にしてもよい。D+113がHigh状態になったことにより、外部端末はUSBインタフェースを持つ処理装置100が接続されたことを検知し、High状態になったD+113をLow状態にする(ステップ817、タイミング1060)。   After the operation of the CPU 141 is resumed, the USB control circuit 143 sets D + 113 to the high state (step 816, timing 1050). Note that, instead of the USB control circuit 143, dedicated hardware may set D + 113 to the High state. In addition, when the timing at which the USB reset 424 is set to the High state is not after the timing 1020 but after the timing 1040, the USB control circuit 143 may set D + 113 to the High state after the USB reset 424 is set to the High state. When D + 113 is in the High state, the external terminal detects that the processing apparatus 100 having the USB interface is connected, and sets D + 113 in the High state to the Low state (step 817, timing 1060).

以上の処理が正常に行われた場合のみ、ISO7816動作中にUSBインタフェースが活性化され、処理装置100は、USBインタフェースとISO7816インタフェースの両方を同時に使用して動作することができる。   Only when the above processing is normally performed, the USB interface is activated during the ISO 7816 operation, and the processing apparatus 100 can operate using both the USB interface and the ISO 7816 interface at the same time.

なお、本実施の形態の処理装置100では、両方のインタフェースを同時に使用する際に、システムクロック413として内部クロック412を使用する構成としているが、システムクロック413として外部クロック411を使用する場合は、上述のCPU141のスリープ状態への移行、クロック切り替え処理、CPU141の動作再開の一連の処理(ステップ813〜ステップ815)は、USBインタフェースでの動作中にISO7816インタフェースを活性化する処理の中で行われることになる。   In the processing apparatus 100 of the present embodiment, when both interfaces are used simultaneously, the internal clock 412 is used as the system clock 413. However, when the external clock 411 is used as the system clock 413, The series of processes (steps 813 to 815) of the transition to the sleep state of the CPU 141, the clock switching process, and the operation restart of the CPU 141 (steps 813 to 815) are performed in the process of activating the ISO 7816 interface during the operation with the USB interface. It will be.

以上の処理は、クロック制御回路130の他に、UART制御回路142やUSB制御回路143を利用することにより、全てハードウェアで行うことが可能であるが、以下では、CPU141に内蔵されたROM等に搭載したファームウェアを用いて、USBインタフェースにて動作中にISO7816インタフェースの活性化を行う方法、およびISO7816インタフェースにて動作中にUSBインタフェースの活性化を行う方法の例について説明する。   The above processing can be performed entirely by hardware by using the UART control circuit 142 and the USB control circuit 143 in addition to the clock control circuit 130, but in the following, a ROM built in the CPU 141, etc. An example of a method of activating the ISO 7816 interface during operation with the USB interface and a method of activating the USB interface while operating with the ISO 7816 interface using the firmware installed in the system will be described.

図17は、本実施の形態の処理装置100の、ファームウェアを用いたUSBインタフェースにて動作中におけるISO7816インタフェースの活性化手順、およびISO7816インタフェースにて動作中におけるUSBインタフェースの活性化手順の例を表したフロー図である。   FIG. 17 illustrates an example of the ISO 7816 interface activation procedure during operation with the USB interface using firmware and the USB interface activation procedure during operation with the ISO 7816 interface of the processing apparatus 100 according to the present embodiment. FIG.

図17において、処理装置100がUSBインタフェースで動作しているとき、CLK_SELECT1501には“1”、RESET_SELECT1502には“0”、MODE_SELECT1503には“10”、USB_DETECT1512には“1”がそれぞれ設定されている(ステップ1700)。   In FIG. 17, when the processing apparatus 100 is operating with the USB interface, “1” is set in the CLK_SELECT 1501, “0” in the RESET_SELECT 1502, “10” in the MODE_SELECT 1503, and “1” in the USB_DETECT 1512. (Step 1700).

クロック制御回路130もしくはUART制御回路142が、ISO7816インタフェース活性化手順の開始および外部リセット421がHigh状態になったことを検知すると、CPU141に対してUART割り込みを発生させる(ステップ1701)。このとき、クロック制御回路130は、MODE_SELECT1503を“11”に設定する。UART割り込みを検知すると、ファームウェアは、40,000クロック以内に、UART割り込み関数内でATRをUART_I/O112経由で送信する(ステップ1702)。なお、ATR送信後にMODE_SELECT1503に“11”に設定するようにしてもよい。   When the clock control circuit 130 or the UART control circuit 142 detects that the ISO 7816 interface activation procedure is started and the external reset 421 is in a high state, the CPU 141 generates a UART interrupt (step 1701). At this time, the clock control circuit 130 sets MODE_SELECT 1503 to “11”. When the UART interrupt is detected, the firmware transmits ATR via the UART_I / O 112 within the UART interrupt function within 40,000 clocks (step 1702). Note that MODE_SELECT 1503 may be set to “11” after ATR transmission.

以上のような処理が正常に行われた場合のみ、USBインタフェースでの動作中にISO7816インタフェースが活性化され、処理装置100は、USBインタフェースおよびISO7816インタフェースの両方を同時に使用して動作することができる。   Only when the above processing is normally performed, the ISO 7816 interface is activated during the operation with the USB interface, and the processing apparatus 100 can operate using both the USB interface and the ISO 7816 interface at the same time. .

処理装置100がISO7816インタフェースで動作しているとき、CLK_SELECT1501には“0”、RESET_SELECT1502には“1”、MODE_SELECT1503には“01”、USB_DETECT1512には“0”がそれぞれ設定されている(ステップ1710)。   When the processing apparatus 100 is operating with the ISO7816 interface, “0” is set in the CLK_SELECT 1501, “1” is set in the RESET_SELECT 1502, “01” is set in the MODE_SELECT 1503, and “0” is set in the USB_DETECT 1512 (Step 1710). .

USB検出回路430もしくはUSB制御回路143が、D+113およびD−114が少なくとも10msの間Low状態であることを検知すると、CPU141に対してUSB検出割り込みを発生させる(ステップ1711)。USB検出割り込みを検知すると、ファームウェアは、USB検出割り込み関数内で、CLK_SELECT1501に“1”を設定し(ステップ1712)、スリープ命令を実行してCPU141をスリープ状態に移行させる(ステップ1713)。なお、USB検出信号432がHigh状態になると、USB_DETECT1512に“1”が設定されるため、USB検出割り込みを利用せず、USB_DETECT1512が“1”になることをファームウェアで監視する方法でもよい。   When the USB detection circuit 430 or the USB control circuit 143 detects that D + 113 and D-114 are in a low state for at least 10 ms, a USB detection interrupt is generated for the CPU 141 (step 1711). When detecting the USB detection interrupt, the firmware sets “1” to CLK_SELECT 1501 in the USB detection interrupt function (step 1712), executes the sleep command, and shifts the CPU 141 to the sleep state (step 1713). Note that when the USB detection signal 432 is in a High state, “1” is set in the USB_DETECT 1512. Therefore, a method of monitoring the USB_DETECT 1512 to “1” without using the USB detection interrupt may be used.

スリープ命令が実行されるとスリープ信号416がHigh状態となるため、クロック切り替え回路410がシステムクロック413を内部クロック412へと切り替え、CPU141に割り込み信号を送信し、CPU141の動作を再開させる(ステップ1714)。CPU141の動作が再開した後、ファームウェアは、DPPU1511に“1”を設定し、D+113をHigh状態にする(ステップ1715)。その後、ファームウェアは、DP1521の値が“0”であるかどうかを監視し(ステップ1716)、“0”になった場合はUSBインタフェースで動作する。なお、D+113がLow状態になったときにCPU141に対して再度割り込みを発生させるようにしてもよい。   When the sleep command is executed, the sleep signal 416 is in a high state, so that the clock switching circuit 410 switches the system clock 413 to the internal clock 412, transmits an interrupt signal to the CPU 141, and resumes the operation of the CPU 141 (step 1714). ). After the operation of the CPU 141 resumes, the firmware sets “1” in the DPPU 1511 and sets D + 113 to the High state (step 1715). Thereafter, the firmware monitors whether the value of DP 1521 is “0” (step 1716). When the value is “0”, the firmware operates with the USB interface. Note that an interrupt may be generated again for the CPU 141 when D + 113 is in the Low state.

以上のような処理が正常に行われた場合のみ、ISO7816インタフェースにて動作中にUSBインタフェースが活性化され、処理装置100は、USBインタフェースおよびISO7816インタフェースの両方を同時に使用して動作することができる。   Only when the processing as described above is normally performed, the USB interface is activated during the operation with the ISO 7816 interface, and the processing apparatus 100 can operate using both the USB interface and the ISO 7816 interface at the same time. .

スリープ状態に移行している間はCPU141の動作は停止しているため、上記のようにシステムクロック413として供給するクロック系統の切り替えにおいてCPU141をスリープ状態にすることにより、ノイズの影響を受けずにクロック系統を切り替えることが可能となる。さらに、クロック系統の切り替え中に外部からクロックに対する攻撃を受けた場合でも、CPU141の動作は停止しているため、CPU141が誤動作する恐れはなく、処理装置100の耐タンパ性を維持することが可能となる。   Since the operation of the CPU 141 is stopped during the transition to the sleep state, the CPU 141 is brought into the sleep state in the switching of the clock system supplied as the system clock 413 as described above without being affected by noise. The clock system can be switched. Further, even when an external clock attack occurs during the switching of the clock system, the operation of the CPU 141 is stopped, so there is no possibility of the CPU 141 malfunctioning and the tamper resistance of the processing apparatus 100 can be maintained. It becomes.

次に、本実施の形態の処理装置100における、両方のインタフェースにて動作中にISO7816インタフェースの非活性化を行う方法、および両方のインタフェースにて動作中にUSBインタフェースの非活性化を行う方法について説明する。   Next, in the processing apparatus 100 of the present embodiment, a method for deactivating the ISO 7816 interface while operating on both interfaces, and a method for deactivating the USB interface while operating on both interfaces explain.

図11は、本実施の形態の処理装置100の、両方のインタフェースにて動作中におけるISO7816インタフェースの非活性化手順、および両方のインタフェースにて動作中におけるUSBインタフェースの非活性化手順の例を表したフロー図である。また、図12は、本実施の形態の処理装置100の、両方のインタフェースにて動作中におけるISO7816インタフェースの非活性化手順のタイミングチャートの例である。また、図13は、本実施の形態の処理装置100の、両方のインタフェースにて動作中におけるUSBインタフェースの非活性化手順のタイミングチャートの例である。   FIG. 11 shows an example of the deactivation procedure of the ISO 7816 interface while operating on both interfaces and the deactivation procedure of the USB interface while operating on both interfaces of the processing apparatus 100 of the present embodiment. FIG. FIG. 12 is an example of a timing chart of the ISO 7816 interface deactivation procedure during operation on both interfaces of the processing apparatus 100 according to the present embodiment. FIG. 13 is an example of a timing chart of the USB interface deactivation procedure during operation on both interfaces of the processing apparatus 100 according to the present embodiment.

まず、処理装置100が両方のインタフェースにて動作している際に、リセット制御回路420が、EX_RESET111経由の外部リセット421がLow状態になったことを検知した場合(ステップ1101)、ISO7816インタフェース非活性化手順を開始する。その際、リセット制御回路420はUARTリセット423をLow状態にする(タイミング1210)。外部リセット421がLow状態になったことを検知した後、クロック切り替え回路410は、EX_CLK110経由での外部クロック411の供給が停止したことを検知する(ステップ1102)。その際、外部クロック検出信号414をLow状態にする(タイミング1220)。   First, when the processing apparatus 100 is operating on both interfaces, if the reset control circuit 420 detects that the external reset 421 via the EX_RESET 111 is in a low state (step 1101), the ISO 7816 interface is deactivated. Start the conversion procedure. At that time, the reset control circuit 420 sets the UART reset 423 to the Low state (timing 1210). After detecting that the external reset 421 is in the Low state, the clock switching circuit 410 detects that the supply of the external clock 411 via the EX_CLK 110 is stopped (Step 1102). At this time, the external clock detection signal 414 is set to the Low state (timing 1220).

以上の処理が正常に行われたとき、ISO7816インタフェースは非活性化され、処理装置100は、USBインタフェースのみで動作することになる。その後、クロック制御回路130が外部クロック411の供給を検知することにより、再度ISO7816インタフェースを活性化することができる。なお、外部端末が外部リセット421をLow状態にせずに外部クロック411の供給を停止した場合も、ISO7816の規格には反するが、ISO7816インタフェースを非活性化し、処理装置100がUSBインタフェースのみで動作するようにしてもよい。   When the above processing is normally performed, the ISO 7816 interface is deactivated, and the processing apparatus 100 operates only with the USB interface. Thereafter, when the clock control circuit 130 detects the supply of the external clock 411, the ISO 7816 interface can be activated again. Even when the external terminal stops supplying the external clock 411 without setting the external reset 421 to the Low state, the ISO 7816 interface is deactivated and the processing apparatus 100 operates only with the USB interface, although it is against the ISO 7816 standard. You may do it.

処理装置100が両方のインタフェースにて動作している際に、USB検出回路430がD+113およびD−114の信号線の状態がサスペンド状態になったことを検知した場合(ステップ1111)、USBインタフェース非活性化手順を開始する。その際、USB検出回路430はUSB検出信号431をLow状態にする(タイミング1310)。サスペンド状態とは、3ms以上の間、外部端末との間でデータ転送を行っていないときに、消費電力を削減するため、処理装置100を省電力モードで動作させる場合の状態である。なお、USB検出回路430の代わりに、USB制御回路143や専用ハードウェアがサスペンド状態の検知を行ってもよい。   When the processing apparatus 100 is operating on both interfaces, if the USB detection circuit 430 detects that the state of the signal lines D + 113 and D-114 is in the suspended state (step 1111), the USB interface is not connected. Start the activation procedure. At this time, the USB detection circuit 430 sets the USB detection signal 431 to the low state (timing 1310). The suspended state is a state in which the processing apparatus 100 is operated in the power saving mode in order to reduce power consumption when data transfer is not performed with an external terminal for 3 ms or more. Instead of the USB detection circuit 430, the USB control circuit 143 or dedicated hardware may detect the suspended state.

CPU141は、USB検出信号431がLow状態になったことを検知すると、スリープ状態に移行するために必要な処理(レジスタの設定や現在の状態の保存等)を行う。必要な処理が完了した後、スリープ信号416をHigh状態にし、スリープ状態に移行する(ステップ1112、タイミング1320)。クロック切り替え回路410は、スリープ信号416がHigh状態になったことを検知すると、システムクロック413を内部クロック412から外部クロック411へと切り替える(ステップ1113、タイミング1330)。このとき、内部クロック412は停止してもよい。なお、内部クロックスタート信号415をLow状態にすることにより内部クロック412を停止させることも可能である(タイミング1330)。   When the CPU 141 detects that the USB detection signal 431 is in the low state, the CPU 141 performs processing (register setting, saving of the current state, etc.) necessary for shifting to the sleep state. After the necessary processing is completed, the sleep signal 416 is set to the high state and the sleep state is entered (step 1112, timing 1320). When the clock switching circuit 410 detects that the sleep signal 416 is in a high state, the clock switching circuit 410 switches the system clock 413 from the internal clock 412 to the external clock 411 (step 1113, timing 1330). At this time, the internal clock 412 may be stopped. Note that the internal clock 412 can be stopped by setting the internal clock start signal 415 to a low state (timing 1330).

システムクロック413の切り替え後、CPU141に割り込み信号を送信し、外部クロック411にてCPU141の動作を再開させる(ステップ1114、タイミング1340)。なお、ステップ1111にてUSBインタフェースがサスペンド状態になったことを検知した場合であっても、上記のようにシステムクロック413を内部クロック412から外部クロック411に切り替えず、内部クロック412のまま動作するようにしてもよい。   After switching the system clock 413, an interrupt signal is transmitted to the CPU 141, and the operation of the CPU 141 is resumed by the external clock 411 (step 1114, timing 1340). Even when it is detected in step 1111 that the USB interface is in the suspended state, the system clock 413 is not switched from the internal clock 412 to the external clock 411 as described above, and the internal clock 412 is operated. You may do it.

以上の処理が正常に行われたとき、USBインタフェースは非活性化され、処理装置100は、ISO7816インタフェースのみで動作することになる。その後、USB検出回路430もしくはCPU141が、D+113およびD−114の信号線の状態がレジューム状態になったことを検知することにより、再度USBインタフェースを活性化することができる。   When the above processing is normally performed, the USB interface is deactivated, and the processing apparatus 100 operates only with the ISO 7816 interface. Thereafter, when the USB detection circuit 430 or the CPU 141 detects that the signal lines of D + 113 and D-114 are in the resume state, the USB interface can be activated again.

以上の処理は、クロック制御回路130の他に、UART制御回路142やUSB制御回路143を利用することにより、全てハードウェアで行うことが可能であるが、以下では、CPU141に内蔵されたROM等に搭載したファームウェアを用いて、両方のインタフェースにて動作中にISO7816インタフェースの非活性化を行う方法、および両方のインタフェースにて動作中にUSBインタフェースの非活性化を行う方法の例について説明する。   The above processing can be performed entirely by hardware by using the UART control circuit 142 and the USB control circuit 143 in addition to the clock control circuit 130, but in the following, a ROM built in the CPU 141, etc. An example of a method of deactivating the ISO 7816 interface while operating on both interfaces and a method of deactivating the USB interface while operating on both interfaces using the firmware installed in the system will be described.

図18は、本実施の形態の処理装置100の、ファームウェアを用いた両方のインタフェースにて動作中におけるISO7816インタフェースの非活性化手順、および両方のインタフェースにて動作中におけるUSBインタフェースの非活性化手順の例を表したフロー図である。   FIG. 18 shows the deactivation procedure of the ISO 7816 interface during operation at both interfaces using the firmware and the deactivation procedure of the USB interface during operation at both interfaces of the processing apparatus 100 of the present embodiment. It is a flowchart showing the example of.

図18において、処理装置100が両方のインタフェースにて動作しているとき、CLK_SELECT1501には“1”、RESET_SELECT1502には“0”、MODE_SELECT1503には“11”、USB_DETECT1512には“1”がそれぞれ設定されている(ステップ1800)。   In FIG. 18, when the processing apparatus 100 is operating on both interfaces, “1” is set in the CLK_SELECT 1501, “0” in the RESET_SELECT 1502, “11” in the MODE_SELECT 1503, and “1” in the USB_DETECT 1512. (Step 1800).

処理装置100が両方のインタフェースにて動作している際に、ISO7816インタフェースの非活性化手順が開始した場合(ステップ1801)、ファームウェアでは特別な処理を行う必要が無いため、クロック制御回路130におけるISO7816インタフェースの非活性化手順が完了すると、処理装置100はUSBインタフェースのみで動作する。なお、クロック制御回路130もしくはUART制御回路142が、CPU141にEX_CLK100経由での外部クロック411の供給が停止したことを通知する割り込みを発生させてもよい。   When the deactivation procedure of the ISO 7816 interface is started when the processing apparatus 100 is operating on both interfaces (step 1801), the firmware does not need to perform any special processing, so the ISO 7816 in the clock control circuit 130 is not necessary. When the interface deactivation procedure is completed, the processing apparatus 100 operates only with the USB interface. Note that the clock control circuit 130 or the UART control circuit 142 may generate an interrupt notifying the CPU 141 that the supply of the external clock 411 via the EX_CLK 100 is stopped.

処理装置100が両方のインタフェースにて動作している際に、USB検出回路430もしくはUSB制御回路143がD+113およびD−114の信号線の状態がサスペンド状態になったことを検知すると、CPU141にUSBサスペンド割り込みを発生する(ステップ1811)。このとき、ファームウェアは、USBサスペンド割り込み関数内でCLK_SELECT1501に“0”を設定し(ステップ1812)、スリープ命令を実行してCPU141をスリープ状態に移行させる(ステップ1813)。なお、D+113およびD−114の信号線の状態がサスペンド状態になると“1”が設定されるようなレジスタを用いて、サスペンド状態を検知してもよい。   When the processing apparatus 100 is operating with both interfaces, if the USB detection circuit 430 or the USB control circuit 143 detects that the state of the signal lines D + 113 and D-114 is in the suspended state, the CPU 141 receives the USB signal. A suspend interrupt is generated (step 1811). At this time, the firmware sets “0” to CLK_SELECT 1501 in the USB suspend interrupt function (step 1812), executes the sleep instruction, and shifts the CPU 141 to the sleep state (step 1813). Note that the suspend state may be detected using a register in which “1” is set when the signal lines of D + 113 and D-114 are in the suspend state.

スリープ命令が実行されるとスリープ信号416がHigh状態となるため、クロック切り替え回路410がシステムクロック413を外部クロック411へと切り替え、CPU141に割り込み信号を送信し、CPU141の動作を再開させる(ステップ1814)。以上の処理が正常に行われたとき、USBインタフェースは非活性化され、処理装置100は、ISO7816インタフェースのみで動作することになる。   When the sleep instruction is executed, the sleep signal 416 is in a high state. Therefore, the clock switching circuit 410 switches the system clock 413 to the external clock 411, transmits an interrupt signal to the CPU 141, and resumes the operation of the CPU 141 (step 1814). ). When the above processing is normally performed, the USB interface is deactivated, and the processing apparatus 100 operates only with the ISO 7816 interface.

以上に説明したように、本実施の形態の処理装置100によれば、データ転送のためのインタフェースを複数有する場合であっても、インタフェースの状態に応じてシステムクロック413を外部クロック411と内部クロック412との間で切り替えることができ、かつ、クロック切り替えの際のノイズによるCPU141の誤動作がない手順にて切り替えることが可能となる。   As described above, according to the processing apparatus 100 of the present embodiment, even when there are a plurality of interfaces for data transfer, the system clock 413 is set to the external clock 411 and the internal clock according to the state of the interface. It is possible to switch between 412 and 412 in a procedure in which there is no malfunction of the CPU 141 due to noise at the time of clock switching.

これにより、ISO7816−2に準拠した外部端子を持つ処理装置100において、ISO7816−3に準拠したデータ転送を行うインタフェースと、ISO7816−12に準拠したUSB転送を行うインタフェースとを両方同時に使用することができ、ISO7816−3に準拠した少量のデータの転送を行う際は、消費電力が低い外部クロック411を利用して動作し、ISO7816−12に準拠した大容量のデータの転送を行う際は、消費電力が高い内部クロック412を利用して動作することが可能となる。   Thus, in the processing apparatus 100 having an external terminal compliant with ISO 7816-2, it is possible to simultaneously use both an interface that performs data transfer compliant with ISO 7816-3 and an interface that performs USB transfer compliant with ISO 7816-12. When transferring a small amount of data conforming to ISO 7816-3, it operates using an external clock 411 with low power consumption, and when transferring a large amount of data conforming to ISO 7816-12, It is possible to operate using the internal clock 412 having high power.

<実施の形態2>
本発明の実施の形態2である処理装置について説明する。図14は、本実施の形態の処理装置100の内部構成の例を示した図であり、図1に示す処理装置100の構成にコマンド解析モジュール1401を追加した構成となっている。
<Embodiment 2>
A processing apparatus according to the second embodiment of the present invention will be described. FIG. 14 is a diagram illustrating an example of the internal configuration of the processing apparatus 100 according to the present embodiment, in which a command analysis module 1401 is added to the configuration of the processing apparatus 100 illustrated in FIG.

処理装置100が、実施の形態1における図5のステップ521〜S523の処理等によりISO7816インタフェースを活性化した後、外部端末がUART_I/O112経由で特定のコマンドを処理装置100に入力すると、コマンド解析モジュール1401がそのコマンドを解析し、CPU141をスリープ状態に移行する。   When the processing apparatus 100 activates the ISO 7816 interface by the processing in steps 521 to S523 in FIG. 5 in the first embodiment, and the external terminal inputs a specific command to the processing apparatus 100 via the UART_I / O 112, command analysis The module 1401 analyzes the command and shifts the CPU 141 to the sleep state.

その後、実施の形態1における図8のステップ814〜ステップ815と同様に、システムクロック413を外部クロック411から内部クロック412へと切り替えた後、CPU141の動作を開始させる。さらに、内部クロック412から外部クロック411への切り替えも、上記と同様にUART_I/O112経由の特定のコマンドを用いることにより行うことができる。   After that, after switching the system clock 413 from the external clock 411 to the internal clock 412 as in Steps 814 to 815 in FIG. 8 in the first embodiment, the operation of the CPU 141 is started. Further, switching from the internal clock 412 to the external clock 411 can be performed by using a specific command via the UART_I / O 112 as described above.

また、コマンド解析モジュール1401を使用せず、CPU141に内蔵されたROM等に搭載したファームウェアを用いてコマンドを解析し、実施の形態1の図17におけるステップ1712〜ステップ1714と同様に、システムクロック413を外部クロック411から内部クロック412へと切り替えた後、CPU141の動作を開始させるようにしてもよい。さらに、内部クロック412から外部クロック411への切り替えも同様に行うことができる。   Further, the command is analyzed using the firmware installed in the ROM or the like built in the CPU 141 without using the command analysis module 1401, and the system clock 413 is the same as in steps 1712 to 1714 in FIG. 17 of the first embodiment. After switching from the external clock 411 to the internal clock 412, the operation of the CPU 141 may be started. Further, switching from the internal clock 412 to the external clock 411 can be performed in the same manner.

上記手順によりシステムクロック413を外部クロック411から内部クロック412へと切り替えた後、D+113およびD−114が少なくとも10msの間Low状態であることを検知した場合は、USBインタフェースの活性化手順を行った後、ISO7816インタフェースと同時にUSBインタフェースで動作させてもよい。なお、本実施の形態の処理装置100においては、ISO7816インタフェースを使用したコマンドの入力によりシステムクロック413を切り替えるため、USBインタフェースによるデータ転送のために必要なモジュールおよび端子がない構成であっても構わない。   After switching the system clock 413 from the external clock 411 to the internal clock 412 according to the above procedure, if it is detected that D + 113 and D-114 are in a low state for at least 10 ms, the USB interface activation procedure was performed. Thereafter, the USB interface may be operated simultaneously with the ISO 7816 interface. Note that the processing apparatus 100 according to the present embodiment may be configured such that the system clock 413 is switched by inputting a command using the ISO 7816 interface, and thus there are no modules and terminals necessary for data transfer using the USB interface. Absent.

以上に説明したように、本実施の形態の処理装置100によれば、外部からのコマンドによりシステムクロック413を外部クロック411と内部クロック412との間で切り替えることができ、かつ、クロック切り替えの際のノイズによるCPU141の誤動作がない手順にて切り替えることが可能となる。   As described above, according to the processing apparatus 100 of the present embodiment, the system clock 413 can be switched between the external clock 411 and the internal clock 412 by an external command, and at the time of clock switching. It is possible to switch in accordance with a procedure in which the CPU 141 does not malfunction due to noise.

<実施の形態3>
本発明の実施の形態3である処理装置について図19〜図30を用いて説明する。図19は、本実施の形態の処理装置100の内部構成の例を示した図であり、実施の形態1の図1に示す処理装置100の構成にSWP_I/O1917、SWP用内部オシレータ1921、およびSWP制御回路1944を追加した構成となっている。
<Embodiment 3>
The processing apparatus which is Embodiment 3 of this invention is demonstrated using FIGS. 19-30. FIG. 19 is a diagram illustrating an example of the internal configuration of the processing apparatus 100 according to the present embodiment. The configuration of the processing apparatus 100 illustrated in FIG. 1 according to the first embodiment includes the SWP_I / O 1917, the SWP internal oscillator 1921, and The SWP control circuit 1944 is added.

SWP_I/O1917は、外部端末と処理装置100との間でSWP(Single Wire Protocol)に準拠したデータ転送を行うための外部インタフェースであり、ETSI(European Telecommunications Standards Institute)の仕様では図2におけるC6端子206が割り当てられている。SWP制御回路1944は、SWPに準拠したデータ転送を実現する回路である。以下では、SWPに準拠したデータ転送を行うインタフェースをSWPインタフェースと記載する。SWPインタフェースによるデータ転送では、例えば、RF回路を有する外部端末と非接触通信によりデータ転送を行うという形態が一般的である。   SWP_I / O 1917 is an external interface for performing data transfer in conformity with SWP (Single Wire Protocol) between the external terminal and the processing apparatus 100. In the specification of ETSI (European Telecommunications Standards Institute), the C6 terminal in FIG. 206 is assigned. The SWP control circuit 1944 is a circuit that realizes data transfer conforming to SWP. Hereinafter, an interface that performs data transfer in conformity with SWP is referred to as an SWP interface. In the data transfer by the SWP interface, for example, a form in which data transfer is performed by non-contact communication with an external terminal having an RF circuit is common.

SWPインタフェースによるデータ転送の場合にも外部クロックを利用することは可能であるが、SWPインタフェースによる処理中に継続して外部端末から外部クロックが供給されるという保証がない。また、USBインタフェースの処理に使用する内部オシレータ120によって生成される内部クロックを利用することも可能であるが、SWPインタフェースは大容量のデータを扱わず、さらに消費電力をできるだけ低減させる必要があるため、USBインタフェースの処理に使用する内部クロックは適さない。   Although it is possible to use an external clock also in the case of data transfer through the SWP interface, there is no guarantee that the external clock is continuously supplied from the external terminal during the processing through the SWP interface. Although it is possible to use an internal clock generated by the internal oscillator 120 used for processing of the USB interface, the SWP interface does not handle a large amount of data and further needs to reduce power consumption as much as possible. The internal clock used for USB interface processing is not suitable.

そこで、本実施の形態の処理装置100では、クロック生成回路としてSWP用内部オシレータ1921を設け、SWPインタフェースによる処理の際にはSWP用内部オシレータ1921により生成したクロックを使用する構成をとる。なお、SWP用内部オシレータ1921は、処理装置100の内部に限られず、処理装置100の外部から接続する構成であってもよい。以下では、SWP用内部オシレータ1921が生成したクロックをSWP用内部クロックと記載する。   Therefore, the processing apparatus 100 according to the present embodiment has a configuration in which the SWP internal oscillator 1921 is provided as a clock generation circuit, and a clock generated by the SWP internal oscillator 1921 is used in processing by the SWP interface. The SWP internal oscillator 1921 is not limited to the inside of the processing apparatus 100, and may be configured to be connected from the outside of the processing apparatus 100. Hereinafter, the clock generated by the SWP internal oscillator 1921 is referred to as an SWP internal clock.

図20は、SWPインタフェースを持つ処理装置100の初期動作の流れの一例を表した図である。なお、SWPインタフェースは、ISO7816インタフェース、USBインタフェースとは独立して動作する。そのため、SWPインタフェースを持つ処理装置100におけるISO7816インタフェース、USBインタフェースの初期動作の流れは実施の形態1の図3と同様である。   FIG. 20 is a diagram illustrating an example of an initial operation flow of the processing apparatus 100 having the SWP interface. Note that the SWP interface operates independently of the ISO7816 interface and the USB interface. Therefore, the initial operation flow of the ISO 7816 interface and the USB interface in the processing apparatus 100 having the SWP interface is the same as that in FIG. 3 of the first embodiment.

電圧投入前、SWP_I/O1917はLow状態に設定する(ステップ2000)。電圧投入後、規定された動作電圧に達した後、SWP_I/O1917がHigh状態であるかどうかを判定する(ステップ2001)。ステップ2001での判定条件を満たしている場合のみ、以下で述べるSWPインタフェース活性化手順を行う。   Before the voltage is turned on, SWP_I / O 1917 is set to a low state (step 2000). After the voltage is applied, after reaching the specified operating voltage, it is determined whether or not the SWP_I / O 1917 is in a high state (step 2001). Only when the determination condition in step 2001 is satisfied, the SWP interface activation procedure described below is performed.

SWPインタフェース活性化手順では、処理装置100は、SWP_I/O1917がHigh状態になったことを検知すると、その応答として外部端末にACT_SYNCフレームを送信する(ステップ2002)。ACT_SYNCフレームを受信した外部端末は、受信したACT_SYNCフレームや外部端末の仕様に応じたACT_POWER_MODEフレームを処理装置100に送信する(ステップ2003)。外部端末が送信するACT_POWER_MODEフレームには、外部端末が準拠しているモード(フルパワーモードもしくはローパワーモード)を示すビットや、受信したACT_SYNCフレームに異常があったことを示すビット等が含まれる。   In the SWP interface activation procedure, when detecting that the SWP_I / O 1917 is in a high state, the processing apparatus 100 transmits an ACT_SYNC frame to the external terminal as a response (step 2002). The external terminal that has received the ACT_SYNC frame transmits the received ACT_SYNC frame and the ACT_POWER_MODE frame according to the specifications of the external terminal to the processing apparatus 100 (step 2003). The ACT_POWER_MODE frame transmitted by the external terminal includes a bit indicating a mode (full power mode or low power mode) compliant with the external terminal, a bit indicating that the received ACT_SYNC frame is abnormal, and the like.

受信したACT_POWER_MODEフレームがACT_SYNCフレームに異常があったことを示している場合(ステップ2004)、ステップ2002に戻って、処理装置100はACT_SYNCフレームの再送を行う。ステップ2004にて、受信したACT_POWER_MODEフレームがACT_SYNCフレームに異常があったことを示していない場合は、外部端末にACT_READYフレームを送信する(ステップ2005)。   When the received ACT_POWER_MODE frame indicates that the ACT_SYNC frame is abnormal (step 2004), the processing apparatus 100 returns to step 2002 and retransmits the ACT_SYNC frame. If the received ACT_POWER_MODE frame does not indicate that the ACT_SYNC frame is abnormal in step 2004, the ACT_READY frame is transmitted to the external terminal (step 2005).

以上の処理が正常に行われた場合のみ、SWPインタフェースは活性化され、処理装置100はSWPインタフェースでデータ転送を行う装置として動作する。以上の処理が正常に行われなかった場合は、SWPインタフェースでは動作しない。このとき、ISO7816インタフェースもしくはUSBインタフェースの活性化が正常に行われた場合は、処理装置100は当該インタフェースで動作する。   Only when the above processing is normally performed, the SWP interface is activated, and the processing device 100 operates as a device that performs data transfer through the SWP interface. If the above processing is not performed normally, the SWP interface does not operate. At this time, if the ISO 7816 interface or the USB interface is normally activated, the processing device 100 operates with the interface.

図21は、本実施の形態の処理装置100におけるクロック制御回路130に含まれるモジュールの構成例を示した図である。ここでは、実施の形態1の図4に示すクロック制御回路130の構成に、SWP検出回路2140、SWP検出信号2141、SWP用内部クロック2118、SWP用内部クロックスタート信号2119およびSWPリセット2125を追加した構成となっている。なお、SWP検出回路2140はSWP制御回路1944に搭載された構成であってもよい。   FIG. 21 is a diagram illustrating a configuration example of modules included in the clock control circuit 130 in the processing apparatus 100 according to the present embodiment. Here, the SWP detection circuit 2140, the SWP detection signal 2141, the SWP internal clock 2118, the SWP internal clock start signal 2119, and the SWP reset 2125 are added to the configuration of the clock control circuit 130 shown in FIG. 4 of the first embodiment. It has a configuration. The SWP detection circuit 2140 may be mounted on the SWP control circuit 1944.

SWP検出回路2140は、SWP_I/O1917の信号線の状態を監視し、SWP_I/O1917がHigh状態であることを検知すると、SWP検出信号2124をHigh状態にするモジュールである。SWP検出信号2141は、CPU141およびその他のモジュールにSWPインタフェースによりデータが転送されることを通知するための信号である。   The SWP detection circuit 2140 is a module that monitors the state of the signal line of the SWP_I / O 1917 and sets the SWP detection signal 2124 to the High state when detecting that the SWP_I / O 1917 is in the High state. The SWP detection signal 2141 is a signal for notifying the CPU 141 and other modules that data is transferred through the SWP interface.

SWP用内部オシレータ1921は、SWP検出信号2141がHigh状態になるとSWP用内部クロック2118の生成を開始する。ただし、SWP用内部クロック2118は、その発振が安定するまでCPU141などに供給するのを待つ必要がある。SWP用内部クロックスタート信号2119は、SWP用内部オシレータ1921で生成したSWP用内部クロック2118をCPU141や各インタフェース制御回路などに供給する際にHigh状態にする信号である。SWPリセット2125は、SWPインタフェース経由で転送するデータの処理のために必要なモジュールのみにリセットを供給する信号である。   The SWP internal oscillator 1921 starts generating the SWP internal clock 2118 when the SWP detection signal 2141 is in a High state. However, it is necessary to wait for the SWP internal clock 2118 to be supplied to the CPU 141 or the like until its oscillation is stabilized. The SWP internal clock start signal 2119 is a signal that is brought into a high state when the SWP internal clock 2118 generated by the SWP internal oscillator 1921 is supplied to the CPU 141, each interface control circuit, or the like. The SWP reset 2125 is a signal for supplying a reset only to a module necessary for processing data transferred via the SWP interface.

図22は、本実施の形態の処理装置100におけるSWPインタフェースの活性化手順のタイミングチャートの例を表した図である。まず、電圧投入前、EX_CLK110をLow状態、EX_RESET111をLow状態、UART_I/O112をHigh状態、SWP_I/O1917をLow状態、D+113をHigh状態、D−114をHigh状態に設定する(タイミング2210)。電圧投入後、SWP検出回路2140がSWP_I/O1917がHigh状態であることを検知した場合、SWP検出回路2140はSWP検出信号2141をHigh状態にする(タイミング2220)。   FIG. 22 is a diagram illustrating an example of a timing chart of the SWP interface activation procedure in the processing apparatus 100 according to the present embodiment. First, before voltage application, EX_CLK 110 is set to a low state, EX_RESET 111 is set to a low state, UART_I / O 112 is set to a high state, SWP_I / O 1917 is set to a low state, D + 113 is set to a high state, and D-114 is set to a high state (timing 2210). If the SWP detection circuit 2140 detects that the SWP_I / O 1917 is in the high state after the voltage is applied, the SWP detection circuit 2140 sets the SWP detection signal 2141 in the high state (timing 2220).

SWP用内部オシレータ1921は、SWP検出信号2141がHigh状態になったことを検知すると、SWP用内部クロック2118を生成する。その後、SWP用内部オシレータ1921内のタイマを利用して、SWP用内部クロック2118の発振が安定するのを待ち、安定した後、クロック切り替え回路410を経由して、CPU141および各インタフェース制御回路などにSWP用内部クロック2118をシステムクロック413として供給する(タイミング2230)。   The SWP internal oscillator 1921 generates the SWP internal clock 2118 when detecting that the SWP detection signal 2141 is in a high state. Thereafter, the timer in the SWP internal oscillator 1921 is used to wait for the oscillation of the SWP internal clock 2118 to stabilize, and after stabilization, the CPU 141 and each interface control circuit and the like are connected via the clock switching circuit 410. The SWP internal clock 2118 is supplied as the system clock 413 (timing 2230).

このとき、クロック切り替え回路410は、SWP用内部クロックスタート信号2219をHigh状態にする。なお、UART制御回路142およびUSB制御回路143にはSWP用内部クロック2118は供給しなくてもよい。また、リセット制御回路420は、SWP検出信号2141がHigh状態であり、かつSWP用内部クロックスタート信号2119がHigh状態であることを確認した後、システムリセット422をHigh状態にする(タイミング2230)。なお、システムリセット422ではなく、SWPリセット2125をHigh状態にしてもよい。   At this time, the clock switching circuit 410 sets the SWP internal clock start signal 2219 to a high state. Note that the SWP internal clock 2118 need not be supplied to the UART control circuit 142 and the USB control circuit 143. Further, after confirming that the SWP detection signal 2141 is in the high state and the SWP internal clock start signal 2119 is in the high state, the reset control circuit 420 sets the system reset 422 to the high state (timing 2230). Note that instead of the system reset 422, the SWP reset 2125 may be in a high state.

システムリセット422がHigh状態になった後、SWP制御回路1944は、外部端末にACT_SYNCフレームを送信する(タイミング2240)。ACT_SYNCフレームを受信した外部端末は、ACT_POWER_MODEフレームを処理装置100に送信する(タイミング2250)。ACT_POWER_MODEフレームを受信した処理装置100は、そのフレームを確認し、異常がない場合のみ外部端末にACT_READYフレームを送信する(タイミング2260)。なお、以上の処理をSWP制御回路1944の代わりに専用ハードウェアが行う構成としてもよい。   After the system reset 422 enters the high state, the SWP control circuit 1944 transmits an ACT_SYNC frame to the external terminal (timing 2240). The external terminal that has received the ACT_SYNC frame transmits an ACT_POWER_MODE frame to the processing apparatus 100 (timing 2250). The processing apparatus 100 that has received the ACT_POWER_MODE frame confirms the frame and transmits the ACT_READY frame to the external terminal only when there is no abnormality (timing 2260). The above processing may be performed by dedicated hardware instead of the SWP control circuit 1944.

以上の処理は、クロック制御回路130の他に、SWP制御回路1944を利用することにより、全てハードウェアで行うことが可能であるが、以下では、CPU141に内蔵されたROM等に搭載したファームウェアを用いて、SWPインタフェースの活性化を行う方法の例について説明する。   The above processing can be performed entirely by hardware by using the SWP control circuit 1944 in addition to the clock control circuit 130, but in the following, firmware loaded in a ROM or the like built in the CPU 141 will be described. An example of a method for activating the SWP interface will be described.

SWPインタフェースの活性化の際に使用するレジスタの構成は、実施の形態1の図15の構成と同様であるが、設定する値が異なる。本実施の形態では、図15において、CLK_SELECT1501は、システムクロック413の供給源を示すビットであり、例えば、“00”の場合は供給源が外部クロック411であることを示し、“01”の場合は供給源が内部クロック412であることを示し、“10”の場合は供給源がSWP用内部クロック2118であることを示す。RESET_SELECT1502は、外部リセット421の有効/無効を示すビットであり、例えば、“0”の場合は外部リセット421が無効であることを示し、“1”の場合は有効であることを示す。   The configuration of the register used when the SWP interface is activated is the same as the configuration of FIG. 15 of the first embodiment, but the set values are different. In the present embodiment, in FIG. 15, CLK_SELECT 1501 is a bit indicating the supply source of the system clock 413. For example, “00” indicates that the supply source is the external clock 411, and “01”. Indicates that the supply source is the internal clock 412, and “10” indicates that the supply source is the SWP internal clock 2118. The RESET_SELECT 1502 is a bit indicating whether the external reset 421 is valid / invalid. For example, “0” indicates that the external reset 421 is invalid, and “1” indicates that it is valid.

MODE_SELECT1503は、使用可能なインタフェースを示すビットであり、例えば、“001”の場合はISO7816インタフェースが使用可能であることを示し、“010”の場合はUSBインタフェースが使用可能であることを示し、“100”の場合はSWPインタフェースが使用可能であることを示す。さらに、“011”の場合はISO7816インタフェースとUSBインタフェースの両方が使用可能であることを示し、“101”の場合はISO7816インタフェースとSWPインタフェースの両方が使用可能であることを示し、“110”の場合はUSBインタフェースとSWPインタフェースの両方が使用可能であることを示し、“111”の場合は全てのインタフェースが使用可能であることを示す。   MODE_SELECT 1503 is a bit indicating an interface that can be used. For example, “001” indicates that the ISO 7816 interface can be used, and “010” indicates that the USB interface can be used. 100 ″ indicates that the SWP interface can be used. Further, “011” indicates that both the ISO 7816 interface and the USB interface can be used, and “101” indicates that both the ISO 7816 interface and the SWP interface can be used. The case indicates that both the USB interface and the SWP interface can be used, and the case of “111” indicates that all the interfaces can be used.

DPPU1511は、例えば、“1”を設定するとD+113もしくはD−114をプルアップするビットである。USB_DETECT1512は、D+113およびD−114が少なくとも10ms間Low状態であることをUSB検出回路430が検知すると“1”が設定されるビットである。USB_MODE1513は、USBインタフェースの速度を示すビットである。例えば、“0”の場合はLow Speedであることを示し、“1”の場合はFull Speedであることを示す。   The DPPU 1511 is, for example, a bit that pulls up D + 113 or D-114 when “1” is set. USB_DETECT 1512 is a bit that is set to “1” when the USB detection circuit 430 detects that D + 113 and D-114 are in a low state for at least 10 ms. USB_MODE 1513 is a bit indicating the speed of the USB interface. For example, “0” indicates Low Speed, and “1” indicates Full Speed.

DP1521は、D+113の状態を示すビットであり、例えば、“0”の場合はD+113がLow状態であることを示し、“1”の場合はHigh状態であることを示す。DM1522は、D−114の状態を示すビットであり、例えば、“0”の場合はD−114がLow状態であることを示し、“1”の場合はHigh状態であることを示す。   The DP 1521 is a bit indicating the state of D + 113. For example, “0” indicates that D + 113 is in the Low state, and “1” indicates that the state is in the High state. DM1522 is a bit indicating the state of D-114. For example, “0” indicates that D-114 is in the Low state, and “1” indicates that it is in the High state.

図23は、本実施の形態の処理装置100におけるファームウェアを用いたSWPインタフェースの活性化手順の例を表したフロー図である。電圧投入前、CLK_SELECT1501には“00”、RESET_SELECT1502には“1”、MODE_SELECT1503には“001”、DPPU1511には“0”、USB_DETECT1512には“0”がそれぞれ設定されている(ステップ2300)。なお、USB_MODE1513、DP1521、DM1522には、処理装置100の仕様によって異なる値が設定され得るが、本実施の形態の処理装置100では全て“1”が設定されているものとする。   FIG. 23 is a flowchart showing an example of a procedure for activating the SWP interface using firmware in the processing apparatus 100 according to the present embodiment. Before voltage application, “00” is set in CLK_SELECT 1501, “1” in RESET_SELECT 1502, “001” in MODE_SELECT 1503, “0” in DPPU 1511, and “0” in USB_DETECT 1512 (step 2300). Note that different values can be set in the USB_MODE 1513, DP1521, and DM1522, depending on the specifications of the processing apparatus 100, but it is assumed that all the processing apparatuses 100 of the present embodiment are set to “1”.

電圧投入後、CPU141に対してリセット割り込みが発生すると(ステップ2301)、ファームウェアは、リセット割り込み関数内でMODE_SELECT1503の値を確認する(ステップ2302)。なお、MODE_SELECT1503の値はリセット制御回路420が設定するものとする。   When a reset interrupt occurs to the CPU 141 after voltage application (step 2301), the firmware checks the value of MODE_SELECT 1503 in the reset interrupt function (step 2302). Note that the value of MODE_SELECT 1503 is set by the reset control circuit 420.

MODE_SELECT1503の値が“100”の場合、ファームウェアはACT_SYNCフレームを外部端末に送信する(ステップ2303)。ACT_SYNCフレームを受信した外部端末は、処理装置100にACT_POWER_MODEフレームを送信する(ステップ2304)。ACT_POWER_MODEフレームを受信した処理装置100は、受信したフレームを確認し(ステップ2305)、送信したACT_SYNCフレームに異常が無い場合のみ外部端末にACT_READYフレームを送信する(ステップ2306)。   If the value of MODE_SELECT 1503 is “100”, the firmware transmits an ACT_SYNC frame to the external terminal (step 2303). The external terminal that has received the ACT_SYNC frame transmits an ACT_POWER_MODE frame to the processing apparatus 100 (step 2304). The processing apparatus 100 that has received the ACT_POWER_MODE frame confirms the received frame (step 2305), and transmits the ACT_READY frame to the external terminal only when there is no abnormality in the transmitted ACT_SYNC frame (step 2306).

以上の処理が正常に行われた場合のみ、SWPインタフェースが活性化され、処理装置100はSWPインタフェースでデータ転送を行う装置として動作することができる。なお、SWP制御回路1944がACT_READYフレームの送信までハードウェアで行い、全て正常に動作した場合のみ、CPU141に対して割り込みを発生させる構成であってもよい。   Only when the above processing is normally performed, the SWP interface is activated, and the processing device 100 can operate as a device that performs data transfer through the SWP interface. Note that the SWP control circuit 1944 may be configured to generate an interrupt to the CPU 141 only when the ACT_READY frame is transmitted by hardware and everything operates normally.

ステップ2302において、MODE_SELECT1503の値が“100”以外の、“001”や“010”、“011”である場合には、実施の形態1で説明した手順により、ISO7816インタフェースやUSBインタフェースの活性化手順を行う(ステップ2311)。   In step 2302, if the value of MODE_SELECT 1503 is “001”, “010”, or “011” other than “100”, the ISO 7816 interface or USB interface activation procedure is performed according to the procedure described in the first embodiment. Is performed (step 2311).

以上の処理により、処理装置100において、SWPインタフェースを活性化することができる。ここで、図2に示したように、SWPインタフェースによるデータ転送に使用する外部端子とISO7816インタフェースおよびUSBインタフェースによるデータ転送に使用する外部端子とは重複しない。そのため、物理的に3つのインタフェースを同時に使用することも可能である。   With the above processing, the SWP interface can be activated in the processing apparatus 100. Here, as shown in FIG. 2, the external terminals used for data transfer by the SWP interface do not overlap with the external terminals used for data transfer by the ISO 7816 interface and the USB interface. Therefore, it is possible to use three physical interfaces simultaneously.

しかし、上述した初期動作時の処理の結果、処理装置100は、ISO7816インタフェースで動作しているときは外部クロック411で動作し、USBインタフェースで動作しているときは内部クロック412で動作し、SWPインタフェースで動作しているときはSWP用内部クロック2118で動作している。そのため、使用するインタフェースの組み合わせに応じて、システムクロック413で使用するクロックを統一する必要がある。   However, as a result of the processing during the initial operation described above, the processing apparatus 100 operates with the external clock 411 when operating with the ISO 7816 interface, and operates with the internal clock 412 when operating with the USB interface. When operating on the interface, the SWP internal clock 2118 is used. Therefore, it is necessary to unify the clocks used as the system clock 413 according to the combination of interfaces used.

一般的に、SWPインタフェースは非接触通信用途として使用する。そのため、SWPインタフェースで動作している最中にシステムクロックを外部クロック411や内部クロック412に切り替えることが時間的に難しい。そのため、SWPインタフェース動作中にISO7816インタフェースもしくはUSBインタフェースの活性化手順が開始された場合、クロック系統の変更は行わず、システムクロック413をSWP用内部クロック2118のままとする。   Generally, the SWP interface is used for non-contact communication. Therefore, it is difficult in terms of time to switch the system clock to the external clock 411 or the internal clock 412 while operating with the SWP interface. Therefore, when the activation procedure of the ISO 7816 interface or the USB interface is started during the SWP interface operation, the clock system is not changed and the system clock 413 remains the SWP internal clock 2118.

また、USBインタフェースとSWPインタフェースを比較した場合、USBインタフェースの方が大容量のデータを扱うため、通常、内部クロック412の方がSWP用内部クロック2118より高速である。そのため、USBインタフェース動作中にSWPインタフェースの活性化手順が開始された場合、クロック系統の変更は行わず、システムクロック413を内部クロック412のままとする。   When the USB interface and the SWP interface are compared, the USB interface handles a larger volume of data, and therefore the internal clock 412 is usually faster than the SWP internal clock 2118. Therefore, when the SWP interface activation procedure is started during the USB interface operation, the clock system is not changed and the system clock 413 remains the internal clock 412.

なお、SWPインタフェースによるデータ転送の場合でも外部クロック411を利用することは可能である。しかし、外部クロック411がSWPインタフェースの動作中に供給され続けるという保証はない。そこで、ISO7816インタフェース動作中にSWPインタフェースの活性化が開始された場合、システムクロック413を外部クロック411からSWP用内部クロック2118に変更するものとする。   Note that the external clock 411 can be used even in the case of data transfer by the SWP interface. However, there is no guarantee that the external clock 411 will continue to be supplied during operation of the SWP interface. Therefore, when the activation of the SWP interface is started during the ISO 7816 interface operation, the system clock 413 is changed from the external clock 411 to the SWP internal clock 2118.

しかし、処理装置100の動作中に外部クロック411からSWP用内部クロック2118に切り替えると、切り替えの際にノイズが生じ、CPU141が誤動作する可能性があるという問題点がある。そこで本実施の形態の処理装置100では、実施の形態1の図4と同様に、クロック制御回路430に、スリープ信号416およびクロック切り替え信号417を有する構成としている。   However, when switching from the external clock 411 to the SWP internal clock 2118 during the operation of the processing apparatus 100, there is a problem that noise is generated at the time of switching and the CPU 141 may malfunction. Therefore, in the processing apparatus 100 of the present embodiment, the clock control circuit 430 includes the sleep signal 416 and the clock switching signal 417 as in FIG. 4 of the first embodiment.

以下に、本実施の形態の処理装置100が、USBインタフェースにて動作中にSWPインタフェースの活性化手順を行う方法、およびISO7816インタフェースにて動作中にSWPインタフェースの活性化手順を行う方法について説明する。図24は、本実施の形態の処理装置100の、USBインタフェースまたはISO7816インタフェースにて動作中におけるSWPインタフェースの活性化手順の流れの例を表したフロー図である。また、図25は、本実施の形態の処理装置100の、USBインタフェースにて動作中におけるSWPインタフェースの活性化手順のタイミングチャートの例である。また、図26は、本実施の形態の処理装置100の、ISO7816インタフェースにて動作中におけるSWPインタフェースの活性化手順のタイミングチャートの例である。   Hereinafter, a method for performing the SWP interface activation procedure while the processing apparatus 100 according to the present embodiment is operating on the USB interface and a method for performing the SWP interface activation procedure while operating on the ISO 7816 interface will be described. . FIG. 24 is a flowchart showing an example of the flow of the activation procedure of the SWP interface during the operation with the USB interface or the ISO 7816 interface of the processing apparatus 100 of the present embodiment. FIG. 25 is an example of a timing chart of the activation procedure of the SWP interface during the operation with the USB interface of the processing apparatus 100 according to the present embodiment. FIG. 26 is an example of a timing chart of the activation procedure of the SWP interface during the operation by the ISO 7816 interface of the processing apparatus 100 according to the present embodiment.

まず、処理装置100がUSBインタフェースで動作しているとき、SWP検出回路2140が、SWP_I/O1917がLow状態からHigh状態に変化したことを検知すると(ステップ2401)、SWP活性化手順を開始する。このとき、SWP検出回路2140は、SWP検出信号2141をHigh状態にする(タイミング2510)。   First, when the processing apparatus 100 is operating with the USB interface, when the SWP detection circuit 2140 detects that the SWP_I / O 1917 has changed from the low state to the high state (step 2401), the SWP activation procedure is started. At this time, the SWP detection circuit 2140 sets the SWP detection signal 2141 to a high state (timing 2510).

SWP用内部オシレータ1921は、SWP検出信号2141がHigh状態になったことを検知すると、SWP用内部クロック2118を生成する(タイミング2510)。クロック切り替え回路410は、SWP用内部クロック2118が安定した後、SWP用内部クロックスタート信号2119をHigh状態にする(タイミング2520)。このとき、クロック切り替え回路410は、SWP用制御回路1944には内部クロック412を供給する。   When the SWP internal oscillator 1921 detects that the SWP detection signal 2141 is in a high state, it generates the SWP internal clock 2118 (timing 2510). The clock switching circuit 410 sets the SWP internal clock start signal 2119 to the high state after the SWP internal clock 2118 is stabilized (timing 2520). At this time, the clock switching circuit 410 supplies the internal clock 412 to the SWP control circuit 1944.

リセット制御回路420は、SWP用内部クロックスタート信号2119がHigh状態になったことを検知すると、SWPリセット信号2125をHigh状態にする(タイミング2520)。なお、SWPリセット信号2125をHigh状態にするタイミングは、SWP検出信号2141がHigh状態になったタイミング(タイミング2510)でもよい。   When the reset control circuit 420 detects that the SWP internal clock start signal 2119 is in the high state, the reset control circuit 420 sets the SWP reset signal 2125 in the high state (timing 2520). Note that the timing when the SWP reset signal 2125 is set to the High state may be the timing when the SWP detection signal 2141 is set to the High state (timing 2510).

SWP制御回路1944は、SWPリセット信号2125がHigh状態になったことを検知すると、外部端末にACT_SYNCフレームを送信する(ステップ2402、タイミング2530)。なお、SWP制御回路1944は、SWP検出信号2141がHigh状態になったことを検知することにより、外部端末にACT_SYNCフレームを送信してもよい。   When the SWP control circuit 1944 detects that the SWP reset signal 2125 is in a high state, the SWP control circuit 1944 transmits an ACT_SYNC frame to the external terminal (step 2402, timing 2530). Note that the SWP control circuit 1944 may transmit the ACT_SYNC frame to the external terminal by detecting that the SWP detection signal 2141 is in a high state.

ACT_SYNCフレームを受信した外部端末は、処理装置100にACT_POWER_MODEフレームを送信する(ステップ2403、タイミング2540)。ACT_POWER_MODEフレームを受信した処理装置100は、外部端末にACT_READYフレームを送信する(ステップ2404、タイミング2550)。   The external terminal that has received the ACT_SYNC frame transmits an ACT_POWER_MODE frame to the processing apparatus 100 (step 2403, timing 2540). The processing apparatus 100 that has received the ACT_POWER_MODE frame transmits an ACT_READY frame to the external terminal (step 2404, timing 2550).

以上の処理が正常に行われた場合のみ、USBインタフェースでの動作中にSWPインタフェースが活性化され、処理装置100は、USBインタフェースとSWPインタフェースの両方を同時に使用して動作することができる。   Only when the above processing is normally performed, the SWP interface is activated during the operation with the USB interface, and the processing apparatus 100 can operate using both the USB interface and the SWP interface at the same time.

処理装置100がISO7816インタフェースで動作しているとき、SWP検出回路2140が、SWP_I/O1917がLow状態からHigh状態に変化したことを検知すると(ステップ2411)、SWP活性化手順を開始する。このとき、SWP検出回路2140は、SWP検出信号2141をHigh状態にする(タイミング2610)。   When the processing apparatus 100 is operating with the ISO 7816 interface, when the SWP detection circuit 2140 detects that the SWP_I / O 1917 has changed from the low state to the high state (step 2411), the SWP activation procedure is started. At this time, the SWP detection circuit 2140 sets the SWP detection signal 2141 to a high state (timing 2610).

SWP用内部オシレータ1921は、SWP検出信号2141がHigh状態になったことを検知すると、SWP用内部クロック2118を生成する(ステップ2412、タイミング2610)。クロック切り替え回路410は、SWP用内部クロック2118が安定した後、SWP用内部クロックスタート信号2119をHigh状態にし、外部クロック411およびSWP用内部クロック2118の両方が供給されたことを確認した後、クロック切り替え信号417をHigh状態にする(タイミング2620)。また、リセット制御回路420は、SWP用内部クロックスタート信号2119がHigh状態になったことを検知すると、SWPリセット信号2125をHigh状態にする(タイミング2620)。   When the SWP internal oscillator 1921 detects that the SWP detection signal 2141 is in a high state, it generates the SWP internal clock 2118 (step 2412, timing 2610). After the SWP internal clock 2118 is stabilized, the clock switching circuit 410 sets the SWP internal clock start signal 2119 to the High state, and after confirming that both the external clock 411 and the SWP internal clock 2118 are supplied, The switching signal 417 is set to the high state (timing 2620). When the reset control circuit 420 detects that the SWP internal clock start signal 2119 is in a high state, the reset control circuit 420 sets the SWP reset signal 2125 in a high state (timing 2620).

CPU141は、クロック切り替え信号417がHigh状態になったことを検知すると、スリープ状態に移行するために必要な処理(レジスタの設定や現在の状態の保存等)およびSWPインタフェースの処理に関するリセット処理を行う。必要な処理が完了した後、スリープ信号416をHigh状態にし、スリープ状態に移行する(ステップ2413、タイミング2630)。   When the CPU 141 detects that the clock switching signal 417 is in the high state, the CPU 141 performs processing necessary for shifting to the sleep state (register setting, saving of the current state, etc.) and reset processing related to SWP interface processing. . After the necessary processing is completed, the sleep signal 416 is set to the high state and the sleep state is entered (step 2413, timing 2630).

クロック切り替え回路410は、スリープ信号416がHigh状態になったことを検知すると、システムクロック413を外部クロック411からSWP用内部クロック2118へと切り替える(ステップ2414、タイミング2640)。システムクロック413を切り替えた後、CPU141に割り込み信号を送信し、CPU141の動作を再開させる(ステップ2415)。その際に、クロック切り替え回路410は、クロック切り替え信号417およびスリープ信号416をLow状態にする(タイミング2640)。   When the clock switching circuit 410 detects that the sleep signal 416 is in a high state, the clock switching circuit 410 switches the system clock 413 from the external clock 411 to the SWP internal clock 2118 (step 2414, timing 2640). After switching the system clock 413, an interrupt signal is transmitted to the CPU 141 to restart the operation of the CPU 141 (step 2415). At that time, the clock switching circuit 410 sets the clock switching signal 417 and the sleep signal 416 to the Low state (timing 2640).

CPU141の動作再開後、SWP制御回路1944は、外部端末にACT_SYNCフレームを送信する(ステップ2416、タイミング2650)。ACT_SYNCフレームを受信した外部端末は、処理装置100にACT_POWER_MODEフレームを送信する(ステップ2417)。ACT_POWER_MODEフレームを受信した処理装置100は、外部端末にACT_READYフレームを送信する(ステップ2418)。   After the operation of the CPU 141 is resumed, the SWP control circuit 1944 transmits an ACT_SYNC frame to the external terminal (step 2416, timing 2650). The external terminal that has received the ACT_SYNC frame transmits an ACT_POWER_MODE frame to the processing apparatus 100 (step 2417). The processing apparatus 100 that has received the ACT_POWER_MODE frame transmits an ACT_READY frame to the external terminal (step 2418).

以上の処理が正常に行われた場合のみ、ISO7816インタフェースでの動作中にSWPインタフェースが活性化され、処理装置100は、ISO7816インタフェースとSWPインタフェースの両方を同時に使用して動作することができる。なお、ISO7816インタフェースでの動作中にSWPインタフェース活性化手順を行う際に、USBインタフェースでの動作中にSWPインタフェース活性化手順を行う場合と同様に、外部クロックからSWP用内部クロック2118へのシステムクロック413の切り替えを行わず、システムクロック413を外部クロック411のまま動作するようにしてもよい。   Only when the above processing is normally performed, the SWP interface is activated during the operation of the ISO 7816 interface, and the processing apparatus 100 can operate using both the ISO 7816 interface and the SWP interface at the same time. Note that when performing the SWP interface activation procedure during operation with the ISO 7816 interface, the system clock from the external clock to the SWP internal clock 2118 is the same as when performing the SWP interface activation procedure during operation with the USB interface. The system clock 413 may be operated as the external clock 411 without switching 413.

処理装置100がUSBインタフェースおよびISO7816インタフェースの両方にて動作中にSWPインタフェースの活性化手順を行う場合は、ステップ2401〜ステップ2404と同様の方法でSWPインタフェースの活性化を行うものとする。また、処理装置100がUSBインタフェースおよびISO7816インタフェースの両方にて動作中にSWPインタフェースの活性化手順を行う場合に、ステップ2411〜ステップ2418と同様の方法でシステムクロック413をSWP用内部クロック2118に切り替えても良い。   When the processing apparatus 100 performs the SWP interface activation procedure while operating with both the USB interface and the ISO 7816 interface, the SWP interface is activated in the same manner as in steps 2401 to 2404. In addition, when the processing apparatus 100 performs the SWP interface activation procedure while operating with both the USB interface and the ISO 7816 interface, the system clock 413 is switched to the SWP internal clock 2118 in the same manner as in steps 2411 to 2418. May be.

以上の処理は、クロック制御回路130の他に、UART制御回路142、USB制御回路143や、SWP制御回路1944を利用することにより、全てハードウェアで行うことが可能であるが、以下では、CPU141に内蔵されたROM等に搭載したファームウェアを用いて、ISO7816インタフェースでの動作中にSWPインタフェースの活性化を行う方法の例について説明する。   The above processing can be performed entirely by hardware by using the UART control circuit 142, the USB control circuit 143, and the SWP control circuit 1944 in addition to the clock control circuit 130, but in the following, the CPU 141 An example of a method for activating the SWP interface during operation with the ISO 7816 interface using firmware loaded in a ROM or the like built in the PC will be described.

図27は、本実施の形態の処理装置100の、ファームウェアを用いたISO7816インタフェースにて動作中におけるSWPインタフェースの活性化手順の流れの例を表したフロー図である。処理装置100がISO7816インタフェースで動作しているとき、CLK_SELECT1501には“00”、RESET_SELECT1502には“1”、MODE_SELECT1503には“001”、USB_DETECT1512には“0”がそれぞれ設定されている(ステップ2700)。   FIG. 27 is a flowchart showing an example of the flow of the activation procedure of the SWP interface during the operation of the ISO 7816 interface using firmware in the processing apparatus 100 of the present embodiment. When the processing apparatus 100 is operating with the ISO7816 interface, “00” is set in the CLK_SELECT 1501, “1” is set in the RESET_SELECT 1502, “001” is set in the MODE_SELECT 1503, and “0” is set in the USB_DETECT 1512 (Step 2700). .

処理装置100がISO7816インタフェースで動作しているとき、クロック制御回路130もしくはSWP制御回路1944が、SWP_I/O1917がLow状態からHigh状態に変化したことを検知すると、CPU141に対してSWP検出割り込みを発生させる(ステップ2701)。ファームウェアは、SWP検出割り込み関数内で、CLK_SELECT1501に“10”を設定し(ステップ2702)、スリープ命令を実行してCPU141をスリープ状態に移行させる(ステップ2703)。   When the processing device 100 is operating with the ISO 7816 interface, when the clock control circuit 130 or the SWP control circuit 1944 detects that the SWP_I / O 1917 has changed from the low state to the high state, it generates a SWP detection interrupt to the CPU 141. (Step 2701). In the SWP detection interrupt function, the firmware sets “10” to CLK_SELECT 1501 (step 2702), executes the sleep instruction, and shifts the CPU 141 to the sleep state (step 2703).

スリープ命令が実行されるとスリープ信号416がHigh状態となるため、クロック切り替え回路410がシステムクロック413をSWP用内部クロック2118へと切り替え、CPU141に割り込み信号を送信し、CPU141の動作を再開させる(ステップ2704)。CPU141の動作が再開した後、ファームウェアは、外部端末にACT_SYNCフレームを送信する(ステップ2705)。   When the sleep instruction is executed, the sleep signal 416 is in a high state, so the clock switching circuit 410 switches the system clock 413 to the SWP internal clock 2118, transmits an interrupt signal to the CPU 141, and resumes the operation of the CPU 141 ( Step 2704). After the operation of the CPU 141 resumes, the firmware transmits an ACT_SYNC frame to the external terminal (step 2705).

ACT_SYNCフレームを受信した外部端末は、処理装置100にACT_POWER_MODEフレームを送信する(ステップ2706)。ACT_POWER_MODEフレームを受信した処理装置100は、外部端末にACT_READYフレームを送信する(ステップ2707)。   The external terminal that has received the ACT_SYNC frame transmits an ACT_POWER_MODE frame to the processing apparatus 100 (step 2706). Receiving the ACT_POWER_MODE frame, the processing device 100 transmits the ACT_READY frame to the external terminal (step 2707).

以上の処理が正常に行われた場合のみ、ISO7816インタフェースでの動作中にSWPインタフェースが活性化され、処理装置100は、ISO7816インタフェースとSWPインタフェースの両方を同時に使用して動作することができる。なお、処理装置100がUSBインタフェース、もしくはISO7816インタフェースとUSBインタフェースの両方で動作中に、SWPインタフェース活性化手順においてシステムクロック413を内部クロック412からSWP用クロック2118に切り替える場合も、ステップ2701〜ステップ2707と同様の手順で行うことが可能である。   Only when the above processing is normally performed, the SWP interface is activated during the operation of the ISO 7816 interface, and the processing apparatus 100 can operate using both the ISO 7816 interface and the SWP interface at the same time. Even when the processing device 100 is operating with the USB interface or both the ISO 7816 interface and the USB interface, the system clock 413 is switched from the internal clock 412 to the SWP clock 2118 in the SWP interface activation procedure. The same procedure can be used.

次に、本実施の形態の処理装置100が、ISO7816インタフェースおよびSWPインタフェースの両方にて動作中に、SWPインタフェースを非活性化する方法について説明する。なお、ISO7816インタフェースおよびSWPインタフェースの両方にて動作中にISO7816インタフェースを非活性化する際は、実施の形態1の図11におけるステップ1101〜ステップ1102およびタイミング1210〜タイミング1220と同様の手順で行うことができる。   Next, a method for deactivating the SWP interface while the processing apparatus 100 according to the present embodiment is operating with both the ISO 7816 interface and the SWP interface will be described. When deactivating the ISO 7816 interface during operation with both the ISO 7816 interface and the SWP interface, the same procedure as in steps 1101 to 1102 and timings 1210 to 1220 in FIG. 11 of the first embodiment is performed. Can do.

図28は、本実施の形態の処理装置100の、ISO7816インタフェースおよびSWPインタフェースの両方にて動作中におけるSWPインタフェースの非活性化手順の流れの例を表したフロー図である。また、図29は、本実施の形態の処理装置100の、ISO7816インタフェースおよびSWPインタフェースの両方にて動作中におけるSWPインタフェースの非活性化手順のタイミングチャートの例である。   FIG. 28 is a flowchart showing an example of the flow of the deactivation procedure of the SWP interface during the operation of both the ISO 7816 interface and the SWP interface of the processing apparatus 100 of the present embodiment. FIG. 29 is an example of a timing chart of the SWP interface deactivation procedure during the operation of both the ISO 7816 interface and the SWP interface of the processing apparatus 100 according to the present embodiment.

処理装置100がISO7816インタフェースおよびSWPインタフェースの両方にて動作している際に、SWP検出回路2140が、SWP_I/O1917がDe−Active状態になったことを検知した場合(ステップ2801)、SWPインタフェース非活性化手順を開始する。SWP検出回路2140は、SWP_I/O1917がDe−Active状態になったことを検知すると、SWP検出信号2141をLow状態にする(タイミング2910)。   When the processing apparatus 100 is operating with both the ISO 7816 interface and the SWP interface, if the SWP detection circuit 2140 detects that the SWP_I / O 1917 is in the De-Active state (step 2801), the SWP interface is not used. Start the activation procedure. When the SWP detection circuit 2140 detects that the SWP_I / O 1917 is in the De-Active state, the SWP detection circuit 2140 sets the SWP detection signal 2141 in the Low state (timing 2910).

CPU141は、SWP検出信号2141がLow状態になったことを検知すると、スリープ状態に移行するために必要な処理(レジスタの設定や現在の状態の保存等)を行う。必要な処理が完了した後、スリープ信号416をHigh状態にし、スリープ状態に移行する(ステップ2802、タイミング2920)。   When the CPU 141 detects that the SWP detection signal 2141 is in the low state, the CPU 141 performs processing (register setting, saving of the current state, etc.) necessary for shifting to the sleep state. After the necessary processing is completed, the sleep signal 416 is set to the high state and the sleep state is entered (step 2802, timing 2920).

クロック切り替え回路410は、スリープ信号416がHigh状態になったことを検
知すると、システムクロック413をSWP用内部クロック2118から外部クロック411へと切り替える(ステップ2803、タイミング2930)。このとき、SWP用内部クロック2118は停止してもよい。なお、SWP用内部クロックスタート信号2119をLow状態にすることによりSWP用内部クロック2118を停止させることも可能である(タイミング2930)。
When the clock switching circuit 410 detects that the sleep signal 416 is in a high state, the clock switching circuit 410 switches the system clock 413 from the SWP internal clock 2118 to the external clock 411 (step 2803, timing 2930). At this time, the SWP internal clock 2118 may be stopped. Note that the SWP internal clock 2118 can be stopped by setting the SWP internal clock start signal 2119 to the Low state (timing 2930).

システムクロック413の切り替え後、CPU141に割り込み信号を送信し、外部クロック411にてCPU141の動作を再開させる(ステップ2804、タイミング2940)。以上の処理が正常に行われたとき、SWPインタフェースは非活性化され、処理装置100は、ISO7816インタフェースのみで動作することになる。   After switching the system clock 413, an interrupt signal is transmitted to the CPU 141, and the operation of the CPU 141 is resumed by the external clock 411 (step 2804, timing 2940). When the above processing is normally performed, the SWP interface is deactivated, and the processing apparatus 100 operates only with the ISO7816 interface.

以上の処理は、クロック制御回路130の他に、UART制御回路144やSWP制御回路1944を利用することにより、全てハードウェアで行うことが可能であるが、以下では、CPU141に内蔵されたROMに搭載したファームウェアを用いてISO7816インタフェースおよびSWPインタフェースの両方にて動作中にSWPインタフェースの非活性化を行う方法の例について説明する。   The above processing can be performed entirely by hardware by using the UART control circuit 144 and the SWP control circuit 1944 in addition to the clock control circuit 130. However, in the following, the ROM is built in the CPU 141. An example of a method for deactivating the SWP interface while operating on both the ISO 7816 interface and the SWP interface using the installed firmware will be described.

図30は、本実施の形態の処理装置100の、ファームウェアを用いたISO7816インタフェースおよびSWPインタフェースの両方にて動作中におけるSWPインタフェースの非活性化手順の流れの例を表したフロー図である。処理装置100がISO7816インタフェースおよびSWPインタフェースの両方にて動作しているとき、CLK_SELECT1501には“10”、RESET_SELECT1502には“0”、MODE_SELECT1503には“101”、USB_DETECT1512には“1”がそれぞれ設定されている(ステップ3000)。   FIG. 30 is a flowchart showing an example of the flow of the deactivation procedure of the SWP interface during the operation of both the ISO 7816 interface and the SWP interface using firmware in the processing apparatus 100 of the present embodiment. When the processing device 100 is operating with both the ISO7816 interface and the SWP interface, “10” is set in the CLK_SELECT 1501, “0” is set in the RESET_SELECT 1502, “101” is set in the MODE_SELECT 1503, and “1” is set in the USB_DETECT 1512. (Step 3000).

SWP検出回路2140もしくはSWP制御回路1944が、SWP_I/O1917がDe−Active状態になったことを検知すると、CPU141にSWP非活性化割り込みを発生させる(ステップ3001)。ファームウェアは、SWP非活性化割り込み関数内で、CLK_SELECT1501に“00”を設定し(ステップ3002)、スリープ命令を実行してCPU141をスリープ状態に移行させる(ステップ3003)。   When the SWP detection circuit 2140 or the SWP control circuit 1944 detects that the SWP_I / O 1917 is in the De-Active state, it causes the CPU 141 to generate an SWP deactivation interrupt (step 3001). The firmware sets “00” to CLK_SELECT 1501 in the SWP deactivation interrupt function (step 3002), executes the sleep instruction, and shifts the CPU 141 to the sleep state (step 3003).

スリープ命令が実行されるとスリープ信号416がHigh状態となるため、クロック切り替え回路410がシステムクロック413を外部クロック411へと切り替え、CPU141に割り込み信号を送信し、CPU141の動作を再開させる(ステップ3004)。以上の処理が正常に行われたとき、SWPインタフェースは非活性化され、処理装置100は、ISO7816インタフェースのみで動作することになる。   When the sleep command is executed, the sleep signal 416 is in a high state, so the clock switching circuit 410 switches the system clock 413 to the external clock 411, transmits an interrupt signal to the CPU 141, and resumes the operation of the CPU 141 (step 3004). ). When the above processing is normally performed, the SWP interface is deactivated, and the processing apparatus 100 operates only with the ISO7816 interface.

処理装置100がUSBインタフェースおよびSWPインタフェースにて動作している際に、USBインタフェースの非活性化によってシステムクロック413のクロック系統を変更する場合は、実施の形態1の図11のステップ1111〜ステップ1114、もしくは図18のステップ1811〜ステップ1814と同様な手順によって行うことができる。また、SWPインタフェースの非活性化によってシステムクロック413のクロック系統を変更する場合は、図28のステップ2801〜ステップ2804、もしくは図30のステップ3001〜ステップ3004と同様な手順によって行うことができる。   When the processing system 100 is operating with the USB interface and the SWP interface, when the clock system of the system clock 413 is changed by deactivation of the USB interface, Steps 1111 to 1114 in FIG. Alternatively, it can be performed by the same procedure as Step 1811 to Step 1814 of FIG. Further, when the clock system of the system clock 413 is changed by deactivation of the SWP interface, it can be performed by the same procedure as Step 2801 to Step 2804 in FIG. 28 or Step 3001 to Step 3004 in FIG.

以上に説明したように、本実施の形態の処理装置100によれば、SWPに準拠したデータ転送を行うためのSWPインタフェースを有する場合であっても、システムクロック413を外部クロック411、内部クロック412、およびSWP用内部クロック2118との間で切り替えることができ、かつ、クロック切り替えの際のノイズによるCPU141の誤動作がない手段にて切り替えることが可能となる。   As described above, according to the processing apparatus 100 of the present embodiment, the system clock 413 is the external clock 411 and the internal clock 412 even when the SWP interface for performing data transfer conforming to SWP is provided. , And the SWP internal clock 2118, and can be switched by means that does not cause a malfunction of the CPU 141 due to noise at the time of clock switching.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

本発明は、データ転送のための複数のインタフェースを有する処理装置およびそのクロック制御方法、特にISO7816に準拠したICカード等の処理装置に利用可能である。   The present invention can be used for a processing apparatus having a plurality of interfaces for data transfer and a clock control method thereof, particularly a processing apparatus such as an IC card conforming to ISO7816.

本発明の実施の形態1である処理装置の内部構成の例を示した図である。It is the figure which showed the example of the internal structure of the processing apparatus which is Embodiment 1 of this invention. 本発明の実施の形態1の処理装置における外部端子の配置例を示した図である。It is the figure which showed the example of arrangement | positioning of the external terminal in the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置における初期動作の流れの一例を示した図である。It is the figure which showed an example of the flow of the initial stage operation | movement in the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置におけるクロック制御回路に含まれるモジュールの構成例を示した図である。It is the figure which showed the structural example of the module contained in the clock control circuit in the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置におけるUSBインタフェースの活性化手順およびISO7816インタフェースの活性化手順の例を表したフロー図である。It is a flowchart showing the example of the activation procedure of the USB interface in the processing apparatus of Embodiment 1 of this invention, and the activation procedure of the ISO7816 interface. 本発明の実施の形態1の処理装置におけるUSBインタフェースの活性化手順のタイミングチャートの例である。It is an example of the timing chart of the activation procedure of the USB interface in the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置におけるISO7816インタフェースの活性化手順のタイミングチャートの例である。It is an example of the timing chart of the activation procedure of the ISO7816 interface in the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置のUSBインタフェースにて動作中におけるISO7816インタフェースの活性化手順、およびISO7816インタフェースにて動作中におけるUSBインタフェースの活性化手順の例を表したフロー図である。It is the flowchart showing the example of the activation procedure of the ISO7816 interface in operation | movement with the USB interface of the processing apparatus of Embodiment 1 of this invention, and the activation procedure of the USB interface in operation | movement with the ISO7816 interface. 本発明の実施の形態1の処理装置のUSBインタフェースにて動作中におけるISO7816インタフェースの活性化手順のタイミングチャートの例である。It is an example of the timing chart of the activation procedure of the ISO7816 interface in operation | movement with the USB interface of the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置のISO7816インタフェースにて動作中におけるUSBインタフェースの活性化手順のタイミングチャートの例である。It is an example of the timing chart of the activation procedure of the USB interface during operation | movement with the ISO7816 interface of the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置の、両方のインタフェースにて動作中におけるISO7816インタフェースの非活性化手順、および両方のインタフェースにて動作中におけるUSBインタフェースの非活性化手順の例を表したフロー図である。The flow showing an example of the deactivation procedure of the ISO 7816 interface while operating on both interfaces and the deactivation procedure of the USB interface while operating on both interfaces of the processing apparatus according to the first embodiment of the present invention. FIG. 本発明の実施の形態1の処理装置の、両方のインタフェースにて動作中におけるISO7816インタフェースの非活性化手順のタイミングチャートの例である。It is an example of the timing chart of the deactivation procedure of the ISO7816 interface in operation | movement in both the interfaces of the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置の、両方のインタフェースにて動作中におけるUSBインタフェースの非活性化手順のタイミングチャートの例である。It is an example of the timing chart of the deactivation procedure of the USB interface in operation | movement in both the interfaces of the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態2の処理装置の内部構成の例を示した図である。It is the figure which showed the example of the internal structure of the processing apparatus of Embodiment 2 of this invention. 本発明の実施の形態1の処理装置におけるUSBインタフェースおよびISO7816インタフェースの活性化の際に使用するレジスタの構成例の一部を示した図である。It is the figure which showed a part of example of a structure of the register | resistor used in the case of activation of the USB interface and ISO7816 interface in the processing apparatus of Embodiment 1 of this invention. 本発明の実施の形態1の処理装置におけるファームウェアを用いたUSBインタフェースの活性化手順およびISO7816インタフェースの活性化手順の例を表したフロー図である。It is the flowchart showing the example of the activation procedure of the USB interface using the firmware in the processing apparatus of Embodiment 1 of this invention, and the activation procedure of the ISO7816 interface. 本発明の実施の形態1の処理装置の、ファームウェアを用いたUSBインタフェースにて動作中におけるISO7816インタフェースの活性化手順、およびISO7816インタフェースにて動作中におけるUSBインタフェースの活性化手順の例を表したフロー図である。The flow showing the example of the activation procedure of the ISO7816 interface in operation | movement with the USB interface using firmware of the processing apparatus of Embodiment 1 of this invention, and the activation procedure of the USB interface in operation | movement with the ISO7816 interface FIG. 本発明の実施の形態1の処理装置の、ファームウェアを用いた両方のインタフェースにて動作中におけるISO7816インタフェースの非活性化手順、および両方のインタフェースにて動作中におけるUSBインタフェースの非活性化手順の例を表したフロー図である。Examples of the deactivation procedure of the ISO 7816 interface while operating on both interfaces using firmware and the deactivation procedure of the USB interface while operating on both interfaces of the processing apparatus according to the first embodiment of the present invention FIG. 本発明の実施の形態3の処理装置の内部構成の例を示した図である。It is the figure which showed the example of the internal structure of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置における初期動作の流れの一例を表した図である。It is a figure showing an example of the flow of the initial stage operation | movement in the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置におけるクロック制御回路に含まれるモジュールの構成例を示した図である。It is the figure which showed the structural example of the module contained in the clock control circuit in the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置におけるSWPインタフェースの活性化手順のタイミングチャートの例を表した図である。It is a figure showing the example of the timing chart of the activation procedure of the SWP interface in the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置におけるファームウェアを用いたSWPインタフェースの活性化手順の例を表したフロー図である。It is a flowchart showing the example of the activation procedure of the SWP interface using the firmware in the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、USBインタフェースまたはISO7816インタフェースにて動作中におけるSWPインタフェースの活性化手順の流れの例を表したフロー図である。It is a flowchart showing the example of the flow of the activation procedure of SWP interface in operation | movement by the USB interface or the ISO7816 interface of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、USBインタフェースにて動作中におけるSWPインタフェースの活性化手順のタイミングチャートの例である。It is an example of the timing chart of the activation procedure of the SWP interface during operation | movement with a USB interface of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、ISO7816インタフェースにて動作中におけるSWPインタフェースの活性化手順のタイミングチャートの例である。It is an example of the timing chart of the activation procedure of the SWP interface during operation | movement by the ISO7816 interface of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、ファームウェアを用いたISO7816インタフェースにて動作中におけるSWPインタフェースの活性化手順の流れの例を表したフロー図である。It is a flowchart showing the example of the flow of the activation procedure of the SWP interface in operation | movement by the ISO7816 interface using firmware of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、ISO7816インタフェースおよびSWPインタフェースの両方にて動作中におけるSWPインタフェースの非活性化手順の流れの例を表したフロー図である。It is a flowchart showing the example of the flow of the deactivation procedure of a SWP interface in operation | movement by both the ISO7816 interface and a SWP interface of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、ISO7816インタフェースおよびSWPインタフェースの両方にて動作中におけるSWPインタフェースの非活性化手順のタイミングチャートの例である。It is an example of the timing chart of the deactivation procedure of the SWP interface during operation | movement with both the ISO7816 interface and the SWP interface of the processing apparatus of Embodiment 3 of this invention. 本発明の実施の形態3の処理装置の、ファームウェアを用いたISO7816インタフェースおよびSWPインタフェースの両方にて動作中におけるSWPインタフェースの非活性化手順の流れの例を表したフロー図である。It is a flowchart showing the example of the flow of the deactivation procedure of the SWP interface in operation | movement by both the ISO7816 interface and SWP interface using firmware of the processing apparatus of Embodiment 3 of this invention.

符号の説明Explanation of symbols

100…処理装置、110…EX_CLK、111…EX_RESET、112…UART_I/O、113…D+、114…D−、115…Vcc、116…GND、120…内部オシレータ、130…クロック制御回路、141…CPU、142…UART制御回路、143…USB制御回路、
201…C1端子、202…C2端子、203…C3端子、204…C4端子、205…C5端子、206…C6端子、207…C7端子、208…C8端子、
410…クロック切り替え回路、411…外部クロック、412…内部クロック、413…システムクロック、414…外部クロック検出信号、415…内部クロックスタート信号、416…スリープ信号、417…クロック切り替え信号、420…リセット制御回路、421…外部リセット、422…システムリセット、423…UARTリセット、424…USBリセット、430…USB検出回路、431…USB検出信号、
1401…コマンド解析モジュール、
1501…CLK_SELECT、1502…RESET_SELECT、1503…MODE_SELECT、1511…DPPU、1512…USB_DETECT、1513…USB_MODE、1521…DP、1522…DM、
1917…SWP_I/O、1921…SWP用内部オシレータ、1944…SWP制御回路、
2118…SWP用内部クロック、2119…SWP用内部クロックスタート信号、2125…SWPリセット、2140…SWP検出回路、2141…SWP検出信号。
DESCRIPTION OF SYMBOLS 100 ... Processing apparatus, 110 ... EX_CLK, 111 ... EX_RESET, 112 ... UART_I / O, 113 ... D +, 114 ... D-, 115 ... Vcc, 116 ... GND, 120 ... Internal oscillator, 130 ... Clock control circuit, 141 ... CPU 142 ... UART control circuit, 143 ... USB control circuit,
201 ... C1 terminal, 202 ... C2 terminal, 203 ... C3 terminal, 204 ... C4 terminal, 205 ... C5 terminal, 206 ... C6 terminal, 207 ... C7 terminal, 208 ... C8 terminal,
410: clock switching circuit, 411: external clock, 412 ... internal clock, 413 ... system clock, 414 ... external clock detection signal, 415 ... internal clock start signal, 416 ... sleep signal, 417 ... clock switching signal, 420 ... reset control Circuit, 421 ... External reset, 422 ... System reset, 423 ... UART reset, 424 ... USB reset, 430 ... USB detection circuit, 431 ... USB detection signal,
1401 ... Command analysis module,
1501 ... CLK_SELECT, 1502 ... RESET_SELECT, 1503 ... MODE_SELECT, 1511 ... DPPU, 1512 ... USB_DETECT, 1513 ... USB_MODE, 1521 ... DP, 1522 ... DM,
1917 ... SWP_I / O, 1921 ... SWP internal oscillator, 1944 ... SWP control circuit,
2118 ... SWP internal clock, 2119 ... SWP internal clock start signal, 2125 ... SWP reset, 2140 ... SWP detection circuit, 2141 ... SWP detection signal.

Claims (8)

外部端末から供給される外部クロックに同期して前記外部端末との間でデータ転送を行う第1のインタフェースおよびその制御回路と、クロックを生成するクロック生成回路と、前記クロック生成回路で生成された内部クロックを用いて前記外部端末との間でデータ転送を行う第2のインタフェースおよびその制御回路とを有する処理装置であって、
該処理装置が前記外部端末との間でデータ転送を行うために使用するインタフェースに応じて、該処理装置内のCPUおよびその他のモジュールが利用するシステムクロックを、前記外部クロックと前記内部クロックとの間で切り替え、その際に、前記CPUをスリープ状態にした後に切り替え、切り替えが完了した後に前記CPUのスリープ状態を解除して動作を再開させるクロック制御回路と、
ISO7816−2準拠の外部端子とを有し、前記第1のインタフェースは、ISO7816−3に準拠したデータ転送を行うインタフェースであり、前記第2のインタフェースは、ISO7816−12に準拠したUSB転送を行うインタフェースであり、
前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースと、前記ISO7816−12に準拠したUSB転送を行うインタフェースとを両方同時に使用可能であることを特徴とする処理装置。
A first interface for transferring data to and from the external terminal in synchronization with an external clock supplied from an external terminal and its control circuit, a clock generation circuit for generating a clock, and the clock generation circuit A processing device having a second interface for transferring data to and from the external terminal using an internal clock and a control circuit thereof;
A system clock used by the CPU and other modules in the processing device is determined between the external clock and the internal clock according to an interface used by the processing device to transfer data to and from the external terminal. switch between, on time, switching after the CPU to sleep, a clock control circuit Ru to resume operation to release the sleep state of the CPU after the switching is completed,
An external terminal conforming to ISO 7816-2, the first interface is an interface that performs data transfer conforming to ISO 7816-3, and the second interface performs USB transfer conforming to ISO 7816-12 Interface
As an interface used to transfer data to and from the external terminal, both an interface that performs data transfer conforming to ISO 7816-3 and an interface that performs USB transfer conforming to ISO 7816-12 can be used simultaneously. processing apparatus according to claim der Rukoto.
請求項1記載の処理装置において、
該処理装置が前記外部端末との間でデータ転送を行うために使用するインタフェースに応じて、該処理装置内に供給するリセットを選択するリセット制御回路を有することを特徴とする処理装置。
The processing apparatus according to claim 1, wherein
A processing apparatus, comprising: a reset control circuit that selects a reset to be supplied to the processing apparatus in accordance with an interface used to transfer data to and from the external terminal.
請求項1または2に記載の処理装置において、
前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースと、前記ISO7816−12に準拠したUSB転送を行うインタフェースとを両方同時に使用する場合は、前記システムクロックとして前記内部クロックを使用し、前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースを使用している際に、前記ISO7816−12に準拠したUSB転送を行うインタフェースが活性化された場合は、前記システムクロックを前記外部クロックから前記内部クロックに切り替えることを特徴とする処理装置。
The processing apparatus according to claim 1 or 2 ,
As an interface used to transfer data to and from the external terminal, an interface that performs data transfer conforming to the ISO 7816-3 and an interface that performs USB transfer conforming to the ISO 7816-12 are simultaneously used. In this case, when the internal clock is used as the system clock, and an interface that performs data transfer conforming to ISO 7816-3 is used as an interface that is used to perform data transfer with the external terminal. In addition, when an interface that performs USB transfer in conformity with the ISO 7816-12 is activated, the processing clock is switched from the external clock to the internal clock.
請求項1または2に記載の処理装置において、
前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースと、前記ISO7816−12に準拠したUSB転送を行うインタフェースとを両方同時に使用する場合は、前記システムクロックとして前記外部クロックを使用し、前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−12に準拠したUSB転送を行うインタフェースを使用している際に、前記外部クロックの供給を検知した場合は、前記システムクロックを前記内部クロックから前記外部クロックに切り替えることを特徴とする処理装置。
The processing apparatus according to claim 1 or 2 ,
As an interface used to transfer data to and from the external terminal, an interface that performs data transfer conforming to the ISO 7816-3 and an interface that performs USB transfer conforming to the ISO 7816-12 are simultaneously used. In this case, when the external clock is used as the system clock, and an interface that performs USB transfer conforming to the ISO7816-12 is used as an interface used to perform data transfer with the external terminal. In addition, when the supply of the external clock is detected, the system clock is switched from the internal clock to the external clock.
請求項記載の処理装置において、
前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースと、前記ISO7816−12に準拠したUSB転送を行うインタフェースとを両方同時に使用し、前記システムクロックとして前記内部クロックを使用している場合において、前記ISO7816−12に準拠したUSB転送を行うインタフェースが非活性化された場合は、前記システムクロックを前記内部クロックから前記外部クロックに切り替えることを特徴とする処理装置。
The processing apparatus according to claim 3 , wherein
As an interface used to transfer data to and from the external terminal, an interface that performs data transfer conforming to the ISO7816-3 and an interface that performs USB transfer conforming to the ISO7816-12 are used at the same time. When the internal clock is used as the system clock and the USB transfer interface compliant with the ISO7816-12 is deactivated, the system clock is switched from the internal clock to the external clock. The processing apparatus characterized by the above-mentioned.
請求項記載の処理装置において、
前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースと、前記ISO7816−12に準拠したUSB転送を行うインタフェースとを両方同時に使用し、前記システムクロックとして前記外部クロックを使用している場合において、前記ISO7816−3に準拠したデータ転送を行うインタフェースが非活性化された場合は、前記システムクロックを前記外部クロックから前記内部クロックに切り替えることを特徴とする処理装置。
The processing apparatus according to claim 4 , wherein
As an interface used to transfer data to and from the external terminal, an interface that performs data transfer conforming to the ISO7816-3 and an interface that performs USB transfer conforming to the ISO7816-12 are used at the same time. When the external clock is used as the system clock and the interface that performs data transfer conforming to the ISO7816-3 is deactivated, the system clock is switched from the external clock to the internal clock. The processing apparatus characterized by the above-mentioned.
外部端末から供給される外部クロックに同期して前記外部端末との間でデータ転送を行う第1のインタフェースおよびその制御回路と、クロックを生成する第1のクロック生成回路と、前記第1のクロック生成回路で生成された第1の内部クロックを用いて前記外部端末との間でデータ転送を行う第2のインタフェースおよびその制御回路と、クロックを生成する第2のクロック生成回路と、前記第2のクロック生成回路で生成された第2の内部クロックを用いて前記外部端末との間でデータ転送を行う第3のインタフェースおよびその制御回路とを有する処理装置であって、
該処理装置が前記外部端末との間でデータ転送を行うために使用するインタフェースに応じて、該処理装置内のCPUおよびその他のモジュールが利用するシステムクロックを、前記外部クロックと前記第1の内部クロックと前記第2の内部クロックとの間で切り替え、その際に、前記CPUをスリープ状態にした後に切り替え、切り替えが完了した後に前記CPUのスリープ状態を解除して動作を再開させるクロック制御回路と、
ISO7816−2準拠の外部端子とを有し、前記第1のインタフェースは、ISO7816−3に準拠したデータ転送を行うインタフェースであり、前記第2のインタフェースは、ISO7816−12に準拠したUSB転送を行うインタフェースであり、前記第3のインタフェースは、前記外部端末内のRF回路とデータ転送を行うインタフェースであり、
前記外部端末との間のデータ転送を行うために使用するインタフェースとして、前記ISO7816−3に準拠したデータ転送を行うインタフェースと、前記ISO7816−12に準拠したUSB転送を行うインタフェースと、前記外部端末のRF回路とデータ転送を行うインタフェースの内のいずれか2つ以上のインタフェースを同時に使用可能であることを特徴とする処理装置。
A first interface for transferring data to and from the external terminal in synchronization with an external clock supplied from an external terminal, a control circuit for the first interface, a first clock generation circuit for generating a clock, and the first clock A second interface for transferring data to and from the external terminal using the first internal clock generated by the generation circuit and its control circuit; a second clock generation circuit for generating a clock; and the second A processing apparatus having a third interface for transferring data to and from the external terminal using the second internal clock generated by the clock generation circuit and a control circuit for the third interface,
The system clock used by the CPU and other modules in the processing device is changed to the external clock and the first internal depending on the interface used by the processing device to transfer data to and from the external terminal. switching between the clock and the second internal clock when the switching after the CPU to sleep, a clock control circuit we leave for wake of the CPU to resume operation after the switching is completed When,
An external terminal conforming to ISO 7816-2, the first interface is an interface that performs data transfer conforming to ISO 7816-3, and the second interface performs USB transfer conforming to ISO 7816-12 The third interface is an interface that performs data transfer with an RF circuit in the external terminal;
As an interface used for data transfer with the external terminal, an interface for performing data transfer in conformity with the ISO 7816-3, an interface for performing USB transfer in conformity with the ISO 7816-12, and an interface of the external terminal processing and wherein simultaneously available der Rukoto any two or more interfaces of the interface for RF circuit and the data transfer.
請求項記載の処理装置において、
該処理装置が前記外部端末との間でデータ転送を行うために使用するインタフェースに応じて、該処理装置内に供給するリセットを選択するリセット制御回路を有することを特徴とする処理装置。
The processing apparatus according to claim 7 , wherein
A processing apparatus, comprising: a reset control circuit that selects a reset to be supplied to the processing apparatus in accordance with an interface used to transfer data to and from the external terminal.
JP2008067068A 2007-06-12 2008-03-17 Processing equipment Expired - Fee Related JP5166927B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2008067068A JP5166927B2 (en) 2007-06-12 2008-03-17 Processing equipment
TW97118903A TW200912601A (en) 2007-06-12 2008-05-22 Processing device and clock control method
US12/136,988 US8015428B2 (en) 2007-06-12 2008-06-11 Processing device and clock control method
CN2008101099555A CN101324931B (en) 2007-06-12 2008-06-11 Processing device and clock control method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2007155453 2007-06-12
JP2007155453 2007-06-12
JP2008067068A JP5166927B2 (en) 2007-06-12 2008-03-17 Processing equipment

Publications (2)

Publication Number Publication Date
JP2009020861A JP2009020861A (en) 2009-01-29
JP5166927B2 true JP5166927B2 (en) 2013-03-21

Family

ID=40188466

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008067068A Expired - Fee Related JP5166927B2 (en) 2007-06-12 2008-03-17 Processing equipment

Country Status (3)

Country Link
JP (1) JP5166927B2 (en)
CN (1) CN101324931B (en)
TW (1) TW200912601A (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5229155B2 (en) * 2009-08-07 2013-07-03 大日本印刷株式会社 IC chip, data processing method, data processing program, IC card, etc.
JP5397320B2 (en) * 2010-05-26 2014-01-22 大日本印刷株式会社 IC chip, IC card, and method of operating IC chip
JP5952019B2 (en) * 2012-02-09 2016-07-13 ラピスセミコンダクタ株式会社 Information processing apparatus, semiconductor device, and power consumption suppression method
JP5928715B2 (en) * 2012-07-13 2016-06-01 大日本印刷株式会社 IC card
CN102945504A (en) * 2012-11-19 2013-02-27 北京宏思电子技术有限责任公司 Intelligent card and control method thereof
WO2014093862A1 (en) * 2012-12-13 2014-06-19 Coherent Logix, Incorporated Reconfiguration of clock generation circuitry
CN104267639B (en) * 2014-09-22 2018-02-23 苏州贝昂科技有限公司 A kind of clock system, counter and task processing method
CN112114616B (en) * 2020-08-04 2022-10-25 深圳市宏电技术股份有限公司 Switching method of real-time clock, electronic equipment and computer storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62237592A (en) * 1986-04-08 1987-10-17 Casio Comput Co Ltd Clock switching system for ic card
JPH0610830B2 (en) * 1988-04-09 1994-02-09 シャープ株式会社 IC card clock signal switching device
JPH0398186A (en) * 1989-09-11 1991-04-23 Toppan Printing Co Ltd Reader/writer for ic card
JP2580789B2 (en) * 1989-09-11 1997-02-12 凸版印刷株式会社 IC card
JPH06176255A (en) * 1992-12-09 1994-06-24 Sanden Corp Commodity price setting device for automatic vending machine

Also Published As

Publication number Publication date
CN101324931B (en) 2011-09-21
TW200912601A (en) 2009-03-16
JP2009020861A (en) 2009-01-29
CN101324931A (en) 2008-12-17

Similar Documents

Publication Publication Date Title
JP5166927B2 (en) Processing equipment
US8015428B2 (en) Processing device and clock control method
US9342131B2 (en) USB hub and control method of USB hub
US8745417B2 (en) Computer system and notebook computer, and method for controlling computer system
RU2008129125A (en) METHOD FOR DOWNLOADING THE HOST DEVICE FROM THE MMC / SD DEVICE, THE HOST DEVICE LOADING FROM THE MMC / SD DEVICE AND THE MMC / SD DEVICE FROM WHICH THE HOST DEVICE CAN BE DOWNLOADED
JP5397739B2 (en) Image processing apparatus, image processing method, and image processing program
JP2004507809A (en) Method and apparatus for providing deterministic power-up voltage in a system where voltage levels are controlled by a processor
CN110785327B (en) Vehicle control device
WO2018112239A1 (en) Hard reset over i3c bus
US9557802B2 (en) Method of controlling SDIO device and related SDIO system and SDIO device
KR100392451B1 (en) Portable computer system and controlling method thereof
US7398409B2 (en) Semiconductor integrated circuit and its power-saving control method and program
US20150253842A1 (en) Semiconductor device, and power control method for usbotg
JP3552213B2 (en) SD memory card host controller and clock control method
US7219248B2 (en) Semiconductor integrated circuit operable to control power supply voltage
US20060195638A1 (en) Peripheral device
JP2008129836A (en) Processing device
JP2006201868A (en) Controller for electronic equipment and return control method from power saving mode
US7010709B2 (en) Information processing device
JP2007090830A (en) Recorder and power supply device with power-saving mode
JP2003248525A (en) Apparatus and method for power saving control of electronic equipment
JPH06152695A (en) Serial interface circuit
JPH0398188A (en) Ic card
JP2002019231A (en) Printer
US20140056336A1 (en) Electronic system and communication control method for transmitting and receiving data by serial communication

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20100528

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120814

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121012

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121204

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121221

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

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5166927

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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