RS232 Serial Port

Voltage levels with respect to ground represent the RS 232 signals. There is a wire for each signal, together with the ground signal (reference for voltage levels). This interface is useful for point-to-point communication at slow speeds. For example, port COM1 in a PC can be used for a mouse, port COM2 for a modem, etc. This is an example of point-to-point communication: one port, one device. Due to the way the signals are connected, a common ground is required. This implies limited cable length - about 30 to 60 meters maximum. (Main problems are interference and resistance of the cable.) Shortly, RS 232 was designed for communication of local devices, and supports one transmitter and one receiver.

One of the most universal parts of the PC is its serial port. You can connect a mouse, a modem, a printer, a plotter, another PC, etc. But its usage (both software and hardware) is one of the best-kept secrets for most users, besides that it is not difficult to understand how to connect devices to it and how to program it.

Here is the list of all signals specified in the RS232C standard. Its letters identifies each signal. Pin number on a DB-25 and DB-9 connector and its signal name. The circuit letters associated to each signal are devised by the following:

  • If the first letter is A, this is a common circuit
  • If the first letter is B, this is a signal circuit
  • If the first letter is C, this is a control circuit
  • If the first letter is D, this is a timing circuit
  • If the letters are preceded by an S, this is a secondary channel


Pin Assignment and Configurations

CIRCUIT

V.24 CIRCUIT #

DB-25 Pin #

DB-9 Pin #

SIGNAL NAME

AA

101

1

-

Protective
Ground

AB

102

7

5

Signal
Ground

BA

103

2

3

Transmitted
Data

BB

104

3

2

Received
Data

CA

105

4

7

Request
to send

CB

106

5

8

Clear
to send

CC

107

6

6

Data set
ready

CD

108

20

4

Data terminal
ready

CE

125

22

9

Ring
detector

CF

109

8

1

Carrier
detect

CG

110

21

-

Signal quality
detect

CH / CI

111 / 112

23

-

Data signal
rate selector

DA

113

24

-

Transmitter signal
timing (DTE)

DB

114

15

-

Transmitter signal
timing (DCE)

DD

115

17

-

Receiver signal
timing

SBA

118

14

-

Secondary
TX

SBB

119

16

-

Secondary
RX

SCA

120

19

-

Secondary
RTS

SCB

121

13

-

Secondary
CTS

SCF

122

12

-

Secondary
CD



9

-

Reserved
Positive test



10

-

Reserved
Negative test



11

-

N/C



18

-

N/C



25

-

N/C



Signal Direction
AA: Protective ground
This line is connected to the power ground of the serial adapter. It should not be used as signal ground. Connect this line to the screen of the lead wire (if applicable). By connecting this line on both sides you make sure that no large currents flow through the signal ground in case of an insulation defect or other defect on either side. On the other side, when two devices are separated by great distances you may not wish to use its signal, because of different ground potential and it is possible that it may carry a substantial current as a ground loop. If it is great enough, it may cause electrical interference.

AB: Signal ground
This is the logical ground, which is used as a point of reference for all signals received or transmitted. This signal is very important and must be present for all communications.

BA: Transmitted data
This line is used to transmit data from the DTE to the DCE. It is maintained at a logical 1 state when nothing is transmitted. The terminal will start to transmit when a logical 1 is present on all of the following lines:
  • Clear To Send
  • Data Terminal Ready
  • Data Set Ready
  • Data Carrier Detect

BB: Received data
This circuit is used to receive data from the DCE to the DTE. The terminal will start to transmit when a logical 1 is present on all of the following lines:
  • Request To Send
  • Data Terminal Ready
  • Data Set Ready
  • Data Carrier Detect
The standard specifies the output levels as being -5 to -15 Volts for logical 1 and +5 to +15 Volts for logical 0, and the input levels as being -3 to -15 Volts for logical 1 and +3 to +15 Volts for logical 0. This ensures data bits to be read correctly even at maximum lengths between DTE and DCE, which are specified as 50 feet although you could probably go too much greater distances without any problems. As you may have noticed, logical 1 are represented by a negative tension and vice versa. There's no particularly good reason for the inversion except that it's the way things have always been done, why change when it works!

CA: Request To Send
On this line, the DTE will send a signal when it wants to receive data from the DCE.

CB: Clear To Send
Here the DCE will send a signal when it's ready to receive data from the DTE. (Example: When your local modem connects to another modem via telephone lines).

CC: Data Set Ready
At a logical level of 1, this line indicates to the DTE that the DCE is ready to send data. (Ex. When a modem has established a connection with a remote modem and is in transmission mode).

CD: Data Terminal Ready
When a logical level 1 is sent from the DTE the DCE can start to send and receive data. When this line passes to logical level 0 the DCE will stop all communications. (Ex. A modem would stop all communications and would disconnect from the line, you will often see "DROP DTR" in communication programs).

CF: Data Carrier Detect
On this line the DCE indicates to the DTE that it has established a carrier with a remote device.

CE: Ring Indicator
This line is used mostly by communications software when the modem is not in "auto answer" mode and will indicate to the software that a remote device is calling. This is signal is optional when not using software that will answer a phone call automatically.

CG: Signal quality
This line although rarely used serves to indicate to the DTE that the quality of the signal is poor or just not good enough to keep a good connection.

CH: Data signal rate selector
In this case where a modem able of multiple connection rates, the DTE could choose the speed at which it is connected. Usually this line is kept a logical level 0 which selects the highest speed.

CI: Data signal rate selector
This signal is the same as CH but in this case the modem selects the speed at which the DTE communicates.


Timing circuits
In synchronous mode, it is necessary to have some way to exchange clock signals, here are three timing circuits used in the RS-232 protocol.
DA & DB: Transmitter signal timing
  • DA: DTE towards DCE (clock part of the DTE).
  • DB: DCE towards DTE (clock part of the DCE). These two circuits are used to synchronize the flow of data. Timing is given by the DTE or DCE but never from both at the same time. Usually data is transmitted to the modem or it's own clock control on the DB circuit.
  • DD: Receiver signal timing DCE
  • DD: DCE towards DTE (clock part of the DCE). This circuit is used to synchronize data received from the DTE. The clock signal received on this line indicates to the DTE at which instant to sample the received data on the BB line