Parallax WIZnet W5200 Quick Start Manual page 8

Table of Contents

Advertisement

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 QuickStart + 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)
wiz.SetSubnetMask(255, 255, 255, 0)
wiz.SetMac($50, $38, $58, $33, $32, $41) 'Statically set the W5200's hardware ID
wiz.SetIp(192, 168, 1, 130)
Quick Start Web Server Application
This example web server program for the QuickStart + 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 QuickStart + 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 QuickStart + W5200 board, the web server will
start. In order to view the web page served by your QuickStart + W5200 board, you need to know the
IP address that your router assigned to your QuickStart + 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 QuickStart + W5200 into the
browser's address bar.
10. Your browser should display the webpage dynamically rendered from the QuickStart + W5200
board.
Copyright © Parallax Inc.
'Tell the W5200 the router's address
'Statically set the subnet to communicate on
' (should be unique on the network)
'Statically set the W5200's IP address
WIZnet W5200 for QuickStart (#40002)
v1.0 3/13/2013 Page 8 of 10

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WIZnet W5200 and is the answer not in the manual?

This manual is also suitable for:

40002

Table of Contents