Recently, a customer asked what the difference is between 2-wire and 4-wire serial RS485 communication? To answer this question it is helpful to have some understanding of the RS485 standard. The problem is that 'RS' stands for 'Recommended Standard' and has not been treated by manufacturers as an absolute definition.
Origin
The RS485 standard was established by Electronic Industries Alliance, EIA, in 1983 as a half duplex multidrop variation of the balanced or differential simplex signal standard, RS422. Current standards for serial communication are typically established by the EIA and the Telecommunications Industry Association, TIA. The current standard for RS485 was set in 1998 and is designated TIA/EIA-485-A. For many years, manufacturers have loosely employed what is commonly called RS485 to provide reliable multidrop serial communication for their specific and sometimes proprietary network. However, these RS485 variations are what make common compatibility between some manufacturers virtually impossible. 4-wire implementation of RS485 is one of these variations.
To gain a more detailed understanding of the difference between 2-wire and 4-wire RS485, a layman's understanding of the basic concept of this standard may be helpful. One of the most important things to understand about the common communication standards such as RS232, RS422, and RS485 is that they are strictly hardware standards and do not define any characteristics of the data.
Negating noise
These standards describe some electrical characteristics of the media, that is the wire through which the signal passes, and some electrical characteristics of the transmitters and receivers which define how many of each can be connected together and things like the voltage levels of the signal. The terms 'balanced' or 'differential' signal is used to characterise RS422 and RS485 serial communication. For the purpose of this discussion these terms may be used interchangeably. It is the main difference between the single-ended RS232 signal and the differential RS422 and RS485 signal.
Because RS232 is single-ended, that is, the signal references a common signal ground, and that ground is easily distorted by external noise, RS232 is reliable only for short distances. RS422 and RS485 use a differential signal which is an opposing positive and negative signal, each on its own wire, so that when the positive goes high, above ground reference, the negative does the same, going low, below ground reference. Thus, two signals are compared to each other and not with the ground reference making them much more resistant to noise. Noise typically introduced from the environment impacts the negative and positive signal equally, but the comparison of the signals is usually not affected significantly.
RS422 and RS485 also use twisted pair wires to carry the positive and negative signals so that the fields surrounding the conductors created by these opposing signals complement each other, and in effect, reinforce the signal. The differential signal and the twisted pair media are the two primary reasons RS422 and RS485 signals are much more resistant to environmental electromagnetic noise than RS232, and subsequently, can support transmission distances up to 100 times greater.
RS232 was the most common type of serial communication port found on consumer computers. USB and Ethernet are rapidly displacing RS232 in the consumer market but RS422 and RS485 are still popular in the industrial market where the environment might demand greater serial communication distances in higher levels of electromagnetic interference. RS422 with a differential signal was designed to be a more reliable version of the single-ended RS232 signal. In typical applications, both RS232 and RS422 are peer-to-peer. This means that the transmitter of one device is wired to the receiver of the other device and vice versa. In the case of RS232 this requires one wire for transmission, one wire for reception, and one wire for the signal ground. RS422 use twisted pairs instead of a single wire for each signal, so two wires for transmission and two wires for reception, or a 4-wire system.
The next step came with the realisation that connection of multiple devices on a single communication link could offer significant savings both in cable and hardware interface cost. RS422 allows for up to 10 receivers to be connected to a single transmitter. But this means that one device would be master and all other devices would be slaves without the capability to respond. This is called simplex communication when data flows in only one direction on a wire or twisted pair. Keep in mind that a twisted pair does not carry two different signals; it is the same signal with opposing polarities. So RS232 and RS422 are simplex. Data flows over one wire or twisted pair in only one direction.
For a device to communicate data over RS232 or RS422 it must have both a transmitter and a receiver with a separate wire or twisted pair connected to both. The bi-directional communication may take place, but over the individual wires the communication is simplex. The only logical way to make a multidrop serial communication network that would not require many transmitters and receivers in each device, not to mention the many individual wires to interconnect them, would be to design a transmitter-receiver that could share a single wire or twisted pair. This is RS485, an electrical definition of components that would allow bi-directional communication on a single twisted pair giving it the signal integrity of RS422. But unlike simplex communication where data only flows in one direction because a transmitter is on one end and one or more receivers is on the other end, all connections have transmitters and receivers and data can flow in any direction. But electrically, RS485 is not designed to allow data to flow in both directions at the same time, which is called full duplex, but requires data sequenced to only flow in one direction at a time, called half duplex.
Data collision avoidance
Bi-directional half duplex communication among multiple stations on a single twisted pair also creates a logical problem in sequencing data flow. Unlike RS422, simplex systems, which have only one transmitter on a twisted pair so it is not possible for two transmitters to talk on the same twisted pair at the same time; with RS485 this collision can occur. So data flow control becomes an important part of RS485, although it is not part of the standard. It becomes the responsibility of the developer of the data communication protocol used over RS485 to build a scheme for this type of collision prevention. The easiest way to do this is to do the same thing that is done in RS422, allow one master and all other stations to be slaves. In this case, the master always initiates communication by interrogating only one other station. Then the slave may transmit a response to the master and no other stations transmit. This is bi-directional because the master and the slave both transmit and receive on the same twisted pair, so that sequentially, data flows in both directions, but not at the same time. It is half-duplex because data flows in only one direction at a time, not simultaneously in both directions.
This is the way a typical 2-wire RS485 application works. All of Advantech's RS485-based ADAM modules use this common 2-wire scheme.
Tel: | +27 12 666 9066/8 |
Email: | [email protected] |
www: | www.cme.co.za |
Articles: | More information and articles about Centurion Micro Electronics |
© Technews Publishing (Pty) Ltd | All Rights Reserved