Silicon Laboratories MODEM-DK User Manual

MODEM-DK
EMBEDDED MODEM DEVELOPMENT KIT USERS GUIDE

1. Kit Contents

The Embedded Modem Development Kit contains the following items:
• C8051F120 Target Board
• AB3 Modem Adapter Board
• Si2457FT18-EVB Modem Board
• Silicon Laboratories Integrated Development Environment (IDE)
• Keil Software 8051 Development Tools (evaluation assembler, linker and ‘C’ compiler)
• Source code examples and register definition files
• Documentation
• TCP/IP Configuration Wizard
• Embedded Modem Development Kit User’s Guide (this document)
• AC to DC Power Adapter
• USB Debug Adapter (USB to Debug Interface)
• USB Cable

2. Kit Overview

This Embedded Modem Development kit provides a means to develop real-world embedded modem applications based on the CMX Micronet™ protocol stack running on Silicon Laboratories MCU devices. See application note “AN237: TCP/IP Library Programmer’s Guide” for detailed information about the TCP/IP stack. The kit includes three development boards along with the Silicon Laboratories TCP/IP Configuration Wizard and Integrated Development Environment (IDE) to expedite embedded modem designs. Section 3 takes the designer through an example illustrating each of the steps to create an application using the included software.
A C8051F120 Target Board, an AB3 Modem Adapter board, and a Si2457FT18-EVB Modem Board are included in the Embedded Modem Development kit. These boards are shown in Figure 1. The C8051F120 Target Board is a Silicon Laboratories standard development board featuring the 100 MIPs, 8051-based C8051F120 MCU. The AB3 Modem Adaptor Board connects the C8051F120 board to the Si2457 modem chipset board, the Si2457FT18-EVB.

Figure 1. Embedded Modem Development Kit Hardware Overview

Rev. 0.2 9/06 Copyright © 2006 by Silicon Laboratories MODEM-DK
MODEM-DK

3. Development Kit Embedded Modem Demonstration

The example detailed below describes the steps necessary to run a simple demonstration. This example steps through hardware setup and code configuration using the TCP/IP Configuration Wizard and the Silicon Laboratories IDE to create and debug an example ping application.

3.1. Hardware Setup

Connect the hardware included with the kit according to the instructions listed below. Diagrams of the hardware setup are shown in Figure 2 and Figure 3.
1. Connect the Si2457FT18-EVB Modem Board to the AB3 Modem Adapter Board at JP1 and JP2.
2. Connect the AB3 Modem Adapter Board to the C8051F120 Target Board at J24.
3. Using the ribbon cable, connect the USB Debug Adapter to the C8051F120 Target Board at the JTAG
header.
4. Connect one end of the provided USB cable to any available USB port on the PC.
5. Connect the other end of the USB cable into the USB connector on the USB Debug Adapter.
6. Connect the ac/dc Power Adapter to the C8051F120 Target Board at P1. This connection should power
the boards. Power is indicated by the "PWR" LED.
J8J10 J6
P1.6
J1
J5
J9
J4
P1
RESET
P3.7
JTAG
J24
Port 3Port 6Port 5
RJ11
Si2457FT1-EVB
SW1 SW2 SW3
JP2
Modem Board
JP4
JP1
AB3 Modem Adapter Board
RTS
ESC
LED1
LED2
RXD
DCD
RI
TXD
CTS
Port 4
Pin 2
Pin 1
C8051F120
Target Board
Pin 2
Pin 1
J20
Port 7
Port 0 Port 2
C8051F12x
J11
MONEN
J21
J22
Port 1
J3
J23
Pin 2
Pin 1
PWR

Figure 2. Embedded Modem Demo Board Connections

2 Rev. 0.2
MODEM-DK
Si2457FT1
-EVB
Modem
Board
C8051F120
Target Board
AB3 Modem Adapter Board
JTAG
Ribbon
Cable
AC / DC Adapter
USB
Debug
Adapter
PC
USB
Cable
USB Port

Figure 3. Embedded Modem Demo Debug Connections

3.2. Phone Line Hardware Setup

Connect the phone lines and modems according to the instructions listed below. A diagram of the phone line setup is shown in Figure 4.
1. Connect a phone cable from the target PC and modem to a phone line simulator or a phone line outlet.
2. Connect a phone cable from the AB3 Modem Adapter Board at the RJ11 connector to the phone line
simulator or a phone line outlet.
PC
+
Modem
Connector
Modem
Phone
Cable
Phone Line
Simulator
Or
Phone Line
Outlets
Phone
Cable
Embedded Modem
Development Kit
including
Si2457 ISOModem
Modem Connector
®

Figure 4. Embedded Modem Demo Phone Line Connections

3.3. Software Installation

Install the software included with the Embedded Modem Development kit according to the instructions below.
1. Place the Embedded Modem Development Kit CD-ROM into the PC for application install.
2. An installation dialogue box will appear. Click the Install Development Tools button.
3. Follow the installation prompts to install the development tools. The Silicon Laboratories IDE will be installed by default in the “C:\SiLabs\MCU” directory, the Embedded Modem examples will be installed by default in the “C:\SiLabs\MCU\Examples\Modem” directory, and the TCP/IP Configuration Wizard will be installed by default in the “C:\SiLabs\MCU\TCP-IP Config” directory. In addition, shortcuts to the applica­tions will be placed in the StartPrograms menu.
Rev. 0.2 3
MODEM-DK

3.4. Configuring PC Modem Settings

The target PC and modem must be configured to receive communications from the Si2457 in the Embedded Modem Development Kit. Follow the steps below to configure the PC.
1. Open the Network Connections window. Links can be found in the Start menu or the Control Panel.
2. Select Create a New Connection from the File menu in the Network Connections window.
3. The New Connection Wizard will open. Click the Next button.
4. Select the Set up an advanced connection option. Click the Next button. (This window might appear with all operating systems.)
5. Select the Accept incoming connections option. Click the Next button.
6. The next window should show all of the available devices on the PC. Check the modem that will be used for the demo.
7. The Incoming Virtual Private Network (VPN) Connection window does not require any selections. Click the Next button.
8. Check the User that will be allowed to connect. Take note of the User name and Password that are required for this connection. These will be needed in Section 3.6 (Step 6). Click the Next button.
9. Check the Internet Protocol (TCP/IP) option. Click the Next button.
10. Click the Finish button.

3.5. Creating Initialization Firmware with the TCP/IP Configuration Wizard

The next step is to create TCP/IP initialization firmware for the C8051F120 device. This is done using the TCP/IP Configuration Wizard included with the Embedded Modem Development Kit.
1. To run the program, select TCP/IP Configuration Wizard from the StartSilicon Laboratories menu or run TCPIP_Config.exe located by default in the “C:\SiLabs\MCU\TCP-IP Config” directory.
2. In the Hardware Settings section in the left window, check Si245x.
3. In the Settings section in the right window, select your country from the Country Codes list.
4. In the Settings section in the right window, enter the phone number of the target modem in the Outgoing phone number text box.
5. In the Protocol SettingsLink/Physical Layer section in the left window, check PPP and PAP. No PPP or PAP setting changes are required for this demonstration.
6. In the Protocol SettingsTransport Layer section in the left window, check UDP.
7. Next, to create the firmware and project select Generate Project from the File menu.
8. When prompted for a folder to save the project, browse to the “C:\SiLabs\MCU\Examples\Modem\Demo” directory. Click the OK button.
9. Click the OK button when the the “Project generated successfully” message appears.
10. Close the TCP/IP Configuration Wizard.
4 Rev. 0.2
MODEM-DK

3.6. Configuring the Firmware with the IDE

