Silicon Laboratories Ethernet-DK User Manual

Ethernet-DK
EMBEDDED ETHERNET DEVELOPMENT KIT USERS GUIDE

1. Overview

The Embedded Ethernet Development Kit (Ethernet-DK) provides all the hardware and software required to develop real-world embedded Ethernet applications using the industry proven CMX Micronet™ protocol stack and high-performance Silicon Laboratories microcontrollers. The TCP/IP protocol stack is developed specifically for embedded processors and is freely distributed in an easy-to-use library. A TCP/IP Configuration Wizard is provided to generate a highly customized library optimized for user selected protocols. It also generates the framework code required to use the library and a project file that can be managed in the Silicon Laboratories Integrated Development Environment (IDE). Additional information about the TCP/IP library and Configuration Wizard, including a detailed API description, can be found in application note “AN237: TCP/IP Library Programmer’s Guide”.
The Embedded Ethernet Development Kit hardware includes a C8051F120 Target Board, AB4 Ethernet Development Board, USB Debug Adapter, and all necessary cables to debug the MCU and connect it to an Ethernet network. The C8051F120 Target Board features the 100 MIPS, 128 kB Flash, 8 kB RAM, 8051-based C8051F120 MCU. The MCU network interface provided by the AB4 board consists of the CP2200 Ethernet controller and an RJ-45 connector with integrated magnetics and LEDs. The TCP/IP Library includes a built-in driver for the CP2200 and has a custom driver interface with auto-generated templates to allow drivers for any Ethernet controller to be written.
The Silicon Labs IDE supports full-speed, non-intrusive MCU debugging and is bundled with an evaluation version of the Keil C51 Toolchain allowing immediate application code evaluation in C. Projects with up to 4 kB of object code and unlimited library code can be developed using the included toolset. Numerous application code examples are included in the development kit and a walkthrough of an embedded web server demo is included in Section 6 on page 8.

Figure 1. C8051F120TB Target Board and AB4 Ethernet Development Board

Rev. 0.5 6/06 Copyright © 2006 by Silicon Laboratories Ethernet-DK
Ethernet-DK

2. Kit Contents

The Embedded Ethernet Development Kit contains the following items:
C8051F120 Target BoardAB4 Ethernet Development BoardCAT5e Ethernet CableSilicon Laboratories Evaluation Kit IDE and Product Information CD-ROM. CD content includes the
following:
Silicon Laboratories Integrated Development Environment (IDE)Keil C51 Evaluation Toolchain (assembler, linker and C compiler with 4 kB object code generation and
unlimited library code usage)
Source code examples and register definition filesDocumentationTCP/IP Configuration WizardEmbedded Ethernet Development Kit User’s Guide (this document)
Universal (100–240 V, 50–60 Hz) AC to DC Power AdapterUSB Debug Adapter (USB to JTAG/C2 Debug Interface)USB CableSerial Cable
2 Rev. 0.5
Ethernet-DK

3. Hardware Setup

The following instructions illustrate how to setup the hardware included with the kit.
1. Connect the AB4 Ethernet Development Board to the C8051F120 Target Board at J24 (Figure 2). Apply
slight pressure to ensure the mating 96-pin connectors are firmly connected.
2. Using the ribbon cable, connect the USB Debug Adapter to the C8051F120 Target Board at the JTAG
header.
3. Connect one end of the provided USB cable to any available USB port on the PC.
4. Connect the other end of the USB cable into the USB connector on the USB Debug Adapter.
5. Connect the ac/dc Power Adapter to the C8051F120 Target Board at P1. This connection should power
both boards. Power is indicated by the "PWR" LED.
Note: The 'F120TB places a 2 Ω resistor in series with the power supply net powering the AB4 Board. We recom-
mend replacing this resistor with a 0 resistor to prevent large voltage drops, possibly triggering a V Monitor reset, when current demand increases.
DD
AB4 Ethernet Development
Board
RJ45
Prototyping
Area
LED1 LED2
SW2 SW1
AB4 Ethernet Development
Board
J24
Port 3Port 6Port 5
CP2200
J4
J3 J5
J6
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 Ethernet Development Board Attachment

Ribbon
C8051F120
Target Board
Cable
JTAG
USB
Debug
Adapter
J8J10 J6
P1.6
J1
R1
USB
Cable
J5
J9
J4
P1
PC
USB Port
RESET
P3.7
JTAG
AC / DC Adapter

Figure 3. Embedded Ethernet Development Kit Debug Connections

Rev. 0.5 3
Ethernet-DK

4. Network Setup

The Embedded Ethernet Development Kit can be connected to an Ethernet network using a standard Ethernet cable (see Figure 4) or directly to a PC using a crossover cable (see Figure 5). Table 1 describes the benefits of using each of the connection methods. A standard Ethernet cable is included in the kit and crossover cables are available for order from the Silicon Laboratories website, at www.silabs.com.

Table 1. Ethernet Cable Comparison

