Microchip Technology Wi-Fi® G Demo Board User’s Guide

Page 1
Wi-Fi
®
G Demo Board
User’s Guide
2013 Microchip Technology Inc. DS50002147A
Page 2
Note the following details of the code protection feature on Microchip devices:
YSTEM
CERTIFIE DBYDNV
== ISO/TS16949==
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, K PICSTART, PIC and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MTP, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
Analog-for-the-Digital Age, Application Maestro, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, SQI, Serial Quad I/O, Total Endurance, TSHARC, UniWinDriver, WiperLock, ZENA and Z-Scale are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
GestIC and ULPP are registered trademarks of Microchip Technology Germany II GmbH & Co. & KG, a subsidiary of Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
© 2013, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 978-1-62077-077-1
EELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,
32
logo, rfPIC, SST, SST Logo, SuperFlash
QUALITYMANAGEMENTS
DS50002147A-page 2  2013 Microchip Technology Inc.
Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
®
MCUs and dsPIC® DSCs, KEELOQ
®
code hopping
Page 3
WI-FI® G DEMO BOARD
Object of Declaration:
Wi-Fi G Demo Board
USER’S GUIDE
DS50002147A-page 3  2013 Microchip Technology Inc.
Page 4
Wi-Fi G Demo Board User’s Guide
NOTES:
DS50002147A-page 4  2013 Microchip Technology Inc.
Page 5
Wi-Fi G DEMO BOARD
USER’S GUIDE

Table of Contents

Preface ........................................................................................................................... 7
Introduction............................................................................................................ 7
Document Layout .................................................................................................. 7
Conventions Used in this Guide ............................................................................ 9
Warranty Registration.......................................................................................... 10
Recommended Reading...................................................................................... 10
The Microchip Web Site ...................................................................................... 10
Development Systems Customer Change Notification Service .......................... 11
Customer Support ............................................................................................... 11
Document Revision History ................................................................................. 11
Chapter 1. Overview
1.1 Introduction ................................................................................................... 13
1.2 Wi-Fi G Demonstration Kit Contents ............................................................ 13
1.3 Functionality and Features ........................................................................... 13
Chapter 2. Hardware
2.1 Hardware Features ....................................................................................... 17
2.1.1 MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module .................... 17
2.1.2 Processor Support ..................................................................................... 17
2.1.3 Power Supply ............................................................................................ 17
2.1.4 LEDs .......................................................................................................... 17
2.1.5 Switches .................................................................................................... 17
2.1.6 Programming/Debug Port .......................................................................... 17
2.1.7 Expansion Port .......................................................................................... 17
Chapter 3. Getting Started
3.1 Overview ...................................................................................................... 19
3.2 Running the Wi-Fi G Demo Application ........................................................ 19
Chapter 4. Description of Modes of Operation
4.1 SoftAP Network ............................................................................................ 25
4.2 Ad Hoc Networks .......................................................................................... 25
4.3 Wi-Fi Direct Networks ................................................................................... 25
4.4 Zero Configuration/Bonjour .......................................................................... 26
4.4.1 Link Local .................................................................................................. 26
4.4.2 Multicast DNS ............................................................................................ 26
4.4.3 Service Discovery ...................................................................................... 26
4.4.4 Zero Configuration & mDNS demonstration .............................................. 26
4.5 Configured Vs. Unconfigured State .............................................................. 28
4.6 Determining New IP Address Assigned ....................................................... 29
2013 Microchip Technology Inc. DS50002147A-page 5
Page 6
Wi-Fi G Demo Board User’s Guide
Chapter 5. Programming
5.1 Software ....................................................................................................... 31
5.2 Hardware ...................................................................................................... 31
5.3 Programming Sequences – Project .............................................................. 33
5.4 Programming Sequences – Hex File ............................................................ 36
Chapter 6. Advanced Features
6.1 Change Transmit Power ............................................................................... 41
Chapter 7. Customizing Web Pages
7.1 Software Requirements ................................................................................ 43
7.2 Directory Location ........................................................................................ 43
7.3 Steps For Customizing Web Page Contents ................................................ 44
Appendix A. Wi-Fi G Demo Board Schematic
A.1 Introduction .................................................................................................. 47
Worldwide Sales and Service .....................................................................................49
DS50002147A-page 6  2013 Microchip Technology Inc.
Page 7
Wi-Fi G DEMO BOARD
USER’S GUIDE

Preface

NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document.
®
For the most up-to-date information on development tools, see the MPLAB Select the Help menu, and then Topics to open a list of available online help files.
INTRODUCTION
IDE online help.
This chapter contains general information that will be useful to know before using the Wi-Fi G Demo Board. Items discussed in this chapter include:
• Document Layout
• Conventions Used in this Guide
• Warranty Registration
• Recommended Reading
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the Wi-Fi G Demo Board to create a Wi-Fi network and control the demo board functions from the client device web browser.
The manual layout is as follows:
Chapter 1. “Overview” – This chapter provides a brief overview of the demo
board, highlighting its features and uses.
Chapter 2. “Hardware” – This chapter provides the hardware description of the
Wi-Fi G Demo Board.
Chapter 3. “Getting Started” – This chapter describes what you need to know to
start using the Wi-Fi G Demo Board.
Chapter 4. “Description of Modes of Operation” – This chapter provides the
modes of operation description of the Wi-Fi G Demo Board.
Chapter 5. “Programming” – This chapter describes what you need and how to
program the Wi-Fi G Demo Board.
2013 Microchip Technology Inc. DS50002147A-page 7
Page 8
Wi-Fi G Demo Board User’s Guide
Chapter 6. “Advanced Features” – This chapter describes the advanced fea-
tures such as changing transmit power.
Chapter 7. “Customizing Web Pages” – This chapter provides the guidelines on
how to customize web page contents.
Appendix A. “Wi-Fi G Demo Board Schematic” – This appendix includes the
Wi-Fi G Demo Board schematic.
DS50002147A-page 8  2013 Microchip Technology Inc.
Page 9
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books MPLAB® IDE User’s Guide
Initial caps A window the Output window
Quotes A field name in a window or
Underlined, italic text with right angle bracket
Bold characters A dialog button Click OK
N‘Rnnnn A number in verilog format,
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sample source code #define START
Italic Courier New A variable argument file.o, where file can be
Square brackets [ ] Optional arguments mcc18 [options] file
Curly brackets and pipe character: { | }
Ellipses... Replaces repeated text var_name [,
Preface
Emphasized text ...is the only compiler...
A dialog the Settings dialog A menu selection select Enable Programmer
“Save project before build”
dialog A menu path File>Save
A tab Click the Power tab
4‘b0010, 2‘hF1 where N is the total number of digits, R is the radix and n is a digit.
Filenames autoexec.bat File paths c:\mcc18\h Keywords _asm, _endasm, static Command-line options -Opa+, -Opa- Bit values 0, 1 Constants 0xFF, ‘A’
any valid filename
[options]
Choice of mutually exclusive arguments; an OR selection
Represents code supplied by user
errorlevel {0|1}
var_name...]
void main (void)
{ ...
}
2013 Microchip Technology Inc. DS50002147A-page 9
Page 10
Wi-Fi G Demo Board User’s Guide
WARRANTY REGISTRATION
Please complete the enclosed Warranty Registration Card and mail it promptly. Send­ing in the Warranty Registration Card entitles users to receive new product updates. Interim software releases are available at the Microchip web site.
RECOMMENDED READING
This user's guide describes how to use the Wi-Fi G Demo Board. The following Microchip documents are available from the Microchip web site (www.microchip.com), and are recommended as supplemental resources.
MRF24WG0MA/MRF24WG0MB Data Sheet (DS70686)
Microchip MRF24W Getting Started Quick Guide for MRF24WB0MA/B, MRF24WG0MA/B for MLA v5 (DS52108)
PIC32MX5XX/6XX/7XX Family Data Sheet (DS61156)
TCPIP Stack Help.chm (This is bundled together with the TCIP/IP source code releases.)
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information:
Product Support – Data sheets and errata, application notes and sample
programs, design resources, user’s guides and hardware support documents, latest software releases and archived software
General Technical Support – Frequently Asked Questions (FAQs), technical
support requests, online discussion groups, Microchip consultant program member listing
Business of Microchip – Product selector and ordering guides, latest Microchip
press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives
DS50002147A-page 10  2013 Microchip Technology Inc.
Page 11
Preface
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest.
To register, access the Microchip web site at www.microchip.com, click on Customer Change Notification and follow the registration instructions.
The Development Systems product group categories are:
Compilers – The latest information on Microchip C compilers, assemblers, linkers
and other language tools. These include all MPLAB C compilers; all MPLAB assemblers (including MPASM™ assembler); all MPLAB linkers (including MPLINK™ object linker); and all MPLAB librarians (including MPLIB™ object librarian).
Emulators – The latest information on Microchip in-circuit emulators. This
includes the MPLAB REAL ICE™ and MPLAB ICE 2000 in-circuit emulators.
In-circuit Debuggers – The latest information on the Microchip in-circuit debug-
gers. This includes MPLAB ICD 3 in-circuit debuggers and PICkit™ 3 debug express.
®
MPLAB
Integrated Development Environment for development systems tools. This list is focused on the MPLAB IDE, MPLAB IDE Project Manager, MPLAB Editor and MPLAB SIM simulator, as well as general editing and debugging features.
Programmers – The latest information on Microchip programmers. These include
production programmers such as MPLAB REAL ICE in-circuit emulator, MPLAB ICD 3 in-circuit debugger and MPLAB PM3 device programmers. Also included are nonproduction development programmers such as PICSTART PICkit 2 and 3.
IDE – The latest information on Microchip MPLAB IDE, the Windows®
®
Plus and
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document.
Technical support is available through the web site at:
http://www.microchip.com/support
DOCUMENT REVISION HISTORY
Revision A (March 2013)
• Initial Release of this Document.
2013 Microchip Technology Inc. DS50002147A-page 11
Page 12
Wi-Fi G Demo Board User’s Guide
NOTES:
DS50002147A-page 12  2013 Microchip Technology Inc.
Page 13

Chapter 1. Overview

