Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [65]

By Root 2619 0
connector into your forehead).

Note that in Exhibit A, only seven pins are actually installed. This is typical for the real world. The RS-232 signals and their pin assignments on a DB-25 connector are shown in Table 7.1. Only the shaded signals are ever used in practice; all others can be ignored.

Table 7.1 RS-232 signals and pin assignments on a DB-25

There are two interface configurations for serial equipment: DTE (Data Terminal Equipment) and DCE (Data Communications Equipment). DTE and DCE share the same pinouts, but they specify different interpretations of the RS-232 signals.

Every device is configured as either DTE or DCE; a few support both, but not simultaneously. Computers, terminals, and printers are generally DTE, and most modems are DCE. DTE and DCE serial ports can communicate with each other in any combination, but different combinations require different cabling.

There is no sensible reason for both DTE and DCE to exist; all equipment could use the same wiring scheme. The existence of two conventions is merely one of the many pointless historical legacies of RS-232.

DTE and DCE can be quite confusing if you let yourself think about the implications too much. When that happens, just take a deep breath and reread these points:

• The RS-232 pinout for a given connector type is always the same, regardless of whether the connector is male or female (matching pin numbers always mate) and regardless of whether the connector is on a cable, a DTE device, or a DCE device.

• All RS-232 terminology is based on the model of a straight-through connection from a DTE device to a DCE device. (By “straight through,” we mean that TD on the DTE end is connected to TD on the DCE end, and so on. Each pin connects to the same-numbered pin on the other end.)

• Signals are named relative to the perspective of the DTE device. For example, the name TD (transmitted data) really means “data transmitted from DTE to DCE.” Despite the name, the TD pin is an input on a DCE device. Similarly, RD is an input for DTE and an output for DCE.

• When you wire DTE equipment to DTE equipment (computer-to-terminal or computer-to-computer), you must trick each device into thinking that the other is DCE. For example, both DTE devices will expect to transmit on TD and receive on RD; you must cross-connect the wires so that one device’s transmit pin goes to the other’s receive pin, and vice versa.

• Three sets of signals must be crossed in this fashion for DTE-to-DTE communication (if you choose to connect them at all). TD and RD must be crossed. RTS and CTS must be crossed. And each side’s DTR pin must be connected to both the DCD and DSR pins of the peer.

• To add to the confusion, a cable crossed for DTE-to-DTE communication is often called a “null modem” cable. You might be tempted to use a null modem cable to hook up a modem, but since modems are DCE, that won’t work! A cable for a modem is called a “modem cable” or a “straight cable.”

Because the issue of DTE vs. DCE is so confusing, you may occasionally see well-intentioned but ill-advised attempts to bring some sanity to the nomenclature by defining DTE and DCE as if they had separate pinouts (e.g., renaming DCE’s TD pin to be RD, and vice versa). In this alternate universe, pinouts vary but cable connections (by signal name) do not. We suggest that you ignore any material that talks about a “DTE pinout” or a “DCE pinout”; it is unlikely to be a reliable source of information.

Originally, DTE devices were supposed to have male connectors and DCE devices were supposed to have female. Eventually, hardware designers realized that male connectors are more fragile. Expensive computing hardware now usually has female connectors, and most cables are male on both ends.2

Exhibit B shows pin assignments and connections for both null-modem and straight-through cables. Only signals used in the real world are shown.

Exhibit B Pin assignments and connections for DB-25 cables

7.2 ALTERNATIVE CONNECTORS


The following sections describe the most common alternative connector

Return Main Page Previous Page Next Page

®Online Book Reader