MICROCHIP PIC32MX User Guide

PIC32MX Starter Kit
User’s Guide
© 2007 Microchip Technology Inc. DS61144B
Note the following details of the code protection feature on Microchip devices:
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, Accuron, dsPIC, K
EELOQ, KEELOQ logo, microID, MPLAB, PIC,
PICmicro, PICSTART, PRO MATE, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
AmpLab, FilterLab, Linear Active Thermistor, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA 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.
All other trademarks mentioned herein are property of their respective companies.
© 2007, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received ISO/TS-16949:2002 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
DS61144B-page ii © 2007 Microchip Technology Inc.
PIC32MX STARTER KIT
USER’S GUIDE

Table of Contents

Preface ........................................................................................................................... 1
Chapter 1. Introducing the PIC32MX Starter Kit
1.1 Introduction ..................................................................................................... 5
1.2 Highlights ........................................................................................................ 5
1.3 Kit Contents .................................................................................................... 5
1.4 PIC32MX Functionality and Features ............................................................. 6
1.5 Using the PIC32MX Starter Kit Out of the Box ............................................... 7
1.6 Installing the PIC32MX Starter Kit CD ............................................................ 7
1.7 PIC32MX Demonstration Program ................................................................. 7
Chapter 2. PIC32MX Starter Kit Tutorial
2.1 Introduction ..................................................................................................... 9
2.2 Highlights ........................................................................................................ 9
2.3 Host Computer Requirements ........................................................................ 9
2.4 Installing the Starter Kit Board ...................................................................... 10
2.5 Starting the Tutorial Project .......................................................................... 14
2.6 Building the Project ....................................................................................... 15
2.7 Programming the Device .............................................................................. 16
2.8 Running the Program ................................................................................... 17
2.9 Tutorial Program Operation .......................................................................... 17
Chapter 3. Create a New Project
3.1 Introduction ................................................................................................... 21
3.2 Highlights ...................................................................................................... 21
3.3 Creating a New Project ................................................................................ 21
Chapter 4. PIC32MX Starter Kit Hardware
4.1 Introduction ................................................................................................... 31
4.2 Hardware Features ....................................................................................... 31
Appendix A. PIC32MX Starter Kit Schematics
A.1 Introduction .................................................................................................. 33
A.2 Development Board Block Diagram ............................................................. 33
A.3 Starter Kit Board Schematics ....................................................................... 33
Index ............................................................................................................................. 39
Worldwide Sales and Service .................................................................................... 40
© 2007 Microchip Technology Inc. DS61144B-page iii
PIC32MX Starter Kit User’s Guide
NOTES:
DS61144B-page iv © 2007 Microchip Technology Inc.
PIC32MX STARTER KIT
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.
®
IDE online help.

INTRODUCTION

This chapter contains general information that will be useful to know before using the PIC32MX. Items discussed in this chapter include:
• Document Layout
• Conventions Used in this Guide
• 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 PIC32MX Starter Kit as a development tool to emulate and debug firmware on a target board. The manual is composed of the follow­ing chapters:
Chapter 1. “Introducing the PIC32MX Starter Kit” provides a brief overview of
the PIC32MX Starter Kit, highlighting its features and uses.
Chapter 2. “PIC32MX Starter Kit Tutorial” provides step-by-step instructions for
installing the PIC32MX and using the Microchip MPLAB IDE to build and run the tutorial program on the PIC32MX Starter Kit.
Chapter 3. “Create a New Project” provides step-by-step instructions for creating
a new project using the MPLAB IDE and loading it onto the PIC32MX Starter Kit.
Chapter 4. “PIC32MX Starter Kit Hardware” provides a more detailed descrip-
tion of the features of the hardware included in the PIC32MX Starter Kit.
Appendix A. “PIC32MX Starter Kit Schematics” provides a block diagram and
detailed schematics of the PIC32MX Starter Kit.
© 2007 Microchip Technology Inc. DS61144B-page 1
PIC32MX Starter Kit User’s Guide

CONVENTIONS USED IN THIS GUIDE

This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books MPLAB
Emphasized text ...is the only compiler...
Initial caps A window the Output window
A dialog the Settings dialog
A menu selection select Enable Programmer
Quotes A field name in a window or dialog “Save project before build”
Underlined, italic text with right
A menu path File>Save
angle bracket
Bold characters A dialog button Click OK
A tab Click the Power tab
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sample source code
Filenames
File paths
Keywords
Command-line options
Bit values
Constants (in source code)
Italic Courier New A variable argument
#define START
autoexec.bat
c:\mcc18\h
_asm, _endasm, static
-Opa+, -Opa-
0, 1
0xFF, ‘A
file.o, where file can be any
valid filename
Square brackets [ ] Optional arguments
Curly brackets and pipe character: { | }
Choice of mutually exclusive arguments; an OR selection
Ellipses... Replaces repeated text
Represents code supplied by user
mcc18 [options] file [options]
errorlevel {0|1}
var_name [, var_name...]
void main (void) { ... }
®
IDE User’s Guide
DS61144B-page 2 © 2007 Microchip Technology Inc.

RECOMMENDED READING

This user’s guide describes how to use the PIC32MX Starter Kit.
The following Microchip documents are available and recommended as supplemental reference resources.
Readme for the PIC32MX
For the latest information on using PIC32MX microcontrollers, read the file (an ASCII text file) at the root level of the CD included in the PIC32MX Starter Kit. The file generally contains the most current update information, as well as any issues that may not have been available when this user’s guide was published.
Readme Files
For the latest information on using other tools, read the tool-specific readme files in the
Readmes subdirectory of the PIC32MX Starter Kit installation directory. The files contain
update information, as well as any issues that may not have been available when this user’s guide was published.
PIC32MX Data Sheet (DS61143)
Consult this document for detailed information on the PIC32MX general purpose, 32-bit devices. Reference information found in this data sheet includes:
• Device memory map
• Device pinout and packaging details
• Device electrical specifications
• List of peripherals included on the device
MPLAB
This document details the use of Microchip’s MPLAB C32 C Compiler for PIC32MX devices to develop an application. MPLAB C32 is a GNU-based language tool, based on source code from the Free Software Foundation (FSF). For more information about FSF, see their web site at www.fsf.org.
MPLAB
Consult this document for more information pertaining to the installation and implementation of the MPLAB IDE software, as well as the MPLAB Editor and MPLAB SIM Simulator software that are included with it.
®
C32 C Compiler User’s Guide (DS51686)
®
IDE User’s Guide (DS51519)
Preface
PIC32MX.txt

THE MICROCHIP WEB SITE

Microchip provides online support via our web site at www.microchip.com. This web site makes files and information easily available to customers. Accessible by most Internet browsers, 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 listings
Business of Microchip – Product selector and ordering guides, latest Microchip
press releases, listings of seminars and events; and listings of Microchip sales offices, distributors and factory representatives
© 2007 Microchip Technology Inc. DS61144B-page 3
PIC32MX Starter Kit User’s Guide

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 Change Notification and follow the registration instructions.
The Development Systems product group categories are:
Compilers – The latest information on Microchip C compilers and other language
tools. These include the MPLAB C18, MPLAB C30, and MPLAB C32 C compilers; ASM32, MPASM™ and MPLAB ASM30 assemblers; MPLINK™, and MPLAB LINK30, MPLAB LINK32 object linkers; and MPLIB™ and MPLAB LIB30 object librarians.
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
debuggers. This includes the MPLAB ICD 2 and PICkit™ 2.
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
the MPLAB PM3 device programmer and the PICSTART PICkit 2 development programmers.
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
www.microchip.com, click on Customer
®
Plus, PICkit™ 1 and

CUSTOMER SUPPORT

Several channels are available to assist the users of Microchip products:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line
Customers should contact their distributor, representative or FAE for support. Local sales offices are also available to help customers. A list of sales offices and locations is included in the back of this document.
Technical support is available through the web site

DOCUMENT REVISION HISTORY

Revision A (October 2007)
This is the initial release of the PIC32MX Starter Kit User’s Guide.
Revision B (October 2007)
Removed confidential status.
http://support.microchip.com
DS61144B-page 4 © 2007 Microchip Technology Inc.

Chapter 1. Introducing the PIC32MX Starter Kit

1.1 INTRODUCTION

Thank you for purchasing the Microchip Technology PIC32MX Starter Kit. This kit provides a low-cost, modular development system for Microchip’s new line of 32-bit microcontrollers.
The Starter Kit comes pre-loaded with demonstration software for the user to explore the new features of the PIC32MX. It is also expandable through a modular expansion interface, which allows the user to extend its functionality. The PIC32MX Starter Kit also supplies on-board circuitry for full debug and programming capabilities.

1.2 HIGHLIGHTS

This chapter covers the following topics:
• Kit Contents
• PIC32MX Functionality and Features
• Using the PIC32MX Starter Kit Out of the Box
• PIC32MX Demonstration Program
The preprogrammed example code on the PIC32MX MCU has been included on the PIC32MX Starter Kit CD-ROM for future reference. All project files have been included, so that the code may be used directly to restore the PIC32MX MCU on the Starter Kit to its original state (i.e., if the sample device has been reprogrammed with another pro­gram), or so you can use the tutorial code as a platform for further experimentation.
PIC32MX STARTER KIT
USER’S GUIDE

1.3 KIT CONTENTS

The PIC32MX Starter Kit contains the following items:
• PIC32MX Starter Kit Board
•USB MINI-B cable
• PIC32 Starter Kit Installation CD-ROM, containing:
-User’s Guide
- Data Sheet for the PIC32MX family
- PIC32MX Family Reference Manual
- PIC32MX Peripheral Library Manual
- Schematics and PCB drawing files
- Code examples for use with the PIC32MX devices
If you are missing any part of the kit, contact a Microchip sales office for assistance (refer to the list on the last page of this manual).
© 2007 Microchip Technology Inc. DS61144B-page 5
PIC32MX Starter Kit User’s Guide

1.4 PIC32MX FUNCTIONALITY AND FEATURES

A representation of the layout of the PIC32MX Starter Kit is shown in Figure 1-1. The board includes these key features, as indicated in the diagram:
1. PIC32MX360F512L 32-bit microcontroller
2. Green power-indicator LED
3. Regulated +3.3V power supply for powering the Starter Kit board via USB or expansion board
4. On-board crystal for precision microcontroller clocking (8 MHz)
5. USB connectivity for on-board debugger communications
6. PIC18LF4550 USB microcontroller for on-board debugging
7. Orange Debug indicator LED
8. Three push-button switches for user-defined inputs
9. Three user-defined indicator LEDs
10. Connector for connecting various expansion boards (on the underside of board)
For additional details on these features, refer to Chapter 4. “PIC32MX Starter Kit Hard-
ware”.

FIGURE 1-1: PIC32MX STARTER KIT DEMO BOARD LAYOUT

7
6
5
4
3
2
1
8
9
10
DS61144B-page 6 © 2007 Microchip Technology Inc.
Introducing the PIC32MX Starter Kit

1.5 USING THE PIC32MX STARTER KIT OUT OF THE BOX

The PIC32MX Starter Kit may be used directly from the box as a demonstration board for the PIC32MX device. The PIC32MX is preprogrammed with the classic “Simon Says” game in the PIC32MX360F512L device (i.e., simon_says_demo.hex) and is ready for immediate use.

1.5.1 How to Play the Game

