RS232 Data Interface

RS-232 is simple, universal, well understood and supported but RS-232 has some serious shortcomings as a data interface. The standards for RS-232 and similar interfaces usually restrict RS-232 to 256kbps or less and line lengths of 15M (50 ft) or less but today we see high speed ports on our home PC running very high speeds and with high quality cable maxim distance has increased greatly. The rule of thumb for the length a data cable depends on speed of the data, quality of the cable.

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.

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.

The RS-232 interface presupposes a common ground between the DTE and DCE. This is a reasonable assumption when a short cable connects the DTE to the DCE, but with longer lines and connections between devices that may be on different electrical busses with different grounds, this may not be true.

RS232 data is bi-polar…. +3 TO +12 volts indicates an “ON or 0-state (SPACE) condition” while A -3 to -12 volts indicates an “OFF” 1-state (MARK) condition…. Modern computer equipment ignores the negative level and accepts a zero voltage level as the “OFF” state. In fact, the “ON” state may be achieved with lesser positive potential. This means circuits powered by 5 VDC are capable of driving RS232 circuits directly, however, the overall range that the RS232 signal may be transmitted/received may be dramatically reduced.

The output signal level usually swings between +12V and -12V. The”dead area” between +3v and -3v is designed to absorb line noise. In the various RS-232-like definitions this dead area may vary. For instance, the definition for V.10 has a dead area from +0.3v to -0.3v. Many receivers designed for RS-232 are sensitive to differentials of 1v or less.

This can cause  problems when using pin powered widgets – line drivers, converters, modems etc. These type of units need enough voltage & current to power them self’s up. Typical URART (the RS-232 I/O chip) allows up to 50ma per output pin – so if the device needs 70ma to run we will need to use at least 2 pins for power. Some devices are very efficient and only require one pin (some times the Transmit or DTR pin) to be high – in the “SPACE” state while idle.

Data is transmitted and received on pins 2 and 3 respectively. Data  Set Ready (DSR) is an indication from the Data Set (i.e., the modem or DSU/CSU) that it is on. Similarly, DTR indicates to the Data Set that the DTE is on. Data Carrier Detect (DCD) indicates that a good carrier is being received from the remote modem.

Pins 4 RTS (Request To Send – from the transmitting computer) and 5 CTS (Clear To Send – from the Data set) are used to control. In most Asynchronous situations, RTS and CTS are constantly on throughout the communication session. However where the DTE is connected to a multipoint line, RTS is used to turn carrier on the modem on and off. On a multipoint line, it’s imperative that only one station is transmitting at a time (because they share the return phone pair). When a station wants to transmit, it raises RTS. The modem turns on carrier, typically waits a few milliseconds for carrier to stabilize, and then raises CTS. The DTE transmits when it sees CTS up. When the station has finished its transmission, it drops RTS and the modem drops CTS and carrier together.

Clock signals (pins 15, 17, & 24) are only used for synchronous communications. The modem or DSU extracts the clock from the data stream and provides a steady clock signal to the DTE. Note that the transmit and receive clock signals do not have to be the same, or even at the same baud rate.

Note: Transmit and receive leads (2 or 3) can be reversed depending on the use of the equipment – DCE Data Communications Equipment or a DCE Data Terminal Equipment.

Glossary of Abbreviations
CTS
Clear To Send [DCE –> DTE]
DCD
Data Carrier Detected (Tone from a modem) [DCE –> DTE]
DCE
Data Communications Equipment eg. modem
DSR
Data Set Ready [DCE –> DTE]
DSRS
Data Signal Rate Selector [DCE –> DTE] (Not commonly used)
DTE
Data Terminal Equipment eg. computer, printer
DTR
Data Terminal Ready [DTE –> DCE]
FG
Frame Ground (screen or chassis)
NC
No Connection
RCk
Receiver (external) Clock input
RI
Ring Indicator (ringing tone detected)
RTS
Ready To Send [DTE –> DCE]
RxD
Received Data [DCE –> DTE]
SG
Signal Ground
SCTS
Secondary Clear To Send [DCE –> DTE]
SDCD
Secondary Data Carrier Detected (Tone from a modem) [DCE –> DTE]
SRTS
Secondary Ready To Send [DTE –> DCE]
SRxD
Secondary Received Data [DCE –> DTE]
STxD
Secondary Transmitted Data [DTE –> DTE]
TxD
Transmitted Data [DTE –> DTE]
Is Your Interface a DTE or a DCE?