Standard Cable Crossover Cable
Remote access to embedded system. Distance from PC to embedded system is limited by
the length of the cable.
Multiple embedded systems may be networked and accessed from the same (or multiple) PC(s).
Shared communication medium. System may experi­ence packet delays under heavy network traffic. This
Only a single embedded system may be accessed from a single PC.
Dedicated channel bandwidth. Good for achieving consistent data throughput measurements.
effect is greatly reduced if using a switched network.
An existing network with wall outlet or a router/switch is
No additional hardware required.
required.
PC does not require any additional IP address configura­tion.
PC must be configured with a static IP address in order to recognize embedded system.
Standard cable is included in development kit. Crossover cable must be purchased separately.
Embedded Ethernet
Development Kit
‘F120TB + AB4
Ethernet Connector
PC
Ethernet
Connector
Ethernet
Cable
Ethernet
Router/
Switch
Or
Wall Outlet
Ethernet
Cable

Figure 4. Embedded Ethernet Network Connection (Standard Cable)

PC
Ethernet Crossover Cable
Ethernet
Connector

Figure 5. Embedded Ethernet Network Connection (Crossover Cable)

4 Rev. 0.5
Embedded Ethernet
Development Kit
‘F120TB + AB4
Ethernet Connector
Ethernet-DK

4.1. Network Setup Procedure

If using a standard cable:
1. Connect the AB4 Ethernet Development Board to an Ethernet wall outlet or to a router/switch using a
standard Ethernet cable.
2. Connect a PC to the same Ethernet network using a standard Ethernet cable.
If using a crossover cable:
1. Connect the AB4 Ethernet Development Board directly to a PC using an Ethernet crossover cable.
2. Configure the PC to have a static IP address. The steps below show how to configure a Windows PC to use
a static IP address.
a. Open the Network Connections Folder. This is accessible from the control panel or from the start menu by right-
clicking on My Network Places and selecting Properties.
b. Right-click on the Local Area Connection and select Properties.
c. Select Internet Protocol (TCP/IP) and click Properties. Optionally, if the Show icon in notification area when connected
is checked, right-clicking the system tray icon will provide a quick shortcut to the LAN properties dialog and can be used as an indicator that the network is functioning properly.
d. Select Use the following IP address and specify an IP address and subnet mask for the PC. For a subnet mask of
255.255.255.0, the embedded system’s IP address must match the first three octets of the PC’s IP address for the PC to recognize the embedded system. See Section 4.2 for additional information about choosing the embedded system’s IP address. Note: When entering an IP or subnet address into the dialog box, the cursor will automatically advance to the next field for a three digit octet. If entering a one or two digit octet, the spacebar, right arrow key, or ‘.’ can be pressed to advance to the next field.
e. Click OK after the static IP address and subnet mask have been configured. The PC will now be able to access the
embedded system using a crossover cable.
Rev. 0.5 5
Ethernet-DK

4.2. Selecting an IP Address for the Embedded System

For a PC to recognize an embedded system on a network, its IP address and subnet mask need to be configured. Below are a few guidelines to follow when choosing an IP address for the embedded system. Figure 6 shows an example of a compatible PC and embedded system IP address combination.
1. Find the IP address and Subnet mask for the PC. If a Default Gateway is specified, then save this address for later use. If you are using a crossover cable, you may choose any IP address for your PC as long as the Subnet mask allows it to recognize the embedded system.
2. The IP address chosen for the embedded system must match the PC’s IP address in all bit locations where the Subnet mask is a 1 in order for the PC to recognize the embedded system. Otherwise, the PC will send it’s request outside the local network.
3. Do not duplicate IP addresses or select a broadcast address. An IP address is considered a broadcast address if all bits which are 0 in the Subnet mask are 1 in the IP address. Broadcast addresses with additional 1s such as 10.10.255.255 (Figure 6) can be broadcast to nodes outside the local network.
4. The address 255.255.255.255 is known as the Ethernet broadcast address and is used when the Subnet mask for the network is not known. Any packet transmitted to this address will reach all nodes on the local network but cannot go further than the nearest router.

4.3. IP Address Selection Example

The example in Figure 6 shows the IP address and subnet mask of the PC we want to connect to the embedded system. Since the first 24 bits of the subnet mask are 1, the first 24 bits of the embedded web server’s IP address (shown in bold) must match the PC’s IP address. Only the least significant 8 bits may vary making the valid range of IP addresses for the embedded web server 10.10.10.0 to 10.10.10.254 with the exception of 10.10.10.80 since this address is already taken by the PC. 10.10.10.255 is reserved because it is the broadcast address for this network.
PC IP Address
PC Subnet Mask
10 10 10 80
0000 1010 0000 1010 0000 1010 0101 0000
255 255 255 0
1111 1111 1111 1111 1111 1111 0000 0000
Embedded Web Server IP Address
10
10
0000 1010 0000 1010 0000 1010
163
10
1010 0011
(decimal)
(binary)
(decimal)
(binary)
(decimal)
(binary)

Figure 6. IP Address Selection Example

6 Rev. 0.5
Ethernet-DK

5. Software Setup