1.1 INTRODUCTION
Thank you for purchasing the Microchip Technology’s Wi-Fi G Demonstration kit. The Wi-Fi G Demo Board provides a low-cost and portable development system for Microchip’s MRF24WG0MA IEEE 802.11b/g Wi-Fi Transceiver Module.
The Wi-Fi G Demo Board is preloaded with a demo software for the user to explore the features of the MRF24WG0MA Wi-Fi module. It is also expandable through an 8-pin expansion interface, which enables the user to extend its functionality by adding various sensor expansion boards.
The topics discussed in this chapter include:
• Wi-Fi G Demonstration Kit Contents
• Functionality and Features
1.2 Wi-Fi G DEMONSTRATION KIT CONTENTS
The Wi-Fi G Demonstration Kit contains the following:
• Wi-Fi G Demo Board
• 2 AAA Batteries
• Male 1x6 Connector Header HDR-2.54 (J14)
• Wi-Fi G Demo Board Information Sheet (DS52107A)
Wi-Fi G DEMO BOARD
USER’S GUIDE
1.3 FUNCTIONALITY AND FEATURES
The Wi-Fi G Demo Board supports the following network types:
• Infrastructure (client)
• Ad hoc
• Wi-Fi Direct (peer-to-peer as group client)
•SoftAP
The security modes supported are:
• Open
• WEP-40, WEP-104 (Wired Equivalent Privacy)
• WPA (Wi-Fi Protected Access)
• WPA2 (Wi-Fi Protected Access)
For ease of setup and usability, the following connection methods are also supported.
• WPS-PBC (Wi-Fi Protected Setup Push Button Configuration)
• WPS-PIN (Wi-Fi Protected Setup Personal Information Number)
2013 Microchip Technology Inc. DS50002147A-page 13
Page 14
Wi-Fi G Demo Board User’s Guide
Note: For Demo Version 1.02, only SoftAP, infrastructure and ad hoc network
support are offered. SoftAP supports only open and WEP security at this time. All security modes are supported in other network types. Future versions of the Demo software will include the additional functions noted above.
A representation of the layout for the Wi-Fi G Demo Board is shown in Figure 1-1.
FIGURE 1-1: Wi-Fi
®
G DEMO BOARD LAYOUT
DS50002147A-page 14  2013 Microchip Technology Inc.
Page 15
Overview
The Wi-Fi G Demo Board has the following key features:
1. MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module
2. PIC32MX695F512H 32-bit microcontroller
3. MCP1642 +3.3V Boost regulator
4. Three LED status indicators (LED0 - GREEN, LED1 - YELLOW, LED2 - RED)
5. One push-button switch for user input (SW0)
6. Power ON/OFF slider switch (S1)
7. 6-pin programming/debug port (J14)
8. 8-pin expansion port (J15)
2013 Microchip Technology Inc. DS50002147A-page 15
Page 16
Wi-Fi G Demo Board User’s Guide
NOTES:
DS50002147A-page 16  2013 Microchip Technology Inc.
Page 17

Chapter 2. Hardware

This chapter describes the hardware features of the Wi-Fi G Demo Board.
2.1 HARDWARE FEATURES
The key features of the Wi-Fi G Demo Board are listed below and are introduced in
Section 1.3 “Functionality and Features”. See Figure 1-1 for their locations on the
board.
2.1.1 MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module
The MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module provides wireless con­nectivity to the demo board. Host communication is through SPI2 of the PIC processor on the board.
2.1.2 Processor Support
The Wi-Fi G Demo Board is designed with a permanently mounted (soldered) PIC32MX695F512H processor.
Wi-Fi G DEMO BOARD
USER’S GUIDE
2.1.3 Power Supply
The board is powered by 2 AAA batteries. If required, the battery voltage is monitored and boosted by the MCP1642 Synchronous Boost Regulator.
2.1.4 LEDs
The LEDs: LED0 (GREEN), LED1 (YELLOW) and LED2 (RED) are connected to PORTE and PORTF of the PIC32MX695F512H processor. To turn the LEDs ON, the port pins are set high.
2.1.5 Switches
The Wi-Fi G Demo Board has the following switches:
• S1 – Controls the main power to the board. To turn on the board, move S1 slider to the ON position.
• SW0 – It is an active low push-button switch, connected to RD9 of the processor. When idle, the switch is pulled high (+3.3V) and when pressed, it is grounded.
2.1.6 Programming/Debug Port
Connector J14 provides easy access to the PIC32MX695F512H processor’s debug pins. This is used to program or reflash the demo board with new firmware.
2.1.7 Expansion Port
Connector J15 provides access to six of the processor’s spare I/O pins. These pins can function as general purpose I/O ports or as an SPI, I2C or UART interface to an external circuit design.
2013 Microchip Technology Inc. DS50002147A-page 17
Page 18
Hardware
TABLE 2-1: J15 EXPANSION PORT PIN CONFIGURATIONS
Pin 1 Pin 2 Pin 3 Pin 4 Pin 5 Pin 6 Pin 7 Pin 8 Interface
SCK +3.3V GND SDI SDO /SS -* -* SPI
- +3.3V GND SDA SCL - -* -* I
RTS +3.3V GND RX TX CTS -* -* USART
TX2
* - Pins 7 and 8 may be used as GPIO or A2D (analog-to-digital) pins.
+3.3V GND RX1 TX1 RX2 -* -* DUAL
2
C™
USART
2013 Microchip Technology Inc. DS50002147A-page 18
Page 19

