Home
Silicon Laboratories Ethernet-DK User's Manual
Contents
1. KI f 5 J gt J J i EEE AA ui 4 z p Fi te gt H E HSBE HE ir gt io The mie UC III Fre See I z 2 eee pie ya 3 a oma i 5 T AM AM As i THES me Wis g 38 Y am i as 32779 se ji D SE D ye ee ay 2 BE He H a FER s mie TRS THs z I f LL ji 33383 33388 33383 p J S353 gg gg 3 L lij 8 Hg 3 ee Ii ve sk H O A OL 2 23 UUB KUA iie 33 3 i z aA SA a E E yA OO ae fae a yo ao oO a 2 MANANE ee ee fF a ne a 4 812 124 81 324 86 324 88 324 81 2 J24 823 DO 24 824 TDI 124 827 L PH 825 324 826 yA yA yA a ya 2900 VDD Decoupling AN 7 CD Coens Gena Gea Gen Gam Sor Per 5 24 81 324 16 324 48 Z i 32 Rev 0 6 SILICON LABS Ethernet DK 9 AB4 Ethernet Development Board The Embedded Ethernet Development Kit includes the AB4 Ethernet Development Board designed to connect the C8051F120 or C8051F340 C8051F020 C8051F040 or C8051F060 target board to an ethernet network The ethernet controller used is the CP 2200 Refer to Figure 29 for the locations of the various I O connectors P1 96 pin Expansion I O connector U1 CP2200 Ethernet Controller J1 RJ 45 Ethernet Connector Swi SW2 Input Switches LED1 LED2 Output LEDs J4 Disconnects SW2 from P1 J3 Disconnects SW1 from P1 J5 Disconnects LED1 from P1 J6 Disconnects LE
2. 12 Rev 0 6 SILICON LABS Ethernet DK 5 Verify the Compiler and Linker tabs are pointing to the C51 exe compiler and BL51 exe linker files in C Keil C51 BIN in the Executable field 6 Press the Compiler tab s Customize button Under the Variable Location drop down box select Large aoe ooo r Tool Definition Presets Preset Name Keten AY Save As Save Rename Delete Keep current command line flags r Tool Definition Keil Assembler Compiler Linker Executable C Keil C51 BIN C51 exe Browse Command line flags DB OE BR INCDIR C KeilS C51 SINC Customize a This tool vendor requires a command line flag to specify include file directories Add Include WA Press the Add Include Path Flag button to automatically add the default directory paths Path Flag Caneel _ XDATA and press OK Then press OK to close the Tool Chain Integration dialog 7 Build the project This can be done by clicking on the Build Make Project button in the toolbar selecting rv r Listing vG te LST fil M Generate ile waren Level 2 17 Include symbols 7 Include assembly code 132 Page Width Page length 60 IV Include conditional code List include files r Object T Keep variables in order IV Include Extended debug information IV Include debug information Include browse information M Enable ANSI intege
3. 20 Rev 0 6 SILICON LABS Ethernet DK 6 2 3 Finding the Embedded System We will now search for embedded systems on the network Note The Netfinder utility v1 0 is not compatible with Windows Vista or Windows 7 1 Open the Netfinder utility found in C SiLabs MCU Utilities Netfinder 2 Press the Search button as shown in Figure 14 to begin searching for devices EZ Netfinder v1 0 OK Cancel Configure Assign IP Quick Launch Web Browser Hyperterminal Bootloader 1 Show MAC Address V Show Left Column IV Show Right Column Sort By Unsorted J Figure 14 Search Button 3 The Embedded System should appear inside a box with a green background If it appears inside a box with a yellow background then a DHCP server was not found Please skip directly to step 5 4 Select the embedded system by clicking anywhere inside the green area After the black border appears press the Web Browser Quick Launch Button a Netfinder v1 0 OK Cancel Configure Assign IP Search lt Hyperterminal Bootloader SILICON LABS 1 Show MAC Address Show Time Powered Show Time on Network Sort By Unsorted zj Figure 15 Web Browser Quick Launch Button Rev 0 6 21 Ethernet DK 5 The default web browser should launch and display the home page served by the embedded web server The same result can be achieved by typing the IP address of the embedd
4. IV Include Extended debug information IV Include debug information Include browse information M Enable ANSI integer promotion rules 7 Generate Registerbank independent code T Optimization Level Level 8 Common tail merging Emphasis Favor Fast Code gt Memory Model Variable Location Code Size limits Large 64K Functions m Command Line DB OE BR INCDIR C Keil C51 SINC Large Reset Defaults Project Build Make Project from the menu or pressing the F7 shortcut key SILICON LABS Rev 0 6 19 Ethernet DK 8 Click the Connect button in the toolbar or select Debug gt Connect from the menu Note If you receive the error message Communication could not be established with the specified serial adapter open the Connection Options Dialog by selecting Options Connection Options from the menu Verify that the USB Debug Adapter is selected and that the debug interface is set to JTAG 4 in the toolbar 9 Download the project to the target by clicking the Download Code button 10 Run the demo by clicking the Go button in the toolbar selecting Debug gt Go from the menu or pressing the shortcut key F5 w Silicon Laboratories IDE Eile Edit View Project Debug Tools Options Window Help o sa eja nnaa RR Pn oom z ET iB TCPIP_Project Gy Header Files mn_defs h mn_ems h
5. Ethernet DK SILICON LABS EMBEDDED ETHERNET DEVELOPMENT KIT USER S 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 inclu
6. The TCP Echo Client Server example shows how to send and receive data using a low level TCP socket The same example file can configure the MCU as a client or server based on the value of SERVER MODE in main c Set SERVER_MODE to 1 for server or 0 for client In client mode the embedded system sends a string to a TCP Echo server then waits for the string to be received Once the string is received from the server the embedded system repeats the process The TCP Echo server application TCP_SVR exe should be started on the PC prior to running code on the embedded system In server mode the embedded system waits for strings to be sent from the PC client application TCP_CLI exe and echoes them back to the PC The C8051F120 Echo server should be started prior to starting the PC application The PC client application is started with the following syntax TCP_CLI 10 10 10 163 where 10 10 10 163 is the IP Address of the embedded echo server The TCP Echo Client Server example is located by default in the C SiLabs MCU Examples C8051F 12x_13x Ethernet TCP directory The example can be opened by opening the project file TCP wsp in the Firmware directory in the Silicon Laboratories IDE 7 4 UDP Echo Client Server The UDP Echo Client Server example shows how to send and receive data using low level UDP socket This example is identical to the TCP example except data is sent in UDP packets The UDP Echo Client Server example is located by def
7. WA Press the Add Include Path Flag button to automatically add the default directory paths A Add Include Path Flag 18 Rev 0 6 SILICON LABS Ethernet DK 5 Verify the Compiler and Linker tabs are pointing to the C51 exe compiler and BL51 exe linker files in C Keil C51 BIN in the Executable field 6 Press the Compiler tab s Customize button Under the Variable Location drop down box select Large aoe ooo r Tool Definition Presets Preset Name Keten AY Save As Save Rename Delete Keep current command line flags r Tool Definition Keil Assembler Compiler Linker Executable C Keil C51 BIN C51 exe Browse Command line flags DB OE BR INCDIR C KeilS C51 SINC Customize a This tool vendor requires a command line flag to specify include file directories Add Include WA Press the Add Include Path Flag button to automatically add the default directory paths Path Flag Caneel _ XDATA and press OK Then press OK to close the Tool Chain Integration dialog 7 Build the project This can be done by clicking on the Build Make Project button in the toolbar selecting rv r Listing vG te LST fil M Generate ile waren Level 2 17 Include symbols 7 Include assembly code 132 Page Width Page length 60 IV Include conditional code List include files r Object T Keep variables in order
8. From the Windows Start menu start the TCP IP Configuration Wizard The shortcut will be under the Start Silicon 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 DHCP HTTP and NETFINDER The lower level protocols TCP and UDP will automatically be enabled as shown in Figure 12 r TCP IP Configuration Wizard T Link Physical Layer Settings Ethernet E PPP Device Name C pap Netfinder Device Name O SLIP Th Internet Layer Text Description ae G Enter Text Description ARP FG Transport Layer Definition of Event 1 TCP Time Powered UDP k pipa ar Definition of Event 2 DHCP Time on Network O DNS C FIP oof HTTP eer NETFINDER O SMTP CO TFTP Setti Sockets F Used Space 35 KB SYSCLK _ Free Space 93 KB Figure 12 TCP IP Configuration Wizard Protocol Selection Cy 16 Rev 0 6 SILICON LABS Ethernet DK 5 Save the selected configuration using the File gt Save As menu 6 Generate a new project with supporting firmware by selecting Generate Project from the File menu see Figure 13 7 When prompted for a folder
9. J12 J19 Port 0 7 connectors J20 Analog I O terminal block J22 VREF connector J23 VDD Monitor Disable J24 96 pin Expansion I O connector R1 Current Limiting Resistor For 96 pin Interface Note R1 should be shorted with a zero ohm resistor if the F120TB is providing power to the AB4 Port 5 Port 6 Port 3 Port 4 Port 7 E 1 Pin 1 Port 0 EEEN 2 Pin 1 323 C8051 F12X P3 7 RESET Pin 2 Pin 1 Figure 27 C8051F120 Target Board Rev 0 6 31 SILICON LABS Ethernet DK 8 1 C8051F120 Target Board Schematic as a Beee oA te zo ae alz mi ze 1 8 7 41 D Jal o it 5 he r rE E 3v02 Oo 100K ol sw2 2 1 2 1 w Power LED 0 GND 3VD2 RS 470 ohm 2 A D2 k ReD c32 cz YA o
10. and controls an LED 6 4 1 Modifying the Source HTML Content The following instructions show how to modify the HTML content in the web server You may use the example in stage 1 or the example in stage 2 as a starting point We will start by modifying the main web page index html Note The Netfinder utility v1 0 is not compatible with Windows Vista or Windows 7 1 In the VFILE_DIR subdirectory of the main project folder open index html in a text editor e g Notepad Any of the projects generated earlier can be used for this stage of the demo 2 Modify the HTML source to make the web page noticeably different This can include changing the background color or the text Figure 23 shows the text changed to This web page has been modified Save the HTML source file when done gt index html Notepad oE File Edit Format View Help lt html gt a lt head gt lt title gt Hello World lt title gt lt head gt lt body cele par cil text white link yellow vlink red alink blue gt lt hi gt Hello World lt hl gt lt br gt lt br gt lt B gt This web page has been modified lt B gt zibens lt html gt Figure 23 Modifying the HTML Source 6 4 2 Updating the File Arrays using HTML2C All web server content is added to the project in the form of file arrays unsigned character arrays initialized to the binary representation of the file The HTML2C utility reads any file HTML images ex
11. f d zaji f id Tla T td 7T Zd KEN Tid Ved rd Ved TMS Vid O d Vtd 0 Zd IMS Oved 0904 0214 7 004 0Z04 3NYN TWNOIS NIN 1SOH JIYA NNOD YY Nid 96 aac E aaa 35 Rev 0 6 SILICON LABS Ethernet DK 10 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 of the C51 compiler These tools can be used from within the Silicon Laboratories IDE 10 1 System Requirements The Silicon Laboratories IDE requirements m Pentium class host PC running Microsoft Windows 2000 XP or later m One available USB port m 64 MB RAM and 40 MB free HD space recommended 10 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 A51 pdf can be found on line under the Help menu in the IDE or in the SiLabs MCU hip directory 10 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
12. the full professional version except code size is limited to 4 kB and the floating point library is not included The TCP IP Library object code does not count against the 4 kB code size limit The C51 compiler reference manual C51 pdf can be found under the Help menu in the IDE or in the SiLabs MCU hip directory 10 4 Using the Keil Software 8051 Tools with the Silicon Laboratories IDE The default configuration of the Keil 8051 tools when using the Silicon Laboratories IDE project manager enables object extensions debug record generation and uses the OMF 51 format This is required for source level debugging The Silicon Labs IDE also allows the Keil 8051 tools to be called directly from the command line using a batch file Refer to Application Note AN104 Integrating Keil 8051 Tools Into the Silicon Labs IDE in the SiLabs MCU Documentation Appnotes directory on the CD ROM for additional information on using the Keil 8051 tools with the Silicon Laboratories IDE Application Notes can also be found on the Silicon Labs website http www silabs com products mcu Pages ApplicationNotes aspx 36 Rev 0 6 SILICON LABS Ethernet DK APPENDIK SUPPORTED PROTOCOLS Link Physical Layer Ethernet IEEE802 3 Widely installed local area network link physical layer Internet Layer IP Internet Protocol IP specifies the format of packets and manages the addressing of all devices on the network IP is included in al
13. 0 of the IDE and above m Added descriptions for installing the ETHERNET DK software from the Development Kit CD Clarified steps for building the projects 38 Rev 0 6 SILICON LABS Ethernet DK NOTES SILICON LABS Rev 0 6 39 Ethernet DK CONTACT INFORMATION Silicon Laboratories Inc 400 W Cesar Chavez Austin TK 78701 Please visit the Silicon Labs Technical Support web page https www silabs com support pages contacttechnicalsupport aspx and register to submit a technical support request The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice Silicon Laboratories assumes no responsibility for errors and omissions and disclaims responsibility for any consequences resulting from the use of information included herein Additionally Silicon Laboratories assumes no responsibility for the functioning of undescribed features or parameters Silicon Laboratories reserves the right to make changes without further notice Silicon Laboratories makes no warranty rep resentation or guarantee regarding the suitability of its products for any particular purpose nor does Silicon Laboratories assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation conse quential or incidental damages Silicon Laboratories products are n
14. 4 P1 2 B 4 P1 1 C 4 P1 0 A 5 P2 7 B 5 P2 6 C 5 P2 5 A 6 P2 4 B 6 P2 3 C 6 P2 2 A 7 P2 1 B 7 P2 0 C 7 P3 7 A 8 P3 6 B 8 P3 5 C 8 P3 4 A 9 P3 3 B 9 P3 2 C 9 P3 1 A 10 P3 0 B 10 PO 7 C 10 P0 6 A 11 P0 5 B 11 P0 4 C 11 P0 3 A 12 P0 2 B 12 PO 1 C 12 P0 0 A 13 P7 7 B 13 P7 6 C 13 P7 5 A 14 P7 4 B 14 P7 3 C 14 P7 2 A 15 P7 1 B 15 P7 0 C 15 P6 7 A 16 P6 6 B 16 P6 5 C 16 P6 4 A 17 P6 3 B 17 P6 2 C 17 P6 1 A 18 P6 0 B 18 P5 7 C 18 P5 6 A 19 P5 5 B 19 P5 4 C 19 P5 3 A 20 P5 2 B 20 P5 1 C 20 P5 0 A 21 P4 7 B 21 P4 6 C 21 P4 5 A 22 P4 4 B 22 P4 3 C 22 P4 2 A 23 P4 1 B 23 P4 0 C 23 TMS A 24 TCK B 24 TDI C 24 TDO A 25 RST B 25 DGND Digital Gnd C 25 VUNREG A 26 AGND Analog Gnd B 26 DAC1 C 26 DACO A 27 CP1 B 27 CP1 C 27 CPO A 28 CP0 B 28 VREF C 28 VREFD A 29 VREFO B 29 VREF1 C 29 AINO 7 A 30 AINO 6 B 30 AINO 5 C 30 AINO 4 A 31 AINO 3 B 31 AINO 2 C 31 AINO 1 A 32 AINO O B 32 AGND Analog Gnd C 32 AV 3 3 VDC Analog 34 Rev 0 6 SILICON LABS Ethernet DK 9 2 AB4 Board Schematic No yi yi 6y 84 g z CENI 4 N3349 4 O O za ta GA QASH l oly oly x ASL avi 33S x ASL 1 ziavi 33S uy old BINA zs A WW is wv ay er ou I a av 33s Xl a aayi 335 INNHS T1VISNI 1NNHS TIVISNI amp A z1 e Jian or sr AINNHS T1
15. C SiLabs MCU Examples C8051F 12x_13x Ethernet HTTP web server 1 directory This project is identical to the one generated in the previous steps Silicon Laboratories IDE File Edit View Project Debug Tools Options Window Help Deka y add Eiles to Project Add Groups to Project E New_Proi ae Assemble Compile File Alt A Ctrl F7 18 Build Make Project Alt M F7 4 Rebuild Project Ctrl Shift F7 Pasi New Project Open Project Save Project Save Project As 3 If you would like to view the source code double click on main c on the left hand side of the screen in the Project Window Source code modification is not required to run this demo 4 Select the Keil tools by going to ProjectTool Chain Integration and selecting the Keil preset under the Preset Name drop down menu Press No when the Save Preset dialog appears r Tool Definition Presets Preset Name Keil read only v SaveAs Save Rename Delete F x cono ii Keep current command line flags r Tool Definition Keil Assembler Compiler Linker Executable C Keil C51 BIN A51 EXE Browse Command line flags XR GEN DB EP NOMODS51 INCDIR C Keil C51 INC a G This tool vendor requires a command line flag to specify include file directories Add Include WA Press the Add Include Path Flag button to automatically add the default directory paths Path Flag
16. C8051F 12x_13x Ethernet HTTP directory These are the same examples used in the Embedded Ethernet Demo The first three examples web server 1 web server 2 and web server3 are under 4 kB and can be compiled using the evaluation version of the Keil C51 compiler The uWeb server example is larger than 4 kB and requires the full version of the Keil C51 compiler to build the project A HEX file containing the firmware object code is available for users who do not have the full version of the Keil C51 compiler See Section 6 on page 9 for additional information about the HTTP examples 7 2 SMTP Mail Client The SMTP Mail Client example shows how to send an e mail from the embedded system When run the example will send two e mails to the SMTP server specified by IP_SMTP_ADDR in mn_userconst h This address should be set to the address of the SMTP server on the network Ask your network administrator for the IP address of the SMTP server on your network Once the e mails are received by the mail server they are forwarded to e mail addresses specified by to in main c The messages can be received by the PC by opening a mail program such as Outlook One e mail will be text based and the other will have a text file attachment The SMTP example is located by default in the C SiLabs MCU Examples C8051F12x_13x Ethernet SMTP directory The example can be opened by opening the project file SMTP wsp in the Silicon Laboratories IDE 7 3 TCP Echo Client Server
17. D2 from P1 v IND v AB4 Ethernet Development Board Figure 29 AB4 Ethernet Development Board The AB4 Ethernet development board is compatible with multiple MCU development boards that contain a 96 pin connector Table 2 maps select signals on the AB4 board to the corresponding MCU port pin s Table 2 AB4 Board Signals AB4 Signal Name F020 F040 amp F120 F060 F340 swt P2 0 P4 1 P2 0 P1 1 sw2 P2 1 P4 2 P2 1 P1 2 LED1 P2 2 P4 3 P2 2 P1 3 LED2 P2 3 P4 4 P2 3 P1 4 INT P2 4 P0 3 P2 4 P0 3 P0 3 RST P4 5 P4 5 P1 0 A15_CS P5 7 P5 7 P2 7 Rev 0 6 33 SILICON LABS Ethernet DK 9 1 Expansion I O Connector J1 The 96 pin expansion I O connector J1 is used to connect the AB4 Ethernet Development Board to the C8051F120 Target Board J1 provides access to many C8051F120 signal pins Pins for 3 V digital ground analog ground and the unregulated power supply VUNREG are also available The VUNREG pin is connected directly to the unregulated V pin of the P1 power connector on the C8051F120 Target Board See Table 3 for a complete list of pins available at J1 Table 3 J1 Pin Descriptions Pin Description Pin Description Pin Description A 1 3 VD2 3 3 VDC B 1 DGND Digital Gnd C 1 XTAL1 A 2 MONEN B 2 P1 7 C 2 P1 6 A 3 P1 5 B 3 P1 4 C 3 P1 3 A
18. P 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 e TCP IP Configuration Wizard 5 C PPP m Settings fof PAP of SLIP Ty Intemet Layer of IP of PING Source IP Address ARP 10 10 10 163 ow Transport Layer Destination IP Address 255 255 255 255 Gateway IP Address TG Application Layer 255 255 255 255 0 BOOTP 3 DHCP Subnet Mask IP Address coer 255 255 255 0 oof HTTP C NETFINDER woof SMTP C TFTP System Settings LJ Virtual Files m Code Size Used Space 28 KB Free Space 100 KB m Figure 8 TCP IP Configuration Wizard IP Address Specification 10 Rev 0 6 SILICON LABS Ethernet DK 9 Save the selected configuration using the File Save 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 appea
19. TCP IP stack firmware The LEDs on the RJ 45 Ethernet connector should light up if the MCU is connected to a network Once the network router detects the presence of the embedded system it will be accessible from any PC connected to the same network This usually takes a few seconds but can take over 30 seconds depending on the size of the network The delay is minimized if the embedded system is connected directly to a PC using a crossover cable The PING utility is available on all PCs and allows the user to check if the MCU is responding to network requests The instructions below show how to ping the embedded system 1 Using the Windows Start menu select Start gt Run and type cmd when the Run dialog appears Alternatively type cmd in the Search programs and files field A black terminal window should appear 2 At the prompt type ping followed by a space and the IP address of the embedded system as shown in Figure 10 Press the Enter key when finished 3 If the PC is able to communicate with the embedded system then ping will report the number of milliseconds it took to receive a reply from the embedded system Otherwise it will report Request timed out Microsoft Windows XP Version 5 1 2600 C WINDOWS System32 cmd exe JE x g C Copyright 1985 2001 Microsoft Corp M gt ping 10 10 10 163_ Figure 10 Pinging the Embedded System 6 1 4 Accessing the Embedded System using a Web Browser Once the ping utility is able to rece
20. VISNI INNHS TIYLSNI an9 ana TI zanod tanad H amoo ano0 Nov YOLOANNOD NO SAYL IV1IW H108 OL 909 909 v t anavi 43s OST ONY GNOHO 8 ONY Z SNid OL sa 1 za Nje N Q3LIINNOI 38 GINOHS YOLI3NNOI or ka HIV3NGIONN 3NVId GNNOYS LP w 104 10 Hz a SION 4d09 9ay790 H 3 94 ana sav sa 42 _ lt sa iN NOHO 69 0ay 0 HEU ya OOAL 78 sav sa 02 ca x zav za 8 _ lt za a N g 6 10Y 10 ba 10 1a 3 N za oav oa Hi o0 031 N3349 Zl za nai or ty g 2 cf ear z 7x8 doit ya oe ana va 194 9y Fe ov gAV Res sq nowt sy 4 ov daH 001 ay PRE wv omy sy aw ey He cv 4 F zy Pee 5 zy 1 7645099 FA Mra g i Z oy 82 ov 909 909 No 23 Or 08 L Fav 33s adz ae E am Or Ky C sr L YM or aM jr SISI NALON MVI 4 ils 4 E NaXnW Ww li TIA ey ZHMO00 0Z 19V WoL IA Z g KUJI zaan Hg va NIT lov 1 anay 33s 100A Fer sy or 484 HAY HE Nd A isu 002249 net Faas in 002 d90 anot anyo anyo anro INVL UZA UZA YA 19 9 z3 e WA O ANY I SNid IN avan vid A aast aact dOd ON dOd ON SZLIHN EGZUHW L 1 x x o ano o ano ZHA LHW h TMS ax h INS ax ol us Q 01d SJAA Nid LYOd JHL NIJ3ML38 NOILNSLNOD INJAZYd OL SWIL NSAID ANY LV NJANO 38 CINOHS SNid 3H1 40 3NO AINO SNid 140d FITNA 01 G3LOSNNOD 34V SIYN IS 0904 ONY OZl4 O O4 OZO4 3HL 04 310N Lid Sd L Sd SOSLY O ld Std Std isi 0d 0d t Zd 0d t Zd Ani vid etd V9d
21. are 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 d irectory of the CD ROM 2 After the installation dialogue box appears click the Install Development Tools button s SILICON LABS Install tools to develop code program Flash and debug Indudes Silicon Labs IDE and examples me Click this button to display a list of other Other Development Utlities development tools that can be installed Click this button to display a list of third party Third Party Tools development tools that can be installed Click this button to view an index of available device and kit documentation Browse Documentation Exit www silabs com View Kit Re
22. ault in the C SiLabs MCU Examples C8051F12x_13x Ethernet UDP directory The example can be opened by opening the project file UDP wsp in the Firmware directory in the Silicon Laboratories IDE 7 5 DHCP BOOTP Examples Two HTTP web server examples using DHCP and BOOTP are provided in the C8051F12x_13x Ethernet DHCP and C8051F12x_13x Ethernet BOOTP folders respectively These servers dynamically obtain their IP address information from a DHCP or BOOTP server 30 Rev 0 6 SILICON LABS Ethernet DK 8 C8051F120 Target Board The Embedded Ethernet Development Kit includes a target board with a C8051F120 device pre installed for evaluation and software development Numerous input output I O connections are provided to facilitate prototyping using the target board Refer to Figure 27 for the locations of the various I O connectors For further details see the C8051F12x Development Kit User s Guide located on the kit CD or installed by default in the C SiLabs MCU Documentation Users Guides directory P1 Power connector accepts input from 7 to 15 VDC unregulated power adapter J1 Connects SW2 to P3 7 pin J3 Connects LED D3 to P1 6 pin J4 JTAG connector for Debug Adapter interface J5 DB 9 connector for UARTO RS232 interface J6 Connector for UARTO TX P0 0 J8 Connector for UARTO RTS P4 0 J9 Connector for UARTO RX P0 1 J10 Connector for UARTO CTS P4 1 J11 Analog loopback connector
23. ddress 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 or Network 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 VI Intemet Protocol TCP IP ope Description Transmission Control Protocol Intemet Protocol The default wide area network protocol that provides communication across diverse interconnected networks Show icon in notification area when connected 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 arro
24. des 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 9 Th gt gt 5 gt 5 Oo 5 5 5 ol 5 co 5 o e o D D Lo o O e te o D SILICA KABAKA TUKIRI C8051FX20 TB abs O00000000000000000000000 gt Che hoKekoiehoielelofeleis ole o Te Figure 1 C8051F120TB Target Board and AB4 Ethernet Development Board Rev 0 6 1 11 Copyright 2011 by Silicon Laboratories Ethernet DK Ethernet DK 2 Kit Contents The Embedded Ethernet Development Kit contains the following items m C8051F120 Target Board m AB4 Ethernet Development Board m CAT5e Ethernet Cable m Silicon Laboratories Evaluation Kit IDE and Product Information CD ROM CD content includes the following e Silicon Laboratories Integrated Development Environment IDE e Keil C51 Evaluation Toolchain assembler linker and C compiler with 4 kB object code
25. e 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 10 10 10 80 decimal 0000 1010 0000 1010 0000 1010 0101 0000 binary PC Subnet Mask 255 255 255 0 decimal 11111111 1111 1144 1111 1111 0000 0000 inary Embedded Web Server IP Address 10 10 10 163 decimal 0000 1010 0000 1010 0000 1010 1010 0011 binary Figure 6 IP Address Selection Example 6 Rev 0 6 SILICON LABS Ethernet DK 5 Softw
26. ecutable binary files etc and generates two files original_filename h and original_filename c that can be added to the project HTML2C can be accessed several ways including Drag and drop Web server content dropped on HTML2C will initiate a conversion File Open command from GUI HTML2C has a graphical user interface to start conversions Batch File The update bat batch file in the VFILE_DIR folder can be used to automate the conversion process If additional content is added to the server the batch file can be updated as shown in Figure 24 3 update bat Notepad Jo File Edit Format View Help html2c exe index htm html2c exe second_page htm html2c exe image jpg Figure 24 Automating the Conversion Using a Batch File Rev 0 6 27 SILICON LABS Ethernet DK 6 4 3 Re Building the Project and Viewing Results Once the file arrays are updated it is time to re build the project and view the results 1 Open and re build the project This can be done by selecting Project gt Open Project and selecting the correct project then clicking on the Build Make Project button in the toolbar selecting Project Build Make Project from the menu or pressing the F7 shortcut key If not already connected click the Connect button in the toolbar or select Debug gt Connect from the menu Note If you receive the error message Communication could not be established with the specified serial adapter o
27. ed web server into the address bar of a web browser Figure 16 shows a screenshot of the home page Now go directly to Section 6 3 Stage 3 Configuring MAC and IP Addresses over the Serial Port on page 25 E Hello World Microsoft Internet Explorer fx File Edit View Favorites Tools Help ay i Address http 10 10 10 163 B co Hello World This page is served from a C8051F12x and uses the Silicon Laboratories TCP IP stack 4 My Computer Figure 16 Hello World Web Page 6 If the network does not have a DHCP server then the embedded system will search for approximately 35 seconds before going into static IP address mode After going into static IP address mode Netfinder will display information about the device in a window with a yellow background Select the device by clicking inside the yellow area and pressing the Assign IP button as shown in Figure 17 a Netfinder v1 0 1 Show MAC Address IV Show Time Powered IV Show Time on Network Sort By Unsorted X OK Cancel Quick Launch Web Browser Hypererminal Bootloader Figure 17 Static IP Address Mode 22 Rev 0 6 SILICON LABS Ethernet DK 7 Enter the IP address subnet mask and default gateway if known into the Assign IP Address dialog and press OK See Appendix A for information on how to configure the PC with a static IP address and how to select a static IP address for the CP2201EB A windows com
28. ernet ya Wu Wa Port 5 Port 6 Port 3 oar cies ae P ort 4 Port 7 Port 1 Pin 2 pe Su J10 J8 J6 J9 Port 0 O Pin 1 Port 2 ja J23 I 8051F12x voee Prototyping Are C8051F120 Target Board J22 AB4 Ethernet Development Board USB Debug Adapter C8051F 120 Target Board USB Port AC DC Adapter Figure 3 Embedded Ethernet Development Kit Debug Connections Rev 0 6 3 SILICON LABS 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 Note Firewalls or VPN policies may need to be disabled in order to communicate with the development kit 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 Only a single embedded system may be accessed from a single PC Shared communication medium System may experience packet delays under heavy netw
29. ess any key to continue Figure 21 Waiting for User Input 3 Once connected you should see the text in Figure 21 appear on the screen Press any key 4 The MCU will prompt you to specify and verify an IP address Figure 22 shows an example of successful programming of the IP address Press any key after entering the IP address and use y or n for the confirmation Press any key to continue a Press any key to continue Enter the IP address eg 10 10 10 163 10 10 10 163 Is 10 10 10 163 correct y IP address successfully programmed Figure 22 Successful Programming of IP Address 5 If programming is successful the green LED on the C8051F 120 Target Board will stop blinking and the web server will start You should now be able to ping the embedded web server or access it from a web browser Note Once programmed the MCU will not prompt for the IP address until the next firmware download To force an IP address update hold the SW2 P3 7 switch on the C8051F120 Target Board down and reset the MCU 26 Rev 0 6 SILICON LABS Ethernet DK 6 4 Stage 4 Adding Web Server Content In the first three stages of the demo we learned how to make an embedded web server find it on the network using Netfinder and program its IP over the serial port In this stage we will learn how to change the HTML content on the server and see an example of an embedded temperature sensing web server uWeb that graphs temperature
30. generated Select TCP P_Project wsp and click the Open button Note An example project is available by default in the C SiLabs MCU Examples C8051F 12x_13x Ethernet HTTP web server 2 directory This project is identical to the one generated in the previous steps Eile Edit view osas Ba New Proji Silicon Laboratories IDE Project Debug Tools Options Window Help Add Files to Project Add Groups to Project kita Assemble Compile File BB Build Make Project Alt M F7 4 Rebuild Project Ctrl Shift F7 x Alt A Ctrl F7 New Project Open Project Save Project Save Project As O 703 fy A EN les 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 Select the Keil tools by going to Project Tool Chain Integration and selecting the Keil preset under the Preset Name drop down menu Press No when the Save Preset dialog appears r Tool Definition Presets Preset Name Keil read only v SaveAs Save Rename Delete F x owe AA Keep current command line flags r Tool Definition Keil Assembler Compiler Linker Executable C Keil C51 BIN A51 EXE Browse Command line flags XR GEN DB EP NOMODS51 INCDIR C Keil C51 INC i i This tool vendor requires a command line flag to specify include file directories
31. generation and unlimited library code usage e Source code examples and register definition files e Documentation e TCP IP Configuration Wizard e Embedded Ethernet Development Kit User s Guide this document Universal 100 240 V 50 60 Hz AC to DC Power Adapter USB Debug Adapter USB to JTAG C2 Debug Interface USB Cable Serial Cable 2 Rev 0 6 SILICON LABS 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 as shown in Figure 3 3 Connect one end of the provided USB cable to any available USB port on the PC Figure 3 4 Connect the other end of the USB cable into the USB connector on the USB Debug Adapter Figure 3 5 Connect the ac dc Power Adapter to the C8051F120 Target Board at P1 Figure 3 This connection should power both boards Power is indicated by the PWR LED on the C8051F120 TB Note The F120TB places a 2 Q resistor in series with the power supply net powering the AB4 Board We recom mend replacing this resistor with a 0 Q resistor to prevent large voltage drops possibly triggering a Vpp Monitor reset when current demand increases AB4 Eth
32. it View Favorites Tools Help i Address http 10 10 10 163 MB co Hello World This page is served from a C8051F12x and uses the Silicon Laboratories TCP IP stack Done 5 Computer Figure 20 Hello World Web Page 24 Rev 0 6 SILICON LABS Ethernet DK 6 3 Stage 3 Configuring MAC and IP Addresses over the Serial Port In the first two stages of the demo we learned how to generate firmware for an embedded web server using the TCP IP Configuration Wizard and access the embedded server from a web browser In this stage we will learn how to dynamically configure the IP address over the serial port 6 3 1 Configuring the Target Board Jumpers for UART communication To enable UART communication on the C8051F120 Target Board jumpers J6 and J9 must be shorted See Figure 27 for the location of J6 and J9 6 3 2 Modifying the Firmware to Enable the Serial Port The simple web server firmware generated by the TCP IP Configuration Wizard does not support configuring the IP address over the serial port In order to configure the MCU using the serial port the firmware must be modified The web server 3 project in the examples folder has been created to demonstrate an example of configuration using the serial port The following list outlines the functionality that has been added to web server 3 VDD Monitor is enabled as a reset source because firmware needs to write erase Flash memory UART1 Initialization rou
33. ive a reply from the embedded system the embedded system is now ready to be accessed from a web browser The instructions below show how to access the embedded HTTP web server 1 Open an instance of your favorite web browser 2 Type in the IP address of the embedded system and press Enter A web page stored inside the MCU should be displayed on the screen as shown in Figure 11 g Hello World Microsoft Internet Explorer BAX File Edit View Favorites Tools Help ay Address http 10 10 10 163 Bco Hello World This page is served from a C8051F12x and uses the Silicon Laboratories TCP IP stack My Computer Figure 11 Embedded Web Server Rev 0 6 15 SILICON LABS Ethernet DK 6 2 Stage 2 Basic Web Server with DHCP and Netfinder Capability In the first stage of the demo we learned how to generate firmware for an embedded web server using the TCP IP Configuration Wizard and access the embedded server from a web browser In this stage we will learn how to generate a web server that uses automatic network configuration DHCP to automatically obtain an IP address from the network We will also find the embedded web server on the network using the Netfinder utility Note The Netfinder utility v1 0 is not compatible with Windows Vista or Windows 7 6 2 1 Generating the Embedded Web Server Firmware We will now use the TCP IP Configuration Wizard to generate a project with DHCP and Netfinder capability 1
34. l builds of the TCP IP stack PING Packet Internet Groper PING is a basic network program which verifies that a particular IP address exists and can respond to requests PING is included in all builds of the TCP IP stack ARP Address Resolution Protocol ARP converts higher level IP addresses to lower level MAC addresses It is not available with SLIP or PPP Transport Layer TCP Transmission Control Protocol TCP is a connection oriented transport protocol It offers a reliable full duplex data stream that may be written to and read from by devices on the network UDP User Datagram Protocol UDP is a connection free best effort transport protocol It formats data into units called datagrams and sends them across the network however it provides no guarantee that the data will arrive A UDP checksum is performed on the data to allow the receiving node the ability to detect data errors Application Layer DHCP Dynamic Host Configuration Protocol Used to obtain a dynamic IP address from a DHCP server BOOTP Bootstrap Protocol Older protocol used to obtain a dynamic IP address FTP File Transfer Protocol FTP transfers a complete file from one network device to another FTP requires the TCP transport layer The FTP module in the TCP IP stack configures the device to operate as an FTP server only It cannot act as an FTP client HTTP HyperText Transfer Protocol HTTP sends and requests files typically HTML files acr
35. lease Notes 3 Select the ETHERNET DK entry and press the Install button SILICON LABS Select the option corresponding to your kit C8051F005 DK C8051F020 DK C8051F040 DK C8051F060 Dk C8051F 120 DK C8051F206 DK C8051F226 DK C8051F300 DK C8051F310 Dk C8051F320 DK C8051F326 DK C8051F330 Dk C8051F340 DK C8051F350 DK C8051F410 DK C8051T600 DK or C8051T606 DK MODEM DK or ETHERNET DK C8051F336 DK C8051F360 DK C8051F530A DK C8051T610 DK C8051T630 DK C8051F500 DK C8051F540 DK C8051F560 DK or C8051F580 DK 8051F700 DK or C8051F800 DK C8051F930 DK C8051F912 DK C8051F996 DK CP2400 DK Si1000 DK or Si1010 DK cP2501 DkK Install Rev 0 6 Ethernet DK 4 Unselect the Install Raisonance Evaluation 8051 Toolset option and select Install Keil Evaluation 8051 Toolset Then press the Install button Individual installers will run for each of the Development Tools Install Silicon Labs IDE Install all C8051 xxx Documentation Install Configuration Wizard 2 Install TCP IP Configuration Wizard 0 Install R Evaluation 8051 Toolset Install 5 Follow the installation prompts to install the development tools The following applications will be installed e The Silicon Laboratories IDE will be installed by default in the C SiLabs MCU directory e The Embedded Ethernet examples will be installed by default in the C SiLabs MCU Example
36. mand line window should appear ping the device at its new address then close Programming is successful when the progress bar stops and gives the message Success Device Programmed as shown in Figure 18 IV Show Time on Network Sort By Unsorted 2 M Show MAC Address IV Show Time Powered OK Cancel Assign IP Address IP Address Configure Cancel Subnet Mask Assign IP Default Gateway Search Reload Timer Close this window ong Success Device Programmed Quick Launch Web Browser Hyperterminal Bootloader Figure 18 Assign IP Address Dialog 8 Close the Assign IP Address dialog then press Search to refresh the Netfinder screen 9 Select the device by clicking inside the yellow area and pressing the Web Browser quick launch button as shown in Figure 19 za Netfinder v1 0 Show Time on Network Sort By Unsorted 1 Show MAC Address MV Show Time Powered OK Cancel Configure a aunch Bootloader Figure 19 Web Browser Quick Launch Button In Static IP Address Mode 23 ES Rev 0 6 SILICON LABS Ethernet DK 10 The default web browser should launch and display the home page served by the embedded web server The same result can be achieved by typing the IP address of the embedded web server into the address bar of a web browser Figure 20 shows a screenshot of the uWeb v2 0 home page File Ed
37. ork traffic This effect is greatly reduced if using a switched network Dedicated channel bandwidth Good for achieving consistent data throughput measurements An existing network with wall outlet or a router switch is required No additional hardware 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 Ethernet i Router Development Kit a F120TB AB4 Ethernet Wal Outlet Fineret Ethernet Cable Connector Cable Ethernet Connector Figure 4 Embedded Ethernet Network Connection Standard Cable Embedded Ethernet Development Kit F120TB AB4 Ethernet Crossover Cable Ethernet Connector Ethernet Connector Figure 5 Embedded Ethernet Network Connection Crossover Cable 4 Rev 0 6 SILICON LABS 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 a
38. oss a network It is commonly used to transfer files across the World Wide Web HTTP requires the TCP transport layer The HTTP module in the TCP IP stack configures the device to operate as an HTTP server only It cannot act as an HTTP client or browser SMTP Simple Mail Transfer Protocol SMTP sends and receives e mails It requires the TCP transport layer The SMTP module in the TCP IP stack can only act as an SMTP client An SMTP server must be available on the network to forward emails from the Ethernet DK to the specified e mail address TFTP Trivial File Transfer Protocol TFTP is a simplified version of FTP It requires the UDP transport layer The TFTP module in the TCP IP stack can only act as a TFTP client It cannot act as a TFTP server DNS Domain Name Service Allows domain name e g www silabs com to be resolved into an equivalent IP address Netfinder Allows an embedded system to be identified on a network Rev 0 6 37 SILICON LABS Ethernet DK DOCUMENT CHANGE LIST Revision 0 3 to Revision 0 4 m Added Netfinder Example m Added note that R1 should be shorted with a zero ohm resistor on the F12x Target Board m Updated the supported protocols in the Appendix m Updated screenshots for Version 3 1 of the TCP IP Configuration Wizard Revision 0 4 to Revision 0 5 m Removed Section 10 USB Debug Adapter See USB Debug Adapter User s Guide Revision 0 5 to Revision 0 6 m Updated text for v4
39. ot be established with the specified serial adapter open the Connection Options Dialog by selecting Options Connection Options from the menu Verify that the USB Debug Adapter is selected and that the debug interface is set to JTAG 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 selecting Debug gt Go from the menu or pressing the shortcut key F5 Rev 0 6 25 SILICON LABS Ethernet DK 6 3 3 Programming the IP Address Now the MCU will be running the new firmware and blinking the green LED P1 6 to indicate that the IP address has not been programmed In this mode the MCU is waiting for the user to initiate the update by connecting to the serial port and pressing any key to start Figure 21 shows the output seen on a UART terminal screen when the MCU is waiting for user input The following instructions show how to program the IP and MAC addresses 1 Connect the serial port on the C8051F120 Target Board to an available COM port on the PC using a serial cable included in kit If the PC does not have a COM port a USB to UART bridge such as the CP210x Evaluation Kit available at www silabs com can be used as a virtual COM port 2 Open a UART terminal on the PC and configure it for 9600 Baud 8 N 1 communication Press any key to continue Press any key to continue Press any key to continue Press any key to continue Pr
40. ot designed intended or authorized for use in applications intended to support or sustain life or for any other application in which the failure of the Silicon Laboratories product could create a situation where per sonal injury or death may occur Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized ap plication Buyer shall indemnify and hold Silicon Laboratories harmless against all claims and damages Silicon Laboratories and Silicon Labs are trademarks of Silicon Laboratories Inc Other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders 40 Rev 0 6 ES SILICON LABS
41. pen the Connection Options Dialog by selecting Options Connection Options from the menu Verify that the USB Debug Adapter is selected and that the debug interface is set to JTAG Download the project to the target by clicking the Download Code button in the toolbar Run the server by clicking the Go button in the toolbar selecting Debug gt Go from the menu or pressing the shortcut key F5 View the embedded web server from a web browser using the same methods learned in stage 1 or stage 2 The updated web page stored inside the MCU should be displayed on the screen as shown in Figure 25 E Hello World Microsoft Internet Explorer BAXI kA File Edit View Favorites Tools Help ddress http 10 10 10 163 x B co Hello World This web page has been modified Done 3 My Computer Figure 25 Embedded Web Server with Modified Content 6 4 4 Viewing the uWeb Embedded Web Server The Hello World server used in the demo up to this point contains a single static web page Another example server included as a HEX file in the Examples C8051F12x_13x Ethernet HTTP uWeb folder is the uWeb server This embedded web server contains multiple HTML pages images a Java temperature display applet and CGI script capabilities allowing the detection and control of an LED state This server demonstrates some of the capabilities of the Silicon Laboratories TCP IP stack The following ins
42. r promotion rules 7 Generate Registerbank independent code T Optimization Level Level 8 Common tail merging Emphasis Favor Fast Code gt Memory Model Variable Location Code Size limits Large 64K Functions m Command Line DB OE BR INCDIR C Keil C51 SINC Large Reset Defaults Project Build Make Project from the menu or pressing the F7 shortcut key SILICON LABS Rev 0 6 13 Ethernet DK 8 Click the Connect button in the toolbar or select Debug gt Connect from the menu 9 Download the project to the target by clicking the Download Code button Note If you receive the error message Communication could not be established with the specified serial adapter open the Connection Options Dialog by selecting Options Connection Options from the menu Verify that the USB Debug Adapter is selected and that the debug interface is set to JTAG L in the toolbar 10 Run the demo by clicking the Go button in the toolbar selecting Debug gt Go from the menu or pressing the shortcut key F5 Silicon Laboratories IDE Eile Edit View Project Debug Tools Options Window Help Deh s eja nnsa 6 5E T 0 0 wm x4 xi HB TCPIP_Project Gy Header Files mn_defs h mn_emns h 14 Rev 0 6 SILICON LABS Ethernet DK 6 1 3 Testing Connectivity Using PING After pressing GO the MCU will be executing the
43. ration Wizard 1 From the Windows Start menu start the TCP IP Configuration Wizard The shortcut will be under the Start Silicon 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 SILICON LABS Ge TCP IP Configuration Wizard O C8051F 34 E USB FIFO Support Protocol Settings FB Link Physical Layer Ethernet CO PPP C PAP O SUP T Intemet Layer IP PING H ARP T Transport Layer TCP O UDP FB Application Layer C BooTP C DHCP O DNS O FTP C NETFINDER C SMTP C TFTP System Settings m Settings Size of HTTP buffer bytes 512 Number of post functions fT Size of URI buffer bytes 52 Size of HTTP POST request buffer bytes a Code Size Used Space 28 KB Free Space 100 KB Figure 7 TCP IP Configuration Wizard Protocol Selection Rev 0 6 9 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 I
44. rs 13 Close the TCP IP Configuration Wizard New Reset Options Settings Open Save Save As Destination IP Address 255 255 255 255 Select Project Directory Source IP Address Generate Project 10 10 10 163 Gateway IP Address For Application Layer 255 255 255 255 C BOOTP p H mili Subnet Mask IP Address 0 FTP 255 25 25 0 vf HTTP C NETFINDER HC SMTP ine TFTP System Settings wo Virtual Files i Sockets SYSCLK Code Size Used Space 28 KB TE MAC Addresses m Free Space 100 KB Figure 9 TCP IP Configuration Wizard Project Generation Rev 0 6 11 SILICON LABS 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 Laborato ries IDE 1 From the Windows Start menu start the Silicon Laboratories IDE The shortcut will be under the Start Silicon 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 Project Open Project menu command Browse to the directory where the TCP IP project was generated Select TCP P_Project wsp and click the Open butto n Note An example project is available by default in the
45. s C8051F12x Ethernet directory e The TCP IP Configuration Wizard will be installed by default in the C SiLabs MCU TCP IP Config directory e Shortcuts to the applications will be placed in the Start gt Programs menu 6 To compile the projects discussed in this tutorial the Keil tools must be enabled to the 4k code limited evaluation version See AN104 Integrating Keil 8051 Tools into the Silicon Labs IDE for more information Application notes can be found on the Silicon Labs Application Notes webpage http www silabs com products mcu Pages ApplicationNotes aspx 8 Rev 0 6 SILICON LABS 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 Configu
46. tine uses Timer 1 for baud rate generation UART1 is assigned to P0 0 and P0 1 in the Crossbar The stdio h header file is included to allow use of string formatting functions such as printf The ipconfig routine is used to configure the MAC address The global jp_address 4 variables is added in the Scratchpad area of Flash to store the programmed MAC Address The Scratchpad area is used to store the variable because it can be erased and re written without interfering with program code m The global first time variable is stored in Flash to keep track of whether the IP address has been programmed The following instructions show how to load the web server 3 project 1 Halt the MCU by clicking the Stop button in the toolbar selecting Debug Stop from the menu or pressing the shortcut key F4 2 Close the current open project using the Project gt Close Project menu command 3 Open the web server 3 project using the Project gt Open Project menu command The web server 3 project workspace is located by default in C SiLabs MCU Examples C8051F12x_13x Ethernet HTTP web server 3 directory 4 Build the project This can be done by clicking on the Build Make Project button in the toolbar selecting Project Build Make Project from the menu or pressing the F7 shortcut key 5 If not already connected click the Connect button in the toolbar or select Debug gt Connect from the menu Note If you receive the error message Communication could n
47. 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 8 Click the OK button when the Project generated successfully message appears 9 Close the TCP IP Configuration Wizard an end i New Reset Options Open Settings Device Name Save Netfinder Device Name Save As Select Project Directory Text Description Generate Project Enter Text Description Definition of Event 1 Time Powered Definition of Event 2 Time on Network NDER System Settings l T Virtual Files Code Size Sockets Used Space 35 KB SYSCLK Free Space 93 KE a Figure 13 TCP IP Configuration Wizard Project Generation Rev 0 6 17 SILICON LABS Ethernet DK 6 2 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 Start Silicon 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
48. tructions can be used to download the uWeb server 1 While connected to the C8051F120 Target Board select Debug gt Download Object File from the menu in the Silicon Labs IDE Browse to the Examples C8051F12x_13x Ethernet HTTP uWeb folder Select the uWeb_F120_3_1 hex and click Download Then press Go Program the IP address using the method in Section 6 3 3 on page 26 Type in the IP address of the embedded system in a web browser and press Enter The uWeb server executing on the MCU should be displayed on the screen as shown in Figure 26 28 Rev 0 6 SILICON LABS Ethernet DK SIL ICON LABS uWeb Main Menu 1 View Curre nt Temperature P ONTROL LEDS TROI TEMPERATURE SENSOR CALIBRATION so caa The LED is ON CMX AL SYSTEMS El ooe 2 Local intranet Figure 26 uWeb Embedded Web Server Rev 0 6 29 Ethernet DK 7 Example Source Code The Embedded Ethernet Development Kit includes example source code libraries and register definition files for all MCU devices These examples are installed by default in the C SiLabs MCU Examples directory during IDE installation Inside this directory an Ethernet folder is included within each device family directory supported by the TCP IP Configuration Wizard Each of the examples is described below 7 1 HTTP Web Server Three HTTP Web Server examples are included by default in the C SiLabs MCU Examples
49. w key or can be pressed to advance to the next field Obtain an IP address automatically 9 Use the following IP address IP address 10 10 10 80 Subnet mask 255 255 255 Default gateway 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 ES Rev 0 6 5 SILICON LABS 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 ar
Download Pdf Manuals
Related Search
Related Contents
LAVINA® 32R -S User Manual - Polished Concrete Solutions Trig-Tek™ 313A Frequency Divider User Manual MPPKVVCL/FSP/ F-02 /modified SBD Vol II 39 Details of meter iHome iH20 User's Manual Purchase Orders - SPAR Associates San Francisco Bundle Kit Guidelines - The Canon Brand LH40型 外観 ドイツ ユラボ社 精密恒温循環装置 プレストLH40型 簡易 『 レビス ® 尿中アルブミン-マウス(S タイプ) 』取扱説明書 Copyright © All rights reserved.
Failed to retrieve file