Serial Port Complete - Latest Microcontroller projects

(lily) #1

Chapter 2


  " 3
  


An application-specific protocol can define the contents of the data being trans-
mitted and might also specify lower-level parameters such bit rate and number
of data bits. The protocol can be a defined industry standard or a vendor-spe-
cific protocol. Two examples of industry-standard protocols are the “AT” com-
mands and related protocols for modems and the NMEA 0183 protocol for
global positioning systems.



One way computers access the outside world is via modems that connect to the
phone system. A phone modem converts digital data transmitted by a computer
to an analog signal for transmitting on the phone line. In the other direction,
the modem convert’s the phone line’s analog signal to digital data to send to the
computer. Older modems connected to RS-232 serial ports on PCs, while
recent modems typically reside on the system bus. Embedded systems can
incorporate modems or access external modems.
For communicating with computers, many modems support a protocol
descended from the “AT” command set and related protocols first defined by
modem manufacturer Hayes Microcomputer Products, Inc. A specification that
documents the commands and protocols is V.250 from the International Tele-
communication Union (www.itu.int).
The AT commands are plain text. Most begin with the letters “AT”. A com-
puter can use the commands to communicate with a modem. For example, in
this command:
ATDT5552468
“AT” begins the command, “D” means dial, “T” means use touch tones to dial,
and “5552468” is the number to dial. The command ends in a CR.
This command requests the modem to echo everything the modem transmits
back to the transmitting computer:
ATE1
This command turns echoing off:
ATE0
Modems that support AT commands have two operating modes. In command
mode, the modem responds to received commands. In data mode, the modem
transmits and receives data over the phone lines. To switch from data mode to
command mode, a computer sends an escape sequence. The sequence is typi-
Free download pdf