Chapter 3. Getting Started

MRF24WG0MA MAC (SN): 001EC001F102 SSID: MCHP_G_F102
3.1 OVERVIEW
The Wi-Fi G Demo application uses a network provisioning mechanism called EasyConfig to enable configuration of an embedded device on a wireless network. EasyConfig utilizes the web server of the TCP/IP stack and a wireless network to enable the user to input the desired network information from a client browser, and then reset the device to connect to the desired network.
3.2 RUNNING THE Wi-Fi G DEMO APPLICATION
This section describes how to connect to the Wi-Fi G Demo Board to control the on board LEDs and view the status of the SW0 switch from a web browser. It also describes how to connect the Wi-Fi G Demo board to an existing network.
1. After turning the power on, the Wi-Fi G Demo Board broadcasts a SoftAP net­work with an SSID, MCHP_G_xxxx, where, xxxx is the last four digits of the MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module’s MAC address (See
Example 3-1).
Wi-Fi G DEMO BOARD
USER’S GUIDE
EXAMPLE 3-1:
FIGURE 3-1: AVAILABLE WIRELESS NETWORKS
2013 Microchip Technology Inc. DS50002147A-page 19
Note: SoftAP is required to transmit beacons within each beacon interval. This
increases the transmit power consumption and therefore shorten the battery life.
Page 20
Wi-Fi G Demo Board User’s Guide
2. Connect a client device (e.g., laptop, smart devices) to the MCHP_G_xxxx SoftAP network.
3. When the client device is connected, use a standard web browser and enter the IP address of the Wi-Fi G Demo Board. The default IP address is
http://192.168.1.3. Another alternative is to enter “mchpboard.local” into the web
browser. See figure Figure 3-2.
FIGURE 3-2: ACCESSING WEB BROWSER
4. The following web pages from the web server that is running on the Wi-Fi G Demo Board are displayed.
a) The index.htm web page displays the additional information about the Wi-Fi G
Demo Board application. It also displays the continually updating status of the three LEDs (LED0, LED1 and LED2) and push-button on the Wi-Fi G Demo Board, see Figure 3-3. To control the LEDs, click on the LED icon on the web page. To see the status of the push-button, press SW0 on the Wi-Fi G Demo Board.
DS50002147A-page 20  2013 Microchip Technology Inc.
Page 21
FIGURE 3-3: SAMPLE INDEX.HTM WEB PAGE
Getting Started
b) The mrf24wg0ma.htm web page highlights the features of the MRF24WG0MA
IEEE 802.11 b/g Wi-Fi Transceiver Module and the supporting development tools. See Figure 3-4.
2013 Microchip Technology Inc. DS50002147A-page 21
Page 22
Wi-Fi G Demo Board User’s Guide
FIGURE 3-4: SAMPLE MRF24WG0MA.HTM WEB PAGE
c) The configure.htm web page enables the user to scan for nearby networks
and connect to the selected network to start up as a group client in Wi-Fi Direct network, or as an ad hoc, or as a SoftAP and to select WPS-PBC or WPS-PIN. See Figure 3-5.
DS50002147A-page 22  2013 Microchip Technology Inc.
Page 23
Getting Started
FIGURE 3-5: SAMPLE CONFIGURE.HTM WEB PAGE
5. To connect the Wi-Fi G Demo board to an existing network, click Display Scan
Results on the configure.htm web page. See Figure 3-6.
FIGURE 3-6: DISPLAY SCAN RESULTS WEB PAGE
6. When a new network is selected, the Wi-Fi G Demo Board resets automatically
using the parameters (SSID, security key) of the new network to reconnect to this new network. See Figure 3-7.
2013 Microchip Technology Inc. DS50002147A-page 23
Page 24
Wi-Fi G Demo Board User’s Guide
FIGURE 3-7: RECONNECTION TO NEW NETWORK
7. To continue using the demo, the client device must be reconnected to the same network where Wi-Fi G Demo Board is redirected to.
Note: This is not applicable for initial release Demo Version 1.02. The demo board
always attempts to connect to the last known network. If the user wants to reset the demo board to factory default conditions (startup in SoftAP mode) again, then simply press SW0 for 4 seconds. Do NOT press SW0 immedi­ately on power up, as this initiates a self-test and does not reset the demo board to default factory conditions.
DS50002147A-page 24  2013 Microchip Technology Inc.
Page 25

Chapter 4. Description of Modes of Operation

