RS-232 Serial Interface

The RS-232 serial interface protocol was designed to allow the transmission of computer data over standard telephone lines. This is accomplished by standardizing computer data into 8 bit data bytes. The RS-232 interface will put a start bit at the front of the byte and a stop bit at the rear of the byte to indicate a complete character to the receiving device. These 8 bit bytes are disassembled into1 start bit, 8 separate data bits and stop bit, which are transmitted via modem and phone line to a receiving device which assembles the 10 bits back into an 8 bit data byte after stripping off the start bit and the stop bit. The receiving device either prints or stores the 8 bit data byte dependent upon the receiving device.

An ASCII (American Standardized Code for Information Interchange) code was established to assign 8 bit codes for all printable data characters. These codes are accepted worldwide as the standard for character transmission and the decoding of data. Below is a brief example of an ASCII data table.

Binary data

Hex

Octal

ASCII data representation

01000001

41

101

A

01000010

42

102

B

01000011

43

103

C

.

.

.

.

01100001

61

141

a

01100010

62

142

b

01100011

63

143

c

RS-232 DEFINITIONS

DCE..........Data Communications Equipment. This term refers to the modem which controls the flow of data between two devices across telephone lines.

DTE..........Data Terminal Equipment. This term refers to the equipment attached to the modem. DTE may be printers, ASCII terminals or other computers. (DTE is the device that requires the DCE in order to transmit or receive data from point to point.)

 

SIGNAL DEFINITIONS

DSR..........Data Set Ready. A signal from the DCE (modem) indicating that it is active and available to communicate with the DTE.

DTR..........Data Terminal Ready. A signal from the terminal equipment to the DCE indicating that it is active and available to communicate with the DCE.

DCD/CD..........Data Carrier Detect or Carrier Detect. This signal indicates that the modems (DCE) at both ends of the link are connected over the telephone circuit and are able to transmit or receive data on the link.

RTS..........Request To Send. This signal is asserted by DTE to let the modem know that it has data to send to the remote connection.

CTS..........Clear To Send. This signal is asserted by DCE in response to RTS to indicate that the device can transmit the data to the modem.

SIG GND..........Signal Ground. This is the ground reference for the transmit and receive data signals. Some interface designs use an isolated power supply for the interface to protect it from power surges. On interfaces with a grounded power supply it is the same as frame ground.

CHS GND..........Chassis Ground. This is the green wire safety ground for the DTE. This wire typically attaches the safety ground of the remote device and the modem together for a common ground.

RI..........Ring Indicator. Signal from the DCE to DTE indicating that the DCE is being called. This signal is typically used by the S/W to wait a specific number of rings prior to answering the line.

RD/RX..........Receive Data. This is the line on which data is received by the DTE equipment.

TD/TX..........Transmitted Data. This is the line on which data is transmitted from the DTE equipment.

Note !! Transmit and Receive data signals on the cable are always referenced from the Data Terminal Equipment and not the modem.

NULL MODEM

Null modem is a term used to define the cable connection between two serial devices when there is no modem used. This is most often used to direct connect a serial device (printer) to the RS-232 serial port of a computer for local communications, usually within 25-50 ft of the computer. Loopbacks are used on the serial connectors of each device to make the RS-232 serial interface "think" that there is a modem attached and that serial communications can be enabled. The cable loopbacks used to make each device think there is a modem between them is as follows:

DTR to DTR to DCD. DTR is asserted when the terminal device is powered on. With a 6-8-20 loopback the device interface also sees DSR asserted (modem available) and DCD asserted (link complete). These three signals are the "interlock" that allows the interface to think that the DCE link is complete and communications can begin.

RTS to CTS Whenever the DTE has a byte of data to send it will assert RTS. With RTS being connected to CTS, the interface will allow the DTE to transmit data each time it makes a request to send.

TD to RD each end. Transmit data of one device needs to be connected to receive data of the other device. This is done by connecting pin 2 of the computer connector to pin 3 of the device connector and pin 3 of the computer connector to pin 2 of the device connector. This will "cross" the transmit data line to the receive data line of each device.

TYPICAL NULL MODEM CABLE PINOUT

Printer end DB-25 Pin #

Computer end DB-25 Pin #

6 to 8 to 20 DTR/DSR/CD

5 CTS

2 (TD)

3 (RD)

3 (RD)

2 (TD)

7 SIG GND

7 SIG GND

4 to 5 RTS to CTS

Looped back on connector. No connection thru the cable

6 to 8 to 20 DTR/DSR/CD

Looped back on connector, to the remote device ...........

 

NOTE!! The above cable pin out has Xmit data and Rcv data crossed between devices. It has DTR from the printer connected to CTS of the computer. If the printer is off-line, powered off, out of paper or in a fault condition DTR will be low, disabling CTS and the computer will not be enabled to send data. When DTR returns to a high state CTS is enabled and data will be sent. This is a "hardware busy" wiring scheme to direct connect a printer to a serial port. This wiring configuration can be implemented with a 4 wire telephone cable.