Find out by following these steps: The point of reference for all signals is the terminal (or PC).

  • Measure the DC voltages between (DB25) pins 2 & 7 and between pins 3 & 7. Be sure the black lead is connected to pin 7 (Signal Ground) and the red lead to whichever pin you are measuring.
  • If the voltage on pin 2 (TD) is more negative than -3 Volts, then it is a DTE, otherwise it should be near zero volts
  • If the voltage on pin 3 (RD) is more negative than -3 Volts, then it is a DCE
  • If both pins 2 & 3 have a voltage of at least 3 volts, then either you are measuring incorrectly, or your device is not a standard EIA-232 device.
  • In general, a DTE provides a voltage on TD, RTS, & DTR, whereas a DCE provides voltage on RD, CTS, DSR, & CD
DB-9 pin used for Asynchronous Data

This is a standard 9 to 25 pin cable layout for async data on a PC AT serial cable
Description Signal 9-Pin DTE 25-Pin DCE Source DTE or DCE
Carrier Detect CD 1 8 from Modem
Receive Data RD 2 3 from Modem
Transmit Data TD 3 2 from Terminal/Computer
Data Terminal Ready DTR 4 20 from Terminal/Computer
Signal Ground SG 5 7 from Modem
Data Set Ready DSR 6 6 from Modem
Request to Send RTS 7 4 from Terminal/Computer
Clear to Send CTS 8 5 from Modem
Ring Indicator RI 9 22 from Modem

 

25 pin D-shell connector RS232 commonly used for Async. data
Pin Signal Description
1 PGND Protective Ground
2 TXD Transmit Data
3 RXD Receive Data
4 RTS Ready To Send
5 CTS Clear To Send
6 DSR Data Set Ready
7 SG Signal Ground
8 CD Carrier Detect
20 DTR Data Terminal Ready
22 RI Ring Indicator

Some Applications require more Pins than a Simple Async. Configurations

RS-232 Interface
RS-232 (EIA Std.) applicable to the 25-pin interconnection of Data Terminal Equipment (DTE) and Data Communications Equipment (DCE) using serial binary data
Pin Description EIA CKT From DCE To DCE
1 Frame Ground AA
2 Transmit Data BA D (Data)
3 Received Data BB D
4 Request to Send CA C (Control)
5 Clear to Send CB C
6 Data Set Ready CC C
7 Signal Gnd. Common Return AB
8 Rcvd. Line Signal Detector CF C
11 Undefined
12 Secondary Rcvd.Line Sig. Detector SCF C
13 Secondary Clear to Send SCB C
14 Secondary Transmit Data SBA D
15 Transmitter Sig. Element Timing DB T (Timing)
16 Secondary Received Data SBB D
17 Receiver Sig. Element Timing DD T
18 Undefined
19 Secondary Request to Send SCA C
20 Data Terminal Ready CD C
21 Sig. Quality Detector CG C
22 Ring Indicator CE C
23 Data Sig. Rate Selector(DCE) CI
23 Data Sig. Rate Selector(DTE) CH C
24 Transmitter Sig. Element Timing DA T
25 Undefined
Pins used for Synchronous data

 

RS232 (25 pin) Tail Circuit Cable Null Modem Cable for Async or Sync data

RS232D uses RJ45 type connectors (similar to telephone connectors) wired as shown below

 

R-S 232 Specifications
Specifications RS 232 RS 423
Mode of Operation Single-Ended Single-Ended
Total Number of Drivers and Receivers on One Line 1 Driver/1 Receiver 1 Driver/10 Receivers
Maximum Cable Length 50 Ft. 4000 Ft.
Maximum Data Rate 20 kb/s 100 kb/s
Maximum Driver Output Voltage +/-25V +/-6V
Driver Output Signal Level (Loaded Min.) Loaded +/-5V to +/-15V +/-3.6V
Driver Output Signal Level (Unloaded Max.) Unloaded +/-25V +/-6V
Driver Load Impedance (Ohms) 3k to 7k >=450
Max.Driver Current in High Z State Power On N/A N/A
Max.Driver Current in High Z State Power Off +/-6mA@+/-2v +/-100uA
Slew Rate (Max.) 30V/uS Ajustable
Receiver Input Voltage Range +/-15V +/-12V
Receiver Input Sensitivity +/-3V +/-200mV
Receiver Input Resistance (Ohms) 3k to 7k 4 k min.