4.1 SoftAP NETWORK
On starting the demo, the factory default conditions has the product start up as a SoftAP without security. This means that all the network information that is being con­figured on the device is going over-the-air in the open. For most applications, unless another user is specifically attempting to listen in on this network, the potential security impact is minor. However, for applications that require baseline level of security, WEP can be employed on the network.
SoftAP is the centralized coordinator for the network. With MRF24WG0MA IEEE
802.11 b/g Wi-Fi Transceiver Module firmware version 0x3107 and future releases, it supports Wired Equivalent Privacy (WEP) (40-bit/104-bit) security.
4.2 AD HOC NETWORKS
Ad Hoc networks are peer-to-peer networks with no centralized coordinator for the net­work. All the devices share the responsibilities of keeping the network running. Accord­ing to 802.11 specifications, ad hoc network only supports 802.11b rates of 1 Mbps, 2 Mbps, 5.5 Mbps and 11 Mbps.
One downfall of ad hoc networks is that typically security is not employed on them.
The MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module can secure an ad hoc network with Wired Equivalent Privacy (WEP) (40-bit/104-bit) security, like most of the laptops and ad hoc devices. Very few devices in the market can secure an ad hoc net­work with Wi-Fi Protected Access (WPA) level security due to tremendous overhead.
For most applications, unless another user is specifically attempting to listen in on this network, the potential security impact is minor. However, for applications that require baseline level of security, WEP can be employed on the network.
Most Android devices do not support ad hoc networks.
Wi-Fi G DEMO BOARD
USER’S GUIDE
4.3 Wi-Fi DIRECT NETWORKS
Wi-Fi Direct network is a peer-to-peer (P2P) network. It enables the user to configure a secured wireless network between several devices, such as smart devices, laptops or computers with wireless network adapters, without using an access point (AP).
Wi-Fi Direct supports Wi-Fi Protected Setup (WPS) connection method, which is known as the WSC (Wi-Fi Simple Configuration) Config Methods in the Wi-Fi Peer-to-Peer (P2P) Technical Specifications, in particular WPS Push Button method with WPA2.
From the negotiation process, each device determines which devices become group owner (GO) or group client (GC). The GroupOwnerIntent field in the P2P information element (IE) indicates the level of desire to become the GO. The higher the value, the higher the desire to be the GO.
MRF24WG0MA IEEE 802.11 b/g Wi-Fi Transceiver Module only supports the role of GC.
Wi-Fi Direct does not support 802.11b.
2013 Microchip Technology Inc. DS50002147A-page 25
Page 26
Wi-Fi G Demo Board User’s Guide
4.4 ZERO CONFIGURATION/BONJOUR
Zero Configuration (Zeroconf) provides a mechanism to simplify the device configura­tion on a network. The term Zeroconf is titled from the names Bonjour (Apple) and Avahi (Linux), and is an Internet Engineering Task Force (IETF) standard. Zeroconf provides simplified naming conventions, instead of relying on the IP addresses alone.
The Zeroconf is built on the following three core technologies:
4.4.1 Link Local
The first component of Zeroconf is the ability to self-assign an IP address to each mem­ber of a network. Usually, a Dynamic Host Configuration Protocol (DHCP) server han­dles such situations. However, when no DHCP server exists, Zeroconf-enabled devices negotiate the unique IP address amongst themselves.
4.4.2 Multicast DNS
The second component of Zeroconf is the ability to self-assign the host names. Multi­cast Domain Name System (mDNS) provides the local network with the ability to have the features of a DNS server. User can use the host names to access the devices on the network. When devices select to use the same host name, as in the IP address res­olution, each of the devices has the ability to self-assign the Auto-negotiate New Names, usually appending a number at the end of the name.
4.4.3 Service Discovery
The last component of Zeroconf is service discovery. All Zeroconf devices can broad­cast what services they provide. For instance, a printer can broadcast about available printing services. A thermostat can broadcast that it has an HVAC control service. For a specific service, the user can see the list of devices that provide the service, and connect to it. This eliminates the need to know whether something exists on a network (and what its IP or host name is). The user can query the network to see if a certain service exists or not, and easily connect to it.
4.4.4 Zero Configuration & mDNS demonstration
An iPhone and an apps supporting Zero Configuration is used in the demonstration.
DS50002147A-page 26  2013 Microchip Technology Inc.
Page 27
Description of Modes of Operation
FIGURE 4-1: ZERO CONFIGURATION DOMAIN
Click on the local domain and determine available services. See Figure 4-2.
FIGURE 4-2: SERVICE DISCOVERY
Click on the service offered, in this case, DemoWebServer. A web browser opens and displays the Wi-Fi G Demo Board web pages. See Figure 4-3.
2013 Microchip Technology Inc. DS50002147A-page 27
Page 28
Wi-Fi G Demo Board User’s Guide
FIGURE 4-3: DEMO WEB BROWSER
4.5 CONFIGURED VS. UNCONFIGURED STATE
When the Wi-Fi G Demo is in an unconfigured state (i.e, serving the default MCHP_G_xxxx SSID in SoftAP mode), the GREEN LED (LED0) blinks twice per sec­ond to indicate that it is not configured. After the network is configured, the LED blinks once per second.
Note: When the Wi-Fi G Demo Board is moved to a different network, a new IP
address is assigned to it. As the new Wi-Fi G Demo Board does not display the new IP address, the user must obtain the new IP address from the server that assigned it. Refer to your server’s documentation for the neces­sary steps required to obtain the new IP address.
DS50002147A-page 28  2013 Microchip Technology Inc.
Page 29
Description of Modes of Operation
4.6 DETERMINING NEW IP ADDRESS ASSIGNED
There are two methods to determine the new IP address assigned:
a) Zero Configuration / mDNS
From the zero configuration apps, once this apps redirects and opens up the web browser, the Wi-Fi G Demo web page shows the new assigned IP address. See
Figure 4-3.
b) AP DHCP ClientTable
Refer to your AP’s documentation for the necessary steps required to obtain the new IP address. As an example, for certain APs, by selecting <Status> and then <Local Net­work>, an option <DHCP Client Table> is offered. This DHCP Client Table lists the IP address that is assigned to the Wi-Fi G Demo Board. See Figure 4-4.
FIGURE 4-4: DHCP CLIENT TABLE
2013 Microchip Technology Inc. DS50002147A-page 29
Page 30
Wi-Fi G Demo Board User’s Guide
NOTES:
DS50002147A-page 30  2013 Microchip Technology Inc.
Page 31
5.1 SOFTWARE
The required software to program Wi-Fi G Demo Board include:
• Microchip MPLAB
• Microchip MPLAB XC32 Compiler
Wi-Fi G Demo Board is based on the Microchip TCPIP stack software. You can down­load the latest software version from the Microchip web site, as this contains the latest bug fixes and the best support for current versions of the compilers.
Initial release is based on the Microchip TCPIP v5 stack software. Future plan is to add this to Microchip TCPIP V6 stack software. Software updates are available on the Microchip web site.
The initial release will only demo SoftAP with the capability to scan before connection, enabling scan results to be available. From the scan results, another network can be chosen to be redirected to.
Future releases will add more features such as Wi-Fi Protected Setup (WPS), etc.
Refer to the release notes for more information.
Wi-Fi G DEMO BOARD

