The AT Command Set Reference - Command Set Summary and Syntax

[Copyright 1993,2000,2001,2002,2003,2004 Frank Durda IV, All Rights Reserved.
Mirroring of any material on this site in any form is expressly prohibited.
The official web site for this material is:
Contact this address for use clearances: clearance at
Comments and queries to this address: web_reference at]

Section 2: The AT Command Set Summary and Syntax

The AT Command set is named after a functional artifact of the original Hayes Smartmodems operation. On these modems, the modem would automatically adjust the DTE baud rate (the speed that bits move between the modem and the local computer or terminal) by watching for a pattern of ones and zeros that could be consistently stretched or compressed into representing the ASCII code for the letter "A", followed by the letter "T". The sequence of "A" followed by "T" is sometimes called "ATtention".

"Auto-bauding" is the technique used to look for a specific sequence of bits and determining the senders speed based on how much the expected bit sequence timing must be stretched or compressed on reception (much like playing an audio recording faster or slower until you can understand it). This technique can be traced back to the Digital Equipment Corporation DECSystem-10 systems of the early 1970s, which used the ASCII code [CONTROL]-C (appearing as "^C") to determine serial communication speed of the DTE device, which could be anything between 75 and 9600bps. The reception of this character would also request a login prompt from the operating system, which would be returned at the computed DTE rate.

In AT compatible modems, following the computation of the possibly-correct baud rate by trying to get the received pattern of voltage transitions to align with one of the supported baud rates and the result looks like the ASCII code for the letter "A" (uppercase or lowercase), the tentatively identified speed would be verified by correctly reading the letter "T" at that speed.

If the "T" was correctly received with no framing errors, subsequent characters following the "T" are stored in the modem until an ASCII Carriage Return character (0x0d) is received, at which point the received characters are executed as commands to the modems Command Mode. (There are two special commands that do not start with "AT", but all the others do.)

The size of the command buffer varies by modem, but the traditional size limit is 40 characters.

During Command Mode, the ASCII Backspace character (0x08) is normally accepted to erase the most recently received non-erase character from the command buffer.

On reception of a carriage return, any commands that were sent to the modem would be executed in the order received (from left to right), up until a syntax or mode error is detected, or a command fails, or the maximum command length is reached, whichever occurs first. If no errors are encountered and all commands are performed, the modem will return a Result Code of "OK" or "0", depending on whether numeric or text responses have been previously selected.

If any commands that are encountered are invalid or not legal at this time, the result code "ERROR" or "4" could be returned. Certain commands can result in several other result codes which may mean that the command succeeded or failed. For example, a Dial command could return a "BUSY" or "7" Result Code, which indicate that the modem could not successfully reach the called party, while the same Dial command could also return a "CONNECT" or "1" Result Code, indicating that carrier has been successfully established to the remote modem. Result Codes are discussed in more detail later.