One Byte of Async Data

 

Cabling Considerations

Cabling made for RS-232 data should be used, although it is possible for low speed data go over 250′ on 2 pair phone cable. Level 5 cable can also be used but for best distance use a low capacitance data grade cable.

The standard maxim length is 50′ but if data is async you can increase that distance to as much as 500′ with a good grade of cable.

The RS-232 signal on a single cable is impossible to screen effectively for noise. By screening the entire cable we can reduce the influence of outside noise, but internally generated noise remains a problem. As the baud rate and line length increase, the effect of capacitance between the different lines introduces serious crosstalk (this especially true on synchronous data – because of the clock lines) until a point is reached where the data itself is unreadable. Signal crosstalk can be reduced by using low capacitance cable and shielding each pair.

Using a high grade cable (individually shield low capacitance pairs) the distance can be extended to 4000′. At higher frequencies a new problem comes to light. The high frequency component of the data signal is lost as the cable gets longer resulting in a rounded, rather than square wave signal.

The maxim distance will depend on the speed and noise level around the cable run.

On longer runs a line driver is needed. This is a simple modem used to increase the maxim distance you can run RS-232 data.

Making Sense of the Specifications

Selecting data cable isn’t difficult, but often gets lost in the shuffle of larger system issues. Care should be taken, however, because intermittent problems caused by marginal cable can be very difficult to troubleshoot.

Shunt Capacitance (pF/ft)The amount of equivalent capacitive load of the cable, typically listed in a per foot basis One of the factors limiting total cable length is the capacitive load. Systems with long lengths benefits from using low capacitance cablePropagation velocity (% of c)The speed at which an electrical signal travels in the cable. The value given typically must be multiplied by the speed of light (c) to obtain units of meters per second. For example, a cable that lists a propagation velocity of 78% gives a velocity of 0.78 X 300 X 106 – 234 X 106 meters per second

Beyond the obvious traits such as number of conductors and wire gauge, cable specifications include a handful of less intuitive terms
Characteristic Impedance (Ohms) A value based on the inherent conductance, resistance, capacitance and inductance of a cable that represents the impedance of an infinitely long cable. When the cable is out to any length and terminated with this Characteristic Impedance, measurements of the cable will be identical to values obtained from the infinite length cable. That is to say that the termination of the cable with this impedance gives the cable the appearance of being infinite length, allowing no reflections of the transmitted signal. If termination is required in a system, the termination impedance value should match the Characteristic Impedance of the cable
Plenum Cable

Plenum rated cable is fire resistant and less toxic when burning than non-plenum rated cable. Check building and fire codes for requirements. Plenum cable is generally more expensive due to the sheathing material used. The specification recommends 24AWG twisted pair cable with a shunt capacitance of 16 pF per foot and 100 ohm characteristic impedance. It can be difficult to decide whether shielding is required in a particular system or not, until problems arise. It is recommended to err on the safe side and use shielded cable. Shielded cable is only slightly more expensive than unshielded. There are many cables available meeting the recommendations of RS-422 and RS-485, made specifically for that application.
Another choice is the same cable commonly used in the misted pair Ethernet cabling. This cable, commonly referred to as Category 5 cable, is defined by the ElA/TIA/ANSI 568 specification. The extremely high volume of Category 5 cable used makes it widely available and very inexpensive, often less than half the price of specialty RS422/485 cabling. The cable has a maximum capacitance of 17 pF/ft (14.5 pF typical) and characteristic impedance of 100 ohms. Category 5 cable is available as shielded misted pair (STP) as well as unshielded misted pair (UTP) and generally exceeds the recommendations making it an excellent choice for RS232 systems.