Serial Programming/Modems and AT Commands/Commands A - M

AT Commands A - M
This module explains the AT commands A to M as used by a "generic" Hayes-compatible modem. Different modems use slightly different commands. However, this list is supposed to be as "generic" as possible, and should not be extended with modem-specific commands. Instead it is recommended to provide such command lists in an Appendix.

A: Answer Command
Syntax:

A

Description:

The command initiates handshake as answering side. No next commands in this command line are proceeded. If handshake succeeds, modem sends successful message ("CONNECT...") to serial line and serial line switches to data mode, otherwise failure message is sent and serial line remains in command mode.

Result Codes:

CONNECT message usually contains speed, protocol and other details of succeeded connection and may be preceded with other messages of connection details.

Related Commands and Registers:
 * 
 * 
 * 
 * 

B: Select Communication Standard
Syntax:[1]

B[0|1]   (original Hayes) B[number] (extensions)

Description:

In original Hayes modems, it selects protocols for 300bps and 1200bps handshake: B0 selects CCITT protocols; B1 selects Bell protocols.

Some vendors (e.g. Rockwell) extends it to limit connection speed (e.g. B15 - no more than 28800 bps).

Result Codes:

Related Commands and Registers:
 * A: Answer
 * D: Dial
 * +MS: Speed and protocol selection

C: Carrier Control Selection
Syntax:

ATC0 The carrier detect (CD) override is always on (default) ATC1 The modem sends the carrier detect signal when it makes connection with another modem and drops the signal when it disconnects.

Description:

Controls the carrier detect signal sent by the modem to the computer. .

DTE Interface:

If AT&C1, the carrier detect enters into a true state when a connection is made. The carrier detect returns to a false state after the connection is dropped.

Aborting Events: None

Related Commands and Registers:

D: Dial Command
Syntax:

D [T|P|digits|misc]

Description:

The command initiates dialing a number using pulse or tone dialing. The dial string can be rather flexible. Almost all of the modem's default settings can be overridden in the dial string. Dialing is controlled by providing dial modifiers after the  command.

Dial Modifiers:


 * 0-9: Digits. This results in the corresponding DTMF tone being sent (tone dialing), or the corresponding number of pulses (pulse dialing) being sent.
 * A-D, #, *: (Tone dialing only) Tone dialing supports six more characters, which can be dialed in addition to the numbers 0-9. However, these characters can trigger special functions in the telephone network and should only be used if their function is required in a particular network.
 * NOTE, one of the nastiest things which can be triggered in some public networks with these characters is a test of the tariff time switch. The test consists of a rapid increase of the counter, which can end up at the phone bill as a huge debt.


 * P: Pulse Dialing Modifier. Indicates that all following numbers should be dialed using pulse dialing, until a  modifier is encountered. The modifier is persistent. It not only affects the current dialing, but also any other dialing (until a   modifier is encountered or the modem is reset).
 * T: Tone Dialing Modifier. Indicates that all following numbers should be dialed using DTMF dialing, until a  modifier is encountered. The modifier is persistent. It not only affects the current dialing, but also any other dialing (until a   modifier is encountered or the modem is reset).
 * W: Wait for Second Dial Tone. This is useful when working behind a PABX. Typically to dial out from behind a PABX it is first necessary to seize an external line by dialing a special number, and then waiting for the public line's dial tone before continuing.
 * ,: Delay. The modem will pause for the delay configured in register S8 before continuing dialing. This is useful when dealing with old, slow mechanical telephone equipment, as well as working in special PABX configurations. Some PABX need some time to seize a line, but provide no progress indication when they have done so. Note, if a second dial tone is provided, then the  modifier is a much better choice over the   modifier.
 * @: Wait for Silence. This is another modifier which is helpful in dealing with special PABX configurations. The modem waits for at least five seconds of silence before continuing dialing. Silence is defined as no signal in the call progress indication frequency band, not as absolute silence (not as absence of line noise).
 * If the modem doesn't detect these five seconds of silence prior to the expiration of the S7 call abort timer, the modem stops the dialing (call abortion), and returns a  result code. This is somewhat counter intuitive, since the modem is waiting for silence as an answer. If busy detection is enabled, some modems return a   answer code instead. Which is also arguable.
 * If an answer tone from some remote modem arrives while waiting for the five seconds of silence, the modem initiates the handshake procedure and aborts dialing. If the handshake succeeds the modem is on-line.


 * !: Flash. A flash is a special signal send to some telephone equipment, like a phone exchange. The flash is send by (ab)using the hook. The modem goes on-hook for a specific time. That time is exchange-equipment / telecom-standard specific. It has to be shorter than the on-hook time which is interpreted by the exchange as call/dialing abortion. The flash time can be configured via the modem's S29 register. Some PABX require a flash if they are supposed to seize a public line.
 * ;: Return to Command State after Dialing. This modifier indicates the end of the dialing, but instead of requesting the modem to go into the call progress state, the modem will return to the command line. This enables additional AT commands to be sent to the modem while it is still off-hook. These additional commands may be placed after the  on the same command line, or can be sent on additional command lines.
 * To continue the call, an additional dial command, e.g. a single  needs to be sent, which will transition the modem's state to enter call progress.
 * Alternatively, the call can be aborted by sending the on-hock command.


 * S=n: Dial Stored Telephone Number. Dial one of four (n = 0 ... 3) telephone dial strings. See the  command for how to store a number in the modem.
 * R: Originate Call in Answer Mode. Originate the call, but behave as being called instead. The modem expects that handshake negotiation is reversed. This is often not implemented in today's modems, and the modifier is ignored.

