Why can't you connect rs 485 directly.  Physical interfaces RS485 and RS422.  Bad jokes of alignment

Why can't you connect rs 485 directly. Physical interfaces RS485 and RS422. Bad jokes of alignment

Description

RS-485 (Recommended Standard 485 or EIA / TIA -485-A) is the recommended standard for transmitting data over a two-wire, half-duplex, multidrop serial balanced communication channel. Co-developed by the Electronic Industries Alliance (EIA) and the Telecommunications Industry Association (TIA). The standard only describes the physical layers of signaling (i.e., only the 1st layer of the OSI open systems interconnection model). The standard does not describe the programming model of the exchange and the exchange protocols. RS-485 was created to expand the physical capabilities of the RS232 interface for transmitting binary data.

RS-485 standard releases

Name: Recommended Standard 485
Electrical Characteristics of Generators and Receivers for Use in Balanced Multipoint Systems
Electrical characteristics of generators and receivers for use in balanced multipoint systems.

Developer: Electronics Industries Association (EIA)... Industrial Electronics Association.
Standard editions:
RS-485A (Recommended Standard 485 Edition: A) year of manufacture 1983.
EIA 485-A year of manufacture 1986.
TIA / EIA 485-A year of manufacture 1998.
TIA / EIA 485-A year of edition 2003.

International and national standards based on RS-485 standard

ISO / IEC 8482 (1993 active)
Publisher: ISO, IEC
Name: Information technology - Telecommunications and information exchange between Systems - Twisted pair multipoint interconnections.
Old editions:
ISO 8284 (1987 not active)

ITU-T v.11 (1996 active)
Publisher: INTERNATIONAL TELECOMMUNICATION UNION
Name: Electrical characteristics for balanced double-current interchange circuits opertiong at data signaling rates up to 10 Mbit / s.
Old editions:
ITU-T v.11 (1993 not active)
CCITT v.11 (1988 not active)

ANSI / TIA -485-A (1998 active)
Publisher: American National Standards Institute, ANSI
Name: Electrical Characteristics of Generators and Receivers for Use in Balanced Digital Multipoint Systems.

RS-485 interface properties

    Bidirectional half-duplex data transmission. The serial data stream is transmitted simultaneously only in one direction, the transmission of data in the other direction requires switching the transceiver. Transceivers are commonly called "drivers", this is a device or electrical circuit that generates a physical signal on the side of the transmitter.

    Symmetrical communication channel. To receive / transmit data, two equivalent signal wires are used. The wires are designated by the Latin letters "A" and "B". These two wires are serial data exchange in both directions (alternately). When using a twisted pair, a symmetrical channel significantly increases the signal immunity to common-mode interference and well suppresses the electromagnetic radiation generated by the useful signal.

    Differential (balanced way of data transmission). With this method of data transmission at the output of the transceiver, the potential difference changes, when transmitting "1", the potential difference between AB is positive when transmitting "0", the potential difference between AB is negative. That is, the current between contacts A and B, when transferring "0" and "1", flows (balances) in opposite directions.

    Multi-point. Allows multiple connection of receivers and transceivers to one communication line. In this case, it is allowed to connect only one transmitter to the line at a given time, and many receivers, the rest of the transmitters must wait for the communication line to be released for data transmission.

    Low impedance transmitter output. The transmitter buffer amplifier has a low impedance output, which allows the signal to be transmitted to many receivers. Standard transmitter loading capacity is 32 receivers per transmitter. In addition, the current signal is used for the operation of the "twisted pair" (the higher the operating current of the "twisted pair", the more it suppresses common-mode noise on the communication line).

    Dead zone. If the differential signal level between the AB contacts does not exceed ± 200mV, then it is considered that there is no signal in the line. This increases the noise immunity of data transmission.

RS-485 Specifications

    Allowable number of transceivers (drivers) 32

    Maximum communication line length 1200m (4000ft)

    Maximum transfer rate 10 Mbps

    Minimum driver output signal ± 1.5V

    Maximum driver output signal ± 5V

    Maximum short-circuit current of the driver 250 mA

    Driver output impedance 54 Ohm

    Driver input impedance 12 kOhm

    Allowable total input impedance 375 Ohm

    Signal insensitivity range ± 200 mV

    Logic one level (Uab)> +200 mV

    Logic zero level (Uab) ← 200 mV

The input impedance for some receivers can be more than 12 kΩ (single load). For example, 48 kOhm (1/4 of a unit load) or 96 kOhm (1/8), which allows you to increase the number of receivers to 128 or 256. With different input impedances of the receivers, it is necessary that the total input impedance is not less than 375 Ohms.

Description of RS-485 operation

Since the standard RS-485 describes only the physical layer of the data exchange procedure, then all the problems of exchange, synchronization and acknowledgment are assigned to a higher exchange protocol. As we have already said, most often, this is the RS-232 standard or other upper protocols (ModBus, DCON, etc.).

RS-485 itself does only the following:

    Converts the input sequence "1" and "0" to a differential signal.

    Transmits a differential signal to a balanced communication line.

    Connects or disconnects the driver transmitter using a higher protocol signal.

    Receives differential signal from communication line.

If you connect the oscilloscope to the AB pins (RS-485) and the GND-TDx pins (RS-232), then you will not see the difference in the shape of the signals transmitted in the communication lines. In fact, the RS-485 waveform completely repeats the RS-232 waveform, except for the inversion (in RS-232, a logical unit is transmitted with a voltage of -12 V, and in RS-485 +5 V).

Fig.1 Form of signals RS-232 and RS-485 when transmitting two characters "0" and "0".

As can be seen from Fig. 1, there is a simple conversion of the signal levels by voltage.

Although the shape of the signals is the same for the above mentioned standards, the method of their formation and the power of the signals are different.

Fig. 2 Formation of RS-485 and RS-232 signals

Conversion of signal levels and a new method of their formation allowed solving a number of problems that at one time were not taken into account when creating the RS-232 standard.

Advantages of RS-485 Physical Signal over RS-232 Signal

    A unipolar + 5V power supply is used, which is used to power most electronic devices and microcircuits. This simplifies design and facilitates device matching.

    The signal strength of the RS-485 transmitter is 10 times the signal strength of the RS-232 transmitter. This allows up to 32 receivers to be connected to one RS-485 transmitter and thus broadcast data transmission.

    Use of balanced signals, which is galvanically isolated from the potential of the mains supply. As a result, interference is excluded from the power zero wire (as in RS-232). Considering the ability of the transmitter to operate on a low impedance load, it becomes possible to use the effect of common mode noise rejection using the properties of the "twisted pair". This significantly increases the communication range. In addition, it becomes possible to "hot" connect the device to the communication line (although this is not provided for by the RS-485 standard). Note that in RS-232, hot plugging of the device usually leads to failure of the computer's COM port.

Description of data exchange according to the RS-485 standard

Each transceiver (driver) RS-485 can be in one of two states: data transmission or data reception. The RS-485 driver is switched using a special signal. For example, Fig. 3 shows data exchange using the AC3 converter from Aries. The converter mode is switched by the RTS signal. If RTS = 1 (True) AC3 transmits data that comes to it from the COM port to the RS-485 network. In this case, all other drivers must be in the receive mode (RTS = 0). Basically RS-485 is a bi-directional buffered multiplexed amplifier for RS-232 signals.

Fig. 3 An example of using the Aries AC3 converter.

