Summary of the invention
The purpose of the present invention is to propose to a kind of pins without using outside any clock, data, while LVDS module again can
Itself management and message transmissions function are completed well.
A kind of LVDS interface communication means of the present invention, wherein include: the initialization for carrying out communication both ends;Carry out LVDS line
Road training;Transmission flow includes: S1, sending BUSY code;S2, the state for checking itself, as state be it is full, then continue send BUSY
Otherwise code sends FREE code;S3, it receives opposite end BUSY code and then waits, be otherwise transferred to S4;S4, it is such as locally transferred to without message
Otherwise S3 is transferred to S5;S5, local message is packaged and is sent, message is transferred to S2 after being sent completely;Receiving process includes:
S6, it receives opposite end BUSY code and then waits, be otherwise transferred to S7;S7, the data for checking opposite end, receive opposite end FREE code and are then transferred to
Otherwise S6 is transferred to S8;S8, such as receive is message, then obtains message length according to encapsulation format, will be connect according to message length
The packet storage received, and update the state of itself.
One embodiment of LVDS interface communication means according to the present invention, wherein carry out communication both ends initialization include:
Select first handshake as both ends in LVDS data line;First end sends square wave, and second end sends complete 1, simultaneously
The two starts the detection to opposite end square wave;Second end stops sending complete 1 after detecting the square wave of first end, starts sender
Wave, while detecting complete the 1 of first end transmission;First end stops sending square wave after detecting the square wave of second end, starts to send complete
1, while detecting complete the 1 of second end transmission;Second end detect first end complete 1 after stop send square wave, start to send complete 1,
The midamble code of first end transmission is detected simultaneously, and second end is shaken hands completion;First end detect second end complete 1 after stop sending it is complete
1, first end is shaken hands completion.
One embodiment of LVDS interface communication means according to the present invention, wherein the training of LVDS route includes: in data line
Before training starts, it is complete 1 that all of data lines, which is exported,;First end sends the full 0 that midamble code detects second end transmission simultaneously, the
Two ends detection midamble code waits for training;Second end receives midamble code and is trained, and exports full 0 after training, simultaneously
Start to detect first end is sent complete 1;First end sends complete 1 after detecting the full 0 that second end is sent, and starts simultaneously at detection training
Code waits for training;Second end detect first end send complete 1 after send midamble code, start simultaneously at detection first end send
Full 0;Full 0 is sent after first end training, starts simultaneously at the full 0 that detection second end is sent;Second end detects first end
Start to send full 0 after the full 0 of transmission, persistently sends the full 0 of multiple clock cycle;Between first end, second end route training from
A data wire starts, and after the completion of training, into the training of second data line, judges whether all of data lines training later
It finishes, as unfinished, second end turns to lower a data wire and continues to train, and so on, until all of data lines training
It finishes, such as completes, then second end enters message transmissions.
LVDS interface communication means of the present invention passes through will be ready, completes signal and is completed using data line, saves exterior tube
Foot;By being packaged to transmitting message, transmission in control code band is realized, that is, saves the exterior tube that full flow control signal occupies
Foot, while can also flexibly add new control command.
Specific embodiment
To keep the purpose of the present invention, content and advantage clearer, with reference to the accompanying drawings and examples, to of the invention
Specific embodiment is described in further detail.
The both ends of LVDS are designed as master-slave mode by the present invention, and operation is divided into 3 stages, and the first stage is the rank of shaking hands that is switched on
Section, second stage are the route training stages, and the phase III is the message transmissions stage.
Fig. 1 is the first stage booting handshake procedure figure of LVDS interface communication means of the present invention, as shown in Figure 1, LVDS
Booting handshake procedure includes the following steps:
(1) select first in LVDS data line as main side, from the handshake at end.
(2) main side sends square wave, sends complete 1 from end, while the two starts the detection to opposite end square wave.In order to guarantee to examine
Reliability is surveyed, square-wave cycle setting can be 16 clock cycle.
(3) stop sending complete 1 after the square wave that end detects main side, start to send square wave, while detecting main side transmission
Complete 1.
(4) main side, which is detected, stops sending square wave after the square wave at end, starts to send complete 1, while detecting from end transmission
Complete 1.
(5) stop sending square wave after detecting complete the 1 of main side from end, start to send complete 1, while detecting the instruction of main side transmission
Practice code, shakes hands completion from end, into the training stage.
(6) main side, which is detected, stops sending complete 1 behind complete the 1 of end, and main side is shaken hands completion, into the training stage.
Fig. 2 is the second stage route training flow chart of LVDS interface communication means of the present invention, as shown in Fig. 2, LVDS line
Road training process includes the following steps:
(1) main side, between end route training since a data wire, training after the completion of, into the second radical evidence
The training of line, and so on, until all of data lines training finishes.It is before data line training starts, all of data lines is defeated
It is out complete 1.
(2) main side sends midamble code and detects the full 0 sent from end simultaneously, and from end, detection midamble code waits for training.
(3) midamble code is received from termination to be trained, export full 0 after training, start simultaneously at what detection main side was sent
Complete 1.
(4) main side, which is detected, sends complete 1 after the full 0 that end is sent, and starts simultaneously at detection midamble code and waits for training.
(5) midamble code is sent after detecting complete the 1 of main side transmission from end, starts simultaneously at the full 0 that detection main side is sent.
(6) full 0 is sent after the training of main side, starts simultaneously at the full 0 that detection is sent from end.
(7) full 0 is sent since detecting after the full 0 that main side is sent end, persistently sends the full 0 of 16 clock cycle, it
After judge whether that all of data lines training finishes, no end, turns to down a data wire from end, repeatedly step 2-7;It has been handled that, then
Enter the message transmissions stage from end.
(8) main side detects the full 0 sent from end, judges whether that all of data lines training finishes later, no end, main side turns
Downward a data wire repeats step 2-7;It has been handled that, then main side enters the message transmissions stage.
Fig. 3 is the phase III message transmissions flow diagram of LVDS interface communication means of the present invention, as shown in figure 3, report
Literary transmission flow is divided into 2 parts, transmission flow and reception process.
Before carrying out message transmissions, there is following agreement to message transmissions
Control code is defined, full 0 code is BUSY code, indicates that transmitting terminal cannot receive data;All-ones are FREE code, indicate hair
Sending end can receive data;
Define message encapsulation format, message length+message content.
Transmission flow comprises the steps of
(1) BUSY code is sent when initially entering the transmission stage.
(2) it checks BUF (for the receiving message) state for receiving itself, completely continues to send BUSY code, otherwise send FREE
Code, is transferred to step 3 later.
(3) it receives opposite end BUSY code then to wait in this step, is otherwise transferred to step 4.
(4) local to be transferred to step 3 without message, otherwise it is transferred to step 5.
(5) local message is packaged, i.e., adds message length information before message, the message after sending encapsulation,
Message is transferred to step 2 after being sent completely.
It is comprised the steps of as shown in figure 3, receiving process
(1) it receives opposite end BUSY code then to wait in this step, is otherwise transferred to step 2.
(2) data for checking opposite end, receive opposite end FREE code and are then transferred to step 1, be otherwise transferred to step 3.
(3) what is received is message, obtain message length according to encapsulation format first, will be received according to message length
Packet storage to receive BUF.Message is transferred to step 1 after receiving.
While step 3 carries out message reception, check that receiving BUF sky expire state, it is full then reception BUF full scale will is set,
It is otherwise provided as non-full.
LVDS interface communication means of the present invention sends square wave by using a data wire in LVDS interface and is opened
Machine is shaken hands, that is, improves successful robustness of shaking hands, because will not accidentally generate square wave in start-up phase, while being saved additional
Ready signal;It is then saved in the training stage using the interaction that the data line being trained to is trained process and completes signal;It is reporting
The literary transmission stage by being packaged to message, defines BUSY code, FREE code saves full flow control signal, while can also be square
Just other control commands of addition.
Compared with prior art, LVDS interface communication means of the present invention is by completing ready RDY DONE signal and using number
It is completed according to line, saves external terminal;By being packaged to transmitting message, transmission in control code band is realized, that is, is saved
The external terminal that full FULL flow control signal occupies, while can also flexibly add new control command.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, without departing from the technical principles of the invention, several improvement and deformations can also be made, these improvement and deformations
Also it should be regarded as protection scope of the present invention.