Common Modem Design Pitfalls
Floyd Kling
GENERAL
Here is a
list
of common questions/pitfalls you may
encounter when embedding a modem module.
This covers the communications with the
modem and some hardware issues. This
is work in progress and I will try to update
periodically.
Let me know what you think...
-
Disclaimer.
The information herein is intended for
designers that are integrating embedded
modems into their product. Please use
this prudently. It is for your
reference only, it is not gospel.
Embedded modem modules vary by design and
manufacturer. Always discuss any
design or operational issues with your modem
module supplier.
-
- 1.
The (in)famous Setup String and use of a
NVRAM
-
-
Setup String:
- By
far, the most common problems I have
encountered is related to the improper
use of the setup string. Modems
are manufactured ready to function,
meaning in most cases, you will have the
best results by simply using the
factory default AT commands and
S-Registers.
-
- I
suggest the following:
-
- When
originating or setting up for answer,
always begin by setting the AT commands
and S-Registers to known
state...(factory defaults).... the &F <probably your most important
command> will recall factory defaults...
the &W and &W1 are recall registers you
will not normally use but for good
housekeeping you can clean them up also:
-
-
send: AT&F&W&W1<cr>
; sets all registers to factory
default and stores to W0 and W1
-
waitfor: OK<cr><lf>
; confirmation
-
send: AT{your setup sting}<cr>
;
Waitfor: OK<cr><lf>
; confirmation
.......Begin your procedure... i.e.
dial or wait for incoming call
-
-
Should I use the modem's on-board NVRAM?
- NO -
and why would you? This
goes hand in hand with the Setup String.
Some modems come with an on board NVRAM.
Primarily, it is for the convenience of
your storing the setup string that may
be recalled when you want to setup for
dialing or answer... While attractive,
it is an easy trap.
-
Avoid using the modem's NVRAM for
storing options.
-
You really do not need (nor should) use
the modem's NVRAM. Better way is
to store your modem setup strings in
your host processor - you will have full
control. Simply load the setup
strings when you begin and end every
session... meaning, just before every
dial, and after every disconnect
or reset, when
preparing to wait for an answer
(incoming ring). Your system will
be more reliable<stable>.
-
-
Why...?, when you simply add your setup
string without pre-setting to factory
default first, you are assuming
you know the previous settings of all
the registers... NOT!!!
-
-
- 2.
Flow Control
-
Determines the method of controlling the
flow of data between the Local PC and
the Local modem.
In most
applications, the speed between the PC
and the modem (DTE Speed) is different
than actual connected speed between the
modem (DCE Speed). If the DCE
speed is slower, (and usually is the
case) the data will be sent into the
modem faster than the modem can send it
to the remote modem. In these cases, the
Local Modem must tell the Local PC to
stop sending data until the modems
buffer can empty. When the buffer
is almost full, the modem will send an
Xoff (or turn OFF CTS) telling the Local
PC to stop sending data. When the local
modems buffer is empty again, the local
modem will then send an Xon (or turn ON
CTS)
My
suggestion: In most cases you should
run your DTE, <port> speed to the modem
at 57600bps or maybe 115200bps.
This will ensure you have optimized the
throughput. You MUST run proper
flow control.
|