Chapter 5. Programming

®
X IDE
USER’S GUIDE
5.2 HARDWARE
The following hardware is required to program the Wi-Fi G Demo Board:
• In-circuit debuggers, emulators or programmers such as the PICkit™ 3, MPLAB
ICD 3 and MPLAB REAL ICE™ In-Circuit emulator.
In Figure 5-1, the MPLAB ICD 3 is used.
In Figure 5-3, the PICkit 3 debugger is used.
• ICD 2 to ICSP Adaptor (Part number AC164110) is needed if the MPLAB ICD 3 or
MPLAB REAL ICE In-Circuit Emulator is used.
• Wi-Fi G Demo Board
• Power supply requirements:
- If programming using PICkit 3 or MPLAB ICD 3, power supply can be supplied
- If using batteries during programming, note that multiple programming may
- +3.3V DC power supply may be needed if MPLAB X IDE is in debugging
The required hardware interconnections include:
• ICD 2 to ICSP Adaptor (Part number AC164110)
- Connect Wi-Fi G Demo Board J14 pin 1 to ICD 2 to ICSP Adaptor J2 pin1.
• PICkit 3
- Connect Wi-Fi G Demo Board J14 pin 1 to PICKit3 header pin 1. See
from the PICkit 3 or MPLAB ICD 3 itself.
drain the batteries.
mode.
See Figure 5-2.
Figure 5-3.
2013 Microchip Technology Inc. DS50002147A-page 31
Page 32
Wi-Fi G Demo Board User’s Guide
• If external power supply is used:
- Supply Wi-Fi G Demo Board J14 pin 2 with +3.3V.
- Connect Wi-Fi G Demo Board J14 pin 3 to GND.
Otherwise, make sure 2 AAA batteries are present.
FIGURE 5-1: Wi-Fi
INTERFACE
®
G DEMO BOARD – MPLAB® ICD 3 HARDWARE
FIGURE 5-2: Wi-Fi
HARDWARE INTERFACE
®
G DEMO BOARD – ICD 2 TO ICSP™ ADAPTOR
DS50002147A-page 32  2013 Microchip Technology Inc.
Page 33
Programming
FIGURE 5-3: Wi-Fi® G DEMO BOARD – PICkit™ 3 HARDWARE
INTERFACE
5.3 PROGRAMMING SEQUENCES – PROJECT
1. Open MPLAB X IDE.
2. Click on F Wi-Fi G Demo Board. See Figure 5-4.
FIGURE 5-4: OPEN Wi-Fi
ile>Open Project. Browse to Wi-Fi G Demo Board directory and open
®
G DEMO BOARD PROJECT
3. Check the appropriate in-circuit debugger is selected. Click on <Project Proper­ties>. See Figure 5-5. Ensure that right in-circuit debugger is selected. See
Figure 5-6.
2013 Microchip Technology Inc. DS50002147A-page 33
Page 34
Wi-Fi G Demo Board User’s Guide
FIGURE 5-5: PROJECT PROPERTIES
FIGURE 5-6: IN-CIRCUIT DEBUGGER SELECTION
4. Ensure that power switch S1 is set to ON. Select <Make and Program Device
(Project Wi-Fi_G_Demo_Board)>. See Figure 5-7.
DS50002147A-page 34  2013 Microchip Technology Inc.
Page 35
FIGURE 5-7: MAKE AND PROGRAM DEVICE
Programming
5. Wait for programming to complete. See Figure 5-8.
FIGURE 5-8: PROGRAMMING IS COMPLETED
2013 Microchip Technology Inc. DS50002147A-page 35
Page 36
Wi-Fi G Demo Board User’s Guide
5.4 PROGRAMMING SEQUENCES – HEX FILE
1. Open MPLAB X IDE.
2. Click on F
See Figure 5-9.
FIGURE 5-9: IMPORT HEX FILE
ile>Import>Hex/ELF ..(Prebuilt) File.
3. Browse to directory containing this HEX file. Select the correct device
<PIC32MX695F512H>. See Figure 5-10.
DS50002147A-page 36  2013 Microchip Technology Inc.
Page 37
Programming
FIGURE 5-10: IMPORT HEX FILE – SELECT DEVICE PIC32MX695F512H
4. Select the correct hardware tool (in-circuit debugger), for example PICkit 3. See
Figure 5-11.
FIGURE 5-11: IMPORT HEX FILE – SELECT IN-CIRCUIT DEBUGGER
5. A Summary listing the Project Directory, Target Device, Platform Tool and Project Source are displayed. Click on <Finish>. See Figure 5-12.
2013 Microchip Technology Inc. DS50002147A-page 37
Page 38
Wi-Fi G Demo Board User’s Guide
FIGURE 5-12: IMPORT HEX FILE – COMPLETED
6. Power supply is supplied to Wi-Fi G Demo Board from the in-circuit debugger.
Under <Project Properties> and selected in-circuit debugger, click on O categories>Power. Enable option to <Power target circuit from PICkit 3> or <Power target circuit from MPLAB ICD 3>. See Figure 5-13 and Figure 5-14.
FIGURE 5-13: PICkit™ 3 POWER CONFIGURATION
ption
DS50002147A-page 38  2013 Microchip Technology Inc.
Page 39
Programming
FIGURE 5-14: MPLAB® ICD 3 POWER CONFIGURATION
7. Click on <Make and Program Device>. See Figure 5-15.
FIGURE 5-15: MAKE AND PROGRAM DEVICE
8. Once programming is completed, the output panel displays programming com­pleted status. See Figure 5-16.
2013 Microchip Technology Inc. DS50002147A-page 39
Page 40
Wi-Fi G Demo Board User’s Guide
FIGURE 5-16: PROGRAMMING COMPLETED
DS50002147A-page 40  2013 Microchip Technology Inc.
Page 41

