CN102314405A - CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit - Google Patents

CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit Download PDF

Info

Publication number
CN102314405A
CN102314405A CN201110157844A CN201110157844A CN102314405A CN 102314405 A CN102314405 A CN 102314405A CN 201110157844 A CN201110157844 A CN 201110157844A CN 201110157844 A CN201110157844 A CN 201110157844A CN 102314405 A CN102314405 A CN 102314405A
Authority
CN
China
Prior art keywords
ccid
card
chip
usb
process chip
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.)
Pending
Application number
CN201110157844A
Other languages
Chinese (zh)
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.)
SHANGHAI HACHENG ELECTRONIC TECHNOLOGY Co Ltd
Original Assignee
SHANGHAI HACHENG ELECTRONIC TECHNOLOGY 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 SHANGHAI HACHENG ELECTRONIC TECHNOLOGY Co Ltd filed Critical SHANGHAI HACHENG ELECTRONIC TECHNOLOGY Co Ltd
Priority to CN201110157844A priority Critical patent/CN102314405A/en
Publication of CN102314405A publication Critical patent/CN102314405A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention relates to the field of electronic information technologies, and particularly relates to a CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit which comprises an STM32F103CBT6 processing chip, a serial port chip, an IC (integrated circuit) card reader-writer, an USB interface of a PC (personal computer), a crystal oscillator, a capacitor, a resistor and CCID protocol processing software. Compared with the prior art, the invention has the advantages that the USB interface is used for communicating with the PC, and a serial port is used for communicating with an original serial port IC card reader-writer, thereby transforming the serial communication of the IC card reader-writer to the USB communication; and the CCID protocol processing software is utilized to virtualize an IC card socket into different CCID devices, thereby realizing the independent operation of the devices and facilitating the operation of a user.

Description