When the USB cable is plugged into the Starter Kit, the three LEDs start blinking to indi­cate the start of a new game. Begin the game by pressing one of the switches to choose the level of game difficulty, SW1-SW3 (SW3 is the eastest, SW1 is the hardest). The goal is to imitate the light patterns as long as you can, without getting frazzled. Ulti­mately, you will make a mistake and all of the LEDs will light up to signal the end of a game. After a brief pause, you can press a switch again to start a new game.
If the Starter Kit is connected to the MPLAB IDE, the game stops. It will be replaced by the MPLAB IDE project that you select when the program button is pressed. The Simon game can be reloaded onto the Starter kit by opening the simon_says_demo.mcw file from the c:\Program Files\Microchip\pic32_solutions\ simon_says_demo directory.

1.6 INSTALLING THE PIC32MX STARTER KIT CD

The Starter Kit CD-ROM contains the MPLAB IDE, MPLAB C32 C Compiler tools, code examples, sample projects, technical documentation, a getting started tutorial and this PIC32MX Starter Kit User’s Guide. When the CD is placed into your CD drive, an auto­matic installation application will guide you to install the tools and necessary documents.

1.7 PIC32MX DEMONSTRATION PROGRAM

The preprogrammed example code on the PIC32MX has been included on the PIC32MX Starter Kit CD-ROM for future reference. All project files have been included, so that the code may be used directly to restore a PIC32MX to its original state (i.e., if the sample device has been reprogrammed with another program), or so you can use the tutorial code as a platform for further experimentation.
© 2007 Microchip Technology Inc. DS61144B-page 7
PIC32MX Starter Kit User’s Guide
NOTES:
DS61144B-page 8 © 2007 Microchip Technology Inc.

Chapter 2. PIC32MX Starter Kit Tutorial

2.1 INTRODUCTION

This chapter is a self-paced tutorial to get you started using the PIC32MX Starter Kit.

2.2 HIGHLIGHTS

Items discussed in this chapter include:
• Host Computer Requirements
• Installing the Starter Kit Board
• Starting with the Tutorial Project
• Building the Project
• Programming the Device
• Running the Program
• Operation of the Tutorial Program

2.3 HOST COMPUTER REQUIREMENTS

PIC32MX STARTER KIT
USER’S GUIDE
To communicate with and program the Starter Kit board, the following hardware and software requirements must be met:
• PC-compatible system
• An available USB port on PC or powered USB hub
• CD-ROM drive
• Windows XP
(The PIC32MX Starter Kit has not been tested on Microsoft® Windows NT®, Windows 2000
®
®
or Microsoft Vista™ operating systems)
© 2007 Microchip Technology Inc. DS61144B-page 9
PIC32MX Starter Kit User’s Guide

2.4 INSTALLING THE STARTER KIT BOARD

As a USB device, the Starter Kit board requires very little effort to install; most of the work is done by the operating system. Begin by closing all applications.

2.4.1 Install the Tools and Projects

1. Insert the PIC32 Starter Kit CD into your CD-ROM drive and click the install from CD menu option. If the installation application does not automatically start, navigate to the files on the CD and open
The following window is displayed:

FIGURE 2-1: INSTALLING THE PIC32 STARTER KIT BOARD

setup.exe.
2. Reboot your system when prompted to do so.
Note: The dialog also provides an option to check the Microchip web site for
newer versions of the Starter Kit software.

2.4.2 View the Getting Started Tutorial

Perform the following steps to view the tutorial:
1. After your computer has rebooted, the Getting Started Tutorial menu opens.
2. View the tutorial instructions for connecting to the Starter Kit board and running the tutorial project.
If you performed the installation steps as you followed along in the Getting Started tutorial, skip to Section 2.5 “Starting the Tutorial Project” on page 14.
If you did not, continue to the next page for instructions about how to connect the board and install the device driver.
DS61144B-page 10 © 2007 Microchip Technology Inc.
Loading...
+ 30 hidden pages