Summary of the invention
The objective of the invention is to address the above problem, a kind of contactless IC card universal encoding-decoding and read-write equipment are provided, it has strengthened the versatility of hardware circuit, widened the coding/decoding scope of hardware circuit, reduced the power consumption of hardware circuit, improved the conversion efficiency of electromagnetic energy, made hardware circuit more reasonable on the whole, signal Processing more at a high speed.
Technical scheme of the present invention is: a kind of contactless IC card universal encoding-decoding and read-write equipment, and wherein, described device comprises:
The antenna adjustments circuit, the return path signal that is used to send the electromagnetic field carrier signal of proximity coupling equipment/vicinity formula coupling equipment and receives proximity integrated circuit card/vicinity formula integrated circuit card;
Synchronously/and clock circuit, be used to produce the carrier signal on the nominal mean frequency and the clock signal of whole device is provided;
Microprocessor controller is used to carry out monitoring and processing to whole device operation;
Proximity coupling equipment/vicinity formula coupling device command frame modulation control circuit is connected to receive its control signal with described microprocessor controller, and the carrier signal that produces the different modulating amplitude is to satisfy different command frame modulation signal requirements;
Proximity coupling equipment/vicinity formula coupling device command frame coding circuit is connected to receive its control signal with described microprocessor controller, produces coded signal frame and requires and the frame coding requirement to satisfy different amplitude modulation(PAM)s;
The RF input of proximity integrated circuit card/vicinity formula integrated circuit card/go interference/analog signal processing circuit, be connected with described microprocessor controller, to proximity integrated circuit card/vicinity formula integrated circuit card return path signal data detect and carry out signal go disturb and simulation process;
Coded signal disturbs treatment circuit, connect the RF input of described proximity coupling equipment/vicinity formula coupling device command frame modulation control circuit and described proximity integrated circuit card/vicinity formula integrated circuit card/go interference/analog signal processing circuit, produce the pulse interference signal of non-rule, normal signal is not decoded by the external world;
Interfered circuit is handled/gone to proximity integrated circuit card/vicinity formula integrated circuit card coded signal digital quantization, is connected with described microprocessor controller, takes out normal proximity integrated circuit card/vicinity formula integrated circuit card signal and it is carried out the digital quantization operation;
The coded signal treatment circuit, be connected with described microprocessor controller, coding to various criterion contactless ic card signal is handled, be mainly used in subcarrier signal with proximity integrated circuit card or contiguous formula integrated circuit card when converting another to wide signal with analysis collection and the correct calculation of convenient described microprocessor controller to signal;
Proximity integrated circuit card/vicinity formula integrated circuit card coded signal demodulation process circuit is connected with described microprocessor controller, and different coded signals is carried out demodulation;
Proximity integrated circuit card/vicinity formula integrated circuit card data output circuit intercoms mutually with background computer or data-analyzing machine.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, described device also comprises an auxiliary circuit, connects pilot lamp and/or hummer so that observe the duty of this device.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, described device also comprises the method for a kind of contactless IC card coding/decoding/read-write, this method is integrated in the described microprocessor controller with the form of program, may further comprise the steps:
(1) initiation parameter setting, this read-write equipment power on or microprocessor controller reset the back parameter is carried out the initialization setting;
(2) send the order of IC-card protocol communication, between this read-write equipment and IC-card, set up data communication;
(3) software and hardware signal parameter control, what hardware circuit was set is configured to meet the operation of software signal passage to IC-card;
(4) judge the IC-card that has or not on the antenna of this read-write equipment according to the ISO standard,, after scan control, turn back to step (2), if having then continue next step if do not have;
(5) use corresponding IC-card protocol core algorithm to carry out data processing, if need adaptive algorithm then to use this algorithm to carry out data sync;
(6) judge whether the IC-card data that receive are correct, then make the incident indication that makes mistakes if not, reset, and after scan control, return step (2), if then continue next step;
(7) the IC-card valid data are exported to the interface of outer computer or data-analyzing machine.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment wherein, increase the display operation of program paragraph header between step (1) and the step (2), increase pilot lamp, hummer indication, data presentation and voice operating between step (6) and step (7).
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, described adaptive algorithm comprises:
(1) detects the starting point signal, once detecting the communication speed that frame synchronizing signal begins to calculate IC-card;
(2) calculate the cycle and the semiperiod of each pulse signal;
(3) detect as test point with periodic point, calculate the first half cycle time value and the second half cycle time value of each test point;
(4) whether the first half cycle time value of second half cycle time value of a last test point and current test point equates, if equate then found the end point of frame synchronizing signal, thereby finishes the detection of IC-card data-frame sync signal, if unequal then continue to detect.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, described proximity coupling equipment/vicinity formula coupling device command frame modulation control circuit comprises the NAND gate circuit of a dual input and the reverser of a single input.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, the RF input of described proximity integrated circuit card/vicinity formula integrated circuit card/go to disturb/analog signal processing circuit comprises the resistance of the detector diode of a rapid on/off, an analog computing amplifier circuit and at least one serial or parallel connection.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, in described proximity coupling equipment/vicinity formula coupling device command frame coding circuit, at least one high frequency capacitance connects the pin of microprocessor controller, to convert the coded signal of proximity coupling equipment/vicinity formula coupling device command frame by the coding sequential of described microprocessor controller to, send to IC-card communicating to connect in order to structure and IC-card.
Above-mentioned contactless IC card universal encoding-decoding and read-write equipment, wherein, resistance, electric capacity and the inductance that interfered circuit comprises one group of series and parallel handled/gone to described proximity integrated circuit card/vicinity formula integrated circuit card coded signal digital quantization, and signal differentiation is quantized to form the front end trigger pip of digital signal and takes out the undesired signal that is mingled with wherein.
Contactless IC card universal encoding-decoding of the present invention and read-write equipment contrast prior art have following beneficial effect: the present invention uses same hardware circuit, realize reading and writing dissimilar IC-cards by disposing different software, widened the coding and decoding scope of this read-write equipment greatly.The present invention has also adopted some high energy-saving circuits as electromagnetic coupled mode circuit to reduce power consumption, improves the efficient of electromagnetic energy conversion.Inner microprocessor controller can be detected exactly with the processing IC card signal and can implement all kinds of control commands to corresponding IC-card in time again among the present invention, thereby makes the design of integrated circuit seem very reasonable, and signal Processing becomes at a high speed in order.
Embodiment
The invention will be further described below in conjunction with drawings and Examples.
Fig. 1 shows the functional block embodiment of circuit of apparatus of the present invention.See also Fig. 1, this device is mainly by antenna adjustments circuit 101, synchronously/clock circuit 102, microprocessor controller 103, proximity coupling equipment/vicinity formula coupling equipment (PCD/VCD, Proximity Coupling Device/Vicinity Coupling Device) command frame modulation control circuit 104, PCD/VCD command frame coding circuit 105, the RF input of proximity integrated circuit card/vicinity formula integrated circuit card (PICC/VICC, Proximity Integrated Circuit Card/VicinityIntegrated Circuit Card)/go interference/analog signal processing circuit 106, coded signal disturbs treatment circuit 107, interfered circuit 108 is handled/gone to PICC/VICC coded signal digital quantization, coded signal treatment circuit 109, PICC/VICC coded signal demodulation process circuit 110, PICC/VICC data output circuit 111 and auxiliary circuit 112 are formed.Wherein, PCD/VCD command frame modulation control circuit 104, PCD/VCD command frame coding circuit 105, auxiliary circuit 112, PICC/VICC data output circuit 111, PICC/VICC coded signal demodulation process circuit 110, coded signal treatment circuit 109, PICC/VICC coded signal digital quantization are handled/are gone the RF input of interfered circuit 108 and PICC/VICC/go to disturb/analog signal processing circuit 106 and all be connected to carry out the transmitted in both directions of data or instruction with microprocessor controller 103.Coded signal disturbs treatment circuit 107 to connect and with the RF input of the unidirectional PCD/VCD of exporting to the command frame of signal modulation control circuit 104 and PICC/VICC/go interference/analog signal processing circuit 106.
Be detailed description below to each element circuit.Fig. 2 shows antenna adjustments circuit 101.See also Fig. 2, antenna adjustments circuit 101 is responsible for sending the electromagnetic field carrier signal of PCD or VCD, and receives the return path signal of PICC or VICC.The centre frequency of carrier wave is 13.56MHz.Antenna L and capacitor C are formed the resonant circuit on the 13.56MHz Frequency point, and the precision of frequency is finished by adjustable capacitor C.
Fig. 3 shows synchronously/clock circuit 102.See also Fig. 3, this synchronously/centre frequency that clock circuit 102 produces standards is for the carrier signal of 13.56MHz and provide clock signal to whole read-write equipment.For example, offer microprocessor controller 103 clock oscillation signals, software detecting synchronous clock etc.
Fig. 4 shows PCD/VCD command frame modulation control circuit 104.This modulation control circuit 104 produces the carrier signal of different modulating amplitude to adapt to the requirement of different contactless IC card command frame modulation signals by using programming of software and hardware signal and relevant hardware control circuit.See also Fig. 4, this modulation control circuit 104 mainly is made up of the NAND gate circuit 401 of one two input and the reverser 402 of a single input etc.For instance, the input pin 403 of NAND gate circuit 401 and the output pin 404 of reverser 402 are controlled by microprocessor controller 103 (or FPGA) respectively, when requiring reverser output pin 404 output 100%ASK signal depth of modulation, NAND gate circuit input pin 403 need be arranged to " 0 " or " 1 " gets final product.
Fig. 5 shows the RF input of PICC/VICC/go interference/analog signal processing circuit 106.See also Fig. 5, this signal processing circuit 106 mainly is made up of the detector diode 501 of a rapid on/off and an analog computing amplifier circuit etc., detection to PICC or VICC return path signal data is provided, and the execution corresponding signal process, for example remove irrelevant simulaed interference signal, signal integer etc.
Coded signal disturbs treatment circuit 107 to produce the pulse interference signal of non-rule and exports the RF input of PICC/VICC/remove interference/analog signal processing circuit 106 and PCD/VCD command frame modulation control circuit 104 to, is used to protect normal signal not decoded by the external world.
Fig. 6 shows PICC/VICC coded signal digital quantization and handles/go interfered circuit 108.See also Fig. 6, this circuit mainly is made up of resistance R 1, R2, capacitor C 1, C2 and the inductance L etc. of one group of series and parallel, take out correct PICC or VICC signal and signal differentiation is quantized the undesired signal that the front end trigger pip of formation digital signal and removal are mingled with.
Fig. 7 shows PCD/VCD command frame coding circuit 105.This circuit is subjected to the control of microprocessor controller 103, produce coded signal frame, the amplitude modulation(PAM) that makes this circuit satisfy different contactless IC cards requires and frame coding (NRZ requirement), and the 100%ASK amplitude modulation(PAM) that for example can satisfy ISO14443 Type A contactless IC card requires and produce coded signal frame etc.See also Fig. 7, this circuit mainly cooperates microprocessor controller 103 to form by one or more high frequency capacitance C.The high frequency capacitance C that is connected on microprocessor controller 103 pins converts the coding sequential of microprocessor controller 103 inside the coded signal of PCD or VCD command frame to, in order to send to IC-card, makes up and the communicating to connect of IC-card.
Coded signal treatment circuit 109 can have different settings, with the special processing of carrying out the contactless IC card signal encoding of different I SO standard.For example, wide signal when the subcarrier signal of PICC or VICC converts another to is to make things convenient for microprocessor controller to the analysis collection of signal and correct calculation or the like.
110 pairs of different coded signals of PICC/VICC coded signal demodulation process circuit carry out demodulation work, comprise the demodulation to coded signals such as NRZ, BPSK, Miller, Manchester.
That PICC/VICC data output circuit 111 mainly provides is general, with the circuit that background computer or data-analyzing machine intercom mutually, mainly with RS232 mode executive's interface, and provide TTL the level connectivity port different with CMOS.
Auxiliary circuit 112 offers one of user and observes intuitively to analyze the duty of this read-write equipment.For example PICC or VICC data are obtained, analyze, export correct after, luminous or hummer (BUZZER) pipes etc. with corresponding light emitting diode (LED) in this contactless IC card universal coding/decoding/read-write equipment, the correctness of operating with designation data.
Fig. 8 shows the flow process of an embodiment of coding/decoding/reading/writing method of the present invention.Below in conjunction with Fig. 8 this flow process is described in detail.
Step S801:, enter by this step if contactless IC card universal coding/decoding/read/write circuit is powered on or carried out hardware or software reset when operating by outer computer or controller.
Step S802: initiation parameter setting.Parameter is provided with and comprises that mainly closing microprocessor interrupts enabling IE, microprocessor interruptions at different levels are set to enable, timer, port status, internal register etc., regularly seek the setting of card time, the RS232 messaging parameter is provided with, single seeks card or continuity is sought the setting of card sign, card data is handled the correlating markings setting, the card data memory pointer is provided with, the card data memory clear-up, RS232 data output identification is provided with, data legitimacy checking parameter is provided with, and the program run sign is provided with, hardware circuit LED, indicator setting such as Buzzer and open microprocessor and interrupt enabling IE etc.
Step S803: program paragraph header LCD shows.This step is optionally, if contactless IC card universal coding/decoding/read/write circuit connects outside liquid crystal LCD, LCD will show information such as current relevant IC-card and internal processes software version.If this read/write circuit does not connect outside liquid crystal LCD, then need not this step.
Step S804: send the order of IC-card protocol communication.Each contactless IC card all has some communication protocols separately, uses different contactless IC card agreements according to different IC-cards.The transmission of protocol communication order will constitute the foundation of the data communication between read/write circuit and the IC-card, thereby make background computer or controller can pass through the data/command communication of realization of this IC-card read/write circuit and card.
Step S805: software and hardware signal parameter control.What be used to be provided with hardware circuit is configured to meet the operation of software signal passage to card.For instance, when ISO14443 Type A contactless IC card is set, owing to will use the depth of modulation of 100%ASK, must hardware circuit module in the A.2 pin of " PCD/VCD command frame modulation control circuit " be set to the software signal output terminal, B.2 pin is set to output terminal etc.
Step S806: judge to have or not the ISO card.If on the antenna of hardware read/write circuit, have according to the ISO standard or during the ISO card of company standard, the hardware read/write circuit detects this IC-card with horse back.If detect less than IC-card, then after scan control, turn back to step S804.
Step S807: use corresponding IC-card protocol core software to handle.In step S806, use corresponding IC-card protocol core software to carry out data processing immediately once detecting IC-card.For ISO14443 Type B card and Chinese second generation I.D. card, can adopt adaptive algorithm to carry out data sync, make up mutual data communication.The concrete steps of adaptive algorithm will be described hereinafter.
Step S808: judge whether the IC-card data that receive are correct.After receiving the IC-card data or using above-mentioned adaptive algorithm to obtain the IC-card valid data, the IC-card core protocol software in the hardware read/write circuit will call the analysis that relevant data CRC algorithm is carried out the data correctness.If correctly just enter next step.Otherwise, after make mistakes incident indication reset and scan control, turn back to step S804.
The output of step S809:RS232 card valid data.The valid data that IC-card is relevant send background computer or backstage microprocessor etc. to by the outer computer interface, carry out data processing.Main hardware interface mode is RS232TTL level or CMOS level.
Step S810:LED indication/Buzzer indication/LCD demonstration/speech processes, this step is optional.In order to represent the correct of IC-card data manipulation/communication more significantly or to make mistakes etc., these processing procedures are integrated in the auxiliary circuit 112 as program.After IC-card is successfully operated, LED will be lighted by software, and Buzzer is driven the buzzer that sends correct data by software data.LCD shows or sound circuit if the IC-card read/write circuit has connected, then these hardware circuits also will be under the processing of this step video data or give voice suggestion.
In above-mentioned step S807, when handling the ISO14443 Type B card or the Chinese second generation ID card, can run into the inconsistent problem of synchronizing signal.Specifically, the TR1 parameter that different manufacturers is produced can not be identical, though these cards and RF read/write circuit/chip all meet ISO14443 Type B standard, but because the synchronizing signal before the data communication is inconsistent, and IC-card can not be intercomed mutually with read/write circuit/chip, can not discern mutually, make the versatility of ISO14443 Type B standard become very poor.
Incompatibility problem during adaptive algorithm of the present invention can solve above-mentioned IC-card and RF read/write circuit/chip intercoms mutually, make this RF read/write circuit carry out protocol handshake, to communicate by letter with the Type B card of any manufacturer production, and the acquisition card data, operation sheet etc.
Figure 10 shows the frame synchronization data-signal of an ISO14443 Type B card.Seeing also Figure 10, is that card sends the frame synchronizing signal that is sent before the data-signal between A point and the E point.The frame synchronizing signal length of the ISO14443 Type B card that each producer produced is different, and what have may be 25 pulse signals, and what have may be 74 pulses or the like.In order to allow the IC-card read/write circuit correctly obtain the later data of E point, must accurately measure A point to the pulse between the E point.
Please show the step of adaptive algorithm simultaneously referring to Fig. 9.Below in conjunction with Fig. 9 and Figure 10 adaptive algorithm is described in detail.
Step S91: the signal of detecting starting point (being the A point among Figure 10), on detection of synchronizing signal just changes next step over to, otherwise just continues detecting.As long as the signal value that A is ordered is " 1 ", just illustrate that synchronizing signal is detected here.
Step S92: the communication speed of calculating IC-card.
Step S93: the period T b and the semiperiod Tc that calculate each pulse signal.
Step S94: detect as test point with periodic point, calculate two semiperiod Tc value Tc1, Tc2 of each test point.In Figure 10, test point is B point, C point and D point.
Step S95: whether the second half cycle time value Tc2 in the last test point equals the first half cycle time value Tc1 in the current test point, if identical, then changes next step over to; Otherwise continue step S95, relatively down a pair of adjacent test point.
Step S96: meet binary phase key transposition system (BPSK, Binary Phase Shift KeyingModulation) rule, found the end point (being the E point) of frame synchronizing signal, thereby finish the detection of card data frame synchronizing signal.
With the concrete operations of ISO14443 Type B card or Chinese second generation IC card of ID card with handle as an example,, further specify the present invention below in conjunction with Fig. 1 and Fig. 8.
At first, microprocessor controller 103 works on power, and its inner software is also started working synchronously.Operating procedure S801 " beginning " and S802 " initiation parameter setting " are provided with the initiation parameter of whole hardware circuit and software program.Specific operation process is followed successively by: LED light is lighted, Buzzer (hummer) pipes, synchronously/clock circuit 102 work and output signals, antenna adjustments circuit 101 work and output signals, PCD/VCD command frame modulation control circuit 104 and PCD/VCD command frame coding circuit 105 send ISO14443 Type B (or second generation ID card) under the control of step S804 " order of transmission IC-card protocol communication " and S805 " control of software and hardware signal parameter " protocol communication order, antenna adjustments circuit 101 again task and output have a modulation signal carrier signal to attempt carrying out contactless communication with IC-card, whole hardware circuit and software program enter " waiting for that IC-card enters " state.
At this moment, if there is an ISO14443 Type B card (or second generation ID card) to enter in the effective range of antenna adjustments circuit 101 of this hardware read/write circuit, then this read-write equipment carries out following operation successively:
Step 1: the RF carrier signal of antenna adjustments circuit 101 outputs is coupled electromagnetic wave energy to the antenna circuit of IC-card inside, and makes the work of IC-card internal circuit.
The protocol communication order that the hardware read/write circuit sends is received in step 2:IC clamping, and sends it back the frame synchronizing signal of IC-card and useful reply data.
Step 3: antenna adjustments circuit 101 can receive that IC-card sends, be modulated at the subcarrier signal on the 13.56MHz carrier frequency.
The RF input of step 4:PICC/VICC/go to disturb/analog signal processing circuit 106 is output RF input/go the signal after interfered circuit is handled to give next step analog signal processing circuit earlier, and analog signal processing circuit is the amplitude basically identical with the data processing of IC-card again, be convenient to carry out the data-signal that digital quantization is handled.
Step 5:PICC/VICC coded signal digital quantization is handled/is gone interfered circuit 108 signal of mimic channel output in the step 4 is carried out digital quantization; go processing such as interference; and this IC-card encoded data signal handled; increase some undesired signals; in order to avoid the IC-card data are illegally intercepted, be used to protect normal signal not decoded by the external world.This signal will send next step circuit (microprocessor controller 103) to.The IC-card data are carried out digital quantization launch in time domain, obtain digital pulse signal (IC-card frame synchronizing signal and IC-card data-signal), deliver to microprocessor controller deal with data frame synchronizing signal and IC-card data-signal.
Step 6: microprocessor controller 103 is started working, and calls the software of each module and implements the signal data analysis.
Step 7: microprocessor controller 103 calls adaptive algorithm and handles the frame synchronization data-signal that IC-card returns, and synchronizing signal is separated with data-signal.
Step 8: microprocessor controller 103 then calls " using corresponding IC-card protocol core software processes " software module the IC-card data-signal that receives is analyzed and computing, IC-card agreement and data globality are complete, CRC calculates correct if meet, the IC-card data of then assert current reception are correct, and data are carried out suitable conversion (for example converting 16 system data etc. to).
Step 9: microprocessor controller 103 then calls " output of RS232 card valid data " software module and carries out data output, and the valid data that IC-card is relevant send background computer or backstage microprocessor etc. to, carry out the data processing on backstage.
Step 10: auxiliary circuit 112 is started working, and LED lights, and hummer (Buzzer) pipes etc.
Step 11: hardware read-write equipment and software program return initial state again.
To sum up, whole hardware read-write equipment has been finished once the proper operation of IC-card under the closely cooperating of in house software, and the operating process and the above-mentioned steps of all the other orders and card are similar.
The foregoing description provides to those of ordinary skills and realizes or use of the present invention; those of ordinary skills can be under the situation that does not break away from invention thought of the present invention; the foregoing description is made various modifications or variation; thereby protection scope of the present invention do not limit by the foregoing description, and should be the maximum magnitude that meets the inventive features that claims mention.