Summary of the invention
The present invention proposes a kind of serial communication system and method between plate, solves communication reliability in prior art
The highest, that design is complicated defect;The present invention designs simply, and communication reliability is high, and communication efficiency is high.
The technical scheme is that and be achieved in that:
Serial communication system between a kind of plate, it includes sending module and receiver module, described sending module and institute
State receiver module signal to connect;
Described sending module includes sending data buffering module and sending data coding module, described transmission data
Buffer module is connected with described transmission data coding module signal;
Described receiver module includes receiving data dynamic sampling module, receiving data decoder module and receive data
Buffer module, described reception data dynamic sampling module is connected with described reception data decoder module signal, institute
State reception data decoder module to be connected with described reception data buffering module by signal;
Described transmission data buffering module is used for caching transmission data, and it includes buffer queue module and sends control
State machine processed, described transmission controlled state machine is used for controlling to send data and synchronous mark field;Described transmission
Data coding module is for encoding and CRC CRC check data, and sends out serial
Data;The serial data that described reception data dynamic sampling module is used for receiving is sampled, and according to institute
State synchronous mark field and sampling phase is carried out dynamic synchronization;Described reception data decoder module is for reception
Decoding data, and carry out CRC check;Described reception data buffering module is used for caching reception data,
Data buffer storage i.e. uses after receiving queue;
Described reception data dynamic sampling module includes four sampling modules, coupling search module and Selecting phasing
Module, only needs a data lines can complete data communication between plate between described plate, described four sampling modules with
Described coupling search module signal connects, and described coupling search module is with described Selecting phasing module by signal even
Connect;The serial data received is sampled by described four sampling modules, the serial data that each bit receives
Obtaining four sampling number evidences, four sampling numbers evidences after displacement are synchronized by described coupling search module
The coupling search of attribute field, four sampling numbers evidences after coupling search are carried out by described Selecting phasing module
Select.
Further, described transmission data coding module is with described reception data dynamic sampling module by signal even
Connect.
Further, described transmission data coding module uses High-Level Data Link Control HDLC coding.
Further, described four sampling modules are connected with described transmission data coding module signal.
Serial communication method between a kind of plate, only needs a data lines can complete data between plate and leads between described plate
Letter, it comprises the steps:
(1) send data to send data coding module by transmission data buffering module;
(2) by described transmission data coding module, data are processed, data are encoded, simultaneously
Plus CRC check, changed into serial data;
(3) serial number of described transmission data coding module coding is received by receiving data dynamic sampling module
According to, transmit it to receive data decoder module;
(4) receive data dynamic sampling module and receive above-mentioned serial data, and it is sampled, according to same
Step attribute field carries out dynamic synchronization to sampling phase;The sampling clock receiving data dynamic sampling module is string
4 times of row data clock;Described reception data dynamic sampling module includes four sampling modules, coupling search
Module and Selecting phasing module, described four sampling modules are connected with described coupling search module signal, described
Coupling search module is connected with described Selecting phasing module by signal;The serial to receiving of the described four sampling modules
Data are sampled, and the serial data that each bit receives obtains four sampling number evidences, described coupling search mould
Four sampling numbers after displacement are searched for by block according to the coupling carrying out synchronous mark field, described Selecting phasing mould
Four sampling numbers evidences after coupling search are selected by block;
(5) by reception data decoder module, the serial data received is decoded, and carries out CRC school
Test;
(6) by receiving data buffering module caching reception data, data buffer storage makes for rear class in receiving queue
With.
Further, described transmission data coding module uses High-Level Data Link Control HDLC coding.
Further, state HDLC coding to force to send synchronous mark field after frame length reaches maximum.
The present invention provides between a kind of communication device board without the serial data communication method with road clock, it is possible to
Under the least encoding overhead, reliably realize data transmission by a data lines.The advantage of the method is:
1) traffic rate is high.In the situation that the clock of 4 times of serial data transmission frequency can be processed by FPGA
Under, serial data rate is up to more than 50Mbps.
2) physics cabling reduces.Carry out between the veneer of data communication, having only to a data lines and can complete data
Transmission.So can greatly alleviate backboard cabling pressure, FPGA pin resource can also be saved simultaneously,
Alleviate veneer wiring pressure.
3) without sequential pressure.Method does not has any phase at receiving terminal FPGA to receiving data as described above
Position requirement, such veneer sequential difference in different slots position on system stability without impact, more without big measuring tank
Position traversal test.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly
Chu, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation
The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Referring to figs. 1 through Fig. 4, serial communication system 1 between a kind of plate, it includes sending module 2 and receiver module
3, described sending module 2 is connected with described receiver module 3 signal;Described sending module includes that sending data delays
Die block and transmission data coding module, described transmission data buffering module and described transmission data coding module
Signal connects;Described receiver module includes receiving data dynamic sampling module, receiving data decoder module and connect
Receiving data buffering module, described reception data dynamic sampling module is with described reception data decoder module signal even
Connecing, described reception data decoder module is connected with described reception data buffering module by signal;Described transmission data
Buffer module is used for caching transmission data, and it includes buffer queue module and sends controlled state machine, described
Send controlled state machine for controlling transmission data and synchronous mark field;Described transmission data coding module is used for
Data are encoded and CRC CRC check, and send out serial data;Described reception number
According to dynamic sampling module for the serial data received is sampled, and according to described synchronous mark field pair
Sampling phase carries out dynamic synchronization;Described reception data decoder module is used for receiving decoding data, and
Carry out CRC check;Described reception data buffering module is used for caching reception data, and data buffer storage is in receiving team
I.e. use after row.
Further, described transmission data coding module is connected with described reception data dynamic sampling module by signal.
Further, described transmission data coding module uses High-Level Data Link Control HDLC coding.
Further, described reception data dynamic sampling module include four sampling modules, coupling search module and
Selecting phasing module, described four sampling modules are connected with described coupling search module signal, and described coupling is searched
Rope module is connected with described Selecting phasing module by signal.
Further, described four sampling modules are connected with described transmission data coding module signal.
CRC i.e. CRC (Cyclic Redundancy Check): be in data communication field
Conventional a kind of error check code, is characterized in that the length of information field and check field can be arbitrarily selected.
HDLC i.e. High-Level Data Link Control (High-Level Data Link Control): be one in Synchronization Network
Transmitting data, bit-oriented data link layer protocol, it is by International Organization for Standardization (ISO) basis
SDLC (Synchronous Data Link Control) the protocol extension exploitation of IBM Corporation.
Serial communication method between a kind of plate, it comprises the steps: that (1) will by sending data buffering module
Data are transmitted to sending data coding module;(2) by described transmission data coding module to data at
Data are encoded by reason, simultaneously plus CRC check, are changed into serial data;(3) by connecing
Receive data dynamic sampling module and receive the serial data of described transmission data coding module coding, transmit it to
Receive data decoder module;(4) receive data dynamic sampling module and receive above-mentioned serial data, and it is entered
Row sampling, carries out dynamic synchronization according to synchronous mark field to sampling phase;(5) by receiving data decoding
The serial data received is decoded by module, and carries out CRC check;(6) by receiving data buffering
Module caching receive data, data buffer storage in receiving queue for rear class.
Further, serial data communication is completed by single bus between system board.Heretofore described serial
Data wire need not with road clock.
Further, described transmission data coding module uses High-Level Data Link Control HDLC coding.
Further, described HDLC coding is forced to send synchronous mark field after frame length reaches maximum.
The present invention provides a kind of source that need not to send the serial communication method with road clock, at transmitting terminal logarithm
After doing suitable coding, between veneer, only need a data lines can complete data communication between plate.In this example
Serial communication method FPGA interior-excess between plate is existing, specifically:
1) send data buffering module to be used for caching transmission data, contain buffer queue and send controlled state
Machine.Data buffer storage, among queue, sends controlled state machine and is responsible for controlling to send data and synchronous mark word
Section.
2) send data coding module to encode for data carry out specific (class HDLC coding), add simultaneously
Upper CRC check.
3) data dynamic sampling module is received, for the serial data received being sampled and according to synchronizing mark
Will field carries out dynamic synchronization to sampling phase.
4) receive data decoder module to be used for receiving decoding data, and carry out CRC check.
5) receiving data buffering module to be used for caching reception data, data buffer storage makes for rear class in receiving queue
With.
Firstly the need of explanation serial data frame format, serial data controls HDLC protocol based on High Level Link and becomes
Changing, it includes synchronous mark field F and data field D, specifically:
Synchronous mark field F: attribute field is the bit pattern of 01111110, initiateing and front in order to marker frames
The termination of one frame, attribute field can also be as filling character between frame and frame simultaneously.
Data field D: in addition to attribute field.At transmitting terminal, occur when being found to have continuous 5 " 1 "
Time, add one " 0 " behind, then proceed to the bit stream sent thereafter;At receiving terminal, when sending out continuously
After existing 5 " 1 " occurs, if its latter bit " 0 ", it is automatically deleted it, to recover original bit stream.
Data field includes check field.
Illustrate quantitatively, carry out instantiation explanation with a set of typical parameter.Definition serial data tranmitting data register
For 25MHz, speed is 25Mbps;Definition synchronous mark field largest interval is 60us.With 2 synchronizations
Between attribute field, data are a frame, and so every interframe can have up to 1500 25MHz clock cycle,
Transmittable 1500 bit data in the case of Duo.
Sending in data buffering module, data buffer storage to be sent in FIFO, is sent and controls shape by buffer queue
State machine controls transmission state.When buffer queue has data, then take Data Concurrent in FIFO and send;Work as transmission
When data encoding unit continuously transmits 1500 cycles, send controlled state machine and control to send synchronous mark by force
Field, sends the state transfer schematic diagram of controlled state machine as shown in Figure 3.
Sending the coding of data coding module complete paired data field, coded system is retouched by data field above
The mode stated.Serial bit stream is sent with clock 25MHz after coding.
Receive dynamic sampling module to complete, to sampling and the Phase synchronization receiving serial data, to realize for the present invention
Main contents.Itself particularly as follows: receiving terminal in this locality with the 100MHz of 4 times of transmitting terminal 25MHz clocks
Clock is sampled to receiving data.The most no matter receiving terminal clock phase whether with receive data syn-chronization, often
Individual bit receives data can obtain 4 sampling number evidences, as shown in Figure 4.
Analyze from sequential, these 4 sampled points must have at least 3 and stablize sampled point.Four sampling numbers
According to the coupling search carrying out sync id field F after displacement.After coupling search, four phase points are selected
Selecting, specifically chosen mode is, when continuous 3 sampled points all mate with synchronous mark word, selects second
The phase place of sampled point is as the sampling phase of this frame subsequent data.Receive data dynamic sampling lock unit structure
Figure is as shown in Figure 2.
Receiving data decoder module and complete the decoding to serial data stream, decoding process is according to data field D institute
The method described is decoded.Receive data cache module serial bit circulation is changed to byte stream, is carried out
CRC check is also stored in buffer queue.
The present invention requirement to clock frequency deviation: in above-mentioned canonical parameter instantiation illustrates, when transmitting terminal sends
Clock and receiving terminal receive clock can not homology, but both frequency deviation differences must not exceed 166.7PPM.Big in frequency deviation
Occasion can reduce synchronous mark interfield every.
The present invention provides between a kind of communication device board without the serial data communication method with road clock, it is possible to
Under the least encoding overhead, reliably realize data transmission by a data lines.The advantage of the method is:
1) traffic rate is high.In the situation that the clock of 4 times of serial data transmission frequency can be processed by FPGA
Under, serial data rate is up to more than 50Mbps.
2) physics cabling reduces.Carry out between the veneer of data communication, having only to a data lines and can complete data
Transmission.So can greatly alleviate backboard cabling pressure, FPGA pin resource can also be saved simultaneously,
Alleviate veneer wiring pressure.
3) without sequential pressure.Method does not has any phase at receiving terminal FPGA to receiving data as described above
Position requirement, such veneer sequential difference in different slots position on system stability without impact, more without big measuring tank
Position traversal test.
From technique scheme and it can be seen that between some high speeds, low cost, plate simple, reliable number
According to communication situation, the method can complete demand well.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all at this
Within bright spirit and principle, any modification, equivalent substitution and improvement etc. made, should be included in this
Within bright protection domain.