The included CD-ROM contains the Silicon Laboratories IDE, Keil C51 toolset, and documentation including datasheets, application notes, and an electronic version of this user’s guide. The instructions below describe how to install the Embedded Ethernet Development Kit software. Refer to the readme.txt file on the CD-ROM for the IDE release notes containing the latest information regarding supported devices, revision history, and known issues.
1. Place the Embedded Ethernet Development Kit CD-ROM into the 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.
2. After the installation dialogue box appears, click the Install Development Tools button.
3. Follow the installation prompts to install the development tools. The following applications will be installed:
The Silicon Laboratories IDE will be installed by default in the “C:\SiLabs\MCU” directory.The Embedded Ethernet examples will be installed by default in the
C:\SiLabs\MCU\Examples\C8051F12x\Ethernet” directory.
The TCP/IP Configuration Wizard will be installed by default in the “C:\SiLabs\MCU\TCP-IP Config”
directory.
Shortcuts to the applications will be placed in the StartPrograms menu.
Rev. 0.5 7
Ethernet-DK

6. Embedded Ethernet Tutorial

Now that the Embedded Ethernet Development Kit hardware has been set up, the software installed, and the embedded system connected to a network, it is time to download firmware into the MCU and test its network connectivity. The Embedded Ethernet Tutorial consists of four stages of increasing functionality and will allow the user to quickly learn how to use the development kit hardware and software.
6.1. Stage 1—Basic Web Server
In the first demo stage, we will generate a “Hello World” web server with a single static web page using the TCP/IP Configuration Wizard. We will learn how to PING the embedded web server and view the page in a web browser.

6.1.1. Generating a Project using the TCP/IP Configuration Wizard

The instructions below show how to generate a new project using the TCP/IP Configuration Wizard.
1. From the Windows Start menu, start the TCP/IP Configuration Wizard. The shortcut will be under the
StartSilicon Laboratories menu. Alternatively, the Configuration Wizard can be started by double-clicking TCPIP_Config.exe located by default in the “C:\SiLabs\MCU\TCP-IP Config” directory.
2. In the Communications Adapter section of the left window, check CP2200.
3. In the Device section of the left window, verify that C8051F12x is selected.
4. In the Protocol Settings section of the left window, make sure Ethernet is selected then check HTTP. The lower level protocols required to run HTTP (e.g., TCP) will automatically be enabled (see Figure 7).

Figure 7. TCP/IP Configuration Wizard Protocol Selection

8 Rev. 0.5
Ethernet-DK
5. In the System Settings section of the left window, select IP Addresses.
6. In the right window, set the Source IP Address to the IP address of the embedded system.
7. If the Gateway IP Address and Subnet mask of the network are known, then fill in the addresses on the right window (see Figure 8).
8. If using the CP2200, the MAC address field is ignored. The CP2200 Ethernet Controller contains a unique factory-programmed MAC address stored in Flash memory.

Figure 8. TCP/IP Configuration Wizard IP Address Specification

Rev. 0.5 9
Ethernet-DK
9. Save the selected configuration using the FileSave As menu.
10. Generate a new project with supporting firmware by selecting Generate Project from the File menu (see Figure 9).
11. When prompted for a folder to save the project, browse to an empty directory or create a new directory. Note: Any files in the selected directory will be overwritten. Click the OK button.
12. Click the OK button when the “Project generated successfully” message appears.
13. Close the TCP/IP Configuration Wizard.

Figure 9. TCP/IP Configuration Wizard Project Generation

10 Rev. 0.5
Ethernet-DK

6.1.2. Programming the MCU

We will now build the project created by the TCP/IP Configuration Wizard and download the firmware to the MCU using the Silicon Laboratories IDE.
1. From the Windows Start menu, start the Silicon Laboratories IDE. The shortcut will be under the
StartSilicon Laboratories menu. Alternatively, the Silicon Labs IDE can be started by double-clicking IDE.exe located by default in the “C:\SiLabs\MCU” directory.
2. After the splash screen disappears, open the generated project using the ProjectOpen Project menu command. Browse to the directory where the TCP/IP project was generated. Select TCPIP_Project.wsp, and click the Open button.
Note: An example project is available by default in the “C:\Silabs\MCU\Examples\C8051F12x\Ethernet\HTTP\web-server-1” directory. This project is identical to the one generated in the previous steps.

Figure 10. Opening a Project in the Silicon Labs IDE

3. If you would like to view the source code, double-click on main.c on the left hand side of the screen. Source code modification is not required to run this demo.
4. Build the project. This can be done by clicking on the Build/Make Project button in the toolbar, selecting ProjectBuild/Make Project from the menu, or pressing the F7 shortcut key.
5. Click
6. Download the project to the target by clicking the Download Code button in the toolbar.
7. Run the demo by clicking the Go button in the toolbar (
.
the
Connect
Note: If you receive the error message “Communication could not be established with the specified serial
adapter”, open the Connection Options Dialog by selecting Verify that the
pressing the shortcut key
button in the toolbar or select
USB Debug Adapter
F5
.
is selected and that the debug interface is set to
Debug→Connect
Options→Connection Options
see Figure 11), selecting
from the menu
Debug→Go
.
from the menu.
JTAG.
from the menu, or

Figure 11. Running the Demo in the Silicon Labs IDE

Rev. 0.5 11
Loading...
+ 23 hidden pages