WO2006128348A1 - A ic card controller and a method for controlling the ic card - Google Patents

A ic card controller and a method for controlling the ic card Download PDF

Info

Publication number
WO2006128348A1
WO2006128348A1 PCT/CN2006/000847 CN2006000847W WO2006128348A1 WO 2006128348 A1 WO2006128348 A1 WO 2006128348A1 CN 2006000847 W CN2006000847 W CN 2006000847W WO 2006128348 A1 WO2006128348 A1 WO 2006128348A1
Authority
WO
WIPO (PCT)
Prior art keywords
card
control
pin
controller
card controller
Prior art date
Application number
PCT/CN2006/000847
Other languages
French (fr)
Chinese (zh)
Inventor
Zhenya Zhou
Yonggang Wang
Original Assignee
Magima Digital Information Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Magima Digital Information Co., Ltd. filed Critical Magima Digital Information Co., Ltd.
Publication of WO2006128348A1 publication Critical patent/WO2006128348A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Definitions

  • the present invention relates to an IC card controller that controls the operation of one or more IC cards with one IC card controller by time division multiplexing of pins.
  • the invention further relates to a method of controlling more than one IC card with an IC card controller.
  • FIG 1 is a simplified diagram of a conventional IC card 10.
  • the IC card 10 has an IC card chip 11 (hereinafter, collectively referred to as an IC card for convenience, it will be easily understood by those skilled in the art).
  • the IC card 10 generally has eight contacts C1 to C8, and the definition of each contact is as shown in Table 1:
  • the contacts of the IC card are not limited to eight, but depend on the particular application.
  • the IC card 10 can omit the contacts C4 and C8 and have only 6 Contacts. Therefore, an IC card having a different number of contacts can be designed by those skilled in the art depending on the particular application.
  • IC cards have a wide range of applications in finance, communications, pay TV, and more. It is divided into four categories: memory card, encrypted memory card, CPU card and RF card. You can get a lot of IC cards in your daily life, such as phone IC card, bus card, SIM card in mobile phone. Cards can also be divided into contact and contactless IC cards.
  • the decryption of the charged digital TV is generally realized by the IC card.
  • the program provided by one operator needs the corresponding IC card to decrypt. If there are multiple operators, the corresponding number of IC cards is required.
  • the digital TV set-top box sold on the market has only one IC card slot. To watch the programs provided by different operators, it is necessary to replace the IC card in the slot, which is troublesome, and the frequent insertion and removal will cause the IC card and the IC card. The slot is accelerated and damaged.
  • the IC card controller needs to be added accordingly to control the IC card operation, but this will increase the chip area, the number of chip peripheral pins, and system resources. Occupation is not conducive to reducing the design and manufacturing cost of the chip.
  • FIG. 2 shows two IC card controllers: an IC card controller 21 and an IC card controller 22; two IC card interface chips: an IC card interface chip 211 and an IC card interface chip 221; and two ICs.
  • Card A connection logic diagram of the IC card 212 and the IC card 222.
  • the IC card interface chips 211 and 221 can employ various IC card interface chips known in the art, for example, the TDA8004AT chip designed by Philips, and the like. Here, its main function is voltage coupling. Of course, this part of the function can also be integrated in the IC card controller and the interface chip is omitted.
  • the TDA8004AT is taken as an example for description (of course, those skilled in the art can use other existing interface chips, and the pin definitions of these interface chips are similar to the pin definition of the TDA8004AT, and will not be described here).
  • RST reset signal output (corresponding to RST)
  • I/O data input/output (corresponding to I/0UC)
  • the pin definitions of the IC card controllers 21 and 22 are as shown in Table 3 (only the pin definitions of the IC card controller 21 are listed here, and the pins of the IC card controller 22 are the same as those of the IC card controller 21):
  • the IC card slot (not shown) is provided with a terminal for detecting whether the card is in the slot, and sends a detection signal to the PRES pin of the IC card interface chip 211, and the IC card interface chip 211 sends the signal to the IC through the pin.
  • the i-sc_detectlj) pin of the card controller 21 tells the IC card controller 21 whether or not the IC card 212 is inserted in the IC card slot.
  • the GND pin of the IC card interface chip 211 is connected to the C5 contact of the IC card 212 to provide a standard ground level for the IC card.
  • the 0-sc-vcc-enl-b pin of the IC card controller 21 is connected to the CM C pin of the IC card interface chip 211.
  • the o_sc_vcc-enl-b pin sends a power-on signal, the signal is a continuous level, and the level input from the foot enables the IC card interface chip.
  • the VCC pin of 211 generates the operating level of the IC card 212, and the IC card 212 is supplied with the operating voltage through the C1 contact of the IC card 212.
  • the b_sc_data_b pin of the IC card controller 21 passes through the I/0UC pin of the IC card interface chip 211 and The I/O pin is connected to the C7 contact of the IC card 212, and data exchange between the IC card controller 21 and the IC card 212 is realized.
  • the 0-sc-elk pin of the IC card controller 21 outputs the clock to the XTAL1 pin of the IC card interface chip 211, and the IC card interface chip 211 outputs the clock to the C3 contact of the IC card 212 through the CLK pin, which is the IC card 212.
  • the 0-sc-rstin-b pin of the IC card controller 21 is connected to the RSTIN pin of the IC card interface chip 211, and the RST pin of the IC card interface chip 211 is connected to the C2 contact of the IC card 212, and the reset signal is controlled from the IC card.
  • the device 21 is sent to the IC card 212.
  • the C6 contact of the IC card 212 is the programming voltage of the IC card 212.
  • the IC card 212 is not required to be programmed, so the contact is not used (it is emphasized here that the use of the programming contact C6 is emphasized). Methods are known to those skilled in the art).
  • the signal flow between the IC card controller 22, the IC card interface chip 221, and the IC card 222 is the same as that between the IC card controller 21, the IC card interface chip 211, and the IC card 212, and is therefore omitted here.
  • FIG. 3 shows a logic block diagram of a prior art IC card controller 21.
  • the IC card controller 21 includes a bus interface module (BUS Interface) 311, a memory direct access module (DMA Mode) 312, a clock generator (SC_CLK Generator) 313, a register module (REGs) 314, and a cache module (TX/RX).
  • BUS Interface bus interface module
  • DMA Mode memory direct access module
  • SC_CLK Generator clock generator
  • REGs register module
  • TX/RX cache module
  • the bus interface module 311 is connected to the system bus (BUS) 32 to complete the IC card controller 21 and system (not shown) Data exchange;
  • the memory direct access module 312 can send a DMA request to the system through the bus interface module 311 and the system bus 32 under the control of the register module 314, so that the data exchange between the IC card controller 21 and the system is performed in the DMA mode;
  • the clock generator 313 generates a clock 0_sc_elk required for the IC card to operate under the control of the register module 314;
  • the buffer module 315 is respectively connected to the transceiver 316 and the register module 314 to become a data exchange path between the IC card and the system;
  • the rate generation module 317 generates a clock enable signal of a certain baud rate under the control of the register module 314 to the transceiver, and controls the IC card and the IC card control.
  • register module 314 is a control center of the whole IC card controller 21, which receives an input signal I- sc- detectl- b, the control signal output outputs an IC card if the IC card o- vcc- present Enl — b and reset signal output 0 — sc__rstin — b.
  • the peripheral pins of the chip are very precious.
  • adding an IC card controller will increase 6 pins, and also increase the chip area, and also occupy a bus.
  • the register interface is not conducive to reducing chip design and manufacturing costs.
  • the present invention has been made in view of the above problems, and provides an IC card controller having: a control unit; a clock signal pin, a reset signal pin, a data exchange pin, and N power-on control signal pins; the control unit configured to provide a reset The signal and the N power-on control signals, the IC card controller time-multiplexes the clock signal pin, the reset signal pin, and the data exchange pin, and controls an N IC card by an IC card controller, where N is an integer greater than 1. .
  • the present invention also provides a method for controlling N IC cards by an IC card controller, wherein N is an integer greater than 1, and the IC card controller pairs reset signal pins and clock signals for the N IC cards
  • the pin and the data exchange pin perform time division multiplexing to individually control the power-on control signals for the N IC cards.
  • the invention utilizes an IC card controller to operate different IC cards when needed by time division multiplexing of pins, which has the advantages of saving chip area, number of peripheral pins of the chip, and register interface of the system bus, thereby reducing the design and manufacturing cost of the chip. . Because only one IC card needs to be operated during the process of digital TV decryption, the design of the present invention does not affect the actual use. Therefore, the present invention has the advantages of saving system resources, reducing chip area, and reducing chip peripheral pins. BRIEF DESCRIPTION OF THE DRAWINGS
  • FIG. 1 is a schematic structural view of a conventional IC card in the prior art.
  • FIG. 2 is a connection logic diagram of two IC card controllers, two IC card interface chips, and two IC cards in the prior art.
  • Figure 3 is a logic block diagram of a prior art IC card controller.
  • FIG. 4 is a diagram showing a connection logic relationship between an IC card controller and an IC card interface chip and an IC card according to an embodiment of the present invention.
  • FIG. 5 is a logic block diagram of an IC card controller in accordance with an embodiment of the present invention.
  • FIG. 6 is a circuit for generating an IC card power-on signal according to an embodiment of the present invention. Detailed description of the preferred embodiment
  • FIG. 4 there is shown a logical relationship diagram of an IC card controller 31 connected to two IC card interface chips 211 and 221 and two IC cards 212 and 222, in accordance with an embodiment of the present invention.
  • the IC card controller pin definitions of the embodiments of the present invention are as shown in Table 4:
  • the IC card interface chips 211 and 221 use a conventional IC card interface chip such as the TDA8004AT.
  • TDA8004AT a conventional IC card interface chip
  • those skilled in the art can also use other interface chips arbitrarily or combine the functions of the interface chip into the IC card controller, which are included in the scope of the present invention.
  • this example connects the 3V/5V pin of the TDA8004AT directly to the "1" on the board to implement an IC card supporting 5V.
  • an IC card of 3V voltage can also be used, depending on design requirements and application.
  • the clock signal pin (o_ SC Elk a), the reset signal pins (o_sc_rstin_b) and a data exchange needle (b- sc- data- b) time multiplexing three pins, for each IC card Separate two pins, one IC card detection signal pin (i-sc-detect ljD and i-sc-detect2-b) and the IC card power-on signal pin (o_sc-vcc-enl-b and o-sc) — vcc— en2 — b ) Control (in the text, in the case where there is no need to distinguish between two IC cards, the IC card detection signals are collectively referred to as i-sc_detect-b, and the IC card power-on signals are collectively referred to as o- Sc_vcc—en_b), switched by the software control card.
  • the majority of the registers of the existing IC card controller are kept unchanged, and only the IC card detection signal (i-sc_detect-b) and the IC card power-on signal (o-sc_vcc-en) need to be modified.
  • - b) Logic it should be noted that the IC card detection signal is not necessary.
  • the IC card may always be inserted in a different slot, and the system may default to the presence of the default IC card, and the system has to do differently. Switching and control between the IC cards, that is, only the logic involved in the IC card power-on signal ( o_sc_vcc_en_b ) in the IC card controller is required.
  • the IC card controller 41 of the present invention differs from the prior art IC card controller 21 as described above in that the logic within the register module is different.
  • the IC card controller 31 of the present invention includes a bus interface module (BUS Interface) 311, a memory direct access module (DMA Mode) 312, a clock generator (SC-CLK Generator) 313, a register module (REGs) 514, and a cache module ( TX/RX—FIFO) 315, Transceiver 316, Baudrate 317.
  • BUS Interface bus interface module
  • DMA Mode memory direct access module
  • SC-CLK Generator clock generator
  • REGs register module
  • TX/RX—FIFO TX/RX—FIFO
  • the bus interface module 311 is connected to the system bus (BUS) 32 to complete data exchange between the IC card controller 31 and the system (not shown); the memory direct access module 312 passes the bus interface module 311 under the control of the register module 314. And the system bus 32 sends a DMA request to the system, so that the data exchange between the IC card controller 31 and the system is performed in the DMA mode; the clock generator 313 generates the clock required for the IC card to operate under the control of the register module 514; the cache module 315 Connected to the transceiver 316 and the register module 514, respectively, to become a data exchange path between the IC card and the system; the baud rate generation module 317 generates a clock enable signal of a certain baud rate under the control of the register module 514 to the transceiver, the control IC
  • the data exchange speed between the card and the IC card controller 31; the register module 514 is the control center of the entire IC card controller 31.
  • the register module 514 in the IC card controller 31 of the present invention is different from the register module 314 in the IC card controller 21 of the prior art in that: the register module 514 in the IC card controller 31 of the present invention pairs the clock signal pin (0-sc-elk), reset signal pin (0-sc-rstin-b), and data exchange pin (b-sc-data-b) three pins for time division multiplexing, using separate ICs for each IC card
  • the card detection signal pins i-sc_detectl_b and i-sc-detect2-b
  • the IC card power-on signal pins o-sc-vcc-enl-b and o-sc-vcc-en2-b. Switching by the software control card (note that, as mentioned above, the detection signal pin is not necessary, so it is also possible to use a separate power-on signal pin for each IC card only).
  • register module 514 is set to contain two registers: Status Register And a control register (not shown), the following two registers of the register module 514 of the embodiment of the present invention are described:
  • Receive FIFO status When the value is 1, it indicates that the receive FIFO is empty. When it is 0, it indicates that there is data.
  • 0E Receive FIFO overflow error. It is reset when the SR register is read.
  • RXPE Receive even parity error for character frames. It is reset when the SR register is read.
  • TXPE The even parity error of the transmitted character frame. It is reset when the SR register is read.
  • 'THRE The status of the transmit FIFO. A value of 1 indicates that the transmit FIFO is empty; a value of 0 indicates that there is data.
  • TXMT The status of the transmit FIFO and the transmitted shift register. When 1 is set, both are empty; any one with data is 0.
  • Sc_detect2 The status of the second IC card 222, when 1 indicates that the second IC card 222 is in the slot; when 0, it indicates that the second IC card 222 is not in the slot. The default is 0, which means no cards are inserted.
  • Sc_detectl The state of the first IC card 212, when 1 indicates that the first IC card 212 is in the slot; when 0, it indicates that the first IC card 212 is not in the slot. The default is 0, which means no cards are inserted.
  • C0L2 Set to 1 when the second IC card 222 is removed. It can be reset when the CPU writes 0, or when the system is reset.
  • C0L1 Set to 1 when the first IC card 212 is removed. It can be reset when the CPU writes 0, or when the system is reset.
  • BGT indicates that it is associated with a 22 etu (elementary time unit)
  • the status bit of the off counter This counter starts counting at the start bit of each I/O line. If the count ends before the next start bit, the BGT bit is set to 1. This bit is used to help the check card not respond to the card before the last character is sent, or after the last received character, before the last etu time, no characters are transmitted (this bit has no control switch bit) . It can be reset by writing a 0 and will be automatically reset each time the start bit is encountered.
  • Block protection time is the shortest time between the start edges of consecutive characters sent in two identical directions. Therefore, the delay between the last character of a received block and the first character of a transmitted block should be at least BGT but less than BWT.
  • IDLE The status of the transmit state machine and the accept state machine. When 1 is set, the status of the transmit state machine and the accept state machine are both IDLE (idle state), and the default is 0.
  • SEN Card switch enable bit (switch-en), a value of 1 indicates that the software is allowed to switch the card, defaulting to 0.
  • PSE2 Controls the CMD CC of the TDA8004AT connected to the second IC card 222, (port o_sc_vcc_en2).
  • PSE1 Controls the CMDVCC of the TDA8004AT connected to the first IC card 212, (port o_sc_vcc_enl).
  • RSTIN Outputs a reset signal to the TDA8004AT.
  • the IC card interface chip provides a clock signal sc_ clk to the IC card, and the system uses bits 7 to 0 to control the generation of sc-elk, including:
  • CE Clock enable/di sable bit.
  • CD When the card is removed from the clock, disable.
  • CP The polarity of the clock signal.
  • DIV The frequency of the clock signal output.
  • F is the system clock frequency used by this module.
  • FIG. 6 illustrates a generation circuit of the power-on signal 0-sc-vcc-en1-b of the IC card 212. Since the power-on signal generating circuit of the IC card 222 is the same as that of the IC card 212, only the power-on signal generating circuit of the IC card 212 will be described here. There are two main modules, a conversion module 641 and an AND logic module 642.
  • the C0L1 bit of the status register is set by the inverter 611 and the conversion module 641; otherwise, the sc_detectl bit of the status register is 1, the IC card 212 is in the slot, but the C0L1 bit of the status register cannot be set to 0; the C0L1 bit requires the system reset signal sys-reset or the CPU is set to 0 by the conversion module 641.
  • the 0-sc-vcc_enl-b signal is 3 ⁇ 4 ⁇
  • the sc_detectl and PSE1 one bit in the control register
  • the card switching is implemented by software control.
  • the switch needs to be switched, the SEN (switch-en) bit of the SR register is queried, and the bit is 1 to switch. Because this bit is 1, it indicates that both the transmit and receive FIFOs are empty, and both the transmit and receive state machines are in the IDLE state. At this time, the card switching will not lose data, and then the software can switch the card by operating the PSE1 and PSE2 bits of the control register.
  • the above description of the configuration of the status register and the control register has been described in detail for the sake of clarity, but this is very easy for those skilled in the art since the invention is based on the clock signal pin, the reset signal pin and the data.
  • the exchange pin performs time division multiplexing, and provides power-on control signals to a plurality of IC cards, thereby controlling a plurality of IC cards by using one IC card controller.
  • those skilled in the art are fully capable of arbitrarily modifying the register modules in the IC card controller of the prior art to achieve the above functions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Credit Cards Or The Like (AREA)

