Serial interfaces are primarily used for serial bit-by-bit data transmission, allowing for bidirectional communication with just a pair of transmission lines, which offers the advantages of simple communication lines and low costs. Nowadays, many serial data interfaces are used in specific fields, with common examples including I2C, CAN, LIN, SPI, Flex, MOST, and I2S. Of course, there are also some interfaces with higher transmission rates, such as FireWire, HDMI, and Thunderbolt. However, the serial interfaces we will discuss today can be considered the ancestors of these interfaces: RS-232 and RS-485. Despite being among the earliest to appear, many people believe these two interfaces are outdated or discontinued. In fact, they remain active in the field of data transmission and continue to play a significant role. Below, we will analyze these two types of interfaces one by one.
RS-232
The RS-232 interface was introduced in 1970 and is the world’s first serial interface, supporting only point-to-point transmission. Initially, it was used as a method to connect Data Terminal Equipment (DTE), frequently connecting video terminals, computers, and modems. When RS-232 first appeared on personal computers, it was referred to as a serial port, used to connect to printers or other devices. Today, it is still widely used in embedded computer development systems, scientific instruments, and various industrial control devices.
The RS-232 standard specifies that the logic high level is between -3 V and -25 V, while the logic low level is between +3 V and +25 V, with levels close to zero being invalid (as shown in Figure 1). Logic high is defined as a negative voltage, and the effective negative voltage signal state is called marking, which signifies OFF; logic low is defined as a positive voltage, and the effective positive voltage signal state is called spacing, which signifies ON. Typically, the minimum voltage values for logic high and low fluctuate between ±5 V, with maximum voltage values usually between ±12 V or ±15 V.
The cable medium for connecting RS-232 interfaces generally comes in two types: parallel wires or twisted pairs. The cable length typically should not exceed 15 meters to limit the maximum data transmission rate. However, in cases of very low data transmission rates, the cable length can exceed 15 meters. When transmitting via connecting cables, the capacitance between the cables must be limited to 2500 pF to control the data rate to around 20 kbits/s. Due to the low data transmission rate and the absence of matched generator and load impedance to mitigate data attenuation, the connected cable is usually not considered a proper transmission line.
Additionally, RS-232 specifies 20 different signal connections, constructed from a 25-pin D-sub (mini D-type) connector known as DB-25. However, for cost and space-saving reasons, this connector is now rarely used, replaced instead by the 9-pin D-sub or DB-9 connector. The control signals commonly used on the nine-pin connector include:
Data Carrier Detect (DCD): Notifies the DTE that the DCE is receiving a valid signal.
Data Set Ready (DSR): Notifies the DTE that the DCE is ready to receive signals.
Receive Data (RD): The actual signal received from the DTE.
Request to Send (RTS): A signal from the DTE indicating it is ready to transmit.
Transmit Data (TD): The signal sent from the DTE.
Clear to Send (CTS): Notifies the DTE that the DCE is ready to receive data.
Data Terminal Ready (DTR): Indicates from the DTE to the DCE that it is ready to send or receive data.
Ring Indicator (RI): This line was used in older modem connections but is no longer in use.
Common Ground: All signal grounds are connected.
RS-485
RS-485 is now commonly referred to as TIA-485, capable of point-to-point connections as well as one-to-multipoint connections. Compared to RS-232, RS-485 has expanded functionality in various aspects: it supports higher data transmission rates, allows for the connection of up to 128 transceivers on the bus, and has bidirectional communication capabilities. This standard specifies that the logic high level must not be lower than -200 mV, and the logic low level must not be lower than +200 mV. The voltage difference at both ends must be effective when it is above 0.2V, but as long as the voltage range is between -7V and +12V, the network can operate normally.
The transmission medium for the RS-485 standard is twisted pair cables of #22 or #24 AWG solid wire, and four-wire twisted pairs are required for full-duplex operation. It can perform high-voltage differential balanced transmission through twisted pairs, with a maximum transmission distance exceeding 1200 meters. Ideally, EIA-485 requires two termination resistors, with resistance values equal to the characteristic impedance of the transmission cable to prevent data transmission errors. In many cases, when connecting RS-485 communication links, a simple pair of twisted wires is used to connect the “A” and “B” ends of each interface. The RS-485 interface connector uses a DB-9 9-pin plug, with the smart terminal RS-485 interface using DB-9 (socket), and the keyboard connection RS-485 using DB-9 (pin).
Application Areas
RS-232 is generally used for low data transmission rates over short distances, effectively operating in noisy environments such as factories and public sites. Common devices include low-speed modems, industrial control devices, programmable logic controllers (PLC), computer numerical control (CNC) machines, robots, embedded control computers, medical instruments and equipment, as well as embedded controller development systems. RS-485, on the other hand, is commonly used for high data transmission rates over long distances, with common devices including point-of-sale terminals (POS), metering instruments, and large dedicated automation machines.
However, in everyday applications, we often need to convert between two different interface types. In this case, we can use the now popular USB interface, which can help us convert to RS-232 and RS-485 interfaces.
In summary, RS-232 is suitable for short-distance low-rate transmission requirements, while RS-485 is suitable for long-distance transmission. RS-485 is a new interface standard that emerged to address the shortcomings of the RS-232 interface, and due to its excellent noise immunity and multi-station capabilities, it has become the preferred standard.