A kind of CCID protocol treatment circuit
Technical field
The present invention relates to electronic information technical field, specifically a kind of CCID protocol treatment circuit.
Background technology
Because strong security, the capacity of IC-card are big, IC-card is used more and more widely, has related to a plurality of fields such as finance, insurance, traffic, social security at present.Correspondingly, the recoverable amount of IC-card read write line is also very big on the market.
The CCID standard code CCID (USB Chip/Smart Card Interface Devices) be a kind of chip/intelligence card interface device; Equipment is connected with PC through USB interface; The data communication that meets the CCID standard, equipment carries out communication through interface and smart card simultaneously.Provide and support the CCID driving on the operating system of Microsoft more than its Windows 2000 reaches; The CCID interface standard is supported PC (Personal Computer-personal computer)/SC (Smart Card-smart card) interface interchange, makes numerous developers develop operation to information safety devices easily.
At present, the IC-card read write line is main with serial communication mostly on the market, and by how tame manufacturers produce, the communications protocol disunity is made troubles to client's use.Therefore, a kind of CCID protocol treatment circuit that can the serial communication of IC-card read write line be transformed into the USB communication of design is vital.
Summary of the invention
The objective of the invention is to overcome the deficiency of prior art, a kind of CCID protocol treatment circuit that can the serial communication of IC-card read write line be transformed into the USB communication is provided.
In order to achieve the above object; The present invention includes USB interface, crystal oscillator, electric capacity, resistance and the CCID protocol processing software of STM32F103CBT6 process chip, serial port chip, IC-card read write line, PC; It is characterized in that: the interface PD0/OSC_IN of STM32F103CBT6 process chip, PD1/OSC_OUT are connected with the two ends of crystal oscillator respectively; The two ends of crystal oscillator connect ground connection behind the electric capacity respectively, constitute external crystal oscillation circuit; Interface USBDM (2) PA11 of STM32F103CBT6 process chip is connected the USB interface of back PC with resistance D-line connects; Interface USBDP (2) PA12 of STM32F103CBT6 process chip is connected the USB interface of back PC with resistance D+ line connects, and constitutes the USB communicating circuit with PC; The interface UART1_RX of STM32F103CBT6 process chip is connected with the serial ports RS232_RX of IC-card read write line through serial port chip; The interface UART1_TX of STM32F103CBT6 process chip is connected with the serial ports RS232_TX of IC-card read write line through serial port chip, constitutes the serial communication circuit with the IC-card read write line; The CCID protocol processing software is the basis with the circuit that the STM32F103CBT6 process chip constitutes; Accomplish following steps: at first carry out initialization; After initialization is accomplished; Judge whether to obtain the CCID order according to CCID order rreturn value, promptly obtained the CCID order, then carry out also return results of CCID order as rreturn value is different with initial value; The identical CCID that promptly do not obtain with initial value orders like rreturn value; Then detect IC-card socket state variation: changing like IC-card socket state then changes according to CCID notice of settlement PC IC-card state and carries out handled, does not change then to return like IC-card socket state and obtains the CCID order again.
Described CCID protocol processing software to obtain the CCID commands steps following: at first carry out the rreturn value initialization; After the rreturn value initialization; The STM32F103CBT6 process chip is obtained the IC-card output command, is non-ly connect card output command and SAM card output command, and according to the output command that is obtained the USB end points is set; The STM32F103CBT6 process chip is obtained the IC-card input command, is non-ly connect card input command and SAM card input command, and carries out data processing according to the input command that is obtained.The STM32F103CBT6 process chip is according to the setting and the The results of data processing of USB end points, by returning after the rreturn value processing of CCID protocol processing software with the CCID order.
Described serial port chip adopts the MAX232 chip.
Described electric capacity is 20pF.
Described resistance is 22 Ω.
The present invention compares with prior art, carries out communication through USB interface and PC, through serial ports and the communication of former serial ports IC-card read write line, thereby realizes the serial communication of IC-card read write line is transformed into the USB communication; Through the CCID protocol processing software IC-card socket is invented different CCID equipment, make, make things convenient for the user to operate to the equipment independent operation.
Description of drawings
Fig. 1 is a connection synoptic diagram of the present invention.
Fig. 2 is the FB(flow block) of master routine of the present invention.
Fig. 3 obtains the FB(flow block) of CCID order for the present invention.
Embodiment
Combine accompanying drawing that the present invention is done further describes at present.
Referring to Fig. 1, the present invention includes the USB interface, crystal oscillator, electric capacity, resistance and the CCID protocol processing software that comprise STM32F103CBT6 process chip, serial port chip, IC-card read write line, PC.Interface PD0/OSC_IN, the PD1/OSC_OUT of STM32F103CBT6 process chip are connected with the two ends of crystal oscillator respectively, and the two ends of crystal oscillator connect ground connection behind the electric capacity of 20pF respectively, constitute external crystal oscillation circuit; Interface USBDM (2) PA11 of STM32F103CBT6 process chip is connected the USB interface of back PC with the resistance of 22 Ω D-line connects; Interface USBDP (2) PA12 of STM32F103CBT6 process chip is connected the USB interface of back PC with the resistance of 22 Ω D+ line connects, and constitutes the USB communicating circuit with PC; The interface UART1_RX of STM32F103CBT6 process chip is connected with the serial ports RS232_RX of IC-card read write line through the MAX232 serial port chip; The interface UART1_TX of STM32F103CBT6 process chip is connected with the serial ports RS232_TX of IC-card read write line through the MAX232 serial port chip, constitutes the serial communication circuit with the IC-card read write line.
The present invention is a base hardware platform with the hardware circuit that the STM32F103CBT6 process chip constitutes, designs C CID protocol processing software on this platform base, virtual CCID equipment.The STM32F103CBT6 process chip be 32 based on the ARM core, have flash memory, USB micro controller and a plurality of communication port.The STM32F103CBT6 process chip can be used 7 end points at most by software arrangements USB end points.Through configuration USB end points, can the different IC-card socket in the serial ports IC-card read write line be invented a plurality of USB devices, the corresponding IC-card socket of each USB device.When PC operation IC-card, send serial port command according to the IC-card seat that is connected and give the operation of IC-card read write line corresponding IC-card, and the result is returned to PC.
The present invention is behind system power-on reset; The USB Interrupt Process at first is set and waits for the response of PC interrupt data; Serial ports initialization and wait for serial data interrupt response then; The data that the serial ports RS232_RX of last CCID protocol processing software master routine circular wait IC-card read write line, RS232_TX receive, and the data that receive are sent to PC through USB interface.
Referring to Fig. 2; CCID protocol processing software master routine of the present invention is following: at first carry out initialization, after initialization is accomplished, judge whether to obtain the CCID order according to CCID order rreturn value; Promptly obtain the CCID order as rreturn value is different with initial value, then carried out CCID order and return results; The identical CCID that promptly do not obtain with initial value orders like rreturn value; Then detect IC-card socket state variation: changing like IC-card socket state then changes according to CCID notice of settlement PC IC-card state and carries out handled, does not change then to return like IC-card socket state and obtains the CCID order again.
Referring to Fig. 3; In the CCID protocol processing software master routine of the present invention to obtain the CCID command procedure following: at first carry out the rreturn value initialization; After the rreturn value initialization; The STM32F103CBT6 process chip is obtained the IC-card output command, is non-ly connect card output command and SAM card output command, and according to the output command that is obtained the USB end points is set; The STM32F103CBT6 process chip is obtained the IC-card input command, is non-ly connect card input command and SAM card input command, and carries out data processing according to the input command that is obtained.The STM32F103CBT6 process chip is according to the setting and the The results of data processing of USB end points, by returning after the rreturn value processing of CCID protocol processing software with the CCID order.

