The RS232-C and V.24 Standards

In most computer systems, the UART is connected to circuitry that generates signals that comply with the EIA (Electronics Industry Association) RS232-C  (Recommend Standard  number 232 revision C) specification (there is also a CCITT standard named V.24 that mirrors the specifications included in RS232-C). The RS232-C defines the electrical specifications of the serial port; the signals are represented by voltage levels with respect to a common signal ground.

Bit Assignments (Marks and Spaces)

The protocol  specify two values : a value of 1 is called a Mark and a value of 0 is called a Space. When a communication line is idle, the line is said to be “Marking”, or transmitting continuous 1 values. The Start bit always has a value of 0 (a Space). The Stop Bit always has a value of 1 (a Mark). This means that there will always be a Mark (1) to Space (0) transition on the line at the start of every word, even when multiple word are transmitted back to back. This guarantees that sender and receiver can resynchronize their clocks regardless of the content of the data bits that are being transmitted.

The idle time between Stop and Start bits does not have to be an exact multiple (including zero) of the bit rate of the communication link, but most UARTs are designed this way for simplicity.

In RS232-C, the "Marking" signal (a 1) is represented by a voltage between -3 VDC and -12 VDC, and a "Spacing" signal (a 0) is represented by a voltage between 3 and +12 VDC. The transmitter is supposed to send +12 VDC or -12 VDC, and the receiver is supposed to allow for some voltage loss in long cables. 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  Some transmitters in low power devices (like portable computers) sometimes use only +5 VDC and -5 VDC, but these values are still acceptable to a RS232-C receiver, provided that the cable lengths are short.

Break Signal

It is the signal  generated by sending continuous Spacing values (no Start or Stop bits). When there is no electricity present on the data circuit, the line is considered to be sending Break.

The Break signal must be of a duration longer than the time it takes to send a complete byte plus Start, Stop and Parity bits. Most UARTs can distinguish between a Framing Error and a Break, but if the UART cannot do this, the Framing Error detection can be used to identify Breaks.

In modern systems there are two types of Break signals. If the Break is longer than 1.6 seconds, it is considered a "Modem Break", and some modems can be programmed to terminate the conversation and go on-hook or enter the modems' command mode when the modem detects this signal. If the Break is smaller than 1.6 seconds, it signifies a Data Break and it is up to the remote computer to respond to this signal. Sometimes this form of Break is used as an Attention or Interrupt signal and sometimes is accepted as a substitute for the ASCII CONTROL-C character. 

Note: Breaks cannot be generated from paper tape or from any other byte value, since bytes are always sent with Start and Stop bit. The UART is usually capable of generating the continuous Spacing signal in response to a special command from the host processor.

DTE and DCE Devices

The RS232-C specification defines two types of equipment: the Data Terminal Equipment (DTE) and the Data Carrier Equipment (DCE). These terms are used to indicate the pin-out for the connectors on a device and the direction of the signals on the pins.  Usually, the DTE device is the terminal (or computer), and the DCE is a modem.  The DCE device receives signals on the pins that the DTE device transmits on, and vice versa.

When two devices that are both DTE or both DCE must be connected together without a modem or a similar media translator between them, a NULL modem must be used. The NULL modem electrically re-arranges the cabling so that the transmitter output is connected to the receiver input on the other device, and vice versa. Similar translations are performed on all of the control signals so that each device will see what it thinks are DCE (or DTE) signals from the other device.

The number of signals generated by the DTE and DCE devices are not symmetrical. The DTE device generates fewer signals for the DCE device than the DTE device receives from the DCE.

Pin Assignments

The EIA specification and the ITU equivalent, V.24 calls for a twenty-five pin connector (usually a DB25) and defines the purpose of most of the pins in that connector.

Personal Computer and similar systems provide a subset of RS232-C signals via nine pin connectors (DB9). The signals that are not included on the PC connector deal mainly with synchronous operation and this transmission mode is not supported by the UART. Actually newer PC haven't  serial port so a specific adapter (generally USB/Serial adapter) needs to be used to communicate in USART fashion.  

In  the old PC a DB25, a DB9, or both types of connectors were used for RS232-C communications. (The PC also uses a DB25 connector for the parallel printer interface which causes some confusion.)

Below is a table of the RS232-C signal assignments in the DB25 and DB9 connectors.