The situation when more than one RS-485 driver in the transmitter mode will work at the same time leads to data loss. This situation is called "collision". To avoid collisions in data exchange channels, it is necessary to use higher protocols (OSI). Such as MODBUS, DCON, DH485, etc. Or programs that directly work with RS-232 and solve collision problems. These protocols are commonly referred to as 485 protocols. Although in fact, the hardware basis of all these protocols is, of course, RS-232. It provides hardware processing of the entire information flow. The software processing of the data stream and the solution of problems with collisions are dealt with by higher-level protocols (Modbus, etc.) and software.

Basic principles of implementation of upper-level protocols (MODBUS type)

Let's take a quick look at these protocols, although they are not related to the RS-485 standard. Typically, the upper layer protocol includes packet, frame, or frame exchange. That is, information is transmitted in logically complete parts. Each frame is necessarily marked, i.e. its beginning and end are denoted by special characters. Each frame contains the device address, command, data, checksum, which are necessary for organizing multipoint exchange. To avoid collisions, the "master" - "slave" scheme is usually used. The "master" has the right to independently switch its RS-485 driver to the transmission mode, the rest of the RS-485 drivers work in the receive mode and are called "slaves". In order for the "slave" to start transmitting data to the communication line, the "master" sends him a special command, which gives the device with the specified address the right to switch its driver to the transmission mode for a certain time.

After transmitting the enable command to the "slave", the "master" turns off its transmitter and waits for the response from the "slave" for a period of time called a "timeout". If during the timeout a response from the "slave" is not received, then the "master" again seizes the communication line. The "host" is usually a program installed on the computer. There is also a more complex organization of packet protocols, which makes it possible to cyclically transfer the role of "master" from device to device. Usually such devices are called "leaders", or the devices are said to transmit a "marker". Possession of the "marker" makes the device a "master", but it will have to transfer it to another device in the network according to a certain algorithm. Basically, the above protocols differ in these algorithms.

As we can see, the upper protocols have a batch organization and are executed at the software level, they allow to solve the problem with data "collisions" and multipoint organization of data exchange.

Implementation of transceivers (drivers) RS-485

Many companies make RS485 transceivers. They are usually called RS232 - RS485 converters or RS232-RS485 converters. For the implementation of these devices, special microcircuits are produced. The role of these microcircuits is to convert the RS232C signal levels to the RS485 signal level (TTL / CMOS) and vice versa, as well as to ensure the half-duplex operation.

By the method of switching to transmission mode, devices are distinguished:

    Switchable by means of a separate signal. To switch to the transmission mode, you must set an active signal at a separate input. This is usually the RST signal (COM port). These transceivers are now rare. But, nevertheless, they are sometimes not replaceable. Let's say you need to listen to data exchange between industrial equipment controllers. At the same time, your transceiver should not go into transmission mode, so as not to create a collision in this network. The use of a transceiver with automatic switching is not allowed here. An example of such a converter Aries AC3.

    With automatic switching and without checking the line status. The most common converters, which switch automatically when an information signal appears at their input. At the same time, they do not control the busyness of the communication line. These converters require careful use due to the high probability of collisions. An example of the Aries AC3M converter.

    With automatic switching and with line status check. The most advanced converters that can transmit data to the network only if the network is not occupied by other transceivers and there is an information signal at the input.

Hardware implementation of RS485 on the example of the converter RS232-RS485 AC3 Aries

Fig.4 Schematic diagram of AC3 Aries.

Figure 4 shows a schematic diagram of the AC3 Aries converter. This converter has a separate signal to enable data transfer mode. The COM output signal of the RST port is used as a control signal. If RST = 1 (+ 12V) the converter transmits data from the TD (COM port) to the RS485 network, if RST = 0 (-12 V), then the data is received from the RS-485 network to the RD (COM port) input. The converter operates on a 220 volt AC industrial network. The converter power supply is made according to a pulse circuit based on the TOP232N (DA1) microcircuit. The power supply provides two independent voltages + 5V. To receive and convert polar signals RS232 (± 12 V) into unipolar signals TTL / CMOS level (+5 V), the MAX232N microcircuit (DD1) is used. This microcircuit is interesting in that it is powered from a unipolar voltage of +5 V and has built-in voltage sources that are necessary to work with polar signals of ± 12V. For the correct operation of the built-in voltage sources, external capacitors C14, C15, C17, C18 are connected to the MAX232N microcircuit. ... In addition, the microcircuit has two converters of signal levels RS-232C to TTL / CMOS in both directions.

Signal assignment:
RST - to switch the converter to transmit / receive mode
TD - data transfer from RS232 to RS485
RD - data reception in RS232 from RS485

Further, RS232 signals converted to TTL / CMOS level are fed to 6N137 optocouplers, which provide galvanic isolation of RS232 and RS485 signals. To transmit / receive data on the side of the RS485 interface, a DS75176 microcircuit (multipoint RS485 transceiver) is used. This microcircuit is powered from a separate source with a voltage of +5 V. The microcircuit is a TTL / COMOS level signal amplifier with switching the transmission direction. The DS75176 outputs are connected to pins A and B through 100 Ohm resistors, which provides an A-B short-circuit current of 250mA. The RS485 signal strength is about 10 times that of the RS232 signals. This microcircuit amplifies the signal to the required power and provides half-duplex operation.

RS-485 network topology

The RS-485 network is built on a serial bus (bus) scheme, i.e. devices in the network are connected in series with symmetrical cables. In this case, the ends of the communication lines must be loaded with terminating resistors (terminators), the value of which must be equal to the characteristic impedance of the communication cable.

Terminators perform the following functions:

    Reduces signal reflection from the end of the communication line.

    Provides sufficient current through the entire communications line to reject common mode noise with a twisted pair cable.

If the distance of the network segment exceeds 1200 m or the number of drivers in the segment is more than 32 pieces, you need to use a repeater to create the next network segment. Moreover, each network segment must be connected to terminators. In this case, a network segment is considered to be a cable between an end device and a repeater or between two repeaters.

The RS-485 standard does not specify what type of balanced cable to use, but de facto they use a twisted pair cable with a characteristic impedance of 120 ohms.

Figure 6 Belden 3106A Industrial Cable for RS485 Networks

It is recommended to use Belden3106A industrial cable for RS485 networks. This cable has a characteristic impedance of 120 ohms and is a double shielded twisted pair cable. Belden3106A cable contains 4 wires. The orange and white wires are symmetrical shielded twisted pair. The blue wire of the cable is used to connect the zero potential of the power supplies of the devices in the network and is called "common" (Common). The bare wire is used to ground the cable sheath and is called Drain. In a network segment, the drain wire is grounded through a resistance on the device chassis, at one end of the segment, to prevent stray currents from flowing through the cable sheath, at different ground potential at remote points.

Typically, the termination and protective earth resistances are located inside the device. It is necessary to connect them correctly using jumpers or switches. A description of these connections must be found in the technical documentation of the device manufacturer.

Figure 7 1747-AIC Wiring Diagram (Allen Bradley)

Figure 7 shows the cable connections to intermediate devices on a network segment. For the first instrument on a DH-485 network segment, jumper 5-6 must be installed (this connects the 120 ohm terminator that is inside the 1747-AIC) and jumper 1-2 (connects the drain wire to the instrument chassis through an internal resistance). For the last device in the network segment, only jumper 5-6 needs to be installed (connect a terminator)

When using other balanced cables, especially when their characteristic impedance is not known, the size of the terminators is selected empirically. To do this, you need to install the oscilloscope in the middle of the network segment. By controlling the shape of rectangular pulses transmitted by one of the drivers, it can be concluded that it is necessary to adjust the value of the terminator resistance.

Software for working in RS-485 networks

The RS-485 interface has become the main physical interface for industrial data transmission networks. Such protocols as ModBus, ProfiBus DP, DCON, DH-485, work on the physical layer RS-485.