Claims (6)

1. CCID protocol treatment circuit; The USB interface, crystal oscillator, electric capacity, resistance and the CCID protocol processing software that comprise STM32F103CBT6 process chip, serial port chip, IC-card read write line, PC; It is characterized in that: the interface PD0/OSC_IN of STM32F103CBT6 process chip, PD1/OSC_OUT are connected with the two ends of crystal oscillator respectively; The two ends of crystal oscillator connect ground connection behind the electric capacity respectively, constitute external crystal oscillation circuit; Interface USBDM (2) PA11 of STM32F103CBT6 process chip is connected the USB interface of back PC with resistance D-line connects; Interface USBDP (2) PA12 of STM32F103CBT6 process chip is connected the USB interface of back PC with resistance D+ line connects, and constitutes the USB communicating circuit with PC; The interface UART1_RX of STM32F103CBT6 process chip is connected with the serial ports RS232_RX of IC-card read write line through serial port chip; The interface UART1_TX of STM32F103CBT6 process chip is connected with the serial ports RS232_TX of IC-card read write line through serial port chip, constitutes the serial communication circuit with the IC-card read write line; The CCID protocol processing software is the basis with the circuit that the STM32F103CBT6 process chip constitutes; Accomplish following steps: at first carry out initialization; After initialization is accomplished; Judge whether to obtain the CCID order according to CCID order rreturn value, promptly obtained the CCID order, then carry out also return results of CCID order as rreturn value is different with initial value; The identical CCID that promptly do not obtain with initial value orders like rreturn value; Then detect IC-card socket state variation: changing like IC-card socket state then changes according to CCID notice of settlement PC IC-card state and carries out handled, does not change then to return like IC-card socket state and obtains the CCID order again.
2. a kind of CCID protocol treatment circuit according to claim 1; It is characterized in that: described CCID protocol processing software to obtain the CCID commands steps following: at first carry out the rreturn value initialization; After the rreturn value initialization; The STM32F103CBT6 process chip is obtained the IC-card output command, is non-ly connect card output command and SAM card output command, and according to the output command that is obtained the USB end points is set; The STM32F103CBT6 process chip is obtained the IC-card input command, is non-ly connect card input command and SAM card input command, and carries out data processing according to the input command that is obtained.
3.STM32F103CBT6 process chip is according to the setting and the The results of data processing of USB end points, by returning after the rreturn value processing of CCID protocol processing software with the CCID order.
4. a kind of CCID protocol treatment circuit according to claim 1 is characterized in that: described serial port chip adopts the MAX232 chip.
5. a kind of CCID protocol treatment circuit according to claim 1 is characterized in that: described electric capacity is 20pF.
6. a kind of CCID protocol treatment circuit according to claim 1 is characterized in that: described resistance is 22 Ω.
CN201110157844A 2011-06-13 2011-06-13 CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit Pending CN102314405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110157844A CN102314405A (en) 2011-06-13 2011-06-13 CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110157844A CN102314405A (en) 2011-06-13 2011-06-13 CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit

Publications (1)

Publication Number Publication Date
CN102314405A true CN102314405A (en) 2012-01-11

Family

ID=45427590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110157844A Pending CN102314405A (en) 2011-06-13 2011-06-13 CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit

Country Status (1)

