Previous Lecture Next Lecture Home Classes Contact
Hardware – Software
Integration
Data
Acquisition and Control Hardware
Signal
Conditioning / DAC Interface
Application
Examples from Robust Data Comm
Power,
Power Return, Chassis Ground, Earth Ground
QUICK
REFERENCE FOR RS485, RS422, RS232 AND RS423

http://www.cyberresearch.com/content/tutorials/tutorial17.htm
· Using Digital line directly – typically bad idea – current limit, no protection.
· Using Digital lines with line buffer: increases your current capabilities. Also, can invert signal if necessary to avoid boot-up problems for some older, non-programmable cards.
·
Using transistor: better, but make sure
that ‘off’ = really ‘off’ – use diode to require
a minimum of 0.7V to turn on. Limit current using resistor and gain of
transistor (
·
Optically coupled
· Inductive Loads (solenoids, motors, valves,…): sure way to kill your switch or DIO. Always use ‘free-wheeling diode’ and caps to prevent voltage spikes. The induced voltages are easily 10x of supply (12 VDC solenoid will induce a 120 VDC spike). The diode provides a closed circuit for reverse voltage. The cap takes off any spikes, plus or minus.
· EMI and PWM: typically, only one digital output is set up for PWM (i.e., software drivers exist to set frequency, duty cycle, rather than commanding a DIO for PWM yourself.
§ The pulse rise time determines the EMI frequency, not the PWM frequency. Slower rise / fall times are better, unless you need perfect square wave – perfect square wave is bad from EMI point.
· Pulse Counting: only limited Dig. Inputs are set up for pulse counting. Out of 8, typically only one. There are limits for how many pulses you can count (buffer limit, 12 or 16 bit word). There is a maximum frequency limit on how many you can count – may have to divide.
Opto-Isolated Solid-State Relays
The diagram at right illustrates how an opto-isolated solid-state relay works. Notice that your digital I/O board functions as a current sink. When the voltage level on your digital I/O line goes low, it allows current to flow from the 5V power supply to ground on your digital I/O board. This is called "Negative True Logic" because the relay circuit is closed (turned on) when the voltage level of your digital I/O channel goes low (turns off). The light-emitting diode (LED) in series between the power supply and the current sink on your digital I/O board closes the circuit as the light it emits is picked up by a light-receptive transistor. This closes the contact and turns on power to your AC or DC power line. The greater the current sink rating of your digital I/O board, the more current will be able to flow from the power source through the LED, ensuring that enough light is emitted to close the circuit.

http://www.cyberresearch.com/content/tutorials/tutorial17.htm
· Often DAC cards use programmable DIO. By default, they boot up as digital inputs, tied high. If you use DIOs as switches, that means your device could be turned on until the computer has control of the card and can program / set the DIO.
§ You can use a Hex-inverter with enable lines as a buffer and to invert the default ‘high’ setting to a default ‘low’ setting. Also protects DAC card from damage, your own buffer chip typically can be replaced easier.
http://www.cyberresearch.com/content/tutorials/tutorial2.htm
RS-232: RS-232 is the most common serial line interface. All personal computers have at least one RS-232 serial port. RS-232 is an unbalanced or single ended peer to peer Line Interface Standard. RS-232 is ideal for connecting short distances less than 50ft. In general RS-232 is limited to 100kb/s, but new technologies allow for baud rates over 1Mbp/s along short distances of cable.
RS-422: RS-422 is used in situations where long distances are required. RS-422 can drive up to 4000FT at 100kbp/s. Or short distance's over 1 Mbp/s RS-422 allows for one driver and up to ten receivers to be on a multi-dropped network or bus. RS-422 is a differential or balanced Line Interface Standard.
RS-485: RS-485 is used in situations similar to where RS-422 is used. RS-485 has the added advantage of allowing up to thirty two (32) multi-dropped receivers or transmitters on a multi-dropped network or bus. Furthermore RS-485 also permits a wire saving (1/2) duplex mode.
RS-423: RS-423 is a single ended Line Interface standard similar to RS-232, but it permits up to 10 receivers to be multi-dropped on the same network or bus. It can drive up to 4000ft at 100kb/s
Current
Good application note for RS422 / RS485 / RS232 connection, grounding,, ….: http://www.robustdc.com/




Stolen from http://www.connecttech.com/products/interfaces/interfaces.html.
Line drivers and receivers are commonly used to exchange data between two or more points (nodes) on a network. Reliable data communications can be difficult in the presence of induced noise, ground level differences, impedance mismatches, failure to effectively bias for idle line conditions, and other hazards associated with installation of a network. The connection between two or more elements (drivers and receivers) should be considered a transmission line if the rise and/or fall time is greater than half the time for the signal to travel from the transmitter to the receiver.
Standards
have been developed to insure compatibility between units provided by different
manufacturers, and to allow for reasonable success in transferring data over
specified distances and/or data rates. The Electronics Industry Association
(EIA) has produced standards for RS485, RS422, RS232, and RS423 that deal with
data communications. Suggestions are often made to deal with practical problems
that might be encountered in a typical network. EIA standards where previously
marked with the prefix "RS" to indicate recommended standard;
however, the standards are now generally indicated as "EIA" standards
to identify the standards organization. While the standards bring uniformity to
data communications, many areas are not specifically covered and remain as
"gray areas" for the used to discover (usually during installation)
on his own.
Electronic data communications between elements will generally fall into two broad categories: single-ended and differential. RS232 (single-ended) was introduced in 1962, and despite rumors for its early demise, has remained widely used through the industry. The specification allows for data transmission from one transmitter to one receiver at relatively slow data rates (up to 20K bits/second) and short distances (up to 50Ft. @ the maximum data rate).
Independent
channels are established for two-way (full-duplex) communications. The RS232
signals are represented by voltage levels with respect to a system common
(power / logic ground). The "idle" state (MARK) has the signal level
negative with respect to common, and the "active" state (SPACE) has
the signal level positive with respect to common. RS232 has numerous
handshaking lines (primarily used with modems), and also specifies a
communications protocol. In general if you are not connected to a modem the
handshaking lines can present a lot of problems if not disabled in software or
accounted for in the hardware (loop-back or pulled-up). RTS (Request to send)
does have some utility in certain applications. RS423 is another single ended
specification with enhanced operation over RS232; however, it has not been
widely used in the industry.
When communicating at high data rates, or over long distances in real world environments, single-ended methods are often inadequate. Differential data transmission (balanced differential signal) offers superior performance in most applications. Differential signals can help nullify the effects of ground shifts and induced noise signals that can appear as common mode voltages on a network.
RS422 (differential) was designed for greater distances and higher Baud rates than RS232. In its simplest form, a pair of converters from RS232 to RS422 (and back again) can be used to form an "RS232 extension cord." Data rates of up to 100K bits / second and distances up to 4000 Ft. can be accommodated with RS422. RS422 is also specified for multi-drop (party-line) applications where only one driver is connected to, and transmits on, a "bus" of up to 10 receivers.
While a multi-drop "type" application has many desirable advantages, RS422 devices cannot be used to construct a truly multi-point network. A true multi-point network consists of multiple drivers and receivers connected on a single bus, where any node can transmit or receive data.
"Quasi" multi-drop networks (4-wire) are often constructed using RS422 devices. These networks are often used in a half-duplex mode, where a single master in a system sends a command to one of several "slave" devices on a network. Typically one device (node) is addressed by the host computer and a response is received from that device. Systems of this type (4-wire, half-duplex) are often constructed to avoid "data collision" (bus contention) problems on a multi-drop network (more about solving this problem on a two-wire network in a moment).
RS485 meets the requirements for a truly multi-point communications network, and the standard specifies up to 32 drivers and 32 receivers on a single (2-wire) bus. With the introduction of "automatic" repeaters and high-impedance drivers / receivers this "limitation" can be extended to hundreds (or even thousands) of nodes on a network. RS485 extends the common mode range for both drivers and receivers in the "tri-state" mode and with power off. Also, RS485 drivers are able to withstand "data collisions" (bus contention) problems and bus fault conditions.
To solve the "data collision" problem often present in multi-drop networks hardware units (converters, repeaters, micro-processor controls) can be constructed to remain in a receive mode until they are ready to transmit data. Single master systems (many other communications schemes are available) offer a straight forward and simple means of avoiding "data collisions" in a typical 2-wire, half-duplex, multi-drop system. The master initiates a communications request to a "slave node" by addressing that unit. The hardware detects the start-bit of the transmission and automatically enables (on the fly) the RS485 transmitter. Once a character is sent the hardware reverts back into a receive mode in about 1-2 microseconds (at least with R.E. Smith converters, repeaters, and remote I/O boards).
Any
number of characters can be sent, and the transmitter will automatically
re-trigger with each new character (or in many cases a "bit-oriented"
timing scheme is used in conjunction with network biasing for fully automatic
operation, including any Baud rate and/or any communications specification, eg.
9600,N,8,1). Once a "slave" unit is addressed it is able to respond
immediately because of the fast transmitter turn-off time of the automatic
device. It is NOT necessary to introduce long delays in a network to avoid
"data collisions." Because delays are NOT required, networks can be
constructed, that will utilize the data communications bandwidth with up to
100% through put.
|
SPECIFICATIONS |
RS232 |
RS423 |
RS422 |
RS485 |
|
|
Mode of Operation |
SINGLE |
SINGLE |
DIFFER- ENTIAL |
DIFFER- ENTIAL |
|
|
Total Number of Drivers and Receivers on One Line |
1 DRIVER |
1 DRIVER |
1 DRIVER |
1 DRIVER |
|
|
Maximum Cable Length |
50 FT. |
4000 FT. |
4000 FT. |
4000 FT. |
|
|
Maximum Data Rate |
20kb/s |
100kb/s |
10Mb/s |
10Mb/s |
|
|
Maximum Driver Output Voltage |
+/-25V |
+/-6V |
-0.25V to +6V |
-7V to +12V |
|
|
Driver Output Signal Level (Loaded Min.) |
Loaded |
+/-5V to +/-15V |
+/-3.6V |
+/-2.0V |
+/-1.5V |
|
Driver Output Signal Level (Unloaded Max) |
Unloaded |
+/-25V |
+/-6V |
+/-6V |
+/-6V |
|
Driver Load Impedance (Ohms) |
3k to 7k |
>=450 |
100 |
54 |
|
|
Max. Driver Current in High Z State |
Power On |
N/A |
N/A |
N/A |
+/-100uA |
|
Max. Driver Current in High Z State |
Power Off |
+/-6mA @ +/-2v |
+/-100uA |
+/-100uA |
+/-100uA |
|
Slew Rate (Max.) |
30V/uS |
Adjustable |
N/A |
N/A |
|
|
|
+/-15V |
+/-12V |
-10V to +10V |
-7V to +12V |
|
|
Receiver Input Sensitivity |
+/-3V |
+/-200mV |
+/-200mV |
+/-200mV |
|
|
Receiver Input Resistance (Ohms) |
3k to 7k |
4k min. |
4k min. |
>=12k |
|
This text, stolen from http://www.kksystems.com/serdesc1.html, is a general overview of RS422 and RS485 interfacing. The examples are based on the K422 and K485 converters, unless specified otherwise.
Both
RS422 and RS485 use a twisted-pair wire (i.e. 2 wires) for each
signal. They both use the same differential drive with identical voltage
swings: 0 to +5V. The main difference between RS422 and RS485 is as follows: RS422
has no tri-state capability (its driver is always enabled) and it is therefore
usable only in point-to-point communications (although an RS422
device can act as a Master on a 4-wire RS485 system). RS485 has
tri-state capability and can therefore be used in multidrop
systems.
RS422 is full-duplex, i.e. data can flow in both directions simultaneously - and often does. RS422 uses two separate twisted pairs. RS422 is often used simply for extending RS-232 cables. Figure 1 shows a typical RS422 connection:

Figure 1.
RS485
is half-duplex. It exists in two varieties: 2-wire (which uses a single
twisted pair) and 4-wire (which uses two twisted pairs like RS422).
RS485 systems are usually "Master/Slave"; each Slave device has a
unique address and it responds only to a correctly addressed message (a
"poll") from the Master. A Slave never initiates a
dialogue. In a 2-wire system, all devices (including the Master) must have
tri-state capability. In a 4-wire system, the Slaves must have tri-state
capability but the Master does not need it (i.e. it can be an RS422 device)
because it drives a bus on which all other devices merely listen.

Figure 2a.
The
main advantage of 4-wire RS485 systems is that the Master does not need
tri-state capability. This often allows Master software and drivers originally
developed for RS232 to be used in a multidrop system, provided of course that
the Master software emits the correct device addresses. See Figure 2b below.

Figure 2b.
Sometimes a 4-wire RS485 system is used to interconnect just two devices; this is virtually identical to RS422 and a K422 series device can be used at both ends becaus