Industrial data transfer protocols are often classified by manufacturers. Information on a particular communication protocol has to be collected bit by bit.

A specialist working with industrial networks needs a program to read all information transmitted in information networks. The basic secrets of industrial protocols can only be discovered through a comprehensive analysis of transmitted and received data. The ComRead v.2.0 program is designed to save and display data and service signals transmitted in information networks that operate according to the standards RS-232, RS-485, Bell-202, etc. The program not only saves all information, but also creates a time base of data and service signals. The ComRead v.2.0 program scans the information channel without affecting its operation, that is, it works in the mode of listening to the physical media of information transmission. In addition, the program can work in the mode of data translator and service signals. At the same time, it becomes a direct part of the information communication channel. More details can be found with the program here

Broadcast capability.

Multipoint connection.

Disadvantages of RS485

    High energy consumption.

    Lack of service signals.

    Possibility of collisions.

The RS-485 standard was first adopted by the Electronics Industry Association. Today he reviews the electrical characteristics of various receivers and transmitters that are used in balanced digital systems.


What is this standard?

RS-485 is the name of a well-known interface that is actively used in all kinds of industrial control systems for the purpose of connecting certain controllers and many other devices to each other. The main difference between this interface and RS-232 is that it involves the combination of several types of equipment at the same time. When using RS-485, high-speed data exchange between several devices is guaranteed by using a single two-wire communication line in half-duplex mode. He is involved in modern industry in the creation of process control systems.

Range and speed

With the help of the presented standard, it is possible to achieve transmission of information at a speed of up to 10 Mbit / s. It should be noted that in this case, the maximum possible range directly depends on the speed of data transmission. It should be noted that in order to ensure the maximum speed, information can be transmitted no further than 120 meters. At the same time, at a speed of 100 kbps, data is transmitted over 1200 meters.

The number of combined devices

The number of devices that the RS-485 interface can combine in itself directly depends on which transceivers are involved in them. Each transmitter provides specific control of 32 standard receivers. True, you should be aware that there are receivers with an input impedance that differs from the standard by 50%, 25% or less. If you use this equipment, the total number of devices increases accordingly.

Connectors and protocols

The RS-485 cord is not capable of standardizing any particular data frame format or communication protocol. As a rule, the same frames used by RS-232 are used for broadcasting. In other words, the data bits, stop and start bits, and the parity bit, if necessary. As for the operation of the exchange protocols, in most modern systems it is performed according to the "master-slave" principle. This means that a certain device in the network acts as a master and initiates the exchange of sending requests between slave devices, which differ among themselves by logical addresses. The most famous protocol currently is Modbus RTU. It should be noted that the RS-485 cable does not have a specific type of connectors or wiring. In other words, there are terminal connectors, DB9 and others.

Connection

Often, using the presented interface, a local network is encountered, which simultaneously combines several types of transceivers. When making an RS-485 connection, it is necessary to correctly combine the signal circuits with each other. As a rule, they are called A and B. Thus, the polarity reversal is not a big deal, just the connected devices stop working.

When using the RS-485 interface, it is necessary to take into account certain features of its operation. Thus, the recommendations are as follows:

1. The optimal medium for signal transmission is a twisted pair cable.
2. The ends of the cord must be terminated using specialized terminal resistors.
3. The network, where standard or USB RS-485 is used, must be laid without branches according to the bus topology.
4. Devices should be connected to the cable using the shortest possible cable length.

Harmonization

With the help of terminal resistors, standard or USB RS-485 guarantees complete matching of the open end of the cord with the subsequent line. This completely eliminates the possibility of signal reflection. The nominal impedance of the resistors associated with the characteristic impedance of the twisted-pair cable and wires is typically around 100-120 ohms. For example, the currently known UTP-5 cable, which is often used in the process of laying Ethernet, has a characteristic impedance of 100 ohms.

For other cable options, other ratings can be applied. The resistors can be soldered to the pins of the cable connectors in the end devices, if necessary. It is not often that resistors are installed in the equipment itself, as a result of which jumpers must be installed to connect the resistor. In this case, when the device is connected, the line is mismatched. To ensure the normal functioning of the rest of the system, you will need to connect a termination plug.

Signal levels

The RS-485 port adopts a balanced communication scheme. In other words, the voltage levels on signal circuits A and B change in antiphase. The sensor provides a signal level of 1.5 V, taking into account the load limit. In addition, a maximum of 6 V is provided when the device is idling. The voltage level is measured differentially. At the location of the receiver, the minimum level of the received signal must be at least 200 mV.

Bias

When there is no signal on the signal circuits, a small offset is applied. It provides protection to the receiver in the event of a false alarm. Experts advise doing an offset of slightly more than 200 mV, because this value is considered to correspond to the input signal falsity zone according to the standard. In such a situation, circuit A approaches the positive pole of the source, and circuit B is pulled up to the common one.

Example

Resistor values ​​are calculated based on the required bias and supply voltage. For example, if you want to get an offset of 250 mV with terminal resistors, RT = 120 ohms. It should be noted that the source has a voltage of 12 V. Taking into account the fact that in this case two resistors are connected in parallel to each other and do not take into account the load from the receiver at all, the bias current reaches 0.0042. At the same time, the total bias resistance is 2857 ohms. In this case, Rcm will be about 1400 Ohm. Thus, you will need to select the nearest denomination. An example would be a 1.5 kΩ resistor. It is required for displacement. In addition, an external 12 volt resistor is used.

It should also be noted that the system has an isolated output from the controller's power supply, which is the main link in its own circuit segment. True, there are other options for performing the bias, where the RS-485 converter and other elements are involved, but you should still take into account the fact that the node providing the bias will sometimes turn off or ultimately be completely removed from the network. When bias exists, the fully idle potential of circuit A is considered positive with respect to circuit B. This acts as a guide when connecting new equipment to the cable without using wire markings.

Incorrect wiring and distortion

Implementation of the recommendations indicated above makes it possible to achieve correct transmission of electrical signals to different points of the network, when the RS-485 protocol is used as a basis. If at least one of the requirements is not met, signal distortion occurs. The most noticeable distortions appear when the information exchange rate is higher than 1 Mbps. True, even at lower speeds, it is not recommended to neglect these tips. This rule also applies during normal network operation.

How to program?

When programming various applications that work with devices used by an RS-485 splitter and other devices with the presented interface, several important points should be taken into account.

Before the delivery of the parcel begins, it is imperative to activate the transmitter. It is worth noting that, according to some sources, the issuance can be carried out immediately after activation. Despite this, some experts advise to pause first, equal in time to the broadcast speed of one frame. In this case, the correct reception program can fully identify the errors of the transient process, which is able to carry out the normalization procedure and prepare for the next data reception.

When the last byte of data has been issued, you must also pause before disconnecting the RS-485 device. This is in a sense due to the fact that in the controller serial port often there are two registers at the same time. The first is a parallel input, it is designed to receive information. The second is considered a shift output, it is used for the purpose of serial output.

When the controller transfers data, any interrupts are generated when the input register is empty. This occurs when information has already been supplied to the shift register, but has not yet been issued. This is also the reason that after the termination of the broadcast, it is necessary to maintain a certain pause before turning off the transmitter. It should be about 0.5 bits longer than the frame in time. When performing more accurate calculations, it is advised to study in more detail the technical documentation of the serial port controller that is used.

It is possible that the RS-485 transmitter, receiver and converter are connected to a common line. Thus, the own receiver will also begin to perceive the transmission made by its own transmitter. It often happens that when in systems that are characterized by random access to the line, this feature is used to check that there is no collision between two transmitters.