The next step is to customize the firmware created by the TCP/IP Configuration Wizard. This is done using the Silicon Laboratories IDE included with the Embedded Modem Development Kit.
1. To run the IDE, select Silicon Laboratories IDE from the StartSilicon Laboratories menu or run IDE.exe located by default in the “C:\SiLabs\MCU” directory.
2. Select ProjectOpen Project to open the Open Workspace window. Browse to the project file created in Section 3.5 located in the “C:\SiLabs\MCU\Examples\Modem\Demo” directory. Select TCPIP_Project.wsp, and click the Open button.
3. Next, the file containing the Demo function must be added to the project. Right click on the Source Files file group in the Project Workspace window, and select Add file to group Source Files. Browse to the “C:\SiLabs\MCU\Examples\Modem\Demo” directory. Select demo.c and click the Open button.
4. In the Project Workspace window, right click on demo.c, and select Add demo.c to build.
5. Next, the main() function needs to be edited to call the function in demo.c. Open main.c and add DEMO(); to the line above the final while(1); statement. After making the edit, Save and close main.c. The main function is listed below.
//-----------------------------------------------------------------------------­// Main Routine //-----------------------------------------------------------------------------­void main (void) {
PSOCKET_INFO socket_ptr;
// Disable watchdog timer WDTCN = 0xde; WDTCN = 0xad;
// Initialize the MCU PORT_Init (); SYSCLK_Init();
// Initialize the TCP/IP stack if (mn_init() < 0) {
// If code execution enters this while(1) loop, the stack failed to initialize. // Verify that all boards are connected and powered properly. while(1);
}
DEMO();
while(1);
}
6. Next, the DEMO() function needs to be edited to include the correct connection information for the target modem. Open demo.c and edit the following lines using the User name and Password from Section 3.4, Step 8.
char pap_user[] = "user"; char pap_pwd[] = "password";
Rev. 0.2 5
MODEM-DK

3.7. Running the Embedded Modem Demo

Once all the changes have been made to the firmware, the project must be built, downloaded to the C8051F120 device, and then run. Follow the instructions below to perform these steps.
1. Build the project by clicking on the Build/Make Project button in the toolbar or selecting Project Build/Make Project from the menu.
2. Click the
3. Download the project to the target by clicking the Download Code button in the toolbar.
4. Run the demo by clicking the Go button in the toolbar
5. To test the connection, the IP Address assigned to the Embedded Modem kit must be retrieved.
a. Open the Network Connections window from the Control Panel.
b. Wait for the connection to be established. When the connection is complete a Network status icon will appear in
c. Double click on the User name connection to open the Connection Status window.
d. Select the Details tab and take note of the Client IP Address shown.
6. Open a Windows Command Prompt window to perform a ping test to verify that the Si2457 modem was successfully able to connect to the target modem
7. Using the IP Address from step 5, type the following in the Command Prompt window: ping IP Address
8. If the communication was successful “Reply” messages will appear. If the communication was NOT suc­cessful “Request Timed Out” messages will appear.
Connect
the system tray. Additionally, the connection, titled with the User name, will appear in the Network Connections window.
button in the toolbar or select
Debug→Connect
or selecting
from the menu to connect to the device.
Debug→Go
from the menu.

3.8. Troubleshooting

If the modems are unable to establish a connection, verify the following:
1. The pap_user and pap_pwd variables in demo.c correspond to the User name and Password of one of the users who is allowed to connect to the incoming connection.
2. It is possible that there is no DHCP server to allocate an IP address. From the Network Connections win­dow, open up the connection and go to the Networking tab. Highlight Internet Protocol (TCP/IP) and click the Properties button. Under "TCP/IP address assignment," select "Specifiy TCP/IP addresses" and specify a range of IP addresses that is valid on your network in the "From:" and "To:" dialog boxes.
6 Rev. 0.2
MODEM-DK

4. Software Setup

The included CD-ROM contains the Silicon Laboratories IDE, Keil software 8051 tools, and additional documentation. Insert the CD-ROM into your PC’s CD-ROM drive. An installer will automatically launch, allowing you to install the IDE software or read documentation by clicking buttons on the Installation Panel. If the installer does not automatically start when you insert the CD-ROM, run autorun.exe found in the root directory of the CD­ROM. Refer to the readme.txt file on the CD-ROM for the latest information regarding known IDE problems and restrictions.

5. Silicon Laboratories IDE (Integrated Development Environment)

The Silicon Laboratories IDE integrates a source-code editor, source-level debugger and in-system Flash programmer. The use of third-party compilers and assemblers is also supported. This development kit includes the Keil Software A51 macro assembler, BL51 linker and evaluation version C51 ‘C’ compiler. These tools can be used from within the Silicon Laboratories IDE.

