Since the advent of the USB interface, the number of serial ports installed on serial devices and computer hosts has decreased, but serial interfaces are still widely used in industrial networking environments or commercial projects. There are dozens of serial data interfaces in use today. Most have been developed for specific applications. Some have become common, such as I2C, CAN, LIN, SPI, software and hardware, MOST, and I2S. There are higher speed serial interfaces such as Ethernet, HDMI and Thunder. The two most classic interfaces are RS232 and RS485. The reason why these long-standing Ethernet interfaces have been used all the time must have value. So let’s study what are the principles of RS485 and RS232? What is the difference? What value can make them last forever?
The entire purpose of a serial interface is to provide a single path for data transmission, either wirelessly or over a cable. Parallel buses are still used in some applications. But with the high-speed data that is so common today, serial servers are the first practical choice for stable communication over any distance greater than a few kilometers.
Serial interfaces can be used to provide a standardized level of logic from transmitter to receiver, define transmission media and connectors, and specify timing and data rates. In some cases, they can perform serial-to-parallel and parallel-to-serial conversions, or specify basic data protocols.
The definition of logical levels, media, and connectors is part of the physical layer (PHY) or Layer 1 of the Open Systems Interconnection (OSI) network model. Any other functions such as data processing are part of the Media Access Control (MAC) layer or Layer 2 of the OSI model.
RS232 serial port
One of the oldest serial interfaces is often called RS232. It was originally established in 1962 as a method of connecting data terminal equipment (DTE), such as electromechanical teletypewriters, to data communications equipment (DCE). Its use over the years has included to video terminals, computers and modems. The first personal computers included an RS232 called a serial port for connecting printers or other peripheral devices. Today, it is still widely used in embedded computer development systems, scientific instruments, and various industrial control equipment.
The official name of the standard is Electronic Industries Association/Telecommunications Industry Association EIA/TIA-232-F. The letter F indicates the latest standard modifications and updates. This standard is essentially the same as the International Telecommunications Union – Telecommunications (ITU-T ) specifications V.24 and V.28.
The standard defines logic 1 as a voltage between –3 and –25 V and logic 0 as a voltage level between 3 and 25 V (Figure 1). Signal levels are often referred to as marks of logic 1 and intervals of logic 0. Voltages between ±3 V are ineffective, giving the interface a huge noise margin. Noise voltages within this range are rejected. In common practice, logic 0 and 1 levels are typically as low as ±5 V and as high as ±12 or ±15 V . The transmitter and receiver are configured as single-ended (not differential) with a ground reference.
1. Voltage levels define logical 1 or mark and logical 0 or space character. Voltages between ±3 V are not valid.
The cable medium can be simple parallel wires or twisted pairs. The length of the cable determines the higher data rate and should generally not exceed 50 feet. However, at lower data rates, longer cable lengths can be used. The main goal today is to use cables with no more than 2500 pF capacitance between wires. This limits the upper data rate to approximately 20 kbits/s. Due to the low data rates used by this interface, the cable is not typically considered a formal transmission line. Transmission lines require matched generator impedance and load impedance to eliminate reflections that cause data corruption.
The standard defines a 25-pin connector called DB-25, which is designed to carry various control lines as well as serial data transmit and receive lines. This connector is rarely used today. Instead, a 9-pin connector called DE-9 was defined and has become the de facto standard today (Figure 2).
2. The popular DB9 connector carries the signals shown. These numbers are the pin numbers on the connector.
Initially, electromechanical devices had very slow data rates. The lowest rate is usually 75 bits/second, but 150 and 300 bits/second are more common. Today, the data rate is defined by the protocol used by the interface and can range up to 115.2 kbit/s. Typical data rates are 1200, 2400, 4800, 9600, 19,200, 38,400 and 115,200 bits/second. The data rate is limited by the maximum allowed slew rate of 30 V/µs (volts per microsecond). For short , low-capacity cables, with appropriate drivers, data rates can be as high as several megabits per second.
Many RS-232 connections are one-way or simplex. However, bidirectional or half-duplex operation is possible using special signals and control voltages available. Two connected devices alternate sending and receiving operations.
The control signals in the interface define the protocol for sending and receiving data. These signals tell two communicating devices when they are busy, transmitting, ready and receiving. The sending device is a DTE (such as a computer), and the receiving device is a DCE (such as a printer). The control signals used on the common nine-pin connector are:
Data Carrier Detection (DCD): The DCE informs the DTE that it is receiving a valid input signal.
Data Set Ready (DSR): DCE informs DTE that it is connected and ready to receive.
Received Data (RD): This is the actual signal received from the DTE.
Request to Send (RTS): This signal from the DTE tells the DCE to prepare to send.
Transmit Data (TD): This is the signal sent by DTE.
Clear to Send (CTS): This line on the DCE tells the DTE that it is ready to receive data.
Data Terminal Ready (DTR): This line goes from DTE to DCE and indicates that it is ready to send or receive data.
Ringing Indicator (RI): This line was used in older modem connections but is no longer used.
Signal Ground: This is the common ground for all signals.
Figure 3 shows the cabling from the DTE to the DCE. Pay attention to the interconnections between the control line pins. Signals on these pins respond to each other in a process called flow control or “handshaking.”
3. This is a common connection between DTE and DCE equipment. Note the connection of the cable from one connector to the other.
Although not officially part of the RS-232 standard, most serial devices that use this interface also use what is called a Universal Asynchronous Receiver Transmitter (UART). This IC, usually separate from the line driver and receiver circuitry, implements a basic communication protocol that transmits up to 8 bits at a time. It performs serial-to-parallel and parallel-to-serial conversion, adding start and stop bits to indicate the beginning and end of the data word, parity bit error detection, and establishment of the data rate.
The data is usually ASCII characters, but any data word of up to 8 bits can be transferred (Figure 4). UARTs can typically be configured to handle different word lengths (5 to 8 bits), add 1, 1.5, or 2 stop bits , and include odd, even, or no parity bits. Data rates from 75 bit/s to 115.2 kbit/s are optional.
RS-485
Also defined by the EIA/TIA standard, this interface is now called TIA-485. It defines not only a single device-to-device interface, but also a communications bus that can be used to form a simple network of multiple devices. Its configuration and specifications also extend the range and data rates beyond the capabilities of the RS-232 interface.
The RS-485 standard specifies differential signaling on two lines, rather than single-ended with a reference voltage to ground. The level of logic 1 is greater than –200 mV, and the level of logic 0 is greater than 200 mV. Typical line voltage levels from line drivers range from a minimum of ±1.5 V to a maximum of approximately ±6V. Receiver input sensitivity is ±200 mV. Noise in the ±200 mV range is essentially blocked. The differential format produces effective common-mode noise cancellation .
The standard transmission medium is #22 or #24 AWG solid wire twisted pair cable. Minimum two lines, but a third reference line may be used. A four-wire cable can also be used if full-duplex operation is required. Cables can be shielded or unshielded, with unshielded being the most common. Cables are considered transmission lines. The nominal characteristic impedance is 100 or 120Ω. Terminating load resistors are required to ensure matched line conditions to prevent reflections from introducing data errors.
The standard does not define a specific connector. Various connection methods have been used, including RS-232 DE-9 connectors. Simple screw terminal connections are common in some types of industrial control equipment.
Cable length defines the higher data rate. But due to lower logic voltage levels and differential connections, data rates may exceed 10 Mbits/s depending on cable length. Maximum cable length is usually defined as 1200 meters or approximately 4000 feet. Typical maximum data rate at 4000 feet is 100 kbits/s. A general guideline is that the product of line length in meters and data rate in bits per second should not exceed 10 8 . For example, a 20-meter cable will allow a maximum data rate of 5 Mbit/s.
The RS-485 interface can be used in half-duplex simplex mode over a single pair of cables. Two pairs of cables can be used for full-duplex or simultaneous transmit and receive operation. A common configuration is a bus network with multiple branches or connections. The standard specifies a maximum of 32 drivers (transmitters) and 32 receivers (Figure 5). When not transmitting, the line driver is disconnected from the line. All receivers are fully connected and the bus terminated with load matching resistors.
5. This is a representation of a typical TIA-485 differential bus showing the individual drivers (D) and receivers (R) as well as the transceivers. Pay attention to the ends of the bus terminating resistors.
The standard does not yet define a specific communication protocol. Sometimes the standard UART protocol is used. Most applications define unique protocols.
Interface changes
Several variations of these two standards are occasionally found in practice. RS-422 is a variation of RS-485 with similar specifications, but is only designed for use with one driver and up to 10 receivers. Logic levels range from ±2 to ±6V . RS-423 is a single-ended rather than differential version of RS-422. Otherwise, other specifications are similar to the RS-485 interface.
Application areas
Currently, the TIA-232 standard has been deployed in a variety of low data rate short range applications. It is particularly effective in equipment used in noisy environments such as factories, process control plants and utility sites. Cable length is typically less than 50 feet . Common devices include low-speed modems, industrial control equipment such as programmable logic controllers (PLCs), computer numerical control (CNC) machine tools, robots, embedded control computers, medical instruments and equipment, and embedded controller development systems.
The TIA-485 interface is also widely used in industrial applications requiring higher speeds and longer distances. It is used for devices of the same type as those defined by the RS-232 interface, as well as devices such as point-of-sale ( POS) terminals, metering instruments, and large specialized automation machines. Networks defined by fieldbuses such as Profibus and Modbus also use it.
Most new devices use the popular USB interface. However, it is often necessary or desirable to convert from one interface to another to allow devices of different types or ages to be used together. Various converters are available to convert USB to TIA-232 or TIA -485, TIA-232 to TIA 485, and vice versa.
summary
Generally, RS232 is best for short distance and low speed suited requirements. It is simple and low-cost, and the interface can be built using many components such as line drivers and receivers, UARTs and connectors. Some drivers allow data rates up to 2 or 3 Mbit/s on short lines. Most interface chips contain a charge pump DC-DC converter that provides positive and negative supply voltages, allowing the IC to operate from a single 3.3V or 5V supply.
RS485 provides higher speeds over longer ranges, or if duplex network capabilities are required. Likewise, many standard components are available for creating interfaces. The IC’s driver and receiver can tolerate more than 32 interrupts and the data rate can be as high as 40 Mbit/ s.Some ICs also include dc-dc converters that provide dual supply voltages
Keywords: RS485 to 4G