Bus format configuration

The presented interface has the ability to combine devices in the "bus" format, when all equipment is connected using one pair of wires. This implies that the communication line must be matched by the end-of-line resistors of the two ends. To ensure this, it is necessary to install resistors that are characterized by a resistance of 620 ohms. They are always mounted on the first and last device connected to the line.

As a rule, modern devices have a built-in matching resistor. If the need arises, it can be connected to the line by installing a special jumper on the device board. It is worth noting that the delivery status of the jumpers is first installed, so you need to remove them from all devices except the first and the last. It should also be noted that in the S2000-PI model repeater converters for a separate output, the matching resistance is activated using a switch. As for the S2000-KS and S2000-K devices, which are characterized by a built-in matching resistance, there is no jumper required to connect it. To provide a long communication line, it is advisable to use specialized repeater-repeaters, which are pre-equipped with fully automatic transmission direction switches.

Star configuration

All taps on the RS-485 line are considered unwanted, as this would result in excessive signal distortion. Although, from the point of view of practice, it is possible to admit this when there is a small length of the branch. In this case, there is no need to install terminating resistors on separate branches.

In an RS-485 system, where control is provided by using a remote control, when resistors and devices are connected to the same line, but powered from different sources, it is necessary to combine the 0 V circuits of all devices and the console in order to achieve equalization of their potentials. When this requirement is not met, the remote is capable of intermittent communication with devices. When using wires with several twisted pairs, a completely free pair can be used for the potential equalization circuit, if necessary. In addition, it is possible to use a shielded twisted pair if the shield is not grounded.

What should be considered?

In most cases, the current flowing through the equipotential bonding wire is considered to be quite small. If 0 V devices or the power supplies themselves are connected to several local ground buses, then the potential difference between different 0 V circuits can reach several units. Sometimes this value is at around tens of volts, and the current that flows through the potential equalization circuit is quite significant. This is often the reason why there is an unstable connection between the remote control and the devices. As a result, they are even capable of failing.

Thus, it is necessary to exclude the possibility of grounding the 0 V circuit, or to ground this circuit at a specific point. In addition, consideration should be given to the possibility of interconnection between 0 V and the protective earth circuit, which is present in the equipment used in the FSA system. It is worth noting that at sites where a relatively difficult electromagnetic environment is characteristic, it is possible to connect to this network by using a "shielded twisted pair" cable. It remains to emphasize that in this situation, there may be a shorter limiting range, because the capacitance of the wire is considered to be higher.

It is easy to make designs using RS-485 lose weight if you understand how to maintain good communication quality at the same time. This article covers facts, myths, and cruel jokes that you should be aware of in order to achieve this goal.

In industrial and building automation systems, a number of remote data collection devices are used that transmit and receive information through a central module that provides access to the data to users and other processors. Data loggers and readers are typical for these applications. A near-ideal data line for this is defined by the RS-485 standard, which connects data acquisition devices with a twisted pair cable.

Since many of the data acquisition and storage devices in RS-485 networks are compact, self-contained, battery-powered devices, measures to reduce their power consumption are necessary to control their heat generation and increase battery life. Likewise, energy savings are important for wearable devices and other applications where RS-485 is used to download data to a central processing unit.

The next section is primarily intended for those who are not familiar with RS-485.

RS-485: history and description

The RS-485 standard was jointly developed by two manufacturers' associations: the Electronics Industries Association (EIA) and the Telecommunications Industry Associastion (TIA). The EIA once labeled all of its standards with the prefix "RS" (Recommended Standard). Many engineers continue to use this designation, but the EIA / TIA has officially replaced "RS" with "EIA / TIA" to make it easier to identify the origin of their standards. Today, various extensions to the RS-485 standard cover a wide variety of applications.

RS-485 and RS-422 have a lot in common and are therefore often confused. Table 1 compares them. RS-485, which defines bidirectional half-duplex communication, is the only EIA / TIA standard to allow multiple receivers and drivers in bus configurations. EIA / TIA-422, on the other hand, defines a single unidirectional multi-receiver driver. RS-485 elements are backward compatible and interchangeable with their RS-422 counterparts, however RS-422 drivers should not be used in RS-485 based systems as they cannot relinquish bus control.

Table 1. Standards RS-485 and RS-422

RS-422 RS-485
Working hours Differential Differential
Tx and Rx number allowed 1 Tx, 10 Rx 32 Tx, 32 Rx
Maximum cable length 1200 m 1200 m
Maximum baud rate 10 Mbps 10 Mbps
Minimum driver output range ± 2V ± 1.5V
Maximum driver output range ± 5V ± 5V
Maximum short-circuit current of the driver 150 mA 250 mA
Load resistance Tx 100 ohm 54 Ohm
Rx input sensitivity ± 200 mV ± 200 mV
Maximum input impedance Rx 4 kΩ 12 kΩ
Rx input voltage range ± 7V -7 V to +12 V
Logic-one level Rx > 200 mV > 200 mV
Rx logic zero level < 200 мВ < 200 мВ

ESD protection

Differential signal transmission in systems based on RS-485 and RS-422 provides reliable data transmission in the presence of noise, and the differential inputs of their receivers can also suppress significant common-mode voltages. However, additional measures must be taken to protect against the significantly higher voltage levels commonly associated with electrostatic discharge (ESD).

The charged capacity of the human body allows a person to destroy an integrated circuit by simply touching it. Such contact can easily occur when laying and connecting the interface cable. To protect against such destructive effects, MAXIM interface chips include "ESD structures". These structures protect transmitter outputs and receiver inputs in RS-485 transceivers from ESD levels up to ± 15kV.

To ensure the stated ESD protection, Maxim repeatedly tests the positive and negative power pins in 200V steps to verify the consistency of levels up to ± 15kV. Devices in this class (meeting the Human Body Model or IEC 1000-4-2 specifications) are marked with an additional "E" suffix in the product designation.

The load capacity of an RS-485 / RS-422 driver is quantified in terms of a unit load, which in turn is defined as the input impedance of one standard RS-485 receiver (12kΩ). Thus, the standard RS-485 driver can drive 32 unit loads (32 parallel 12K ohm loads). However, for some RS-485 receivers, the input impedance is higher - 48 kOhm (1/4 unit load) or even 96 kOhm (1/8 unit load) - and, accordingly, 128 or 256 such receivers can be connected to one bus at once. ... You can connect any combination of receiver types as long as their parallel impedance does not exceed 32 unit loads (i.e., the total impedance is not less than 375 ohms).

Consequences of high speeds

Faster transmissions require higher slew rates at the driver output, and these in turn produce higher levels of electromagnetic interference (EMI). Some RS-485 transceivers keep EMI to a minimum by limiting their slew rates. Slower slew rates also help control reflections caused by fast transients, high data rates, or long links. The basis for minimizing reflections is to use terminating resistors with a rating that matches the characteristic impedance of the cable. For conventional RS-485 cables (24AWG twisted pair wires), this means placing 120 ohm resistors at both ends of the communication line.

Where does all the power go?

An obvious source of power loss is the transceiver quiescent current (IQ), which is significantly reduced in modern devices. Table 2 compares the quiescent currents of low power CMOS transceivers to the industry standard 75176.

Table 2. Comparison of leakage currents for various RS-485 transceivers

Another characteristic of the power consumption of RS-485 transceivers appears when there is no load, the driver output is enabled, and the presence of a periodic input signal. Since open lines should always be avoided in RS-485, the drivers hammer their output structures every time the output is switched. This short turn on of both output transistors immediately causes an inrush current in the supply. A large enough input capacitor dampens these surges, producing an RMS current that rises with the baud rate to its maximum value. For MAX1483 transceivers, this maximum is approximately 15 mA.