5.1. System Requirements

The Silicon Laboratories IDE requirements:
• Pentium-class host PC running Microsoft Windows 95 or later, or Microsoft Windows NT or later.
• One available USB port.
• 64 MB RAM and 40 MB free HD space recommended.

5.2. Assembler and Linker

A full-version Keil A51 macro assembler and BL51 banking linker are included with the development kit and are installed during IDE installation. The complete assembler and linker reference manual can be found on-line under the Help menu in the IDE or in the “SiLabs\MCU\hlp” directory (A51.pdf).

5.3. Evaluation C51 ‘C’ Compiler

An evaluation version of the Keil C51 ‘C’ compiler is included with the development kit and is installed during IDE installation. The evaluation version of the C51 compiler is the same as the full professional version except code size is limited to 4 kB and the floating point library is not included. Additionally, support is included for importing TCP/IP Library object code. The C51 compiler reference manual can be found under the Help menu in the IDE or in the “SiLabs\MCU\hlp” directory (C51.pdf).

5.4. Using the Keil Software 8051 Tools with the Silicon Laboratories IDE

To perform source-level debugging with the IDE, you must configure the Keil 8051 tools to generate an absolute object file in the OMF-51 format with object extensions and debug records enabled. You may build the OMF-51 absolute object file by calling the Keil 8051 tools at the command line (e.g., batch file or make file) or by using the project manager built into the IDE. The default configuration when using the Silicon Laboratories IDE project manager enables object extension and debug record generation. 8051 Tools Into the Silicon Labs IDE” additional information on using the Keil 8051 tools with the Silicon Laboratories IDE.
To build an absolute object file using the Silicon Laboratories IDE project manager, you must first create a project. A project consists of a set of files, IDE configuration, debug views, and a target build configuration (list of files and tool configurations used as input to the assembler, compiler, and linker when building an output object file).
The following sections illustrate the steps necessary to manually create a project with one or more source files, build a program and download the program to the target in preparation for debugging. (The IDE will automatically create a single-file project using the currently open and active source file if you select Build/Make Project before a project is defined.)
in the “SiLabs\MCU\Documentation\Appnotes” directory on the CD-ROM for
Refer to application note “AN104:
Integrating Keil
Rev. 0.2 7
MODEM-DK

5.4.1. Creating a New Project

1. Select ProjectNew Project to open a new project and reset all configuration settings to default.
2. Select FileNew File to open an editor window. Create your source file(s) and save the file(s) with a rec­ognized extension, such as .c, .h, or .asm, to enable color syntax highlighting.
3. Right-click on “New Project” in the Project Window. Select Add files to project. Select files in the file browser and click Open. Continue adding files until all project files have been added.
4. For each of the files in the build, right-click on the file name and select appropriate (based on file extension) and linked into the build of the absolute object file.
Note:
If a project contains a large number of files, the “Group” feature of the IDE can be used to organize. Right-click on “New Project” in the groups or add customized groups. Right-click on the group name and choose to be added. Continue adding files until all project files have been added.

5.4.2. Building and Downloading the Program for Debugging

1. Once all source files have been added to the target build, build the project by clicking on the Build/Make Project button in the toolbar or selecting ProjectBuild/Make Project from the menu.
Note: After the project has been built the first time, the Build/Make Project command will only build the
files that have been changed since the previous build. To rebuild all files and project dependencies, click on the Rebuild All button in the toolbar or select ProjectRebuild All from the menu.
2.
Before connecting to the target device, several connection options may need to be set.
Connection Options
the appropriate adapter in the “Serial Adapter” section. Next, the correct “Debug Interface” must be selected. C8051F12x button to close the window.
3. Click the
4. Download the project to the target by clicking the Download Code button in the toolbar.
Note: To enable automatic downloading if the program build is successful select Enable automatic con- nect/download after build in the ProjectTarget Build Configuration dialog. If errors occur during the
build process, the IDE will not attempt the download.
family devices use the JTAG debug interface. Once all the selections are made, click the
Connect
button in the toolbar or select
Project Window
Project Window
window by selecting
that you want assembled, compiled, and linked into the target
Add file to build
. Select
Options→Connection Options...
Debug→Connect
. Each file will be assembled or compiled as
Add Groups to project
from the menu to connect to the device.
. Add pre-defined
Add file to group
in the IDE menu. First, select
. Select files
Open the
OK
5. Save the project when finished with the debug session to preserve the current target build configuration, editor settings and the location of all open debug views. To save the project, select ProjectSave Project
As... from the menu. Create a new name for the project and click on Save.
8 Rev. 0.2
MODEM-DK