Chapter 6. Advanced Features

6.1 CHANGE TRANSMIT POWER
Wi-Fi APIs are available in source file WFTxPower.c to read and write MRF24WG0MA transmit power. MRF24WG0MA has a transmit power range of 0 dBm to 18 dBm.
Invoke function prototype WF_TxPowerGetMax to read back MRF24WG0MA transmit power. Invoke function prototype WF_TxPowerSetMax to set MRF24WG0MA transmit power. No conversion of units is needed as input parameter to WF_TxPowerSetMax is in dBm.
Wi-Fi G DEMO BOARD
USER’S GUIDE
2013 Microchip Technology Inc. DS50002147A-page 41
Page 42
Wi-Fi G Demo Board User’s Guide
NOTES:
DS50002147A-page 42  2013 Microchip Technology Inc.
Page 43

Chapter 7. Customizing Web Pages

7.1 SOFTWARE REQUIREMENTS
• Microchip MPLAB X IDE
7.2 DIRECTORY LOCATION
WiFiGDemo web pages are contained within MPLAB WiFi_G_Demo_Board project.
FIGURE 7-1: Wi-Fi
Wi-Fi G DEMO BOARD
USER’S GUIDE
®
G DEMO BOARD MPLAB® PROJECT DIRECTORY
• Execute or run batch file, based on MPFS utility MPFS2.jar, to compile HTM files
into a WiFiGDemoMPFSImg.c image
\TCPIP\WiFiGDemo\Convert WebPages to MPFS.bat
2013 Microchip Technology Inc. DS50002147A-page 43
Page 44
Wi-Fi G Demo Board User’s Guide
This batch file will output five files upon successful completion.
- WiFiGDemoMPSFSImg.bin
- WiFiGDemoMPFSImg.c (used by Wi-Fi_G_Demo_Board proj-
ect)
- WiFiGDemoMPFSImg.s
- HTTPPrint.c
- HTTPPrint.idx
• Wi-Fi G Demo HTM files
\TCPIP\WiFiGDemo\WiFiGDemoWebPages
Web Pages
• index.htm
• mrf24wg0ma.htm
• configure.htm
• error.htm
• reconnect.htm
• Javascript file
\TCPIP\WiFiGDemo\WebPages\javascript\mchp.js
• Source code files (where HTM files and stack source codes interacts)
\TCPIP\WiFiGDemo\customHTTPApp.c
7.3 STEPS FOR CUSTOMIZING WEB PAGE CONTENTS
This section illustrates customizing web page contents by adding a new field entry <RF module FW version> to index.htm.
1. Click on the selected HTM file to view the original un-modified web page. For example, index.htm. See Figure 7-2.
FIGURE 7-2: ORIGINAL UN-MODIFIED INDEX.HTM
2. Open index.htm. Create a new entry by adding the following line:
DS50002147A-page 44  2013 Microchip Technology Inc.
Page 45
Customizing Web Pages
<li>RF module FW version: <b> fwver~</b><li>
Save the file. See Figure 7-3.
FIGURE 7-3: INSERT NEW ENTRY INTO INDEX.HTM
3. Click on the modified index.htm to view the changes. See Figure 7-4.
FIGURE 7-4: MODIFIED INDEX.HTM
4. For new added functions, such as <RF module FW version>, the corresponding
files may need to be changed.
2013 Microchip Technology Inc. DS50002147A-page 45
Page 46
Wi-Fi G Demo Board User’s Guide
• CustomHTTPApp.c
// ========================================== // = Sends the FW version = // ========================================== void HTTPPrint_fwver(void) {
static BOOL firstTime = TRUE; static tWFDeviceInfo deviceInfo; BYTE fwVerString[8];
if (firstTime) {
firstTime = FALSE; WF_GetDeviceInfo(&deviceInfo); // only call this once, not
continually } uitoa((deviceInfo.romVersion << 8) | deviceInfo.patchVersion, fwVerString); TCPPutString(sktHTTP, fwVerString);
}
5. Run the batch file <Convert WebPages to MPFS.bat> to generate a new WiFiGDemoMPFSImg.c image
6. Rebuild the project. In the build process, the project uses WiFiGDemoMPF­SImg.c.
7. Connect to the WiFiG-Demo network. The changes are reflected on the WiFi-GDemo web page.
FIGURE 7-5: NEW Wi-Fi
®
G DEMO WEB PAGE
DS50002147A-page 46  2013 Microchip Technology Inc.
Page 47

