Hardware manual
pins 2 and 3 cross over each other (if you draw them on a sheet of paper). The above example is for a 25 pin
connector but for a 9-pin connector the pin numbers 2 and 3 are just the opposite.
The serial pin designations were originally intended for connecting a dumb terminal to a modem. The terminal
was DTE (Data Terminal Equipment) and the modem was DCE (Data Communication Equipment). Today the
PC is usually used as DTE instead of a terminal (but real terminals may still be used this way). The names of
the pins are the same on both DTE and DCE. The words: "receive" and "transmit" are from the "point of
view" of the PC (DTE). The transmit pin from the PC transmits to the "transmit" pin of the modem (but
actually the modem is receiving the data from this pin so from the point of view of the modem it would be a
receive pin).
The serial port was originally intended to be used for connecting DTE to DCE which makes cabling simple:
just use a straight-thru cable. Thus when one connects a modem one seldom needs to worry about which pin is
which. But people wanted to connect DTE to DTE (for example a computer to a terminal) and various ways
were found to do this by fabricating various types of special null-modem cables. In this case what pin
connects to what pin becomes significant.
19.4 RTS/CTS and DTR/DSR Flow Control
This is "hardware" flow control. Flow control was previously explained in the Flow Control subsection but
the pins and voltage signals were not. Linux only supports RTS/CTS flow control at present (but a special
driver may exist for a specific application which supports DTR/DSR flow control). Only RTS/CTS flow
control will be discussed since DTR/DSR flow control works the same way. To get RTS/CTS flow control
one needs to either select hardware flow control in an application program or use the command:
stty -F /dev/ttyS2 crtscts (or the like). This enables RTS/CTS hardware flow control in the Linux device
driver.
Then when a DTE (such as a PC) wants to stop the flow into it, it negates RTS. Negated "Request To Send"
(-12 volts) means "request NOT to send to me" (stop sending). When the PC is ready for more bytes it asserts
RTS (+12 volts) and the flow of bytes to it resumes. Flow control signals are always sent in a direction
opposite to the flow of bytes that is being controlled. DCE equipment (modems) works the same way but
sends the stop signal out the CTS pin. Thus it's RTS/CTS flow control using 2 lines.
On what pins is this stop signal received? That depends on whether we have a DCE-DTE connection or a
DTE-DTE connection. For DCE-DTE it's a straight-thru connection so obviously the signal is received on a
pin with the same name as the pin it's sent out from. It's RTS-->RTS (PC to modem) and CTS<--CTS (modem
to PC). For DTE-to-DTE the connection is also easy to figure out. The RTS pin always sends and the CTS pin
always receives. Assume that we connect two PCs (PC1 and PC2) together via their serial ports. Then it's
RTS(PC1)-->CTS(PC2) and CTS(PC1)<--RTS(PC2). In other words RTS and CTS cross over. Such a cable
(with other signals crossed over as well) is called a "null modem" cable. See Cabling Between Serial Ports
What is sometimes confusing is that there is the original use of RTS where it means about the opposite of the
previous explanation above. This original meaning is: I Request To Send to you. This request was intended to
be sent from a terminal (or computer) to a modem which, if it decided to grant the request, would send back
an asserted CTS from its CTS pin to the CTS pin of the computer: You are Cleared To Send to me. Note that
in contrast to the modern RTS/CTS bi-directional flow control, this only protects the flow in one direction:
from the computer (or terminal) to the modem. This original use appears to be little used today on modern
equipment (including modems).
Serial HOWTO
19.3 Cabling Between Serial Ports 72