AT commands all start with a letter, although some commands use the ampersand (&), the pound (#) character and some other punctutation characters as a prefix. For example, the command "&W" is different than the command "W". A few other symbol characters can be found as command prefixes, but these are not standardized.

The EIA/TIA-602 standard says that commands that begin with the plus-sign (+) are reserved for future use, but many modems use commands prefixed with a plus-sign for operations related to the transmission or reception of FAXes.

AT-compatible modems also contain what are called "S" registers. These are called "S" registers simply because access to a given register is specified by the register number preceded by the letter "S". Some AT-compatible modems have over 350 "S" registers that control a wide variety of functions, and these registers are an area of minimal compatibility between different modem brands and modem models. Only the first eleven "S" registers are used consistently throughout the modem industry, despite different vendors selecting different default values for some of these fundamental registers.

In modem documentation and in this reference, when you see a notation like S1, it is referring to "S" register number "1".

Some AT commands also contain optional parameters known as "Modifiers", which are single-letters, numbers or symbols that alter the default behavior of the command to the immediate left of this character on the command line, and may change the modems default behavior for subsequent commands. Commands that accept a numeric modifier assume that the number 0 has been entered if no other number is specified. For example, the commands "B0" and "B" are considered by the modem to be identical.

It should be noted that in the original Hayes Smartmodem 1200, the distinction between dialing modifiers and commands was somewhat blurred, which is why the letters used in dialing modifiers are not used as the letters for commands. Even after a firm line was drawn between commands and Dial command modifiers in subsequent models, the "P" and "T" dialing modifiers continue to be accepted as free-standing commands.

The "T" and "P" Dial modifiers of a dialing command are also examples of modifiers that remain in effect for subsequent dialing operations until the modem is reset or until the previous setting is changed again. Some modifiers can also be saved in non-volatile memory and remain in effect after the modem is reset or power-cycled.

In general, multiple AT commands can be submitted to the modem on a single line, although certain commands only make sense if they appear as the last item on a command line. For example, the command to tell the modem to wait for dial-tone before dialing a number must appear before the command to dial the number itself.

Examples of AT Command Usage

AT X4 S7=90 D P 8 , T 1 888-611-9999 W 817*
This command line actually contains several commands, and are used to demonstrate how each affects subsequent commands:

AT Attention
Synchronizes the DTE device and DCE (the modem) transmission rate. The modem is assumed to be in Command Mode.
X4 Command Specifies that the modem is supposed to detect dial-tone on execution of a "D" command and prior to dialing numbers, and that the modem is to detect any busy signal after dialing is complete, although some modems may detect busy signals at any time during the dialing process if X4 is set. (X4 is the default EIA-602 value for the "X" command.) The sequence "X4" is a complete command and can be issued on its own command line, eg ATX4[ENTER].
S7=90 Command Sets the S7 register to the value 90. In modems compatible with EIA-602, the S7 register specifies how long the modem is willing to remain off-hook after dialing a number and before the modem gives up waiting for answer carrier from the called modem to be detected. If the called modem is not "heard" in specified number of seconds, the calling modem is to go back on-hook and report an error to the DTE. The sequence "S7=90" is a complete command and can be issued on its own command line, eg ATS7=90[ENTER].
D Command Take the modem off-hook and listen for dial-tone. Because X4 was previously set, if dial-tone is not heard, go on-hook and return an error condition. If dial-tone is heard, proceed to the next dial-modifier.
P Modifier Dial subsequent digits using Pulse (aka Rotary) dialing.
8 Modifier Dial (using Pulse dialing) the number 8.
, (comma) Modifier Wait two seconds before performing the next dial modifier. This command is commonly used when connected to a PBX line, and you are dialing "8" or some similar digit to reach an outside line, before dialing the remaining digits. (The "W" modifier can also be used in this situation.)

The digit 8 is being used more commonly now to reach outside lines from PBX systems instead of 9. This is so that 911 emergency numbers are less likely to be accidentally dialed, and the change allows PBX systems to be programmed to accept 911 directly instead of requiring callers to dial 9911 in order to reach emergency services.

T Modifier Dial subsequent digits using Touch-Tone (DTMF) dialing.
1 888-611-9999 Modifier Dial the digits 18886119999 using Touch-Tone dialing. The minus character and the blank character are ignored by the modem and are allowed for improved human readability.
W Modifier Wait until dial-tone is detected before proceeding to the next dial modifier or command.
817* Modifier Dial the digits 817 and the "*" ("Star") key using Touch-Tone dialing.
Having completed all of the dialing modifiers, the modem will now wait the amount of time specified by the S7 register, listening for carrier from the called modem. If the calling modem hears a busy signal and is operating in the default EIA-602 error mode (X4), the modem will go on-hook immediately and report the error condition. Otherwise, it will wait until it hears carrier and connects, or fails to hear carrier, in which case an error is returned to the DTE. Some modems can also report to the DTE that the modem is detecting ring-back at this point, but this is not an error condition, and the Dial command is still in progress.

A detailed explanation of virtually all modem commands and modifiers can be found in later sections.

Section 3: Unprefixed and special AT Commands (HTML)

Return to The AT Command Set Reference Index (HTML)

[Copyright 1993,2000,2001,2002,2003,2004 Frank Durda IV, All Rights Reserved.
Mirroring of any material on this site in any form is expressly prohibited.
The official web site for this material is:
Contact this address for use clearances: clearance at
Comments and queries to this address: web_reference at]

Visit the home page and index

Valid HTML 4.01!