Country Link
CN (1) CN102314405A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103572020A (en) * 2012-12-07 2014-02-12 江苏大学 STM32-based laser shock peening motion control method and control card
CN104067251A (en) * 2012-01-23 2014-09-24 高通股份有限公司 Operating m-phy communications protocol over universal serial bus (usb) interface, and related devices, systems and methods
CN104850527A (en) * 2015-06-12 2015-08-19 中国电子科技集团公司第四十七研究所 Communication protocol processor
CN105045757A (en) * 2015-07-01 2015-11-11 天津国芯科技有限公司 Method and apparatus for implementing serial communication protocol by using microprocessor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040211835A1 (en) * 2003-04-22 2004-10-28 Stmicroelectronics, Inc. Smart card device used as mass storage device
CN100382065C (en) * 2006-03-31 2008-04-16 北京飞天诚信科技有限公司 Intelligent card reading and writing method based on USB interface and its reading and writing device
CN101719054A (en) * 2009-12-24 2010-06-02 北京飞天诚信科技有限公司 Method and device for realizing multi-card slot access
CN101751586A (en) * 2009-12-29 2010-06-23 上海哈诚电子科技有限公司 IC card reader-writer conforming to PC/SC and CCID intelligent card interface protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040211835A1 (en) * 2003-04-22 2004-10-28 Stmicroelectronics, Inc. Smart card device used as mass storage device
CN100382065C (en) * 2006-03-31 2008-04-16 北京飞天诚信科技有限公司 Intelligent card reading and writing method based on USB interface and its reading and writing device
CN101719054A (en) * 2009-12-24 2010-06-02 北京飞天诚信科技有限公司 Method and device for realizing multi-card slot access
CN101751586A (en) * 2009-12-29 2010-06-23 上海哈诚电子科技有限公司 IC card reader-writer conforming to PC/SC and CCID intelligent card interface protocol

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104067251A (en) * 2012-01-23 2014-09-24 高通股份有限公司 Operating m-phy communications protocol over universal serial bus (usb) interface, and related devices, systems and methods
CN103572020A (en) * 2012-12-07 2014-02-12 江苏大学 STM32-based laser shock peening motion control method and control card
CN103572020B (en) * 2012-12-07 2015-04-22 江苏大学 STM32-based laser shock peening motion control method and control card
CN104850527A (en) * 2015-06-12 2015-08-19 中国电子科技集团公司第四十七研究所 Communication protocol processor
CN104850527B (en) * 2015-06-12 2017-11-03 中国电子科技集团公司第四十七研究所 Communications protocol processor
CN105045757A (en) * 2015-07-01 2015-11-11 天津国芯科技有限公司 Method and apparatus for implementing serial communication protocol by using microprocessor

Similar Documents

Publication Publication Date Title
EP1643372B1 (en) USB device with secondary USB on-the-go function
TWI393009B (en) Data sharing and transfer systems and methods
CN106557340B (en) Configuration method and device
US8862790B2 (en) Method for identifying version type of windows operating system on a host by a USB device
US8745304B2 (en) USB to SD bridge
EP2587385B1 (en) Usb key device and method for realizing intelligent card communication using usb interface
CN107409056A (en) Use the communication path of repeater selective enabling first and the second communication path
TWI482034B (en) Interface card
KR101416193B1 (en) Universal serial bus memory device and method for manufacuring thereof
TW200532456A (en) Efficient connection between modules of removable electronic circuit cards
CN1890620A (en) Expresscard power switch device with enhanced communications paths and security functions
CN102314405A (en) CCID (USB (universal serial bus) chip/smart card interface devices) protocol processing circuit
JP5859663B2 (en) System for performing connection, IO connector assembly and operation method
TWM474270U (en) System combining FM. 2 expansion slot and FM. 2 expansion insertion card
US20120144084A1 (en) Data management device and method thereof
CN201820218U (en) Host system and data transmission circuit
WO2011094959A1 (en) Electronic device with dual-role
CN202093508U (en) CCID protocol processing circuit
US20160232110A1 (en) Input Interface Device for Portable Device
CN105068962A (en) I2C controller access method and I2C controller access system
CN103869883A (en) Extension mainboard and extension system
CN104123257A (en) Universal serial bus devices, communication method, and computer readable storage medium
CN208077203U (en) Multifunction IC card recognizes machine
CN104424153B (en) A kind of audio & video equipment data collecting system and its method to USB interface
CN207148820U (en) A kind of COMe_nano core boards based on Godson 2H chip applications

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120111