The content of the invention
To solve the problems of above-mentioned prior art, the present invention proposes a kind of smart card reader method, including:
IC-card card reader and transceiver module are initialized by RS485 serial line interfaces by MCU, to card reader Working mould
Formula is configured, and reads IC card information by card reader, is wirelessly transferred IC card information by the transceiver module, institute
State transceiver module to be modulated data signal by modem, the modem uses amplitude modulation mode, uses work(
Rate amplifier adjusts the transmission power of signal, and 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 so that system is operated in transmission channel or receives logical
Road.
Preferably, the transceiver module is semiduplex working method, and pattern is operated by RS485 serial line interfaces
Set, receive data to be sent or transmitted the data received, the transceiver module includes FPGA, use
In the working condition of control system;The modem uses the mode of operation of time division duplex, voluntarily completes the modulation of data
And demodulation, radiated by internal phaselocked loop using phase-locking type, the frame synchronization and bit synchronization of data are voluntarily completed when receiving data, together
When demodulated output data and bit synchronization clock, be used as external crystal-controlled oscillation without source crystal using 11.0634MHz;According to the crystalline substance of actual measurement
Bulk oscillation frequency correspondingly changes load capacitance, so that chip normal work when crystal oscillation is at nominal frequency;The modulation
Demodulator completes modulation using internal phase-locking type, adds external loop filter and constitutes a complete phaselocked loop, using point
Number frequency dividing, frequency shift (FS) is selected according to the 0 of modulation data or 1, and then the fractional part with N is modulated by third order sigma-delta modulus
Device is added to form the Fractional-N frequency ratio of final influence phaselocked loop output to change output frequency again with N integer part, realizes modulation.
Preferably, the MCU is realized to card reader and the initial configuration of transceiver module, is received card reader and is issued transmitting-receiving mould
The data of block, and the data in IC-card are sent to transceiver module according to certain baud rate, it is effective that transceiver module is filtered out
Information is sent to the mobile terminal user of distal end by radio-frequency module;
Wherein, card reader data must be transmitted with fixing baud rate;Transceiver module is controlled by MCU;Pass through MCU
The existing transceiver module of universaling I/O port Serial Communication Simulation cause for gossip initialization;
The transceiver module is completed to send data and receives data, and the transceiver module FPGA is come from being connected to
During MCU mode of operation configuration order, the parameter represented by command word is configured to related hardware, the mode of operation configuration
Order includes transceiver mode, working frequency points, bit rate;
The process for sending data includes:When receiving command word and needing to be configured to sending mode, FPGA
Complete following operate:
(1) parameter that resolve command word is represented, is converted into configuration parameter and the write-in of modem;
(2) parameter that resolve command word is represented, is converted into configuration parameter and the write-in of local oscillator;
(3) sending the control signal of frequency mixer makes it be operated in up-conversion pattern;
(4) control signal for sending transceiver toggle switch is turned on power amplifier and exported to antenna;
(5) power control switch of power amplifier is opened, working power is turned on;
(6) data read out from IC-card are received from MCU RS485 serial line interfaces, and are constituted modem
The form of data frame requirement, is sent to modem by setting code check and is modulated transmission.
The present invention compared with prior art, with advantages below:
IC-card reading/writing method proposed by the present invention can improve the reliability of communication, and realize key message and mobile terminal
Between real-time Communication for Power.
Embodiment
Retouching in detail to one or more embodiment of the invention is hereafter provided together with illustrating the accompanying drawing of the principle of the invention
State.The present invention is described with reference to such embodiment, but the invention is not restricted to any embodiment.The scope of the present invention is only by right
Claim is limited, and the present invention covers many replacements, modification and equivalent.Illustrate in the following description many details with
Thorough understanding of the present invention is just provided.These details are provided for exemplary purposes, and without in these details
Some or all details can also realize the present invention according to claims.
An aspect of of the present present invention provides a kind of IC-card reading/writing method, and RS485 serial line interfaces and the IC of standard are passed through by MCU
Card reader is attached, and realizes configuration and the radio read-write to information in IC-card and transmission to reader operating mode, together
When also use radio-frequency module as standby communication link, so can both improve the reliability of communication, key can be realized again
Real-time Communication for Power between information and standard mobile terminal.Fig. 1 is method flow diagram according to embodiments of the present invention.
MCU is attached with IC-card card reader, radio-frequency module and transceiver module respectively by RS485 serial communication interfaces.
After system power-up, system and its each functional module are initialized by MCU, parse host-host protocol to add synchronous letter
Breath, the valid data extracted in a frame etc., and carry out the reception and transmission of wireless data.
Wherein, transceiver module is semiduplex working method.The setting of pattern is operated by RS485 serial line interfaces,
Reception data to be sent are transmitted the data received.The FPGA of transceiver module is used for control system
Working condition and the course of work for coordinating each functional module, are then modulated by modem to data signal,
Make working platform in defined carrier wave frequency range by up-conversion, the transmission power of signal is adjusted with power amplifier, passes through band logical
Wave filter and low-noise amplifier adjust the receiving sensitivity of signal, and then the effective propagation path of control information, pass through high frequency
The switching of switch is so that system is operated in transmission channel or receiving channel.
In order to effectively reduce the complexity of hardware design, the reliability of information transfer is improved, what unit module was completed
Function opposite independent, enters the transmission of row information according to the communication protocol made an appointment by the communication interface of standard each other.
In being wirelessly transferred of IC card information, the selection of wireless channel modulation demodulation system and hardware design are topmost
One of work.The characteristics of IC information transfers is low data rate, and bursty transmission is high to the reliability requirement of information transfer.Numeral
The carrier-wave transmission of signal has many different modulation systems, considers the transmission feature of IC information, selects amplitude modulation mode conduct
The modulation system of wireless channel.Modem uses the mode of operation of time division duplex, voluntarily completes the modulation and demodulation of data,
By internal phaselocked loop, radiated using phase-locking type, the frame synchronization and bit synchronization of data are voluntarily completed when receiving data, exported simultaneously
Demodulating data and bit synchronization clock, external crystal-controlled oscillation is used as using 11.0634MHz without source crystal.Meanwhile, according to the crystal of actual measurement
Frequency of oscillation correspondingly changes load capacitance, so that chip can normal work when crystal oscillation is at nominal frequency.
Modem uses internal phase-locking type and completes modulation, adds an external loop filter and may make up
One complete phaselocked loop, and the fraction division used so that output results in higher frequency resolution, while also carrying
The high precision of modulation.The present invention passes through three ranks according to the 0 of modulation data or 1 selection frequency shift (FS), the then fractional part with N
Sigma-delta D modulator is added the Fractional-N frequency ratio to form final influence phaselocked loop output with N integer part again, to change output
Frequency, realizes modulation.
In the debugging stage, the parameter of modem, including core are set by the host computer Debugging interface of modem
Piece transceiver mode, working frequency points, reference frequency, bit rate, frequency modulation, charge pump current, power output, auxiliary output, crystalline substance
The output of body frequency dividing, frame alignment word, demodulation mode, baseband demodulation bandwidth etc..If chip configuration successful, source current can rise
Height, if configured to sending mode then measures output signal frequency correctness, if configured to reception pattern then measures clock
Port whether correct data sync clock output, judges that whether normal chip operation is according to this.
In addition to modem circuit, also local oscillator circuit, mixer, power amplifier circuit, low
The design of the circuits such as noise amplifier circuit, system is according to design objective set in advance, successively suitable integrated device conduct
The core devices of each circuit realiration corresponding function of the above, because the indexs such as carrier frequency, information transfer distance are with equipment application
The difference of occasion differs greatly, and the flexibility of these circuit designs is also larger.
MCU is realized to card reader and the initial configuration of transceiver module, receives the data that card reader issues transceiver module, and
And the data in IC-card are sent to transceiver module according to certain baud rate, the effective information that transceiver module is filtered out passes through radio frequency
Module is sent to the mobile terminal user of distal end.
Card reader data must be transmitted with fixing baud rate, be connected with MCU;Transceiver module is controlled by MCU;This
Outside, the initialization of transceiver module is also required to a serial port, is showed by MCU universaling I/O port Serial Communication Simulation cause for gossip.
Transceiver module, which can both send data, can also receive data, and FPGA needs be connected to the work from MCU
During operation mode configuration order (including transceiver mode, working frequency points, bit rate), the parameter represented by command word is entered to related hardware
Row configuration.
When receiving command word and needing to be configured to sending mode, FPGA completes following operate:
(1) parameter that resolve command word is represented, is converted into configuration parameter and the write-in of modem.
(2) parameter that resolve command word is represented, is converted into configuration parameter and the write-in of local oscillator, and mainly frequency becomes
Change.
(3) sending the control signal of frequency mixer makes it be operated in up-conversion pattern.
(4) control signal for sending transceiver toggle switch is turned on power amplifier and exported to antenna.
(5) power control switch of power amplifier is opened, working power is turned on.
(6) data read out from IC-card are received from MCU RS485 serial line interfaces, and are constituted modem
The form of data frame requirement, is sent to modem by setting code check and is modulated transmission.
When receiving command word and needing to be configured to reception pattern, FPGA completes following operate:
(1) parameter that resolve command word is represented, is converted into configuration parameter and the write-in of modem.
(2) parameter that resolve command word is represented, is converted into configuration parameter and the write-in of local oscillator, mainly does frequency change
Change.
(3) sending the control signal of frequency mixer makes it be operated in down coversion pattern.
(4) control signal for sending transceiver toggle switch is turned on aerial signal to low noise vocal input.
(5) power control switch of switch-off power amplifier, turns it off working power.
(6) output port is demodulated from modem data, receives demodulating data and composition serial transmission format (1
Beginning position, 8 data bit, 1 stop position) be dealt into data receiver by predefined host computer serial ports code check and shown.
In summary, the present invention proposes a kind of smart card reader method, can improve the reliability of communication, and realizes pass
Real-time Communication for Power between key information and mobile terminal.
Obviously, can be with general it should be appreciated by those skilled in the art, above-mentioned each module of the invention or each step
Computing system realize that they can be concentrated in single computing system, or be distributed in multiple computing systems and constituted
Network on, alternatively, the program code that they can be can perform with computing system be realized, it is thus possible to they are stored
Performed within the storage system by computing system.So, the present invention is not restricted to any specific hardware and software combination.
It should be appreciated that the above-mentioned embodiment of the present invention is used only for exemplary illustration or explains the present invention's
Principle, without being construed as limiting the invention.Therefore, that is done without departing from the spirit and scope of the present invention is any
Modification, equivalent substitution, improvement etc., should be included in the scope of the protection.In addition, appended claims purport of the present invention
Covering the whole changes fallen into scope and border or this scope and the equivalents on border and repairing
Change example.