Appendix A. Wi-Fi G Demo Board Schematic

A.1 INTRODUCTION
This appendix shows the Wi-Fi G Demo Board Schematic.
Wi-Fi G DEMO BOARD
USER’S GUIDE
2013 Microchip Technology Inc. DS50002147A-page 47
Page 48
DS50002147A-page 48 2013 Microchip Technology Inc.
FIGURE A-1: Wi-Fi® G DEMO BOARD SCHEMATICS
Wi-Fi G Demo Board User’s Guide
Page 49

Worldwide Sales and Service

AMERICAS
Corporate Office
2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support:
http://www.microchip.com/ support
Web Address:
www.microchip.com
Atlanta
Duluth, GA Tel: 678-957-9614 Fax: 678-957-1455
Boston
Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088
Chicago
Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075
Cleveland
Independence, OH Tel: 216-447-0464 Fax: 216-447-0643
Dallas
Addison, TX Tel: 972-818-7423 Fax: 972-818-2924
Detroit
Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260
Indianapolis
Noblesville, IN Tel: 317-773-8323 Fax: 317-773-5453
Los Angeles
Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608
Santa Clara
Santa Clara, CA Tel: 408-961-6444 Fax: 408-961-6445
Toronto
Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509
ASIA/PACIFIC
Asia Pacific Office
Suites 3707-14, 37th Floor Tower 6, The Gateway Harbour City, Kowloon Hong Kong Tel: 852-2401-1200 Fax: 852-2401-3431
Australia - Sydney
Tel: 61-2-9868-6733 Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000 Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511 Fax: 86-28-8665-7889
China - Chongqing
Tel: 86-23-8980-9588 Fax: 86-23-8980-9500
China - Hangzhou
Tel: 86-571-2819-3187 Fax: 86-571-2819-3189
China - Hong Kong SAR
Tel: 852-2401-1200 Fax: 852-2401-3431
China - Nanjing
Tel: 86-25-8473-2460 Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355 Fax: 86-532-8502-7205
China - Shanghai
Tel: 86-21-5407-5533 Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829 Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660 Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300 Fax: 86-27-5980-5118
China - Xian
Tel: 86-29-8833-7252 Fax: 86-29-8833-7256
China - Xiamen
Tel: 86-592-2388138 Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040 Fax: 86-756-3210049
ASIA/PACIFIC
India - Bangalore
Tel: 91-80-3090-4444 Fax: 91-80-3090-4123
India - New Delhi
Tel: 91-11-4160-8631 Fax: 91-11-4160-8632
India - Pune
Tel: 91-20-2566-1512 Fax: 91-20-2566-1513
Japan - Osaka
Tel: 81-66-152-7160 Fax: 81-66-152-9310
Japan - Yokohama
Tel: 81-45-471- 6166 Fax: 81-45-471-6122
Korea - Daegu
Tel: 82-53-744-4301 Fax: 82-53-744-4302
Korea - Seoul
Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857 Fax: 60-3-6201-9859
Malaysia - Penang
Tel: 60-4-227-8870 Fax: 60-4-227-4068
Philippines - Manila
Tel: 63-2-634-9065 Fax: 63-2-634-9069
Singapore
Tel: 65-6334-8870 Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-5778-366 Fax: 886-3-5770-955
Taiwan - Kaohsiung
Tel: 886-7-213-7828 Fax: 886-7-330-9305
Taiwan - Taipei
Tel: 886-2-2508-8600 Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351 Fax: 66-2-694-1350
EUROPE
Austria - Wels
Tel: 43-7242-2244-39 Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828 Fax: 45-4485-2829
France - Paris
Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79
Germany - Munich
Tel: 49-89-627-144-0 Fax: 49-89-627-144-44
Italy - Milan
Tel: 39-0331-742611 Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399 Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90 Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869 Fax: 44-118-921-5820
10/26/12
DS50002147A-page 49  2013 Microchip Technology Inc.
Loading...