Abstract

The invention provides an IC card controller and a method for controlling N numbers of IC cards. Said IC card controller includes a control unit, a clock signal pin, a reset signal pin, and a data exchange pin. The controller also includes N numbers of control signal pins. Said control unit provides a reset signal and N numbers of control signals. The IC card controller controls the clock signal pin , the reset signal pin and the data exchange pin by time mulitiplexing, such that controlling N numbers of IC cards by one IC card controller, wherein N>1, N is integer.

Description

IC卡控制器以及 IC卡控制方法 发明背景  IC card controller and IC card control method
技术领域  Technical field
本发明涉及一种 IC卡控制器, 通过针脚(pin) 的时分复用实现以一个 IC 卡控制器控制一个以上 IC卡工作。 本发明还涉及一种以一个 IC卡控制器控制 一个以上的 IC卡的方法。  The present invention relates to an IC card controller that controls the operation of one or more IC cards with one IC card controller by time division multiplexing of pins. The invention further relates to a method of controlling more than one IC card with an IC card controller.
现有技术描述  Description of the prior art
1970年, 法国人罗兰德 ·莫瑞诺 (Roland Moreno ) 第一次将可进行编程 设置的 IC ( Integrated Circuit) 芯片放于卡片中, 使卡片具有更多的功能。 当时他在专利申请书中, 对这项发明作了如下阐述: 卡片上具有可进行自我保 护的存储器。 这样就诞生了世界上第一张 IC卡。  In 1970, the Frenchman Roland Moreno placed the IC (Integrated Circuit) chip, which can be programmed, on the card for the first time, making the card more functional. At the time, in the patent application, the invention was described as follows: The card has a self-protecting memory. This gave birth to the world's first IC card.
自 IC卡出现以后, 国际上对它有多种叫法。 英文名称有 " Smart Card" 、 " IC Card" 等; 在亚洲特别是港、 台地区, 则多称为 "聪明卡" 、 "智慧卡" 及 "智能卡"等; 而在我国大陆地区, 人们一般称之为 " IC卡"或 "智能卡"。 以下我们统称为 IC卡。  Since the advent of the IC card, there have been many international names for it. The English names are "Smart Card", "IC Card", etc.; in Asia, especially in Hong Kong and Taiwan, they are often called "smart cards", "smart cards" and "smart cards"; in mainland China, people generally Call it "IC card" or "smart card". Below we are collectively referred to as the IC card.
参考图 1, 图 1是一张普通的 IC卡 10的简图。 如图 1所示, IC卡 10中 具有 IC卡芯片 11 (下文中为了方便起见, 将它们统一称为 IC卡, 这对于本领 域的技术人员来说是容易理解的) 。 IC卡 10—般具有 8个触点 C1〜C8, 各触 点的定义如表 1所示:  Referring to Figure 1, Figure 1 is a simplified diagram of a conventional IC card 10. As shown in Fig. 1, the IC card 10 has an IC card chip 11 (hereinafter, collectively referred to as an IC card for convenience, it will be easily understood by those skilled in the art). The IC card 10 generally has eight contacts C1 to C8, and the definition of each contact is as shown in Table 1:
表 1  Table 1
Figure imgf000003_0001
Figure imgf000003_0001
有关 IC卡标准的具体内容请参 IS07816 , 这里不作详述。 如本领域的技术 人员所已知的那样, IC卡的触点并不限于 8个, 而是取决于特定的应用场合。 例如, 在上述表 1所示的例子中, IC卡 10可以省略触点 C4和 C8而只具有 6 个触点。 因此, 根据特定的应用场合, 本领域的技术人员可以设计具有不同触 点数的 IC卡。 Please refer to IS07816 for details of the IC card standard, which will not be described in detail here. As is known to those skilled in the art, the contacts of the IC card are not limited to eight, but depend on the particular application. For example, in the example shown in Table 1 above, the IC card 10 can omit the contacts C4 and C8 and have only 6 Contacts. Therefore, an IC card having a different number of contacts can be designed by those skilled in the art depending on the particular application.
IC卡在金融、 通讯、 付费电视等方面有着广泛的应用。 分为存储卡、 加密 存储卡、 CPU卡和 RF卡四大类。 日常生活中可以接触到很多 IC卡, 如电话 IC 卡、 公交一卡通、 移动电话里的 SIM卡。 卡还可以分为接触式和非接触式的 IC 卡。  IC cards have a wide range of applications in finance, communications, pay TV, and more. It is divided into four categories: memory card, encrypted memory card, CPU card and RF card. You can get a lot of IC cards in your daily life, such as phone IC card, bus card, SIM card in mobile phone. Cards can also be divided into contact and contactless IC cards.
收费数字电视的解密一般通过 IC 卡来实现, 一个运营商所提供的节目需 要相应的 IC卡来解密, 如果存在多个运营商, 就需要对应数目的 IC卡。 目前, 市场上出售的数字电视机顶盒只有一个 IC 卡插槽, 若要收看不同运营商提供 的节目就需要更换插槽中的 IC卡, 比较麻烦, 而且频繁的插拔会使 IC卡以及 IC卡插槽加速损坏。 如本领域中所已知的那样, 要设置多个 IC卡插槽就需要 相应地增加 IC卡控制器来控制 IC卡工作, 但如此就会增加芯片的面积、 芯片 外围针脚数以及系统资源的占用, 不利于降低芯片的设计和制造成本。  The decryption of the charged digital TV is generally realized by the IC card. The program provided by one operator needs the corresponding IC card to decrypt. If there are multiple operators, the corresponding number of IC cards is required. At present, the digital TV set-top box sold on the market has only one IC card slot. To watch the programs provided by different operators, it is necessary to replace the IC card in the slot, which is troublesome, and the frequent insertion and removal will cause the IC card and the IC card. The slot is accelerated and damaged. As is known in the art, to set multiple IC card slots, the IC card controller needs to be added accordingly to control the IC card operation, but this will increase the chip area, the number of chip peripheral pins, and system resources. Occupation is not conducive to reducing the design and manufacturing cost of the chip.
参考图 2, 图 2示出两个 IC卡控制器: IC卡控制器 21和 IC卡控制器 22 ; 两个 IC卡接口芯片: IC卡接口芯片 211和 IC卡接口芯片 221 ; 以及两个 IC 卡: IC卡 212和 IC卡 222的连接逻辑关系图。  Referring to FIG. 2, FIG. 2 shows two IC card controllers: an IC card controller 21 and an IC card controller 22; two IC card interface chips: an IC card interface chip 211 and an IC card interface chip 221; and two ICs. Card: A connection logic diagram of the IC card 212 and the IC card 222.
IC卡接口芯片 211和 221可以采用业界已知的各种 IC卡接口芯片, 例如 可以釆用飞利浦公司设计的 TDA8004AT芯片等等。 在此, 其主要作用为电压耦 合, 当然, 这部分功能也可集成在 IC卡控制器内而省去该接口芯片。 在这里, TDA8004AT为例进行说明(当然本领域的技术人员可采用其它现有的接口芯片, 这些接口芯片的针脚定义与 TDA8004AT的针脚定义类似, 在这里不作累述) 。  The IC card interface chips 211 and 221 can employ various IC card interface chips known in the art, for example, the TDA8004AT chip designed by Philips, and the like. Here, its main function is voltage coupling. Of course, this part of the function can also be integrated in the IC card controller and the interface chip is omitted. Here, the TDA8004AT is taken as an example for description (of course, those skilled in the art can use other existing interface chips, and the pin definitions of these interface chips are similar to the pin definition of the TDA8004AT, and will not be described here).
TDA8004AT的针脚定义如表 2所示:  The pin definitions for the TDA8004AT are shown in Table 2:
表 2  Table 2
针脚名称 分配  Pin name assignment
OFF IC卡是否存在的信号输出 (与 PRES对应)  OFF Signal output of the IC card (corresponding to PRES)
CMDVCC IC卡上电控制信号输入  CMDVCC IC card power-on control signal input
XTAL1 时钟输入  XTAL1 clock input
RSTIN 复位信号输入  RSTIN reset signal input
3V/5V 电压选择控制信号输入 I/OUC 数据输入 /输出 3V/5V voltage selection control signal input I/OUC data input/output
RST 复位信号输出 (与 RST对应)  RST reset signal output (corresponding to RST)
CLK 时钟输出 (与 XTAL1对应)  CLK clock output (corresponds to XTAL1)
I/O 数据输入 /输出 (与 I/0UC对应)  I/O data input/output (corresponding to I/0UC)
VCC IC卡电源电压 (受 控制)  VCC IC card power supply voltage (controlled)
GND 地  GND ground
PRES IC卡是否存在的信号输入  Signal input for the presence of the PRES IC card
IC卡控制器 21和 22的针脚定义如表 3所示 (这里只列举 IC卡控制器 21 的针脚定义, IC卡控制器 22的针脚与 IC卡控制器 21的定义相同) :  The pin definitions of the IC card controllers 21 and 22 are as shown in Table 3 (only the pin definitions of the IC card controller 21 are listed here, and the pins of the IC card controller 22 are the same as those of the IC card controller 21):
表 3  table 3
Figure imgf000005_0001
Figure imgf000005_0001
IC 卡插槽 (未示出) 设有检测卡是否在槽内的端子, 并把检测信号送到 IC卡接口芯片 211的 PRES脚, IC卡接口芯片 211再通过 ^脚把这个信号送 到 IC卡控制器 21的 i— sc一 detectlj)脚, 告诉 IC卡控制器 21在 IC卡插槽内 是否插有 IC卡 212。  The IC card slot (not shown) is provided with a terminal for detecting whether the card is in the slot, and sends a detection signal to the PRES pin of the IC card interface chip 211, and the IC card interface chip 211 sends the signal to the IC through the pin. The i-sc_detectlj) pin of the card controller 21 tells the IC card controller 21 whether or not the IC card 212 is inserted in the IC card slot.
IC卡接口芯片 211的 GND脚与 IC卡 212的 C5触点连接, 为 IC卡提供标 准的接地电平。  The GND pin of the IC card interface chip 211 is connected to the C5 contact of the IC card 212 to provide a standard ground level for the IC card.
IC卡控制器 21的 0— sc— vcc— enl— b脚与 IC卡接口芯片 211的 CM C脚 连接。 当 IC卡控制器 21要对 IC卡 212进行操作的时候, o_sc— vcc一 enl— b脚 发出上电信号, 该信号是一个持续的电平, 从 脚输入的这个电平使 IC 卡接口芯片 211的 VCC脚产生 IC卡 212的工作电平, 通过 IC卡 212的 C1触 点为 IC卡 212提供工作电压。 The 0-sc-vcc-enl-b pin of the IC card controller 21 is connected to the CM C pin of the IC card interface chip 211. When the IC card controller 21 is to operate the IC card 212, the o_sc_vcc-enl-b pin sends a power-on signal, the signal is a continuous level, and the level input from the foot enables the IC card interface chip. The VCC pin of 211 generates the operating level of the IC card 212, and the IC card 212 is supplied with the operating voltage through the C1 contact of the IC card 212.
IC卡控制器 21的 b_sc_data— b脚通过 IC卡接口芯片 211的 I/0UC脚以及 I/O脚与 IC卡 212的 C7触点连接,实现 IC卡控制器 21与 IC卡 212的数据交 换。 The b_sc_data_b pin of the IC card controller 21 passes through the I/0UC pin of the IC card interface chip 211 and The I/O pin is connected to the C7 contact of the IC card 212, and data exchange between the IC card controller 21 and the IC card 212 is realized.
IC卡控制器 21的 0— sc— elk脚把时钟输出到 IC卡接口芯片 211的 XTAL1 脚, IC卡接口芯片 211再通过 CLK脚把时钟输出到 IC卡 212的 C3触点, 为 IC卡 212提供工作时钟。  The 0-sc-elk pin of the IC card controller 21 outputs the clock to the XTAL1 pin of the IC card interface chip 211, and the IC card interface chip 211 outputs the clock to the C3 contact of the IC card 212 through the CLK pin, which is the IC card 212. Provide a working clock.
IC卡控制器 21的 0— sc— rstin— b脚与 IC卡接口芯片 211的 RSTIN脚连接, IC卡接口芯片 211的 RST脚与 IC卡 212的 C2触点连接, 把复位信号从 IC卡 控制器 21送到 IC卡 212。  The 0-sc-rstin-b pin of the IC card controller 21 is connected to the RSTIN pin of the IC card interface chip 211, and the RST pin of the IC card interface chip 211 is connected to the C2 contact of the IC card 212, and the reset signal is controlled from the IC card. The device 21 is sent to the IC card 212.
IC卡 212的 C6触点为 IC卡 212的编程电压接入, 在此应用中不需对 IC 卡 212进行编程, 故未使用该触点 (在这里需要强调的是关于编程触点 C6 的 使用方法对于本领域的技术人员来说是已知的) 。  The C6 contact of the IC card 212 is the programming voltage of the IC card 212. In this application, the IC card 212 is not required to be programmed, so the contact is not used (it is emphasized here that the use of the programming contact C6 is emphasized). Methods are known to those skilled in the art).
IC卡控制器 22、 IC卡接口芯片 221 以及 IC卡 222之间的信号流向与 IC 卡控制器 21、 IC卡接口芯片 211以及 IC卡 212之间的信号流向相同, 故在此 省略。  The signal flow between the IC card controller 22, the IC card interface chip 221, and the IC card 222 is the same as that between the IC card controller 21, the IC card interface chip 211, and the IC card 212, and is therefore omitted here.
图 3示出现有技术 IC卡控制器 21的逻辑框图。 IC卡控制器 21包括总线 接口模块 (BUS Interface ) 311、 存储器直接存取模块 (DMA Mode ) 312、 时 钟发生器 (SC— CLK Generator ) 313、 寄存器模块 ( REGs ) 314、 缓存模块 ( TX/RX— FIFO) 315、 收发器 ( Transceiver) 316、波特率产生模块 (Baudrate ) 317 ο 其中, 总线接口模块 311与系统总线 (BUS ) 32连接, 完成 IC卡控制器 21与系统 (未示出) 的数据交换; 存储器直接存取模块 312在寄存器模块 314 的控制下可通过总线接口模块 311与系统总线 32向系统发送 DMA请求, 使 IC 卡控制器 21与系统的数据交换在 DMA模式下进行; 时钟发生器 313在寄存器 模块 314的控制下产生 IC卡工作所需要的时钟 0— sc— elk; 缓存模块 315分别 与收发器 316 以及寄存器模块 314连接, 成为 IC卡与系统的数据交换通路; 波特率产生模块 317在寄存器模块 314的控制下产生一定波特率的时钟使能信 号给收发器, 控制 IC卡与 IC卡控制器 21间的数据交换速度; 寄存器模块 314 是整个 IC 卡控制器 21 的控制中心, 它接收 IC 卡是否存在的信号输入 I— sc— detectl— b, 输出 IC卡上电控制信号输出 o— vcc— enl— b 以及复位信号输 出 0— sc__rstin— b。 发明概述 FIG. 3 shows a logic block diagram of a prior art IC card controller 21. The IC card controller 21 includes a bus interface module (BUS Interface) 311, a memory direct access module (DMA Mode) 312, a clock generator (SC_CLK Generator) 313, a register module (REGs) 314, and a cache module (TX/RX). - FIFO) 315, Transceiver 316, Baud Rate Generation Module (Baudrate) 317 ο where the bus interface module 311 is connected to the system bus (BUS) 32 to complete the IC card controller 21 and system (not shown) Data exchange; the memory direct access module 312 can send a DMA request to the system through the bus interface module 311 and the system bus 32 under the control of the register module 314, so that the data exchange between the IC card controller 21 and the system is performed in the DMA mode; The clock generator 313 generates a clock 0_sc_elk required for the IC card to operate under the control of the register module 314; the buffer module 315 is respectively connected to the transceiver 316 and the register module 314 to become a data exchange path between the IC card and the system; The rate generation module 317 generates a clock enable signal of a certain baud rate under the control of the register module 314 to the transceiver, and controls the IC card and the IC card control. Data exchange rate between 21; register module 314 is a control center of the whole IC card controller 21, which receives an input signal I- sc- detectl- b, the control signal output outputs an IC card if the IC card o- vcc- present Enl — b and reset signal output 0 — sc__rstin — b. Summary of invention
对于芯片设计而言,芯片的外围针脚是非常珍贵的,在上述例子的情况下, 增加一个 IC卡控制器就将增加 6根针脚, 同时也会增加芯片的面积, 还会多 占用一个总线的寄存器接口, 不利于降低芯片设计与制造成本。  For the chip design, the peripheral pins of the chip are very precious. In the case of the above example, adding an IC card controller will increase 6 pins, and also increase the chip area, and also occupy a bus. The register interface is not conducive to reducing chip design and manufacturing costs.
因此, 本发明鉴于上述问题, 提供一种 IC卡控制器, 具有: 控制单元; 时 钟信号针、 复位信号针、 数据交换针以及 N个上电控制信号针; 所述控制单元配 置成提供一个复位信号以及 N个上电控制信号, 该 IC卡控制器对时钟信号针、 复 位信号针以及数据交换针进行时分复用, 以一个 IC卡控制器控制 N个 IC卡, 其 中 N为大于 1的整数。  Accordingly, the present invention has been made in view of the above problems, and provides an IC card controller having: a control unit; a clock signal pin, a reset signal pin, a data exchange pin, and N power-on control signal pins; the control unit configured to provide a reset The signal and the N power-on control signals, the IC card controller time-multiplexes the clock signal pin, the reset signal pin, and the data exchange pin, and controls an N IC card by an IC card controller, where N is an integer greater than 1. .
本发明还提供一种以一个 IC卡控制器控制 N个 IC卡的方法,其中 N为大于 1的整数,所述 IC卡控制器对用于所述 N个 IC卡的复位信号针、时钟信号针以及 数据交换针进行时分复用, 对用于所述 N个 IC卡的上电控制信号进行单独控制。  The present invention also provides a method for controlling N IC cards by an IC card controller, wherein N is an integer greater than 1, and the IC card controller pairs reset signal pins and clock signals for the N IC cards The pin and the data exchange pin perform time division multiplexing to individually control the power-on control signals for the N IC cards.
本发明利用一个 IC 卡控制器通过针脚的时分复用在需要的时候操作不同 的 IC 卡, 具有节省芯片面积、 芯片外围针脚数以及系统总线的寄存器接口等 优点, 利于降低芯片的设计与制造成本。 因为在数字电视解密的过程中只需要 对一张 IC 卡进行操作即可, 故本发明的设计方案不会影响实际使用。 因此, 本发明具有节省系统资源、 降低芯片面积、 减少芯片外围针脚等优点。 附图简述  The invention utilizes an IC card controller to operate different IC cards when needed by time division multiplexing of pins, which has the advantages of saving chip area, number of peripheral pins of the chip, and register interface of the system bus, thereby reducing the design and manufacturing cost of the chip. . Because only one IC card needs to be operated during the process of digital TV decryption, the design of the present invention does not affect the actual use. Therefore, the present invention has the advantages of saving system resources, reducing chip area, and reducing chip peripheral pins. BRIEF DESCRIPTION OF THE DRAWINGS
图 1为现有技术中普通 IC卡的结构简图。  1 is a schematic structural view of a conventional IC card in the prior art.
图 2为现有技术中两个 IC卡控制器、 两个 IC卡接口芯片以及两个 IC卡 的连接逻辑关系图。  2 is a connection logic diagram of two IC card controllers, two IC card interface chips, and two IC cards in the prior art.
图 3为现有技术 IC卡控制器的逻辑框图。  Figure 3 is a logic block diagram of a prior art IC card controller.
图 4为根据本发明的实施例的 IC卡控制器与 IC卡接口芯片以及 IC卡的 连接逻辑关系图。  4 is a diagram showing a connection logic relationship between an IC card controller and an IC card interface chip and an IC card according to an embodiment of the present invention.
图 5为根据本发明的实施例的 IC卡控制器的逻辑框图。  Figure 5 is a logic block diagram of an IC card controller in accordance with an embodiment of the present invention.
图 6为根据本发明的实施例的 IC卡上电信号的产生电路。 较佳实施例的详细描述 FIG. 6 is a circuit for generating an IC card power-on signal according to an embodiment of the present invention. Detailed description of the preferred embodiment
参考图 4,图 4示出根据本发明的实施例的 IC卡控制器 31与两个 IC卡接 口芯片 211和 221 以及两个 IC卡 212和 222连接的逻辑关系图。 本发明实施 例的 IC卡控制器针脚定义如表 4所示:  Referring to FIG. 4, there is shown a logical relationship diagram of an IC card controller 31 connected to two IC card interface chips 211 and 221 and two IC cards 212 and 222, in accordance with an embodiment of the present invention. The IC card controller pin definitions of the embodiments of the present invention are as shown in Table 4:
Figure imgf000008_0001
Figure imgf000008_0001
IC卡接口芯片 211和 221釆用传统的 IC卡接口芯片, 例如 TDA8004AT。 以下以 TDA8004AT为例进行描述, 当然, 本领域的技术人员还可以任意使用其 它接口芯片或将接口芯片的功能结合于 IC 卡控制器中, 这都包含在本发明的 范围之内。 - 目前大部分 IC卡都采用 5V电压, 所以本实施例把 TDA8004AT的 3V/5V脚 直接接至电路板上的 " 1 " 来实现支持 5V 的 IC卡。 但是, 如本领域的技术人 员所已知的那样, 也可以釆用 3V电压的 IC卡, 这些取决于设计要求和应用场 合。  The IC card interface chips 211 and 221 use a conventional IC card interface chip such as the TDA8004AT. The following describes the TDA8004AT as an example. Of course, those skilled in the art can also use other interface chips arbitrarily or combine the functions of the interface chip into the IC card controller, which are included in the scope of the present invention. - At present, most IC cards use 5V voltage. Therefore, this example connects the 3V/5V pin of the TDA8004AT directly to the "1" on the board to implement an IC card supporting 5V. However, as is known to those skilled in the art, an IC card of 3V voltage can also be used, depending on design requirements and application.
本发明的 IC 卡控制器 31 对时钟信号针 (o_SC一 elk ) 、 复位信号针 ( o_sc_rstin_b ) 以及数据交换针 (b— sc— data— b ) 三根针脚进行时分复用, 对于每个 IC卡分别使用单独两根针脚一一 IC卡检测信号针 (i— sc一 detect ljD 禾口 i—sc— detect2— b )与 IC卡上电信号针(o_sc— vcc— enl— b禾口 o— sc— vcc— en2— b ) 进行控制(在文中, 在不需要区别两个 IC卡的情况下, 将 IC卡检测信号统称 为 i—sc— detect— b, 将 IC卡上电信号统称为 o— sc— vcc— en_b), 由软件控制卡 的切换。 在此, 保留现有 IC 卡控制器的绝大多数寄存器不变, 只需要修改涉 及到 IC卡检测信号 (i—sc— detect— b ) 和 IC卡上电信号 ( o— sc— vcc— en— b) 的 逻辑。 这里, 需要注意的是, IC卡检测信号并非是必须的。 如本领域的技术人 员已知的那样, 例如在收费数字电视系统的场合, IC卡可能总是插入在不同的 槽中, 系统可以默认的方式默认 IC卡的存在, 系统所要做的是在不同 IC卡之 间的切换和控制, 即只需要 IC 卡控制器中涉及到 IC 卡上电信号 ( o_sc_vcc_en_b ) 的逻辑。 IC card controller 31 of the present invention, the clock signal pin (o_ SC Elk a), the reset signal pins (o_sc_rstin_b) and a data exchange needle (b- sc- data- b) time multiplexing three pins, for each IC card Separate two pins, one IC card detection signal pin (i-sc-detect ljD and i-sc-detect2-b) and the IC card power-on signal pin (o_sc-vcc-enl-b and o-sc) — vcc— en2 — b ) Control (in the text, in the case where there is no need to distinguish between two IC cards, the IC card detection signals are collectively referred to as i-sc_detect-b, and the IC card power-on signals are collectively referred to as o- Sc_vcc—en_b), switched by the software control card. Here, the majority of the registers of the existing IC card controller are kept unchanged, and only the IC card detection signal (i-sc_detect-b) and the IC card power-on signal (o-sc_vcc-en) need to be modified. - b) Logic. Here, it should be noted that the IC card detection signal is not necessary. As is known to those skilled in the art, for example, in the case of a charging digital television system, the IC card may always be inserted in a different slot, and the system may default to the presence of the default IC card, and the system has to do differently. Switching and control between the IC cards, that is, only the logic involved in the IC card power-on signal ( o_sc_vcc_en_b ) in the IC card controller is required.
参考图 5, 图 5示出本发明的实施例的工 C卡控制器 31的逻辑框图。 本发 明的 IC卡控制器 41与如上所述的现有技术 IC卡控制器 21的区别在于寄存器 模块内的逻辑不同。 以下, 与现有技术 IC卡控制器 21中的元部件相同的元部 件以相同的参考标号标识。 本发明的 IC卡控制器 31包括总线接口模块 (BUS Interface ) 311、 存储器直接存取模块 ( DMA Mode ) 312、 时钟发生器 ( SC一 CLK Generator) 313、 寄存器模块 ( REGs ) 514、 缓存模块 ( TX/RX— FIFO) 315、 收 发器 ( Transceiver ) 316、 波特率产生模块 ( Baudrate ) 317。 其中, 总线接 口模块 311与系统总线 (BUS ) 32连接, 完成 IC卡控制器 31与系统 (未示出) 的数据交换; 存储器直接存取模块 312在寄存器模块 314的控制下通过总线接 口模块 311与系统总线 32向系统发送 DMA请求, 使 IC卡控制器 31与系统的 数据交换在 DMA模式下进行; 时钟发生器 313在寄存器模块 514的控制下产生 IC卡工作所需要的时钟; 缓存模块 315分别与收发器 316以及寄存器模块 514 连接, 成为 IC卡与系统的数据交换通路; 波特率产生模块 317在寄存器模块 514的控制下产生一定波特率的时钟使能信号给收发器, 控制 IC卡与 IC卡控 制器 31间的数据交换速度; 寄存器模块 514是整个 IC卡控制器 31 的控制中 心。 本发明的 IC卡控制器 31 中的寄存器模块 514与现有技术中的 IC卡控制 器 21 中的寄存器模块 314的区别在于: 本发明的 IC卡控制器 31 中的寄存器 模块 514对时钟信号针 (0— sc— elk) 、 复位信号针 (0— sc— rstin一 b ) 以及数据 交换针 (b—sc—data—b ) 三根针脚进行时分复用, 对于每个 IC卡分别使用单独 的 IC卡检测信号针 (i— sc— detectl_b和 i— sc— detect2— b ) 与 IC卡上电信号 针(o— sc— vcc— enl— b和 o— sc— vcc— en2— b )进行控制, 由软件控制卡的切换(注 意, 如上所述, 检测信号针不是必须的, 因此, 也可仅对于每个 IC 卡分别使 用单独的上电信号针) 。  Referring to Figure 5, there is shown a logic block diagram of a C-Card Controller 31 of an embodiment of the present invention. The IC card controller 41 of the present invention differs from the prior art IC card controller 21 as described above in that the logic within the register module is different. Hereinafter, the same components as those of the prior art IC card controller 21 are identified by the same reference numerals. The IC card controller 31 of the present invention includes a bus interface module (BUS Interface) 311, a memory direct access module (DMA Mode) 312, a clock generator (SC-CLK Generator) 313, a register module (REGs) 514, and a cache module ( TX/RX—FIFO) 315, Transceiver 316, Baudrate 317. The bus interface module 311 is connected to the system bus (BUS) 32 to complete data exchange between the IC card controller 31 and the system (not shown); the memory direct access module 312 passes the bus interface module 311 under the control of the register module 314. And the system bus 32 sends a DMA request to the system, so that the data exchange between the IC card controller 31 and the system is performed in the DMA mode; the clock generator 313 generates the clock required for the IC card to operate under the control of the register module 514; the cache module 315 Connected to the transceiver 316 and the register module 514, respectively, to become a data exchange path between the IC card and the system; the baud rate generation module 317 generates a clock enable signal of a certain baud rate under the control of the register module 514 to the transceiver, the control IC The data exchange speed between the card and the IC card controller 31; the register module 514 is the control center of the entire IC card controller 31. The register module 514 in the IC card controller 31 of the present invention is different from the register module 314 in the IC card controller 21 of the prior art in that: the register module 514 in the IC card controller 31 of the present invention pairs the clock signal pin (0-sc-elk), reset signal pin (0-sc-rstin-b), and data exchange pin (b-sc-data-b) three pins for time division multiplexing, using separate ICs for each IC card The card detection signal pins (i-sc_detectl_b and i-sc-detect2-b) are controlled by the IC card power-on signal pins (o-sc-vcc-enl-b and o-sc-vcc-en2-b). Switching by the software control card (note that, as mentioned above, the detection signal pin is not necessary, so it is also possible to use a separate power-on signal pin for each IC card only).
这里为了方便起见, 将寄存器模块 514设置为包含两个寄存器: 状态寄存 器和控制寄存器 (未示出) , 以下对本发明实施例的寄存器模块 514的两个寄 存器进行说明: Here, for convenience, register module 514 is set to contain two registers: Status Register And a control register (not shown), the following two registers of the register module 514 of the embodiment of the present invention are described:
状态寄存器 (SR寄存器) (16位) :  Status register (SR register) (16 bits):
Figure imgf000010_0001
Figure imgf000010_0001
FE: 接收 FIFO的状态, 值为 1时, 表示接收 FIFO为空; 为 0时表示有数 据。  FE: Receive FIFO status. When the value is 1, it indicates that the receive FIFO is empty. When it is 0, it indicates that there is data.
0E: 接收 FIFO溢出错误。 当读取 SR寄存器的时候被复位。  0E: Receive FIFO overflow error. It is reset when the SR register is read.
RXPE: 接收字符帧的偶校验错误。 当读取 SR寄存器的时候被复位。  RXPE: Receive even parity error for character frames. It is reset when the SR register is read.
TXPE: 发送字符帧的偶校验错误。 当读取 SR寄存器的时候被复位。 ' THRE: 发送 FIFO的状态, 值为 1时表示发送 FIFO为空; 为 0时表示有数 据。  TXPE: The even parity error of the transmitted character frame. It is reset when the SR register is read. 'THRE: The status of the transmit FIFO. A value of 1 indicates that the transmit FIFO is empty; a value of 0 indicates that there is data.
TXMT: 发送 FIFO和发送的移位寄存器的状态, 为 1 时表示两者都为空; 任何一个有数据则为 0。  TXMT: The status of the transmit FIFO and the transmitted shift register. When 1 is set, both are empty; any one with data is 0.
sc_detect2:第二 IC卡 222的状态,为 1时表示第二 IC卡 222在插槽内; 为 0时表示第二 IC卡 222不在插槽内。 缺省为 0, 表示没有卡被插入。  Sc_detect2: The status of the second IC card 222, when 1 indicates that the second IC card 222 is in the slot; when 0, it indicates that the second IC card 222 is not in the slot. The default is 0, which means no cards are inserted.
sc—detectl :第一 IC卡 212的状态,为 1时表示第一 IC卡 212在插槽内; 为 0时表示第一 IC卡 212不在插槽内。 缺省为 0, 表示没有卡被插入。  Sc_detectl: The state of the first IC card 212, when 1 indicates that the first IC card 212 is in the slot; when 0, it indicates that the first IC card 212 is not in the slot. The default is 0, which means no cards are inserted.
C0L2 : 当第二 IC卡 222被移出的时候被设置为 1。 当 CPU写入 0的时候, 或者系统复位的时候, 才可以复位。  C0L2 : Set to 1 when the second IC card 222 is removed. It can be reset when the CPU writes 0, or when the system is reset.
C0L1 : 当第一 IC卡 212被移出的时候被设置为 1。 当 CPU写入 0的时候, 或者系统复位的时候, 才可以复位。  C0L1 : Set to 1 when the first IC card 212 is removed. It can be reset when the CPU writes 0, or when the system is reset.
BGT: 表示与一个 22个 etu ( elementary time unit : 基本时间单位) 相 关的计数器的状态位。 这个计数器在每个 I/O线上的开始位开始计数, 如果计 数在下一个开始位之前结束, BGT 位被设置为 1。 这一位用于帮助检验卡在上 一个字符发送之后 22个 etii时间之前卡没有应答, 或者在上一个接收的字符 之后, 22个 etu时间之前, 没有传输字符 (这一位没有控制开关位) 。 可以通 过写入 0来复位, 在每次遇到开始位的时候会被自动复位。 BGT: indicates that it is associated with a 22 etu (elementary time unit) The status bit of the off counter. This counter starts counting at the start bit of each I/O line. If the count ends before the next start bit, the BGT bit is set to 1. This bit is used to help the check card not respond to the card before the last character is sent, or after the last received character, before the last etu time, no characters are transmitted (this bit has no control switch bit) . It can be reset by writing a 0 and will be automatically reset each time the start bit is encountered.
BGT在 IS07816协议中的定义: 块保护时间 (BGT )为两个相同方向发送的 连续字符的起始沿之间的最短时间。 因此一个已接收块的最后一个字符与一个 被传输块的第一个字符之间的迟延至少应为 BGT但小于 BWT。  BGT is defined in the IS07816 protocol: Block protection time (BGT) is the shortest time between the start edges of consecutive characters sent in two identical directions. Therefore, the delay between the last character of a received block and the first character of a transmitted block should be at least BGT but less than BWT.
IDLE: 发送状态机和接受状态机的状态, 为 1时表示发送状态机和接受状 态机的状态均为 IDLE (空闲状态) , 默认为 0。  IDLE: The status of the transmit state machine and the accept state machine. When 1 is set, the status of the transmit state machine and the accept state machine are both IDLE (idle state), and the default is 0.
SEN: 卡切换使能位 (switch— en) , 为 1表示允许软件进行卡的切换, 默 认为 0。  SEN: Card switch enable bit (switch-en), a value of 1 indicates that the software is allowed to switch the card, defaulting to 0.
控制寄存器 (16位) :  Control register (16 bits):
Figure imgf000011_0001
Figure imgf000011_0001
PSE2 : 控制与第二 IC 卡 222 连接的 TDA8004AT 的 CMD CC, (端口 o_sc_vcc_en2 ) 。  PSE2: Controls the CMD CC of the TDA8004AT connected to the second IC card 222, (port o_sc_vcc_en2).
PSE1 : 控制与第一 IC 卡 212 连接的 TDA8004AT 的 CMDVCC, (端口 o_sc_vcc_enl ) 。  PSE1 : Controls the CMDVCC of the TDA8004AT connected to the first IC card 212, (port o_sc_vcc_enl).
RSTIN: 输出到 TDA8004AT的复位信号。  RSTIN: Outputs a reset signal to the TDA8004AT.
IC卡接口芯片向 IC卡提供时钟信号 sc— clk, 系统使用比特 7〜比特 0来 控制 sc一 elk的生成, 包括:  The IC card interface chip provides a clock signal sc_ clk to the IC card, and the system uses bits 7 to 0 to control the generation of sc-elk, including:
CE: 时钟 enable/di sable位。 CD: 当卡被移出时钟 disable。 CE: Clock enable/di sable bit. CD: When the card is removed from the clock, disable.
CP: 时钟信号的极性。  CP: The polarity of the clock signal.
DIV: 时钟信号输出的频率。  DIV: The frequency of the clock signal output.
Figure imgf000012_0001
Figure imgf000012_0001
F为本模块所使用的系统时钟频率。  F is the system clock frequency used by this module.
以上详细描述了本发明的实施例的寄存器模块中的两个寄存器, 对于本领 域的技术人员来说在阅读了上述说明之后, 能够简单地对寄存器进行编程, 实 现上述两个寄存器模块。 这里对编程方法不作详述。 另一方面, 虽然上述实施 例以控制寄存器和状态寄存器这两个寄存器来描述控制单元, 但是如本领域的 技术人员所已知的那样, 控制寄存器和状态寄存器都是位于控制单元内部的寄 存器, 其不同的仅仅在于逻辑功能的不同。 因此, 对于本领域的技术人员来说, 可以不必将控制单元具体地划分成状态寄存器或是控制寄存器, 可以通过编程 的方式对控制单元内的寄存器进行编程, 以实现上述功能。  The two registers in the register module of the embodiment of the present invention have been described in detail above, and it will be apparent to those skilled in the art that after reading the above description, the registers can be simply programmed to implement the two register modules. The programming method is not described in detail here. On the other hand, although the above embodiment describes the control unit in two registers, a control register and a status register, as is known to those skilled in the art, both the control register and the status register are registers located inside the control unit. The only difference is the difference in logic functions. Therefore, it is not necessary for a person skilled in the art to specifically divide the control unit into a status register or a control register, and the registers in the control unit can be programmed by programming to achieve the above functions.
参考图 6,图 6例示出 IC卡 212的上电信号 0一 sc— vcc一 enl— b的产生电路。 因为 IC卡 222的上电信号产生电路与 IC卡 212的相同, 所以在此只对 IC卡 212的上电信号产生电路进行说明。 这里有两个主要模块一一转换模块 641 以 及 "与" 逻辑模块 642。 状态寄存器的 sC_detectl位若为 0, 说明 IC卡 212 不在插槽内,就会通过反向器 611与转换模块 641把状态寄存器的 C0L1位置 1 ; 反之, 状态寄存器的 sc— detectl位若为 1, 说明 IC卡 212在插槽内, 但无法 把状态寄存器的 C0L1位置 0; C0L1位需要系统复位信号 sys一 reset或者 CPU 通过转换模块 641 来置 0。 由图 6 可知, 0一 sc— vcc_enl一 b 信号是由 ¾ϊ、 sc_detectl 以及 PSE1 (控制寄存器内的一位) 三个信号经过 "与" 逻辑模块 642生成。 Referring to FIG. 6, FIG. 6 illustrates a generation circuit of the power-on signal 0-sc-vcc-en1-b of the IC card 212. Since the power-on signal generating circuit of the IC card 222 is the same as that of the IC card 212, only the power-on signal generating circuit of the IC card 212 will be described here. There are two main modules, a conversion module 641 and an AND logic module 642. If the s C _detectl bit of the status register is 0, indicating that the IC card 212 is not in the slot, the C0L1 bit of the status register is set by the inverter 611 and the conversion module 641; otherwise, the sc_detectl bit of the status register is 1, the IC card 212 is in the slot, but the C0L1 bit of the status register cannot be set to 0; the C0L1 bit requires the system reset signal sys-reset or the CPU is set to 0 by the conversion module 641. As can be seen from Figure 6, the 0-sc-vcc_enl-b signal is 3⁄4ϊ, The sc_detectl and PSE1 (one bit in the control register) three signals are generated by the AND logic module 642.
卡的切换是由软件控制实现的, 在需要切换时, 只要査询 SR寄存器的 SEN ( switch一 en) 位, 该位为 1就可以进行切换。 因为该位为 1 时, 说明发送和 接受 FIFO都为空, 且发送和接受状态机都处在 IDLE状态。 在这时候进行卡的 切换将不会丢失数据, 然后软件就可以通过对控制寄存器的 PSE1和 PSE2位进 行操作, 进行卡的切换。  The card switching is implemented by software control. When the switch needs to be switched, the SEN (switch-en) bit of the SR register is queried, and the bit is 1 to switch. Because this bit is 1, it indicates that both the transmit and receive FIFOs are empty, and both the transmit and receive state machines are in the IDLE state. At this time, the card switching will not lose data, and then the software can switch the card by operating the PSE1 and PSE2 bits of the control register.
上述为了清楚起见, 详细地描述了状态寄存器和控制寄存器的配置, 但是 这对于本领域的技术人员来说是非常容易的, 因为本发明的发明点就在于将时 钟信号针、 复位信号针和数据交换针进行时分复用, 并对多个 IC 卡分别提供 上电控制信号,从而利用一个 IC卡控制器控制多个 IC卡。为了实现这个目的, 本领域的技术人员完全能够任意地修改现有技术中的 IC 卡控制器中的寄存器 模块, 实现上述功能。  The above description of the configuration of the status register and the control register has been described in detail for the sake of clarity, but this is very easy for those skilled in the art since the invention is based on the clock signal pin, the reset signal pin and the data. The exchange pin performs time division multiplexing, and provides power-on control signals to a plurality of IC cards, thereby controlling a plurality of IC cards by using one IC card controller. In order to achieve this, those skilled in the art are fully capable of arbitrarily modifying the register modules in the IC card controller of the prior art to achieve the above functions.
如上所述, 在不需要 IC卡检测信号的情况下, 本领域的技术人员完全能 够修改图 6所示的上电信号生成电路以及上述实施例中的 IC卡控制器中的控 制寄存器和状态寄存器的逻辑, 这是不需要创造性的劳动的, 是完全包含在本 发明的范围之内的。  As described above, those skilled in the art can completely modify the power-on signal generating circuit shown in FIG. 6 and the control register and status register in the IC card controller in the above embodiment without requiring an IC card detection signal. The logic, which does not require creative labor, is fully within the scope of the present invention.
此外, 上述实施例中仅以两个 IC 卡进行了例示, 但是, 本领域的技术人 员完全能够在本申请的启发下, 不通过创造性的劳动将本申请应用于三个或三 个以上的 IC卡, 这都包含在本申请的范围之内。  Further, in the above embodiment, only two IC cards have been exemplified, but those skilled in the art can fully apply the present application to three or more ICs without creative labor, inspired by the present application. Cards, which are included in the scope of this application.

