background image

Copyright © Parallax Inc.

 

 

WIZnet W5200 for QuickStart (#40002) 

v1.0 3/13/2013  Page 10 of 10 

About the simple_server.spin Program 

The IP address of the WIZnet W5200 board is automatically obtained by your network’s DHCP server.  In 

most cases, the DHCP server will be your network’s router.  Since a DHCP server dynamically assigns IP 
addresses by usage and the number of clients currently connected to the network, your WIZnet W5200 

board’s IP address will almost certainly be different than the one in the screenshot above.  To determine 

your WIZnet W5200 board’s IP address, refer to the “Requesting a Dynamically Assigned IP Address for 

the W5200” section on page 7. 

 
Note that the SD card driver used to allow the Propeller to interface with the SD card cannot descend into 

sub-directories.  Thus, to serve files from the SD card, the files need to be located in the SD card’s root 

directory.  In other words, keep all files you expect to serve with the W5200 board out of folders.  

Additionally, the SD card driver does not support long file names, so make sure that all of your file names 

are 8 characters or less with a 3-character or less file extension. 

 
Within the index.htm HTML web page file, there is a special HTML tag that simple_server.spin looks for 

when the page is rendered to the browser.  This specific string should have the form: 

 

<!--PROPVARxx--> 
 

where the “

xx

” is replaced by numeric values between 00 and 99.  This gives you the ability to place 

100 numbers into the web server’s memory.  When a request for a web page is made, the web server 
begins to serve the page, while searching for the specific string.  When it finds the specific string, the 

web server replaces the specific string with the numeric value of the user variable referenced by the 

specific string. 

 

You can update the value held in a user variable slot with your program by calling: 

 

PUB SetUserVariable(varNumber, val) 

 
…which is located in the W5200 Parse and Replace Webserver.spin object file.  The first parameter, 

varNumber

, is the user variable slot to update. This value can range from 0 to 99.  The second parameter, 

val

, is the value you want to store in that user variable slot. 

Resources and Downloads 

Check for the latest version of this document, free software, and example programs on the product page. 
Go to www.parallax.com and search “40002”.   

Revision History 

Version 1.0: Original release 

Summary of Contents for 40002

Page 1: ...firmware that allows the WIZnet W5200 board QuickStart to respond to or generate any type of network traffic Features Prewritten drivers to support common network protocols such as TCP and UDP connections HTTP DHCP DNS resolution POP SMTP NetBIOS and SNTP Prewritten demonstration programs including a simple web server WIZnet W5200 TCP IP 10BaseTX 100BaseTX Ethernet controller Micro SD card support...

Page 2: ... CAT5 or greater Ethernet cable microSD card reader USB cable male USB A to mini B Parallax 805 00006 or 7 5 Volt DC power supply with 2 1 mm barrel jack Parallax 750 00009 Phillips 0 screwdriver and pliers for assembly Board Features WIZnet W5200 RJ 45 Ethernet Jack 2 1 mm Center positive Barrel Jack microSD Card Slot with Card RTC Super Cap Battery Backup Reset Button 40 Pin QuickStart Header RT...

Page 3: ... them in place on the bottom each with a nylon M3 nut 2 Carefully insert the WIZnet W5200 for QuickStart add on board into the QuickStart header so that the add on board covers the QuickStart board 3 Secure the WIZnet W5200 board to the QuickStart board by screwing the included nylon M3 screws into the standoffs through the WIZnet W5200 board s mounting holes That s it Nylon M3 Standoffs Nylon M3 ...

Page 4: ...thernet jack on the left 2 Attach the other end of the Ethernet cable to your home router Ethernet switch or other Ethernet device as noted in the Typical Home Network Configuration section 3 Next power the system with one of the options below That s it Power Supply Options The QuickStart WIZnet W5200 may be powered by any of these three options it is safe to connect any combination of these at th...

Page 5: ...hey are used by the W5200 board Propeller IO Pin QuickStart Header Pin Pin Function Description P0 1 Available P1 2 Available P2 3 Available P3 4 Available P4 5 Available P5 6 Available P6 7 Available P7 8 Available P8 9 SD_Dout W5200 SD Card SPI Dout Signal P9 10 SD_Clk W5200 SD Card SPI Clock Signal P10 11 SD_Din W5200 SD Card SPI Din Signal P11 12 SD_CS W5200 SD Card SPI Chip Select Signal P12 ...

Page 6: ...ng power from Ethernet In order for PoE to work your physical network needs to have power injected into the transmission medium as per the standard s specification The majority of networks do not natively support this feature as it requires the use of special hardware The header of 10 pins at the bottom of the WIZnet W5200 board pictured above is for use with the Silvertel Ag9050 To enable PoE sim...

Page 7: ...e DhcpObjectDemo spin to see an example of this helper object in action and to print network address information assigned to your QuickStart W5200 board These are the settings that my router assigned to my QuickStart W5200 board Your router will dynamically assign an available IP address to your QuickStart W5200 board when a request is made based on the MAC Media Access Control address entered int...

Page 8: ...r a specific string and will replace it with a value stored in memory as the page is being sent to the requester To see this demonstration web server in action follow these steps 1 Using a file browser Windows Explorer navigate to your unzipped demonstration program directory 2 Enter the Simple_server sub directory 3 With your MicroSD card reader copy the file index htm to the SD card Make sure yo...

Page 9: ...t Page title head body p Testing simple_server spin p h1 This is test PROPVAR00 h1 body html Spin Code for simple_server spin loaded onto the QuickStart W5200 Board CON _xinfreq 5_000_000 _clkmode xtal1 pll16x OBJ webserver W5200 Parse and Replace Webserver requires 3 cogs PUB Go counter Start the web server webserver Start Your custom web server code goes below Reset the counter counter 0 repeat ...

Page 10: ...mes are 8 characters or less with a 3 character or less file extension Within the index htm HTML web page file there is a special HTML tag that simple_server spin looks for when the page is rendered to the browser This specific string should have the form PROPVARxx where the xx is replaced by numeric values between 00 and 99 This gives you the ability to place 100 numbers into the web server s mem...

Reviews: