I briefly introduced what I needed for serial transmission, but here are some details of some things.
Connecting a serial port of two computers will allow you to exchange both directions.In other words, you can send data from computer A to B, and send data from B to A.This is because the TXD of A and the RXD of A, the RXD of A and the RXD and B are connected with two lines.In order to perform two -way communication, two sets of single -directional communication paths must be prepared.
Apart from this, there is also a method of performing two -way communication on one set of communication paths.The format in which two -way communication is used to perform two -way communication is called the full double communication, and the format in which two -way communication is performed using one set of communication routes is called half double communication (Fig. 1).。
Figure 1: Total double communication and half double communication
While total double communication uses two sets of communication routes with fixed transmission directions, half double communication performs two -way communication on one communication path.One pair of communication paths can be done with one set of communication, but instead, sending and receiving cannot be performed at the same time.For example, while computer A is sending to B, B cannot send data to A.This is because there is only one set of communication paths.In the case of total double communication, two sets of communication paths are independent, so you can send them from B to A even if you are being sent from A to B.
In terms of data transmission efficiency, the full double method is advantageous, but the half double system has the advantage of having one set of communication routes (that is, one electric wire is good).If the cable must be extended for a long time, this merit is large, and you may close your eyes on the disadvantageous part and choose a half double system.
In addition, two -way communication using radio waves and infrared rays is basically half double.If you send a signal with the same frequency radio waves or perform infrared communication in the same place, if both sides send them at the same time, they will be confused and cannot do correct communication.In other words, using a specific frequency band or space means that there is only one communication path.A typical example is a radio such as a transceiver.When one is talking (sending), the other party only receives it and cannot send it.Switching and receiving must be changed by the other party until the other party says "Please" (of course, if you use a different wave band of radio waves for sending and receiving, you can do a double communication that simultaneously performs transmission and reception).
In serial transmission, the digital data 0 and 1 are sent out to the communication path according to the content of the data to be sent.At this time, how is 0 and 1 represented on the communication route?
The basic method that represents the data 0 and 1 is to use two types of electrical signals.The simplest way is to assign 0 and 1 for two voltage.For example, the ground level (0V), positive voltage (several bolts), positive voltage and negative voltage, or whether current is flowing, 2 types of electrical state that can be generated and detected relatively easily.And assign 1.In the case of RS-232 compliant serial ports, -5V or less is 1 and+5V or more is set (Fig. 2).
Fig. 2: Expresses 0 and 1 by voltage
In a method of expressing 0 and 1 with a constant voltage, the voltage does not change much if the data continues as data.If the same condition continues for a long time, the timing may be out of the timing (if the voltage changes, you can correct the timing at that time).Even though the sender intends to send 0 of 1000 bits, the receiving side may be regarded as 999 bits.
Depending on the communication method, another condition may be required.For example, when you want to distinguish the state where the data of 0 and 1 is sent and the state where the data is not transmitted is not performed.As long as the two types of electrical state represent 0 and 1, the third state, that is, no data, cannot be expressed.
In order to meet these requirements, there is also a method of expressing 0 and 1 by the pattern of change in signal waveforms, rather than expressing 0 and 1 in the static state of the electric signal.For example, if 0 and 1 are expressed in the pattern of changes in the voltage waveform, even a special pattern such as 0 or 1 continues to continue, can constantly generate any change in voltage, and send data.It can be distinguished from the state that is not performed (a state where voltage changes do not occur).
The 10BASE Ethernet described in Chapter 4 of this book expresses 0 and 1 sent on the cable in the Manchesta coding method.As shown in Fig. 1-9, the pattern of the signal waveform that represents 0 is LH, the pattern that represents 1 is HL (L is a low voltage level, H is high voltage level).In other words, whether it is 0 or 1, the voltage of the signal waveform that expresses the data always changes the voltage once in the middle.
If serial transmission is performed in this way, even if the data pattern is that 0 or 1 continues, signals can always be sent in the form of voltage waveforms.And if there is no voltage change in the transmission circuit, it can be regarded that data is not transmitted.
Figure 3: Manchesta encoding
The method of using two types of electrical condition is simple and certain, but increasing the communication speed will cause problems.In the simple encoding method, the more data to be transmitted, the more number of changes in signals on the communication path increases.This means that the frequency of the transmitted signal is high.In order to send a high frequency signal, you need to use a wider cable with a more frequency band.The higher the frequency, the shorter the extension distance.
To put it simply, the data communication speed is 10 times in the 10Mbps 10BASE-T Ethernet and the 100Mbps 100BASE-TX Ethernet, so if you send data in the same method, the signal frequency will increase by 10 times, the same.It is difficult to wire with a cable or achieve the same extension distance.Therefore, in high -speed communication, a method for sending more bits is devised and used without increasing the frequency of the signal too much.
符号化Coding has several meanings.Converting information such as letters and images into digital data is called a code.The images are broken into pixels, each pixel is quantified and arranged to make up image information, or a binary value is assigned to the character, and it is expressed as a character code.
Coding used during communication is to convert digital data represented by 0 and 1 into another form according to the characteristics and requirements of the communication path.And the encoded data sent on the communication path is restored to the original data on the receiving side.This is called a decryption.
By performing appropriate encoding, it is possible to accidentally send more information on the communication path.