Copyright © Parallax Inc.
WIZnet W5200 for QuickStart (#40002)
v1.0 3/13/2013 Page 8 of 10
Setting Static Network Address Settings.
Sometimes it is useful to be able to set the W5200’s network address settings manually. You may want
to do this if you want to assign your Quic W5200 board an IP address that doesn’t change, or
you want to force it to communicate with non-default address settings. These are some of the common
settings you can change – the methods are located in the W5200.spin driver object file:
PUB SetGateway(octet3, octet2, octet1, octet0)
PUB SetSubnetMask(octet3, octet2, octet1, octet0)
PUB SetMac(octet5, octet4, octet3, octet2, octet1, octet0)
PUB SetIp(octet3, octet2, octet1, octet0)
And an example of these methods in use:
OBJ
wiz :"W5200"
PUB YourProgram
wiz.SetGateway(192, 168, 1, 1) 'Tell the W5200 the router's address
wiz.SetSubnetMask(255, 255, 255, 0) 'Statically set the subnet to communicate on
wiz.SetMac($50, $38, $58, $33, $32, $41) 'Statically set the W5200's hardware ID
' (should be unique on the network)
wiz.SetIp(192, 168, 1, 130) 'Statically set the W5200's IP address
Quick Start Web Server Application
This example web server program for the Quic W5200 board can serve files requested by a web
browser or other application that follows the HTTP protocol. This particular web server implementation
automatically searches for 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 you put
index.htm in the SD card’s root directory (do not put it in a folder).
4.
Safely remove the MicroSD card from your computer.
5.
Insert the MicroSD card into the W5200 board’s MicroSD card slot. Do this with your QuickStart
+ W5200 board unpowered.
6.
Attach your Quic W5200 board to your computer via the QuickStart board’s USB
connector.
7.
Open the simple_server.spin file with the Propeller Tool.
8.
Compile and download the simple_server.spin program to the Propeller by pressing the F11 key
on your keyboard.
Once simple_server.spin has been downloaded to your Quic W5200 board, the web server will
start. In order to view the web page served by your Quic W5200 board, you need to know the
IP address that your router assigned to your Quic W5200 board. If you do not already know
what this IP address is, refer to the “Requesting a Dynamically Assigned IP Address for the W5200”
section on page 7.
9.
Open your favorite web browser and enter the IP address of your Quic W5200 into the
browser’s address bar.
10.
Your browser should display the webpage dynamically rendered from the Quic W5200
board.