Summary of the invention
For solving the problem existing for above-mentioned prior art, the present invention proposes a kind of smart card reader method, comprising:
By RS485 serial line interface, initialization is carried out to IC-card card reader and transceiver module by MCU, reader operating mode is configured, and read IC card information by card reader, by described transceiver module, IC card information is carried out wireless transmission, described transceiver module is modulated digital signal by modulator-demodular unit, described modulator-demodular unit adopts amplitude modulation mode, use the emissive power of power amplifier adjustment signal, the receiving sensitivity of signal is adjusted by bandpass filter and low noise amplifier, and then the effective propagation path of control information, by the switching of HF switch to make system works at transmission channel or receiving cable.
Preferably, described transceiver module is semiduplex working method, is carried out the setting of mode of operation by RS485 serial line interface, receives data to be sent or the data received is transmitted, described transceiver module comprises FPGA (Field Programmable Gate Array), for the duty of control system; Described modulator-demodular unit adopts the mode of operation of time division duplex, complete the modulation and demodulation of data voluntarily, phase-locking type radiation is adopted by inner phaselocked loop, frame synchronization and the bit synchronization of data is completed voluntarily when receiving data, simultaneously demodulated output data and bit synchronization clock, use 11.0634MHz without source crystal as external crystal-controlled oscillation; Correspondingly change load capacitance according to the crystal oscillation frequency of actual measurement, normally work to make crystal oscillation chip when nominal frequency place; Described modulator-demodular unit adopts inner phase-locking type to complete modulation, add that external loop filter forms a complete phaselocked loop, adopt fraction division, according to modulating data 0 or 1 selects frequency shift (FS), then being added with the integral part of N to be formed by third order sigma-delta D modulator with the fraction part of N finally affect the Fractional-N frequency ratio that phaselocked loop exports and changes output frequency again, and realization is modulated.
Preferably, described MCU realizes the initial configuration to card reader and transceiver module, receive the data that card reader issues transceiver module, and according to certain baud rate, the data in IC-card are sent to transceiver module, the effective information that transceiver module filters out sends to the mobile phone users of far-end by radio-frequency module;
Wherein, card reader data must be transmitted with fixing baud rate; Transceiver module is controlled by MCU; By the initialization of the existing transceiver module of the universaling I/O port Serial Communication Simulation cause for gossip of MCU;
Described transceiver module completes and sends data and receive data, described transceiver module FPGA (Field Programmable Gate Array) is when receiving the mode of operation configuration order from MCU, by the parameter of command word representative, related hardware is configured, described mode of operation configuration order comprises transceiver mode, working frequency points, bit rate;
The process of described transmission data comprises: when receiving command word and needing to be configured to sending mode, FPGA (Field Programmable Gate Array) completes following operation:
(1) parameter of resolve command word representative, is converted into the configuration parameter of modulator-demodular unit and writes;
(2) parameter of resolve command word representative, is converted into the configuration parameter of local oscillator and writes;
(3) control signal sending frequency mixer makes it be operated in up-conversion pattern;
(4) control signal sending transceiver toggle switch makes it connect power amplifier and exports antenna to;
(5) open the power control switch of power amplifier, make it connect working power;
(6) receive from the RS485 serial line interface of MCU the data read out from IC-card, and formed the form of modem data frame requirement, be sent to modulator-demodular unit by setting code check and carry out modulation transmission.
The present invention compared to existing technology, has the following advantages:
The IC-card reading/writing method that the present invention proposes can improve the reliability of communication, and realizes the real-time Communication for Power between key message and mobile terminal.
Embodiment
Detailed description to one or more embodiment of the present invention is hereafter provided together with the accompanying drawing of the diagram principle of the invention.Describe the present invention in conjunction with such embodiment, but the invention is not restricted to any embodiment.Scope of the present invention is only defined by the claims, and the present invention contain many substitute, amendment and equivalent.Set forth many details in the following description to provide thorough understanding of the present invention.These details are provided for exemplary purposes, and also can realize the present invention according to claims without some in these details or all details.
An aspect of of the present present invention provides a kind of IC-card reading/writing method, be connected with the IC-card card reader of standard by RS485 serial line interface by MCU, realize the configuration to reader operating mode and the radio read-write to IC-card internal information and transmission, also use radio-frequency module as communication link for subsequent use simultaneously, so both can improve the reliability of communication, the real-time Communication for Power between key message and standard mobile terminal can have been realized again.Fig. 1 is the method flow diagram according to the embodiment of the present invention.
MCU is connected with IC-card card reader, radio-frequency module and transceiver module respectively by RS485 serial communication interface.After system power-up, by MCU, initialization is carried out to system and each functional module thereof, analytical propagation agreement to add synchronizing information, the valid data etc. extracted in a frame, and carry out reception and the transmission of wireless data.
Wherein, transceiver module is semiduplex working method.Carried out the setting of mode of operation by RS485 serial line interface, receive data to be sent or the data received are transmitted.The FPGA (Field Programmable Gate Array) of transceiver module is used for the duty of control system and coordinates the course of work of each functional module, then by modulator-demodular unit, digital signal is modulated, make working platform at the carrier wave frequency range of regulation by up-conversion, by the emissive power of power amplifier adjustment signal, the receiving sensitivity of signal is adjusted by bandpass filter and low noise amplifier, and then the effective propagation path of control information, by the switching of HF switch to make system works at transmission channel or receiving cable.
In order to effectively reduce the complicacy of hardware design, improving the reliability of information transmission, the function opposite independent that unit module completes, being carried out the transmission of information each other by the communication interface of standard according to the communication protocol of making an appointment.
In the wireless transmission of IC card information, the selection of wireless channel modulation demodulation system and hardware design are one of topmost work.The feature of IC information transmission is low data rate, and bursty transmission is high to the reliability requirement of information transmission.The carrier-wave transmission of digital signal has many different modulation systems, considers the transmission feature of IC information, selects amplitude modulation mode as the modulation system of wireless channel.Modulator-demodular unit adopts the mode of operation of time division duplex, complete the modulation and demodulation of data voluntarily, by inner phaselocked loop, employing phase-locking type radiates, frame synchronization and the bit synchronization of data is completed voluntarily when receiving data, simultaneously demodulated output data and bit synchronization clock, use 11.0634MHz without source crystal as external crystal-controlled oscillation.Meanwhile, correspondingly change load capacitance according to the crystal oscillation frequency of actual measurement, can normally work to make crystal oscillation chip when nominal frequency place.
What modulator-demodular unit adopted is that inner phase-locking type completes modulation, add that an external loop filter can form a complete phaselocked loop, and the fraction division adopted, make output can obtain higher frequency resolution, also improve the precision of modulation simultaneously.The present invention selects frequency shift (FS) according to 0 of modulating data or 1, is then added with the fraction part of N the Fractional-N frequency ratio being formed and finally affect phaselocked loop and export again with the integral part of N by third order sigma-delta D modulator, changes output frequency, realize modulation.
In the debug phase, the parameter of modulator-demodular unit is set by the host computer Debugging interface of modulator-demodular unit, comprises chip transceiver mode, working frequency points, reference frequency, bit rate, frequency modulation, charge pump current, output power, auxiliary output, the output of crystal frequency division, frame alignment word, demodulation mode, baseband demodulation bandwidth etc.If chip configuration success, source current can raise to some extent, if be configured to sending mode, measure output signal frequency correctness, if be configured to receiving mode, measure the whether correct data sync clock of clock port and export, judge that whether normal chip operation is according to this.
Except modem circuit, also has the design of the circuit such as local oscillator circuit, mixer, power amplifier circuit, amplifier circuit in low noise, system is according to the design objective preset, integrated device suitable is successively as the core devices of above each circuit realiration corresponding function, due to indexs such as carrier frequency, information transmission distances along with the difference of equipment application scenario differs greatly, the dirigibility of these circuit design is also larger.
MCU realizes the initial configuration to card reader and transceiver module, receive the data that card reader issues transceiver module, and according to certain baud rate, the data in IC-card are sent to transceiver module, the effective information that transceiver module filters out sends to the mobile phone users of far-end by radio-frequency module.
Card reader data must be transmitted with fixing baud rate, are connected with MCU; Transceiver module is controlled by MCU; In addition, the initialization of transceiver module also needs a serial port, existing by the universaling I/O port Serial Communication Simulation cause for gossip of MCU.
Transceiver module both can send data can also receive data, FPGA (Field Programmable Gate Array) needs (to comprise transceiver mode receiving the mode of operation configuration order from MCU, working frequency points, bit rate) time, by the parameter of command word representative, related hardware is configured.
When receiving command word and needing to be configured to sending mode, FPGA (Field Programmable Gate Array) completes following operation:
(1) parameter of resolve command word representative, is converted into the configuration parameter of modulator-demodular unit and writes.
(2) parameter of resolve command word representative, is converted into the configuration parameter of local oscillator and writes, mainly frequency conversion.
(3) control signal sending frequency mixer makes it be operated in up-conversion pattern.
(4) control signal sending transceiver toggle switch makes it connect power amplifier and exports antenna to.
(5) open the power control switch of power amplifier, make it connect working power.
(6) receive from the RS485 serial line interface of MCU the data read out from IC-card, and formed the form of modem data frame requirement, be sent to modulator-demodular unit by setting code check and carry out modulation transmission.
When receiving command word and needing to be configured to receiving mode, FPGA (Field Programmable Gate Array) completes following operation:
(1) parameter of resolve command word representative, is converted into the configuration parameter of modulator-demodular unit and writes.
(2) parameter of resolve command word representative, is converted into the configuration parameter of local oscillator and writes, and mainly does frequency conversion.
(3) control signal sending frequency mixer makes it be operated in down coversion pattern.
(4) send the control signal of transceiver toggle switch to make it connect aerial signal to input to low noise.
(5) power control switch of switch-off power amplifier, makes it turn off working power.
(6) from modem data demodulation output port, receiving demodulation data also form serial transmission format (1 start bit, 8 bit data positions, 1 position of rest) and are dealt into data receiver by predefined host computer serial ports code check and show.
In sum, the present invention proposes a kind of smart card reader method, the reliability of communication can be improved, and realize the real-time Communication for Power between key message and mobile terminal.
Obviously, it should be appreciated by those skilled in the art, above-mentioned of the present invention each module or each step can realize with general computing system, they can concentrate on single computing system, or be distributed on network that multiple computing system forms, alternatively, they can realize with the executable program code of computing system, thus, they can be stored and be performed by computing system within the storage system.Like this, the present invention is not restricted to any specific hardware and software combination.
Should be understood that, above-mentioned embodiment of the present invention only for exemplary illustration or explain principle of the present invention, and is not construed as limiting the invention.Therefore, any amendment made when without departing from the spirit and scope of the present invention, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.In addition, claims of the present invention be intended to contain fall into claims scope and border or this scope and border equivalents in whole change and modification.