Setup


Software should provide some modem setup. The software can be written to retrieve modem configuration from a stored profile recalled on reset, or by DIP switches set for the product. Unique settings must be set up prior to running the software, before the program sends a Zn - Perform Soft Reset command to recall a stored profile. Software assumes the modem is in the power-up state. Unless the software is used in a predictable environment, these assumptions may result in failures with the controller software.

Some commands are always overridden by the controller to ensure proper functioning. Other command options should either default to the factory setting, or act as the transfer agent for the commands. You can provide menus and dialogs to prompt the user for specific activities; the program can then interpret these requests and configure the modem accordingly. The program should also allow the user to enter AT command strings.

Commands frequently set by a modem controller include:
E0         Turns off echo mode to avoid having command echoes pass through   

           the result code scanner.                                           

                                                                             

&F      Recalls the factory profile.                                      

                                                                             

Q1         Enables result codes to ensure that commands are being processed, 

           and to synchronize with the modem command processor (except for    

           synchronous communications where result codes may cause the DTE    

           confusion).                                                        

                                                                             

V0 or V1   Uses either numeric result codes or verbose (recommended) result  

           codes.                                                             

                                                                             

S0=0       Disables auto-answer in setup process to avoid disruption by      

           incoming calls.                                                    

                                                                             

H0         Ensures modem is on hook before continuing to the answer or       

           originate process.                                                 

                                                                             

S12=10     Sets the escape sequence guard time to 200 ms to speed up the     

           escape for hang-up process. This also reduces the probability of   

           inadvertent user escapes.                                          

                                                                             

S2=*       Changes the escape sequence character for two reasons: To avoid   

           inadvertent user escapes, and to provide different escape sequence 

           characters for answer and originate ends. This prevents inadvertent 

           escaping when data is echoed.                                      

                                                                             

S4=*       Modifies the linefeed character to make the <CR><LF>NO    

           CARRIER<CR><LF>result code unique if you scan for it to   

           detect carrier loss.                                               

                                                                             

S95=60     Enables the result codes which provide the maximum amount of      

           information about the connection when it is established.           

                                                                             
Two typical setup sequences using these recommendations follow:

Software design based on using pre-existing user settings:

AT E Q V S0=0 H S12=10 S2=28 S4=31 S95=60 <CR>

Software design based on starting from a known factory setting:

AT &F S2=28 S4=31 S12=10 S95=60

Note: Where the zero suffix is used, it may be omitted from a command. Spaces are shown above for readability, but using spaces between commands is not recommended.

After sending the setup command, and receiving the OK response, the controller continues to originate or answer processing.

If additional setup strings include user-programmed settings or the user is permitted to enter AT setup strings, the software should anticipate ERROR result codes. If an ERROR is returned for a command, the result does not have to be reported to the user, but the controller should not be prevented from continuing. A connection can be made even though some setting is in error or is inappropriate for the class of modem being addressed.

Click here to return to the Contents page.