Home >Industrial IoT>Industrial IoT
RS232/RS485 serial port communication introduction

RS232/RS485 Serial Communications is a type of communication protocol used in serial communication systems. It is a low-level communication protocol used in many different applications.


RS232 is a two-wire, asynchronous serial communication protocol that uses voltage levels to transmit and receive data. It was developed in the late 1960s and is still commonly used today. RS485 is a two-wire, differential serial communication protocol that uses a differential signal to transmit and receive data. It was developed in the 1980s as an improvement to RS232 and is now the most widely used protocol in industrial applications.

On the page :



Related article:

Dingtalk_20230323172917


What is RS232 serial communication


1. Overview of RS-232

The RS232 interface conforms to the serial data communication interface standard formulated by the Electronic Industries Alliance (EIA), and the full name of the original serial number is EIA-RS-232 (abbreviated as 232, RS-232). It is widely used in computer serial interface peripheral connection. Connecting cables and mechanics, electrical characteristics, signal functions and transmission processes.

6

7


The RS-232-C standard specifies data transfer rates of 50, 75, 100, 150, 300, 600, 1200, 2400, 4800, 9600, 19200 bauds per second.

2. Features of RS232 serial port communication

RS-232 is one of the mainstream serial communication interfaces. Since the RS-232 interface standard appeared earlier, it is inevitable that there are deficiencies, mainly as follows:

(1) The signal level of the interface is relatively high, and the chip of the interface circuit is easily damaged. The voltage of any signal line of the RS-232 interface is a negative logic relationship. That is: logic "1" is -3~-12V; logic "0": +3~+12V, and the noise margin is 2V. That is to say, the receiver is required to recognize a signal higher than +3V as a logic "0", a signal lower than -3V as a logic "1", a TTL level of 5V as a logic positive, and 0 as a logic negative. It is incompatible with TTL level, so it needs to use level conversion circuit to connect with TTL circuit.

(2) The transmission rate is low, during asynchronous transmission, the bit rate is 20Kbps;

(3) The interface uses a signal line and a signal return line to form a common-ground transmission form. This common-ground transmission is prone to common-mode interference, so the anti-noise interference is weak.

(4) The transmission distance is limited. The maximum transmission distance standard value is 50 feet, but in fact it can only be used at about 15 meters.


 What is RS485 serial communication

1. Overview of RS485 interface

When the communication distance is required to be tens of meters to thousands of meters, RS485 serial bus is widely used. The RS485 interface adopts balanced transmission and differential reception, so it has the ability to suppress common mode interference. In addition, the bus transceiver has high sensitivity and can detect the voltage as low as 200mV, so the transmission signal can be recovered beyond a kilometer.


Dingtalk_20230323180723


2. Features of RS485 serial port communication

RS485 serial port communication is very convenient for multi-point interconnection, and many signal lines can be saved. RS485 serial port communication can be used to network to form a distributed system. For the shortcomings of RS-232-C, the new standard RS-485 has the following characteristics:

(1) Electrical characteristics of RS485: logic "1" is represented by the voltage difference between the two lines +2V ~ +6V, and logic "0" is represented by the voltage difference between the two lines -6V ~ -2V. The interface signal level is lower than that of RS-232-C, so it is not easy to damage the interface circuit chip, and this level is compatible with TTL level, which is convenient for connection with TTL circuit.

(2) The RS485 interface adopts a combination of a balanced driver and a differential receiver, which has strong anti-common-mode interference ability, that is, good anti-noise performance.

(3) The maximum transmission distance standard value of the RS485 interface is 4000 feet, but it can actually reach 3000 meters.


Refer article : Features of RS485 to LoRaWAN data collector



The difference between RS232 interface and RS485 interface

The RS232 interface is full-duplex, and the RS485 interface is half-duplex.

The transmission method is different. RS-232 communication adopts unbalanced transmission mode (single-ended transmission), and RS-485 communication adopts balanced transmission mode (differential transmission mode).

The communication distance is different. The transmission distance of RS-232 is short (the maximum transmission distance standard value is 15 meters), and the transmission distance of RS-485 is long (the maximum transmission distance is 1200 meters).

The difference in communication lines. RS-232 uses three-core twisted pair, three-core shielded wire, etc. RS-485 uses two-core twisted pair, two-core shielded wire, etc.


Pros and Cons of RS485 and RS232 serial communication interface

Advantages of RS232 serial communication:

RS232 serial port is the most widely used serial interface in computer and communication industry. It works in full-duplex mode and requires three wires: ground, transmit and receive. RS232 can only realize point-to-point communication.

Disadvantages of RS232 serial communication:

1.The interface signal level is relatively high, and the interface circuit chip is easily damaged.

2.The transmission rate is low, the highest baud rate is 19200bps.

3. Poor anti-interference ability.

4.The transmission distance is limited, generally within 15m.

5.Only point-to-point communication can be realized.

RS485 serial port communication characteristics

1. RS485 adopts balanced transmission and differential reception, has good anti-interference ability, and the signal can be transmitted for thousands of meters.
Disadvantages of RS485 serial port communication:
2. RS485 has two wires and four wires. When the four-wire system is used, only point-to-multiple communication can be realized (that is, there can only be one master device, and the rest are slave devices). The four-wire system is rarely used now, and now the two-wire system is mostly used.

3.The two-wire RS485 can only work in a semi-duplex mode, and the sending and receiving cannot be carried out at the same time.

4.RS485 can connect up to 32 nodes on the same bus, which can realize real multi-point communication, but generally adopts the master-slave communication mode, that is, one master has multiple slaves.

5.Because the RS485 interface has good anti-interference ability, long transmission distance and multi-station capability, it becomes the preferred serial interface.