Claims

权利要求 Rights request
1. —种 IC卡控制器, 具有: 1. An IC card controller with:
控制单元; 以及  Control unit;
时钟信号针、 复位信号针以及数据交换针;  a clock signal pin, a reset signal pin, and a data exchange pin;
其特征在于, 该 IC卡控制器还具有 N个上电控制信号针, 所述控制单元配置 成提供一个复位信号以及 N个上电控制信号, 该 IC卡控制器对时钟信号针、 复位 信号针以及数据交换针进行时分复用, 以一个 IC卡控制器控制 N个 IC卡, 其中 N为大于 1的整数。  The IC card controller further has N power-on control signal pins, the control unit is configured to provide a reset signal and N power-on control signals, and the IC card controller pairs the clock signal pin and the reset signal pin And the data exchange pin performs time division multiplexing, and controls an N IC card with an IC card controller, where N is an integer greater than 1.
2. 如权利要求 1所述的 IC卡控制器, 其特征在于, 所述控制单元中设置控 制 IC卡的上电控制信号的控制位, 、表示 IC卡是否存在于 IC卡插槽内的 IC卡存 在状态位和表示 IC卡是否被移出 IC卡插槽的 IC卡移出状态位。  2. The IC card controller according to claim 1, wherein the control unit is provided with a control bit for controlling a power-on control signal of the IC card, and an IC indicating whether the IC card exists in the IC card slot. The card presence status bit and the IC card removal status bit indicating whether the IC card has been removed from the IC card slot.
3. 如权利要求 2所述的 IC卡控制器, 其特征在于, 所述控制单元根据所述 控制位、 IC卡存在状态位和 IC卡移出状态位来控制输出所述上电控制信号。  3. The IC card controller according to claim 2, wherein the control unit controls the output of the power-on control signal according to the control bit, the IC card presence status bit, and the IC card removal status bit.
4. 一种以一个 IC卡控制器控制 N个 IC卡的方法, 其中 N为大于 1的整数, 所述 IC卡控制器对所述 N个 IC卡的复位信号针、 时钟信号针以及数据交换针进 行时分复用, 对所述 N个 IC卡的上电控制信号进行单独控制。  4. A method of controlling N IC cards by an IC card controller, wherein N is an integer greater than 1, and the IC card controller resets a signal pin, a clock signal pin, and a data exchange of the N IC cards. The pins perform time division multiplexing to individually control the power-on control signals of the N IC cards.
5. 如权利要求 4所述的方法, 其特征在于, 所述 IC卡控制器设有控制单元, 所述方法包括: 在所述控制单元中设置控制 IC卡的上电控制信号的控制位、 表示 IC卡是否存在于 IC卡插槽内的 IC卡存在状态位和表示 IC卡是否被移出 IC卡插 槽的 IC卡移出状态位。  The method according to claim 4, wherein the IC card controller is provided with a control unit, and the method comprises: setting a control bit for controlling a power-on control signal of the IC card in the control unit, Indicates whether the IC card exists in the IC card slot and the IC card presence status bit and the IC card removal status bit indicating whether the IC card is removed from the IC card slot.
6. 如权利要求 5所述的方法, 其特征在于, 根据所述控制位、 IC卡存在状态 位和 IC卡移出状态位来控制输出所述上电控制信号。  The method according to claim 5, wherein the outputting the power-on control signal is controlled according to the control bit, an IC card presence status bit, and an IC card removal status bit.
PCT/CN2006/000847 2005-06-01 2006-04-28 A ic card controller and a method for controlling the ic card WO2006128348A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNB2005100263510A CN100385428C (en) 2005-06-01 2005-06-01 Card controller, and method for controlling IC card
CN200510026351.0 2005-06-01

