HOME

TheInfoList



OR:

Data Carrier Detect (DCD) or Carrier Detect (CD) is a
control signal In telecommunications, signaling is the use of signals for controlling communications. This may constitute an information exchange concerning the establishment and control of a telecommunication circuit and the management of the network. Classi ...
present inside an
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
serial communications cable that goes between a computer and another device, such as a
modem The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establis ...
. This signal is a simple "high/low" status
bit The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
that is sent from a data communications equipment (DCE) to a
data terminal equipment Data terminal equipment (DTE) is an end instrument that converts user information into signals or reconverts received signals. It is also called data processing terminal equipment or tail circuit. A DTE device communicates with the data cir ...
(DTE), i.e., from the modem or other
peripheral A peripheral device, or simply peripheral, is an auxiliary hardware device that a computer uses to transfer information externally. A peripheral is a hardware component that is accessible to and controlled by a computer but is not a core compo ...
to a computer in a typical scenario. It is present on virtually all PC serial ports - pin 1 of a nine-pin ( DE9) serial port, or pin eight over a 25-pin (DB25) port. Its purpose varies depending on the device connected, but the most specific meaning is to indicate when a modem is connected to another remote modem via telephone lines. The word "carrier" is a reference to the analog carrier signal generated by a modem, which is
modulated Signal modulation is the process of varying one or more properties of a periodic waveform in electronics and telecommunication for the purpose of transmitting information. The process encodes information in form of the modulation or message ...
to carry the data. On a data modem, the carrier's loss equates to the connection's termination. Much like the Ring Indicator signal, on a PC's serial port, changes to the DCD signal state can generate a
hardware interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
that can be captured by the processor any time the DCD signal changes state, preventing the PC from needing to constantly poll the pin.


As used on modems

DCD is very important on modems, as it is the computer's primary way to find out that the modem has lost its connection to the remote host. Aside from intentional disconnects, modems can lose their connection for a variety of reasons unexpectedly - such as the phone line being disconnected. It is possible to use a modem without the DCD signal, however the only way for the computer to know that a connection is disconnected is by the modem transmitting the words " NO CARRIER" over the data lines. Because the words "NO CARRIER" are also a message that could appear in the context of a normal data session (for example, if typed by a person on the remote end), there is no positive way for a computer program to differentiate the words being sent over the connection versus from the modem. External modems with LED status lights usually have a light labeled "CD" (''carrier detect''). This status light is directly coupled with what the modem is sending the DCD line. By default, when a modem is powered up, the DCD signal is deasserted. It is not asserted until the modem either makes an outgoing call, or answers an incoming call, and then connects with a data modem on the other end. The signal is asserted at the same time the modem reports its CONNECT message, and stays asserted until the call is disconnected (either intentionally or because of a fault in the line). DCD is deasserted once the local modem is no longer receiving carrier from the remote modem, regardless of which side initiated the disconnect. So long as the DCD signal is high, the computer can assume that any data coming from the modem was sent from the remote side. Virtually all newer modems allowing the behavior of the DCD signal to be configured. Typical options available include "always assert DCD", "assert DCD only when connected", and "always assert DCD except immediately after sensing a disconnect". The meaning of DCD differs when the modem is in
fax Fax (short for facsimile), sometimes called telecopying or telefax (short for telefacsimile), is the telephonic transmission of scanned printed material (both text and images), normally to a telephone number connected to a printer or other out ...
or
voice The human voice consists of sound made by a human being using the vocal tract, including talking, singing, laughing, crying, screaming, shouting, humming or yelling. The human voice frequency is specifically a part of human sound produ ...
modes. In these modes, its importance is diminished.


As used with null modems

Frequent use of a serial port is for a direct computer-to-computer connection. This requires an adapter called a
null modem Null modem is a communication method to directly connect two data terminal equipment, DTEs (computer, computer terminal, terminal, printer (computing), printer, etc.) using an RS-232 serial cable. The name stems from the historical use of RS-232 ...
, which isn't actually a modem in the traditional sense, but rather a connector plug that simply crosses the complementary pins on two serial ports so the two sides can communicate. A null modem typically connects the DTR output of each computer to both the DCD and DSR inputs of the other. When used in this scenario, DCD is used to simply detect the presence and/or readiness of the other side to start a session. For example, on Windows PCs, the DTR output is kept low until some program is run to access the serial port and raise the DTR signal high. The remote side will sense this as the DCD input going high. Some equipment will recognize the transition alone as the beginning of a session. Other equipment (such as the console port of a router) may expect characters to be transmitted, but the DCD signal high is still a prerequisite for every communication.


PPS (Pulse per second) timing use

The serial DCD pin can be used to accurately detect a PPS signal, as described in RFC 2783:


As used with other hardware

In
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, each serial port is referenced by two device names - one being (for the first serial port) /dev/ttyS0 versus /dev/cua0. Although these both refer to the same physical port, one important distinction between the way Linux treats these two device names has to do with the DCD line. When ttyS0 is waited on in a
system call In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
, Linux assumes that since this device is for receiving telephone calls, it will put a
process A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management * Business process, activities that produce a specific s ...
to
sleep Sleep is a state of reduced mental and physical activity in which consciousness is altered and certain Sensory nervous system, sensory activity is inhibited. During sleep, there is a marked decrease in muscle activity and interactions with th ...
— figuring that so long as DCD is low, there is nothing to do. When cua0 is used - as it is when placing telephone calls - Linux assumes that the software needs to access the port while DCD is low for the purpose of dialing the number, so this blocking behavior doesn't exist. Nevertheless, there is a control mode
flag A flag is a piece of textile, fabric (most often rectangular) with distinctive colours and design. It is used as a symbol, a signalling device, or for decoration. The term ''flag'' is also used to refer to the graphic design employed, and fla ...
called CLOCAL which is what actually activates or deactivates this behavior, and by default, the flag is set for cua0 but not for ttyS0. An application that insists on using a "tty" port versus a "cua" port is an example of one that might require a jumper wire to force DCD high in order to work properly.Coldwell, Charles
Terminal concepts in GNU/Linux
{{Webarchive, url=https://web.archive.org/web/20080429173545/http://frank.harvard.edu/~coldwell/terminals/ , date=2008-04-29 ''


References


See also

*
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
*
Data Terminal Ready Data Terminal Ready (DTR) is a control signal in RS-232 serial communications, transmitted from data terminal equipment (DTE), such as a computer, to data communications equipment (DCE), for example a modem, to indicate that the terminal is ready ...
* Ring indicator RS-232 signals