Modern modems accept and support a number of additional modifiers.

E: Command State Character Echo Selection
Syntax:

E[0|1]

Description:

Switches character echo on (1) or off (0) when in the command state. Given no argument, assumes 0.

Character echoing is usually not desired when controlling a modem via some software program. It is useful for debugging purposes, and when the modem is controlled manually, e.g. via some generic terminal program.

Result Codes:

F: On-line State Character Echo Selection
Command Description Template

Syntax:



Description:



Result Codes:

Related Commands and Registers:
 * 

H: Hook Command Options
Syntax:MiscModemState.java

H[0|1]

Description:

Controls if the modem goes on-hook (disconnects from the phone line), or off-hook (connects to the phone line). The wording is taken from normal telephone usage, where someone takes the handset off the hook (off-hook) when intending to place a call. The terminology is counter-intuitive for modems, since off-hook indicates the modem goes on-line, and on-hook indicates the modem goes off-line.

or
 * H
 * H0 : The modem will release the phone line (going on-hook) if the modem is currently on-line (off-hook). The command is also typically used to terminate a modem's self-test or automatic line test mode - if provided by a particular modem. The modem will go into command mode after the command. In order to issue the command while on-line, and while not in command mode, the escape code sequence need to be sent prior to the command, to force the modem in command mode first.


 * H1 : If on-hook (off-line), the modem will go off-hook (on-line), and remain in command mode. Typically, the next command in command mode is a  dial command. If the inactivity timer S7 expires while off-hook, the modem goes back on-hook (off-line). This behavior prevents accidental blocking of a phone line by broken DTE software which manages to go off-hook but for whatever reason doesn't use the seized line.

Result Codes:

Related Commands and Registers:
 * A: Answer
 * D: Dial

I: Internal Memory Tests
Command Description Template

Syntax:



Description:



Result Codes:

Related Commands and Registers:
 * 

L: Speaker Volume Level Selection
Command Description Template

Syntax:



Description:



Result Codes:

Related Commands and Registers:
 * 

M: Speaker On/Off Selection
Syntax:

M[0|1|2|3]

Description:


 * 0 : switches the internal speaker always off.
 * 1 : switches the internal speaker off when connected and on otherwise.
 * 2 : switches the internal speaker always on.
 * 3 : switches the internal speaker on when not connected or during retrains, and off during normal connection.

Some vendors add additional modes.

Result Codes:

Related Commands and Registers:
 * L: Set internal speaker loudness