Connecting a standard RS-485 transceiver to the minimum load (one more transceiver, two terminating resistors and two protection resistors) allows you to measure the dependence of the supply current on the baud rate under more realistic conditions. Figure 2 shows ICC versus baud rate for the MAX1483 under the following conditions: standard 560 ohm, 120 ohm, and 560 ohm resistors, VCC = 5V, DE = / RE \ = VCC, and 300m cable.

As you can see from Figure 2, the current consumption rises to approximately 37mA even at extremely low baud rates; this is primarily caused by the addition of terminating resistors and bias resistors. For low power applications, this should demonstrate the importance of the type of negotiation used, as well as the way to achieve fault tolerance. Fault tolerance is discussed in the next section, and a detailed description of reconciliation is available in the Bad Jokes of Conciliation.

fault tolerance

With voltages at the inputs of RS-485 receivers in the range from -200mV to + 200mV, the output state remains undefined. In other words, if the differential voltage on the RS-485 side in half-duplex configuration is 0V and none of the transceivers are leading the line (or the connection is broken), then a logical one and a logical zero at the output are equally probable. To ensure a certain state at the output under such conditions, most modern RS-485 transceivers require the installation of bias resistors: an initial high level (pullup) resistor on one line (A) and a low level (pulldown) on the other (B), like this shown in Figure 1. Historically, bias resistors in most circuits have been specified as 560 ohms, but to reduce power loss (when only one end of the link is terminated) this value can be increased to approximately 1.1 kΩ. Some designers install resistors at both ends with ratings from 1.1k to 2.2k. Here you have to find a compromise between noise immunity and power consumption.

Figure 1. Three external resistors form the termination and bias circuitry for this RS-485 transceiver.

Figure 2. MAX1483 Transceiver Supply Current vs. Baud Rate.

Manufacturers of RS-485 transceivers previously eliminated the need for external bias resistors by providing internal positive bias resistors at the receiver inputs, but this approach was only effective in solving the open circuit problem. The positive bias resistors used in these pseudo failsafe receivers were too weak to level the receiver output on the matched bus. Other attempts to avoid the use of external resistors by changing the receiver thresholds to 0V and -0.5V violated the RS-485 specification.

Maxim's MAX3080 and MAX3471 family of transceivers solved both of these problems by defining an accurate threshold range from -50mV to -200mV, thus eliminating the need for bias resistors while maintaining full compliance with the RS-485 standard. These ICs ensure that a 0V input to the receiver will cause the output to go high. Moreover, this design guarantees a known output state of the receiver for open and closed line conditions.

As shown in Table 2, transceivers differ greatly in their quiescent current values. Therefore, the first step in conserving power should be choosing a low power device such as the MAX3471 (2.8 μA with driver disabled, up to 64 Kbps). Since power consumption increases significantly during data transmission, another goal is to minimize driver runtime by transmitting short telegrams (data blocks, approx. Per.) With long waiting periods between them. Table 3 shows the structure of a typical serial telegram.

Table 3. Serial telegram

An RS-485 based system using receivers in one unit load (up to 32 addressable devices) can, for example, have the following bits: 5 address bits, 8 data bits, start bits (all frames), stop bits (all frames), parity bits (optional), and CRC bits (optional). The minimum telegram length for this configuration is 20 bits. For secure transfers, you must send additional information such as data size, sender address and direction, which will increase the telegram length to 255 bytes (2040 bits).

This change in telegram length, with a structure defined by standards such as X.25, provides data reliability at the expense of increased bus time and power consumption. For example, transferring 20 bits at 200 kbps would take 100 µs. Using the MAX1483 to send 200Kbps data per second, the average current is

(100 μs * 53 mA + (1 s - 100 μs) * 20 μA) / 1 s = 25.3 μA

When the transceiver is in idle mode, its driver should be disabled to minimize power consumption. Table 4 shows the effect of telegram length on the power consumption of a single MAX1483 driver that operates with specific interruptions between transmissions. Using shutdown mode can further reduce power consumption in a system that uses polling technology at fixed intervals or longer, deterministic gaps between transmissions.

Table 4. Relationship between telegram length and current consumption when using the MAX1483 driver

In addition to these software considerations, hardware offers many places for power improvement. Figure 3 compares the currents consumed by various transceivers when transmitting a square wave signal over a 300-meter cable with active drivers and receivers. The 75ALS176 and MAX1483 use a standard 560Ω / 120Ω / 560Ω termination network at both ends of the link, while the "true failsafe" devices (MAX3088 and MAX3471) have only 120Ω termination resistors at both ends of the bus ... At 20 Kbps, the consumption currents range from 12.2mA (MAX3471 with VCC = 3.3V) to 70mA (75ALS176). Thus, a significant reduction in power consumption occurs immediately when you select a low power device with a "true fail-safe" feature, which also eliminates the need to install bias resistors (to ground and to the VCC line). Make sure the receiver of the RS-485 transceiver you choose is outputting the correct logic levels for both open and closed circuit conditions.

Figure 3. Transceiver microcircuits differ greatly in the dependence of the current consumption on the data transfer rate.

Bad jokes of alignment

As noted above, terminating resistors eliminate reflections caused by impedance mismatch, but the disadvantage is additional power dissipation. Their influence is shown in Table 5, which shows the consumption currents for various transceivers (with an active driver) for conditions without resistors, using only terminating resistors, and also a combination of terminating resistors and protective bias resistors.

Table 5. Using terminating resistors and bias resistors increases the current consumption

MAX1483 MAX3088 MAX3471 SN75ALS176
I VCC (no RT) 60 μA 517 μA 74 μA 22 μA
I VCC (RT = 120) 24 μA 22.5 μA 19.5 μA 48 μA
I VCC (RT = 560-120-560) 42 μA N / A N / A 70 μA

Eliminate Negotiation

The first way to reduce power consumption is to eliminate termination resistors altogether. This option is only possible for short links and low data rates, which allow reflections to calm down even before the data is processed by the receiver. As practice shows, matching is not necessary if the signal rise time is at least four times the delay time of one-way signal propagation through the cable. The following steps use this rule to calculate the maximum allowable length of an unmatched cable:

  • Step 1. For the cable in question, find the one-way speed of the signal, typically provided by the cable manufacturer as a percentage of the speed of light in free space (c = 3x10 8 m / s). Typical value for standard PVC insulated cable (consisting of # 24 AWG twisted pair) is 203mm / ns.
  • Step 2... From the specification of the RS-485 transceiver, find its minimum rise time (t r min). For example, for the MAX3471 it is 750ns.
  • Step 3... Divide this minimum rise time by 4. For the MAX3471, we get t r min / 4 = 750ns / 4 = 187.5ns.
  • Step 4... Calculate the maximum cable length that does not require matching: 187.5ns (230mm / ns) = 38m.

Thus, the MAX3471 can provide decent signal quality when transmitting and receiving at 64Kbps over 38m cable without terminating resistors. Figure 4 demonstrates the dramatic reduction in consumption of the MAX3471 achieved when 30 meters of cable without terminating resistor is used instead of 300 meters of cable and 120 terminating resistors.

Figure 4. Terminating resistors - the main power consumer.

RC matching

At first glance, the ability of RC termination to block DC current is very promising. You will find, however, that this technique imposes certain conditions. The termination consists of a series RC network in parallel with the differential receiver inputs (A and B), as shown in Figure 5. Although R is always equal to the impedance of the cable (Z 0), choosing C requires some consideration. A large C value provides a good match, allowing any signal to see an R that corresponds to Z0, but a large value also increases the peak output current of the driver. Unfortunately, longer cables require higher C values. Entire articles have been devoted to determining the C rating to achieve this tradeoff. You can find detailed equations on this topic in the tutorials linked at the end of this article.

Figure 5. RC matching reduces power consumption, but requires careful selection of the C value.

The average signal voltage is another important factor that is often overlooked. Unless the average signal voltage is DC balanced, the DC stair-stepping effect causes significant jitter due to an effect known as "intersymbol interference." In short, RC termination is effective in reducing power consumption, but it tends to degrade signal quality. Since RC negotiation imposes so many restrictions on its use, the best alternative in many cases is no negotiation at all.

Schottky diode matching

Schottky diodes offer an alternative method of matching when high power consumption is a concern. Unlike other types of termination, Schottky diodes do not attempt to match the impedance of the bus. Instead, they simply suppress the positive and negative peaks caused by reflections. As a result, voltage changes are limited to positive threshold voltage and zero.

The Schottky matching circuit wastes little energy because they only conduct in the presence of positive and negative surges. On the other hand, standard resistive termination (with or without bias resistors) constantly dissipates power. Figure 6 illustrates the use of Schottky diodes to combat reflections. Schottky diodes do not provide fail-safe operation, however, the threshold voltage levels selected in the MAX308X and MAX3471 transceivers enable fail-safe operation with this type of termination.

Figure 6. Despite the high cost, the Schottky diode matching circuit has many advantages.

The Schottky diode, the best available approximation to an ideal diode (zero forward voltage Vf, zero on-time tON, and zero reverse recovery time trr), is of great interest as a replacement for power-hungry terminating resistors. The disadvantage of this matching in RS-485 / RS-422 based systems is that Schottky diodes cannot suppress all reflections. Once the reflected signal decays below the forward voltage of the Schottky diode, its energy will remain unaffected by the matching diodes and will remain until it is dissipated by the cable. Whether or not this lingering disturbance is significant depends on the magnitude of the signal at the receiver inputs.

The main disadvantage of the Schottky Terminator is its cost. One termination point requires two diodes. Since the RS-485 / RS-422 bus is differential, this number is multiplied by two again (Figure 6). The use of multidimensional Schottky terminators on the bus is not unusual.

Schottky diode terminators offer many advantages for RS-485 / RS-422 based systems, and energy savings are the main one (Figure 7). There is no need to compute as the specified cable length and baud rate limits will be reached before any Schottky terminator limits. Another advantage is that multiple Schottky terminators in different taps and at the receiver inputs improve signal quality without loading the communication bus.

Figure 7. The current consumption in RS-485 systems is highly dependent on the baud rate and the type of termination.

Summarizing

When the data transfer rate is high and the cable is long, it is difficult to provide ultra-low power consumption in the RS-485 system (in the original "flea power" - Approx. Per.), Since it becomes necessary to install matching devices on the communication line ( terminators). In this case, true-to-noise transceivers at the receiver outputs can save energy even with terminators by eliminating the need for bias resistors. Software communication can also help reduce power consumption by placing the transceiver in a disabled state or disabling the driver when not in use.

For lower speeds and shorter cables, the difference in power consumption is huge: Transmitting data at 60Kbps over a 30m cable using a standard SN75ALS176 transceiver with 120Ω terminating resistors will require 70mA of power from the power system. On the other hand, using the MAX3471 under the same conditions would require only 2.5mA from the power supply.

RS-485 is a standard that was first adopted by the Electronics Industries Association. Today, this standard deals with the electrical characteristics of all kinds of receivers and transmitters used in various balanced digital systems.

What is he like?

Among specialists RS-485 is the name of a rather popular interface, which is actively used in various industrial control systems to connect several controllers, as well as many other devices to each other. The main difference between this interface and the no less common RS-232 is that it provides for the combination of several types of equipment at the same time.

With the help of RS-485, high-speed information exchange between several devices is provided through a single two-wire line communication in half duplex mode. It is widely used in modern industry in the process of forming a process control system.

Range and speed

With the help of this standard, broadcasting of information at a speed of up to 10 Mbit / s is achieved, while the maximum possible range will directly depend on the speed at which the data is transmitted. Thus, to ensure the maximum speed, data can be transmitted no further than 120 meters, while at a speed of 100 kbit / s, information is broadcast over 1200 meters.

The number of combined devices

The number of devices that the RS-485 interface can combine will directly depend on which transceivers are used in the device. Each transmitter is designed to simultaneously control 32 standard receivers, but you need to understand that there are receivers whose input impedance is 50%, 25% or even less of the standard, and if such equipment is used, the total number of devices will increase accordingly.

Connectors and protocols

RS-485 cable does not standardize any specific format of information frames or exchange protocol. In the vast majority of cases, exactly the same frames are used that RS-232 uses, that is, data bits, stop and start bits, as well as a parity bit, if necessary.

The operation of exchange protocols in most modern systems is carried out according to the "master-slave" principle, that is, some device in the network is the master and takes the initiative to exchange sending requests between all slave devices that differ from each other by logical addresses. The most popular protocol today is Modbus RTU.

It is worth noting that the RS-485 cable also does not have any specific type of connectors or wiring, that is, there may be terminal connectors, DB9 and others.

Connection

Most often, using this interface, there is a local network that combines several transceivers simultaneously.

When making an RS-485 connection, you need to competently combine signal circuits with each other, usually called A and B. In this case, the polarity reversal is not so terrible, just the connected devices will not work.

When using the RS-485 interface, you should consider several features of its operation:

  • The most optimal signal transmission medium is twisted pair cable.
  • The ends of the cable must be drowned out using specialized terminal resistors.
  • A network that uses standard or USB RS-485 should be laid without any branching
  • Devices should be connected to the shortest possible length.

Harmonization

Using terminal resistors, standard or USB RS-485 provides full matching of the open end of the cable with the subsequent line, completely eliminating the possibility of signal reflection.

The nominal resistance of the resistors corresponds to the characteristic impedance of the cable and for those cables that are based on twisted pair, in the majority of cases it is approximately 100-120 Ohm. For example, the UTP-5 cable, which is quite popular today, which is actively used in the process of laying Ethernet, has a characteristic impedance of 100 Ohm. For other cable options, some other rating may be used.

Resistors, if necessary, can be soldered on the contacts of the cable connectors already in the final devices. Rarely are resistors installed in the device itself, as a result of which jumpers have to be installed to connect the resistor. In this case, if the device is disconnected, the line is completely mismatched. And in order to ensure the normal operation of the rest of the system, you need to connect a matching plug.

Signal levels

The RS-485 port uses a balanced data transmission scheme, that is, the voltage levels on signal circuits A and B will change in antiphase.

The sensor should provide a signal level of 1.5 V at full load, and not more than 6 V if the device is idling. The voltage level is measured differentially, each signal wire relative to the other.

Where the receiver is located, the minimum level of the received signal in any case must be at least 200 mV.

Bias

In the event that there is no signal on the signal circuits, a slight bias occurs, which protects the receiver from false alarms.

Experts recommend an offset of slightly more than 200 mV, since this value corresponds to the unreliability zone of the input signal according to the standard. In this case, circuit A is pulled up to the positive pole of the source, while circuit B is pulled up to common.

Example

In accordance with the required bias and voltage of the power supply, the calculation is carried out.For example, if you want to obtain an offset of 250 mV when using terminal resistors RT = 120 Ohm, given that the source has a voltage of 12V. Considering that in this case two resistors are connected in parallel each other without taking into account the load from the receiver at all, the bias current is 0.0042 A, while the total resistance of the bias circuit is 2857 ohms. R cm in this case will be approximately 1400 ohms, so you need to choose some closest value.

As an example, we will use a 1.5k bias resistor and an external 12 volt resistor. In addition, our system has an isolated output from the controller power supply, which is the leading link in its segment of the circuit.

Of course, there are a lot of other options for implementing bias, in which an RS-485 converter and other elements are used, but in any case, when placing bias circuits, you need to take into account that the node that will provide it will periodically turn off or even eventually can be completely removed from the network.

If bias is present, then the fully idle potential of circuit A is positive with respect to circuit B, which is a guideline if a new device will be connected to a cable without wire markings.

Incorrect wiring and distortion

The implementation of the above recommendations allows you to achieve normal transmission of electrical signals to various points in the network, if the RS-485 protocol is used as a basis. If at least some of the requirements are not met, signal distortion will occur. The most noticeable distortions begin to appear if the data exchange rate exceeds 1 Mbit / s, but in fact, even in the case of lower speeds, it is highly recommended not to disregard these recommendations, even if the network is “working normally”.

How to program?

There are several important points to keep in mind when programming various applications that work with devices using an RS-485 splitter and other devices with this interface. Let's list them:

  • Before the delivery of the parcel begins, it is imperative to activate the transmitter. Despite the fact that, according to information from certain sources, the issuance can be carried out immediately after switching on, some experts recommend initially holding a pause, which in time will be equal to the transmission rate of one frame. In this case, the correct reception program will have time to fully determine the errors of the transient process, carry out the normalization procedure and prepare for the subsequent data reception.
  • After the last data byte has been issued, it is also recommended to pause before disconnecting the RS-485 device. In particular, this is due to the fact that in the serial port controller there are often two registers at the same time, the first of which is a parallel input and is intended for receiving data, while the second is a shift output and is used for serial output. Any interrupts on transmission by the controller are generated in the event of an empty input register, when information has already been provided to the shift register, but has not yet been issued. For this reason, after the broadcast is interrupted, you need to maintain a certain pause before turning off the transmitter, which should be approximately 0.5 bits longer than the frame in time. For more accurate calculations, it is recommended to study in detail the technical documentation of the serial port controller used.
  • Since the transmitter, receiver and possibly the RS-485 converter are connected to a single line, the own receiver will also perceive the transmission made by its own transmitter. It is not uncommon for systems with random access to the line to use this feature to check that there is no collision between two transmitters. In standard systems operating according to the master-slave principle, it is recommended that interrupts from the receiver be completely closed during transmission.

Bus format configuration

This interface provides for the possibility of combining devices in the "bus" format, when all devices are connected using a single pair of wires. In this case, the communication line must be matched by the end-of-line resistors of the two ends.

To ensure matching, in this case, resistors with a resistance of 620 ohms are installed. They are always installed on the first and last device connected to the line. In the majority of modern devices, there is also a built-in matching resistance, which, if necessary, can be included in the line by installing a special jumper on the device board.

Since the jumpers are initially installed in the delivery state, you must first remove them from all devices, respectively, except for the first and last connected to the line. In the S2000-PI model repeater converters for each individual output, the matching resistance is switched on using a switch, while the S2000-KS and S2000-K devices are characterized by a built-in matching resistance, as a result of which there is no jumper required to connect it.

In order to provide a longer communication line, it is recommended to use specialized repeater-repeaters equipped with fully automatic transmission direction switching.

Star configuration

Any taps in the RS-485 line are undesirable, because in this case there is a fairly strong signal distortion, but from a practical point of view, they can be tolerated if there is a short tap length. In this case, it is not necessary to install terminating resistors on separate branches.

In an RS-485 distribution system, which is controlled from the console, if the latter and the devices are connected to the same line, but powered from different sources, it will be necessary to combine the 0 V circuits of all devices and the console in order to ensure their potential equalization. If this requirement is not met, then the remote control may have an unstable connection with devices. If a cable with several twisted pairs of wires is to be used, then a completely free pair can be used for the potential equalization circuit if necessary. Among other things, it is also possible to use a shielded twisted pair if the shield is not grounded.

What should be considered?

In the overwhelming majority, the current that passes through the potential equalization wire is quite small, however, if 0 V of devices or the power supplies themselves are connected to several local ground buses, the potential difference between different 0 V circuits can be several units, and in some cases even tens of volts, while the current flowing through the potential equalization circuit can be quite significant. This is a common reason that there is an unstable connection between the remote control and the devices, as a result of which they may even fail.

It is for this reason that it is necessary to exclude the possibility of grounding the 0 V circuit, or, as a maximum, to ground this circuit at a certain point. You also need to consider the possibility of interconnection between 0 V and the protective earth circuit, which is present in the equipment that is used in the alarm system.

At objects, which are characterized by a rather severe electromagnetic environment, it is possible to connect this network through a "shielded twisted pair" cable. In this case, a shorter range may be present as the cable capacitance is higher.

For industrial applications, wireless data lines can never completely replace wired... Among the latter, the most common and reliable is still serial interface Rs -485 ... And the manufacturer of the most protected from external influences and various in configuration and degree of integration of transceivers for him, in turn, remains the companyMaxim Integrated .

Despite the growing popularity of wireless networks, the most reliable and stable communication, especially in harsh operating conditions, is provided by wired ones. Well-designed wired networks enable efficient communication in industrial applications and industrial control systems, while ensuring immunity to interference, electrostatic discharge and surges. Distinctive features of the RS-485 interface have led to its widespread use in the industry.

Comparison of RS-485 and RS-422 interfaces

The RS-485 transceiver is the most common physical layer interface for serial data networks for harsh industrial and building management applications. This serial interface standard enables high-speed communication over a relatively long distance over a single differential line (twisted pair). The main problem of using RS-485 in industry and in automated building management systems is that electrical transients arising from fast switching of inductive loads, electrostatic discharges, as well as surge voltages, acting on the networks of automated control systems, can distort the transmitted data or lead to their failure.

Currently, there are several types of data transmission interfaces, each of which is designed for specific applications, taking into account the required set of parameters and protocol structure. Serial interfaces include CAN, RS-232, RS-485 / RS-422, I 2 C, I 2 S, LIN, SPI, and SMBus, however RS-485 and RS-422 are still the most reliable. especially in harsh operating conditions.

The RS-485 and RS-422 interfaces are similar in many respects, however, they have some significant differences that must be taken into account when designing data transmission systems. In accordance with the TIA / EIA-422 standard, the RS-422 interface is specified for industrial applications with one data bus master to which up to 10 slaves can be connected (Figure 1). It provides transmission at speeds up to 10 Mbps using a twisted pair cable, which improves noise immunity and achieves the highest possible data transmission range and speed. Typical applications for the RS-422 are industrial process automation (chemical manufacturing, food processing, paper mills), integrated manufacturing automation (automotive and metalworking industries), HVAC systems, security systems, motor control and object movement control.

RS-485 provides greater flexibility by allowing multiple masters on a common bus and increasing the maximum number of devices on the bus from 10 to 32. According to the TIA / EIA-485 standard, RS-485 has more a wide common-mode voltage range (-7 ... 12 V instead of ± 7 V) and a slightly smaller differential voltage range (± 1.5 V instead of ± 2 V), which ensures a sufficient receiver signal level at maximum line load. Using the advanced capabilities of the multidrop data bus, you can create networks of devices connected to a single RS-485 serial port. Due to its high noise immunity and multi-drop capability, RS-485 is the best serial interface for use in industrial distributed systems connected to a programmable logic controller (PLC), graphics controller (HMI) or other data acquisition controllers. Since RS-485 is an extended version of RS-422, all RS-422 devices can be connected to a bus controlled by an RS-485 master. Typical applications for RS-485 are similar to those listed above for RS-422, with more frequent use of RS-485 due to its advanced capabilities.

RS-485 is the most popular industrial interface

The TIA / EIA-485 standard allows the use of RS-485 at a distance of up to 1200 m. At shorter distances, data rates are more than 40 Mbps. Using a differential signal provides the RS-485 interface with a longer range, but the baud rate decreases as the line length increases. The baud rate is also affected by the cross-sectional area of ​​the line wires and the number of devices connected to it. It is recommended to use RS-485 transceivers with a built-in high frequency correction function, such as the MAX3291, if you need to obtain both long range and high data transfer rates. The RS-485 interface can be used in half duplex mode using one twisted pair of wires or in full duplex mode with simultaneous transmission and reception of data, which is provided using two twisted pairs (four wires). In a multidrop configuration in half duplex mode, RS-485 is capable of supporting up to 32 transmitters and up to 32 receivers. However, the new generation transceiver ICs have a higher input impedance, which can reduce the receiver line load from 1/4 to 1/8 of the standard value. For example, using the MAX13448E transceiver, the number of receivers connected to the RS-485 bus can be increased to 256. With the enhanced RS-485 multidrop interface, you can network multiple devices connected to the same serial port, as shown in Figure 2.

The receiver sensitivity is ± 200 mV. Therefore, to recognize one data bit, the signal levels at the receiver connection point must be greater than +200 mV for zero and less than -200 mV for unity (Figure 3). In this case, the receiver will suppress interference, the level of which is in the range of ± 200 mV. The differential line also provides effective common mode rejection. The minimum input impedance of the receiver is 12 kOhm, the output voltage of the transmitter is in the range of ± 1.5 ... ± 5 V.

Serial problems in an industrial environment

Industrial system designers face the daunting challenges of ensuring reliable operation in an electromagnetic environment that can damage equipment or disrupt digital data transmission systems. One example of such systems is the automatic control of technological equipment in an automated industrial enterprise. The controller that controls the process measures its parameters, as well as environmental parameters, and transmits commands to executive devices or generates emergency notifications. Industrial controllers are, as a rule, microprocessor devices, the architecture of which is optimized for solving the problems of a given industrial enterprise. Point-to-point data lines in such systems are subject to strong electromagnetic interference from the environment.

Industrial DC / DC converters operate with high input voltages and provide isolated voltages from the input to power the load. To power devices of a distributed system that do not have their own mains power supply, voltages of 24 or 48 V DC are used. The terminal load is supplied with 12 or 5 V, obtained by converting the input voltage. Systems that communicate with remote sensors or actuators require protection against transients, electromagnetic interference, and ground potential differences.

Many companies, such as Maxim Integrated, go to great lengths to ensure that ICs for industrial applications are highly reliable and resilient to harsh electromagnetic environments. Maxim's RS-485 transceivers have built-in high-voltage ESD and surge protection and are hot-swappable without data loss on the line.

Protection of data transmission systems from adverse external influences

Enhanced ESD protection

Electrostatic discharge (ESD) occurs when two oppositely charged materials come into contact, thereby transferring static charges and forming a spark discharge. ESD often occurs when people come into contact with objects around them. Spark discharges arising from careless handling of semiconductor devices can significantly degrade their characteristics or lead to complete destruction of the semiconductor structure. ESD can occur, for example, when replacing a cable or simply touching an I / O port and cause the port to be disabled due to the failure of one or more interface chips (Figure 4).

Such accidents can lead to significant losses, as they increase the cost of warranty repairs and are perceived by consumers as a consequence. Low quality product. In industrial production, ESD is a serious problem that can cause billions of dollars in losses annually. Under real-world conditions, ESD can lead to failure of individual components, and sometimes the entire system. External diodes can be used to protect data interfaces, but some interface ICs contain built-in ESD protection components and do not require additional external protection circuits. Figure 5 shows a simplified functional diagram of a typical embedded ESD protection circuit. Signal line impulses are limited by diode protection at the supply voltage V CC and ground, thus protecting the interior of the circuit from damage. Currently manufactured interface chips and analog switches with built-in ESD protection generally comply with IEC 61000-4-2.

Maxim Integrated has invested heavily in IC design with reliable, built-in ESD protection and is currently a leader in RS-232 to RS-485 transceivers. These devices withstand IEC 61000-4-2 and JEDEC JS-001 ESD test pulses directly on the I / O ports. Maxim's ESD solutions are reliable, affordable, have no additional external components, and are less expensive than most peers. All interface microcircuits manufactured by this company contain built-in elements that provide protection of each output from ESD arising during production and operation. The MAX3483AE / MAX3485AE family of transceivers protect transmitter and receiver outputs from high-voltage impulses up to ± 20 kV. At the same time, the normal operating mode of the products is maintained, there is no need to turn off and turn on the power again. In addition, built-in ESD protections provide power on / off and low power standby operation.

Overvoltage protection

In industrial applications, the inputs and outputs of RS-485 drivers are prone to failures due to surge voltages. Surge voltage parameters are different from ESD - while ESD duration is usually in the range up to 100 ns, the duration of surge voltages can be 200 μs or more. Surges can be caused by wiring errors, poor connections, damaged or defective cables, and solder droplets that can form a conductive connection between power and signal lines on a PCB or connector. Since industrial power systems use voltages in excess of 24 V, exposing standard RS-485 transceivers that are not surge protected to such voltages will damage them within minutes or even seconds. To protect against surge voltages, conventional RS-485 interface chips require expensive external devices based on discrete components. RS-485 transceivers with built-in surge protection can handle up to ± 40, ± 60, and ± 80 V common-mode data line noise. Maxim manufactures a line of RS-485 / RS-422 transceivers MAX13442E ... MAX13444E that withstands DC input voltages and outputs up to ± 80 V with respect to ground. The security features function regardless of the current state of the chip - whether it is on, off, or in standby mode - making these transceivers the most reliable in the industry, ideal for industrial applications. Maxim's transceivers survive overvoltages caused by shorted power and signal lines, wiring errors, improper plug connections, faulty cables, and misuse.

Robustness of receivers to undefined line conditions

An important characteristic of the RS-485 interface microcircuits is the immunity of receivers to undefined line states, which guarantees the setting of a high logic level at the receiver output when the inputs are open or closed, as well as when all transmitters connected to the line go into inactive mode (high impedance state of the outputs). The problem of correct perception by the receiver of closed data line signals is solved by shifting the input signal thresholds to negative voltages of -50 and -200 mV. If the input differential voltage of the receiver V A - V B is greater than or equal to -50 mV, the output R 0 is set to a high level. If V A - V B is less than or equal to -200 mV, the output R 0 is set to a low level. When all transmitters go to an inactive state and there is a termination on the line, the differential input voltage of the receiver is close to zero, as a result of which the output of the receiver goes high. In this case, the margin of noise immunity at the input is 50 mV. Unlike previous generation transceivers, the -50 and -200 mV thresholds correspond to the ± 200 mV values ​​set by the EIA / TIA-485 standard.

Hot swappable

Literature

  1. Application note 4491, “Damage from a Lightning Bolt or a Spark – It Depends on How Tall You Are!”;
  2. Application note 5260, “Design Considerations for a Harsh Industrial Environment”;
  3. Application note 639, "Maxim Leads the Way in ESD Protection".