DB25 RS232-C DB9 PC Pin DB 8 Circular Mini DIN RJ45 EIA Circuit Symbol CCITT Circuit Symbol Common Name Signal Source Description
1

AA 101 PG/FG Frame/Protective Ground
2 3 3 1 BA 103 TD DTE Transmit Data
3 2 5 3 BB 104 RD DCE Receive Data
4 7 2
CA 105 RTS DTE Request to Send
5 8

CB 106 CTS DCE Clear to Send
6 6

CC 107 DSR DCE Data Set Ready
7 5 4
AV 102 SG/GND Signal Ground
8 1

CF 109 DCD/CD DCE Data Carrier Detect
9

Reserved for Test
10

Reserved for Test
11

Reserved for Test
12

CI 122 SRLSD DCE Sec. Recv. Line Signal Detector
13

SCB 121 SCTS DCE Secondary Clear to Send
14 6 2 SBA 118 STD DTE Secondary Transmit Data
15

DB 114 TSET DCE Trans. Sig. Element Timing
16 8 6 SBB 119 SRD DCE Secondary Received Data
17

DD 115 RSET DCE Receiver Signal Element Timing
18

141 LOOP DTE Local Loopback
19

SCA 120 SRS DTE Secondary Request to Send
20 4 1
CD 108.02.00 DTR DTE Data Terminal Ready
21

RDL DTE Remote Digital Loopback
22 9

CE 125 RI DCE Ring Indicator
23

CH 111 DSRS DTE Data Signal Rate Selector
24

DA 113 TSET DTE Trans. Sig. Element Timing
25

142 DCE Test Mode

The TD (transmit data) wire is the one through which data from a DTE device is transmitted to a DCE device. This name can be deceiving, because this wire is used by a DCE device to receive its data. The TD line is kept in a mark condition by the DTE device when it is idle. The RD (receive data) wire is the one on which data is received by a DTE device, and the DCE device keeps this line in a mark condition when idle.

RTS stands for Request To Send. This line and the CTS line are used when "hardware flow control" is enabled in both the DTE and DCE devices. The DTE device puts this line in a mark condition to tell the remote device that it is ready and able to receive data. If the DTE device is not able to receive data (typically because its receive buffer is almost full), it will put this line in the space condition as a signal to the DCE to stop sending data. When the DTE device is ready to receive more data (i.e. after data has been removed from its receive buffer), it will place this line back in the mark condition. The complement of the RTS wire is CTS, which stands for Clear To Send. The DCE device puts this line in a mark condition to tell the DTE device that it is ready to receive the data. Likewise, if the DCE device is unable to receive data, it will place this line in the space condition. Together, these two lines make up what is called RTS/CTS or "hardware" flow control. The Software supports this type of flow control, as well as Xon/Xoff or "software" flow control. Software flow control uses special control characters transmitted from one device to another to tell the other device to stop or start sending data. Xon is normally indicated by the ASCII 17 character where as the ASCII 19 character is used for Xoff . 

With software flow control the RTS and CTS lines are not used. The DCE will only have a small buffer so when the DTE fills it up the DCE sends a Xoff character to tell the computer to stop sending data. Once the DCE has room for more data it then sends a Xon character and the DTE sends more data. This type of flow control has the advantage that it doesn't require any more wires as the characters are sent via the TD/RD lines. However on slow links each character requires 10 bits which can slow communication. 

 

DTR stands for Data Terminal Ready. Its intended function is very similar to the RTS line. DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. Some serial devices use DTR and DSR as signals to simply confirm that a device is connected and is turned on. The Software sets DTR to the mark state when the serial port is opened and leaves it in that state until the port is closed. The DTR and DSR lines were originally designed to provide an alternate method of hardware handshaking. It would be pointless to use both RTS/CTS and DTR/DSR for flow control signals at the same time. Because of this, DTR and DSR are rarely used for flow control.

CD stands for Carrier Detect. Carrier Detect is used by a modem to signal that it has established a connection with another modem or it has detected a carrier tone.

The last remaining line is RI or Ring Indicator. A modem toggles the state of this line when an incoming call rings your phone.

 

The Carrier Detect (CD) and the Ring Indicator (RI) lines are only available in connections to a modem. Because most modems transmit status information to a PC when either a carrier signal is detected (i.e. when a connection is made to another modem) or when the line is ringing, these two lines are rarely used.

(to be continued…)

The index page