Serial Port_ Serial Cable

What is the difference between RS-232 RS-422 and RS485? This article can tell you the answer.

What is serial communication? The popular term serial communication generally is asynchronous serial communication.

serial cable db9 female
Serial Cable

Serial communication and Parallel communication?

The opposite of serial communication is parallel communication. Data is generally transmitted in bytes, a byte is 8 bits. Taking an example of parallel communication, that means there will be 8 wires, each representing one bit. A transmission can pass a byte, while the serial communication, the transmission of data is only by a wire, a time can only pass a bit, to pass a byte will need to pass 8 times!

Synchronous and asynchronous communication

Synchronous communication generally means that there is a clock signal to synchronize the data signal. Synchronous communication is relatively simple for the receiver. Because there is a clock signal, every a logic high and logic low level change, just go to fetch the data. Communication rate can be controlled by the sender or master device. Communication speed is also relatively faster than serial communication.

But why a lot of equipment, touch screen and plc, the controller does not use this way, still use the serial port?

Well, in many devices, it is not convenient to connect too many wires, such as connecting 8 data wires, it is not convenient to connect the synchronous clock signal, so a kind of asynchronous serial communication was born.

Relatively speaking, asynchronous serial communication, only need a wire to send data. In the case of the rate requirements are not high, the use of a wire to send data is to bring great convenience and practical value.

So how to ensure that a wire can send normal data? That is to say, the sender sends the data, the receiver is how to know what data.

In order to be able to send data and receive the correct data, the two sides need to agree on a code.

When only one wire is used for data transmission, the default is a logic high, so there is a start bit, right? When a low level is detected, it is the beginning of a byte of data sent, after the start bit, the first byte of the lowest bit, the transmission of a byte, in order to come to the data will not do interference, it is in the byte of data and then add a parity bit, which can be used for odd-checking, even-checking, 1-checking, 0-checking, no-checking.

If there is a start bit, there should be a stop bit, and then add a stop bit at the end.

Transmission of a string of data, we need to know the data split, to time or frequency to decode the data bits and parity bits, the two sides need to agree on a baud rate, the baud rate, is that 1S can be transmitted more than one bit, but also to know how long a bit occupies. This will solve the problem of transmission.

If the transmission process, the data is too fast, we can adjust the stop bit to 1 stop bit or 2 stop bits.

In the serial port communication parameters, there are baud rate, data bits, stop bits, parity bits of these parameters to ensure the correctness and stability of the serial port communication. Of course, this is only a certain aspect to ensure the correctness and stability of serial communication, does not represent the correctness and stability of communication between devices.

Serial communication is mainly divided into RS232, RS485, RS422 communications in three ways,What difference between RS232, RS422 and RS485?

RS232 Serial Port

232 communication is mainly composed of RX, TX, GND three wires.

RX and TX, TX to RX, GND to GND. this is better to understand it. Because sending and receiving are handled by different wires, that is the ability to send data and receive data at the same time, which is known as full-duplex.

Expanding on this, there is another function of serial communication called full-featured serial communication, also known as standard serial port. Because of the data transmission between two devices, some devices process faster and some data slower. In order to ensure that the data can be transmitted properly, on the basis of RX, TX, but also added a few control pins, so there are total of 9 pins together, so the use of DB9 connectors!

In the later equipment, many controllers, HMI, PLC and other use of serial communications, basically do not use the standard serial port, but the direct use of RX, TX, GND three wires to communicate.

But why mention this here. Because only a lot of equipment used in this way, that is, there are still a few devices still retain the function of the standard serial port. This is why you will encounter a computer communication is good, replaced with a touch screen communication will not work. Because many touch screens only use the RX, TX, GND communication, encountered some still retain the standard serial port function is more annoying.

RS485 Serial Port

RS485 is to solve the problem of 232 communication distance. Anyway, 232 communication distance is not long. 485 is mainly a differential signal transmission, only two wires, +, – two wires, or also known as the A, B two wires. A, B two-wire differential level signal is transmitted as a data signal. So the question arises, then is there no concept of RX and TX. Yes, send and receive can not be separated. Transmit and receive are relying on these two to transmit, that is, only for each time to send or only to receive, which is the concept of half-duplex, which is much weaker than 232 in terms of efficiency. Like a walkie-talkie, often a person to speak after, have to say an over, to ensure that the current finished, waiting for the other party to reply.

RS485 is so sacrificed 232 full-duplex efficiency to achieve the cost of their own transmission distance. That there is no that retains the full-duplex 232, but also like 485 so as to improve the transmission distance it, so, 422 came out.

RS422 Serial Port

RS422, some labeled as 485-4, and 485 is labeled as 485-2. what is the difference. Just to remember it. 485-2 is 2 wires. 485-4 is 4 wires.

422 is the 232 RX is divided into two lines, RX +, RX -, TX is divided into TX +, TX -. In this way, you can send and receive at the same time, and you can also have a longer transmission distance like 485. But this is a very advantageous way of communication, why not use it more. My personal answer and understanding is: too many wires.

Because in many equipment communication, basically belongs to a question-and-answer type, therefore, the advantages of full-duplex communication of 232 actually did not play out. Just like now on the phone, although two people can talk at the same time, but two people talking at the same time, gibberish, who knows what to say ah. Especially when a master and multiple slave communication, 485 wiring is much more convenient, anyway, we have two wires, the + are connected to a piece of – are connected to a piece. If it is 422 as a master and multiple slaves, the wiring also have to be half a day it, and communication anomalies are not easy to solve.

Leave a Comment

Your email address will not be published. Required fields are marked *