Data Terminal Ready

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Data Terminal Ready (DTR) is a control signal in RS-232 serial communications, transmitted from a data terminal (DTE), such as a computer, to a data circuit-terminating device (DCE), for example a modem, to indicate that the terminal is ready for communications and the modem may initiate a communications channel.

The DTR signal is present on pin 20 of the 22-wire RS-232 interface using a DB-25 connector, and on pin 4 of a newer DE-9 serial port. The signal is asserted (logic 0) by raising the voltage of the pin from negative to positive. Dropping the signal back to its negative state indicates to the modem that the communications session shall be terminated.

Signaling for modems[edit]

The DTR signal is an important call control signal for a data modem. Dropping DTR from high to low for at least two seconds tells the modem to disconnect (end) a call or data connection.

Software signaling[edit]

A call may also be disconnected by in-band signaling in software with escape codes to activate the modem's command mode, typically "+++", followed by other modem commands to disconnect, e.g., the hangup command ("ATH" per the Hayes command set).

When a modem is being used for automatic answering (such as with the command ATS0=1), the DTR signal confirms to the modem that the computer is available to accept a call. In their default configuration, most modems do not answer calls if the DTR signal is low, even if auto-answer mode is enabled.

When a computer wants to place a call, it raises the DTR signal before sending commands. If the DTR signal is not asserted and the modem receives a dial command, modems either refuse to accept commands, place the call, or they silently disable DTR support for the duration of that call; the actual behavior depends on the modem software. Such behavior can be manually overridden or configured on most newer modems.

DTR configurability on modems[edit]

Virtually all modems new enough to support error correction and data compression (all modems 9600 bit/s and above, and some 2400 bit/s ones as well) have the capability of modifying their use of RS-232 signals, depending on the application.[citation needed] The AT command for manipulating DTR is typically AT&D followed by a single digit.[1] AT&D0 and AT&D2 are mandatory under V.250, and AT&D1 is optional.[2] AT&D3 is non-standard but widely implemented,[3][4] and higher values are used by some vendors.[5]

  • AT&D or AT&D0 - Ignore DTR signal. A call will continue regardless of the DTR line, and the only way to end the call is with the escape sequence, or if it gets terminated by the other side. This setting is only used if the computer equipment cannot provide or control DTR.
  • AT&D1 - Dropping the DTR signal puts the modem into Command Mode, without disconnecting the call. The computer may disconnect the call with the ATH command, or return to the call with ATO. This mode is useful if the computer wishes to change settings on the modem during the call (such as activating test modes).
  • AT&D2 (default on most modems) - Dropping the DTR signal will cause a disconnect. Following the disconnect, the modem returns to command mode.
  • AT&D3 (not supported by all modems) - Dropping the DTR signal will cause a disconnect, followed by a reset (similar to ATZ).

Many modems, especially older ones, have DIP switches that define the default DTR behavior when the modem is powered on or reset.[3] Newer modems use nonvolatile memory to hold this behavior, which can be manipulated with the AT&W command.

Many external modems have LED indicators on the front, one of which is TR ("terminal ready"). This light follows the state of the DTR pin. The light is on when DTR is high, and off when it is low. Modems will typically keep the TR light illuminated when the AT&D0 command is used to force the modem to ignore the DTR signal, regardless of the pin's actual state.

Null modem operation[edit]

When a serial connection is made between two computers using a null modem adapter, the DTR and the Data Carrier Detect (DCD) lines are typically paired. This allows both ends of the connection to sense when the connection is active.

On many operating systems, including Windows, the DTR line is held low while the serial port is unused and not being controlled by any applications.

Use for flow control[edit]

On some printers with serial interfaces, the DTR line is used for hardware flow control, similar to the use of RTS and CTS for modems. This practice is not consistent; other printers define RTS for this same purpose.

When DTR is used for flow control, it manages the flow of data from the printer to the computer. However, because during printing, the bulk of the data is from the computer to the printer, the importance of flow control in the opposite direction is minimal.

Use as a power pin[edit]

On some hardware the DTR line (along with RTS) may be used to provide power. The most notable example of this is a serial mouse. The DE-9 serial port on the PC does not provide any dedicated power source. The mouse driver holds the DTR and RTS lines high at all times so that the device has a source of power.

Another category of devices commonly powered by the DTR line includes converters between RS-232 and other serial standards such as RS-422 and RS-485.

See also[edit]

References[edit]

  1. ^ The Extended Hayes Command Set, KDE, retrieved 2009-11-23 
  2. ^ "6.2.9 Circuit 108 (data terminal ready) behaviour", V.250 : Serial asynchronous automatic dialling and control (05/99, 07/03) (PDF), ITU-T/Telecommunication Standardization Bureau 
  3. ^ a b "8. Controlling EIA-232 Signaling", Courier V-Everything Command Reference, U.S. Robotics, retrieved 2009-11-23 
  4. ^ "A.4 AT&D3 Implementation Issues", PnP for COM Devices, rev 0.92 (RTF), Microsoft and Hayes, February 28, 1995 
  5. ^ Nick Robins (2003), Alpha Micro GPRS Modem Functional Overview 1.0 (PDF), Alpha Micro Components, retrieved 2009-11-23