6. Example Source Code

Example source code, libraries, and register definition files are provided in the “SiLabs\MCU\Examples\Modem” directory during IDE installation. These files may be used as a template for code development. Example applications include an HTTP web server, SMTP mail client, TCP echo client/server, and UDP echo client/server. See "Appendix A—Protocols Supported by the TCP/IP Configuration Wizard" on page 24 for a short description of each protocol supported by the TCP/IP Configuration Wizard. Each of these examples were created using the TCP/IP Configuration Wizard.

6.1. HTTP Web Server

The example project HTTP.wsp, located by default in the “SiLabs\MCU\Examples\Modem\HTTP” directory, configures the embedded modem to act as an HTTP web server. The modem places an outgoing call and establishes a PPP connection with the PC. The number that the modem dials is defined as MODEM_DIAL in mn_userconst.h. The number must be in the format “ATDT#\r” (where ‘#’ is the phone number of the PC’s modem with no spaces or dashes). The PC must be configured to accept incoming connections (See "Appendix B— Connecting the Embedded Modem to a PC" on page 25). The user can specify the modem’s IP address (IP_SRC_ADDR in mn_userconst.h) or the PC can be configured to assign an IP address to the modem. To establish a PPP connection, the variables pap_user and pap_pwd in main.c must match the username and password of one of the user profiles on the PC. Once the PPP connection has been established, the user can type “http:\\XXX.XXX.XXX.XXX” (where XXX.XXX.XXX.XXX is the IP address of the modem) into a web browser to view a “Hello World” HTML document served by the embedded modem.
Note: HTML files can be converted to C files using the HTML2C.exe utility located by default in the “SiLabs\MCU\Utilities\HTML2C” directory.

6.2. SMTP Mail Client

The example project SMTP.wsp, located by default in the “SiLabs\MCU\Examples\Modem\SMTP” directory, configures the embedded modem to act as an SMTP mail client. The modem places an outgoing call and establishes a PPP connection with the PC. The number that the modem dials is defined as MODEM_DIAL in mn_userconst.h. The number must be in the format “ATDT#\r” (where ‘#’ is the phone number of the PC’s modem with no spaces or dashes). The PC must be configured to accept incoming connections (See "Appendix B— Connecting the Embedded Modem to a PC" on page 25). The user can specify the modem’s IP address (IP_SRC_ADDR in mn_userconst.h) or the PC can be configured to assign an IP address to the modem. To establish a PPP connection, the variables pap_user and pap_pwd in main.c must match the username and password of one of the user profiles on the PC. Once the PPP connection is established, the modem will send two emails to the SMTP server at the address defined by IP_SMTP_ADDR in mn_userconst.h. The SMTP server will then forward those emails to the email address defined by the variable to[] in main.c. One email has a text file attached, and the other has no attachments.

6.3. TCP Echo Client/Server

The example project TCP.wsp, located by default in the “SiLabs\MCU\Examples\Modem\TCP\firmware” directory, configures the embedded modem to act as either a TCP echo client or a TCP echo server. To place the modem in server mode, change the value of variable SERVER_MODE to 1 in main.c. To place it in client mode, change SERVER_MODE to 0. The user can specify the modem’s IP address (IP_SRC_ADDR in mn_userconst.h) or the PC can be configured to assign an IP address to the modem. To establish a PPP connection, the variables pap_user and pap_pwd in main.c must match the username and password of one of the user profiles on the PC.
Rev. 0.2 9
Loading...
+ 19 hidden pages