Publications (1)

Publication Number Publication Date
WO2006128348A1 true WO2006128348A1 (en) 2006-12-07

Family

ID=37481219

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/000847 WO2006128348A1 (en) 2005-06-01 2006-04-28 A ic card controller and a method for controlling the ic card

Country Status (2)

Country Link
CN (1) CN100385428C (en)
WO (1) WO2006128348A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107004105B (en) * 2015-09-16 2019-10-25 华为技术有限公司 A kind of release identification circuit and terminal
CN106203574B (en) * 2016-06-24 2019-05-24 恒宝股份有限公司 A kind of smart card and its write card mode

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1102411A2 (en) * 1999-11-15 2001-05-23 China-UK Consultants Limited Mobile phone battery pack
CN1521664A (en) * 2003-02-11 2004-08-18 凹凸科技股份有限公司 Reduced cardbus controller
US20050032398A1 (en) * 2000-12-28 2005-02-10 Francois Perret Interconnecting module for the base of electronic equipment casing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI259406B (en) * 2003-08-15 2006-08-01 Via Tech Inc A method and an apparatus of flash cards access

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1102411A2 (en) * 1999-11-15 2001-05-23 China-UK Consultants Limited Mobile phone battery pack
US20050032398A1 (en) * 2000-12-28 2005-02-10 Francois Perret Interconnecting module for the base of electronic equipment casing
CN1521664A (en) * 2003-02-11 2004-08-18 凹凸科技股份有限公司 Reduced cardbus controller

