I need to know why people in embedded systems use AT commands?
When I have asked people say that it is a standard.
So my question is: What does "AT" means? Why do people keep saying it's a standard?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityOne seldom-appreciated detail about "AT" commands is that many modems would start out in "auto-baud/auto-parity" mode. Initially, the modem would start out not trying to actually decode any serial data, but would simply watch for a consecutive low pulse and high pulse whose widths matched the same valid bit period (e.g. 3.333ms for 300 baud, 833us for 1200 baud, etc.). Upon finding that, they would see if the next low pulse was five times that width. If so, they would watch for either another high-low-high or else for at least 1.5 bit times of high. Finding either of those would indicate that the modem had just seen a 0x41 or 0xC1 (i.e. "A") of the identified baud rate. It would further indicate either the attached computer was using either 8-N-1 or 7-E-1, or that it was using either 7-N-1 or 7-O-1. In either case, it would look for the next character to be either 0x54 or 0xD4 (i.e. "T"). That would allow the modem to further categorize the character length and parity settings.
Note that everything received before the "AT" would be ignored. If echo was turned on, the data would be echoed back to the attached computer simply by mirroring all line transitions without any serial decoding. If a computer sent data prior to the "AT" at e.g. 247 baud, it would be echoed back at that speed.
Nowadays, a few devices use an initial "A" for auto-baud-rate detection, but otherwise the fact that commands start with "AT" is basically a historical curiosity.
It refers to the Hayes command set which has been the standard for a long time for issuing commands to modems (and other equipment) over a serial line.
Instead of the commands and data having two separate lines, only one line is used and to switch into command mode from data a certain sequence is sent, e.g. +++ followed by a set length pause. Then the next data is seen as a command by the receiving equipment.
The reason to use something like this is the fact that it avoids the need for another pair of lines, which in many cases are simply not available, especially in small embedded systems.
Have a look at the Wiki page and the links at the bottom - there is plenty of detail there.
There are all sorts of extensions to the original AT set though, so I wouldn't bank on everything that mentions AT to actually use all the original Hayes commands. For example I have a bluetooth serial chip here which IIRC uses it's own AT type set.
I'm no expert on it though, I just remember hacking around with commands in ye olde days of dial up and BBS.
The "AT" command set was to solve a problem of needing out of band control information over the same byte-stream channel arbitrary data was sent. This was a common problem of modems, back when they were external boxes connected to computers via a serial cable.
Hayes was a manufacturer of such modems, and gained a lot of early popularity. Their solution for the out of band problem was to send the modem mostly two letter ASCII control commands with a special sequence to put it in data pass thru mode. To reduce the likelyhood of random stuff looking like commands, their command sequences all started with the AT command, which stood for "attention".
Hayes gained so much market share that other modem manufacturers had to implement the same command set to be compatible. That way customers could use their modems without having to re-write software, which was already set up to drive a Hayes modem.
Nowadays, this scheme is rarely used but of course something that was so pervasive sticks around in dark corners even today.
There is an especially good document that describes the history of the "AT" commands that can be found here:
http://nemesis.lonestar.org/reference/telecom/modems/at/history.html
It contains many pages of good "history" on how the protocol came about.
I'm not one of those "people in embedded systems" but I'd say that AT
commands are still in use because they come from a well-defined low-overhead standard for in-line signaling.
What that means is that you can use the same communication channel both for signaling (AT commands to manage the communication) and data (actual data you want to send). The AT
standard specifies how to differentiate between the two so you and your serial device don't get confused when talking to each other.
AT
is for ATtention
Well, because it is. I'd say it is actually a mix of de-facto standardization and a couple of "real" standards and some recommendations.
why people in embedded systems use AT commands
- there is nothing embedded-specific about your question or the use of AT on a serial link. It could be that you've seen this on an embedded system, but its origin is explained below and is not specific to embedded systems. (Be careful not to paint things with too broad of a brush.) \$\endgroup\$modemu
: a Unix program that creates a master/slave pseudo-tty device, and simulates a modem which actually goes over telnet. You "dial" a host withATD<hostname>
. The funny thing is that program came out almost exactly at a time when I needed it, around 1996: version 0.0.1. I have not needed it since. And it is still 0.0.1! I used it in conjunction with minicom to do zmodem transfers over telnet to remote hosts that could only be reached that way. \$\endgroup\$