Also Published As

Publication number Publication date
CN1873634A (en) 2006-12-06
CN100385428C (en) 2008-04-30

Similar Documents

Publication Publication Date Title
RU2633126C2 (en) Strengthening mechanism of transfer and/or configuration of one protocol of inter-connections for another protocol of inter-connections
US7712659B2 (en) Card recognition system for recognizing standard card and non-standard card
US7725638B2 (en) Application processor circuit incorporating both SD host and slave functions and electronic device including same
EP1643372B1 (en) USB device with secondary USB on-the-go function
CN101604301B (en) Use of bond option to alternate between pci configuration space
US20050055479A1 (en) Multi-module circuit card with inter-module direct memory access
US8745304B2 (en) USB to SD bridge
US8307143B2 (en) Interface card system
TW200413937A (en) Combination non-volatile memory and input-output card with direct memory access
TWI303368B (en) Integrated interface controller and method to enhance a controller system
US8335883B2 (en) Data processing device and data processing system
US9680972B2 (en) SD switch box in a cellular handset
JP3556913B2 (en) PC card input / output control device
EP1475715A2 (en) Smart card device and method for debug and software development
WO2006128348A1 (en) A ic card controller and a method for controlling the ic card
US20090292849A1 (en) Adaptable pci express controller core
TWI784165B (en) Usb host-to-usb host chip
TWI270085B (en) IC card controller and the method used therein
CN111221583B (en) Multi-smart-card starting management device and system
JP2005085237A (en) Card recognition system
JP2004013794A (en) Semiconductor integrated circuit device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

WWW Wipo information: withdrawn in national office

Country of ref document: DE

122 Ep: pct application non-entry in european phase

Ref document number: 06722422

Country of ref document: EP

Kind code of ref document: A1