PIC32MX Starter Kit User’s Guide © 2009 Microchip Technology Inc.
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.
PIC32MX STARTER KIT USER’S GUIDE Table of Contents Preface Introduction............................................................................................................ 1 Document Layout .................................................................................................. 1 Conventions Used in this Guide ............................................................................ 2 Recommended Reading....................................................................................
PIC32MX Starter Kit User’s Guide Appendix A. PIC32MX Starter Kit Schematics A.1 Introduction .................................................................................................. 37 A.2 Development Board Block Diagram ............................................................. 37 A.3 Starter Kit Board Schematics ....................................................................... 37 Index .....................................................................................................
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.
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 Initial caps Referenced books MPLAB® IDE User’s Guide Emphasized text ...is the only compiler...
Preface 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. Release Notes for PIC32MX Starter Kit For the latest information on the PIC32MX Starter Kit, open PIC32MX Starter Kit Release Notes.
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 www.microchip.com, click on Customer Change Notification and follow the registration instructions.
Preface 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. Revision C (November 2008) Updated the instructions in Section 3.3.2 “Task 2, Select the Language Toolsuite”. Added connector table in Section Table 4-1: “Starter Board Connector Part Numbers”. Revision D (February 2009) Updated directory names and associated figures. © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide NOTES: DS61144D-page 6 © 2009 Microchip Technology Inc.
PIC32MX STARTER KIT USER’S GUIDE 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.
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.
Introducing the PIC32MX Starter Kit 1.5 INSTALLING THE PIC32MX STARTER KIT CD The default PIC32MX Starter Kit installation directory is: c:\Microchip Starter Kits\PIC32 Starter Kits Note, throughout this document, the following phrase “[install directory]” refers to this default installation, c:\Microchip Starter Kits, or a directory selected by the user during the time of installation.
PIC32MX Starter Kit User’s Guide NOTES: DS61144D-page 10 © 2009 Microchip Technology Inc.
PIC32MX STARTER KIT USER’S GUIDE 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: • • • • • • • 2.
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 setup.exe.
PIC32MX Starter Kit Tutorial 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 16.
PIC32MX Starter Kit User’s Guide 2. As shown in Figure 2-3, the next dialog box tracks the wizard as it searches for the device. (This activity may take several seconds.) When it is done, click Next. FIGURE 2-3: HARDWARE WIZARD – SEARCHING FOR DEVICE 3. If prompted to select a driver, select mp32mxsk.inf, as shown in Figure 2-4. Click Next to continue. FIGURE 2-4: DS61144D-page 14 HARDWARE WIZARD – SELECTING THE DRIVER © 2009 Microchip Technology Inc.
PIC32MX Starter Kit Tutorial 4. If prompted with a dialog box for Windows Logo testing, as shown in Figure 2-5, click Continue Anyway. FIGURE 2-5: WINDOWS LOGO TESTING 5. The next window (Figure 2-6) indicates that the installation of the software for the starter kit is complete. Click Finish. FIGURE 2-6: © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide 2.5 STARTING THE TUTORIAL PROJECT Click the MPLAB IDE icon on your computer desktop. The MPLAB IDE opens with the starter kit tutorial project loaded, as shown in Figure 2-7. If the MPLAB IDE does not have the starter kit tutorial project loaded, select File>Open Workspace... from the menu bar and browse to the tutorial project file: [install directory]\PIC32 Starter Kits\ Starter_Kit_Tutorial\starter_kit_tutorial.
PIC32MX Starter Kit Tutorial 2.6 BUILDING THE PROJECT From the menu bar of the main MPLAB IDE window, click Project>Make. The build Output window displays, as shown in Figure 2-8. Observe the progress of the build. When the “BUILD SUCCEEDED” message displays, you are ready to program the device. FIGURE 2-8: BUILD OUTPUT WINDOW © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide 2.7 PROGRAMMING THE DEVICE 2.7.1 Program the Device Click on the Program All Memories icon on the Program Device Tool Bar, as shown in Figure 2-9). FIGURE 2-9: PROGRAM DEVICE TOOL BAR A Programming Warning window (Figure 2-10) opens to warn you about overwriting the memory. Click Yes. FIGURE 2-10: PROGRAMMING WARNING WINDOW The Output window (Figure 2-11) tracks the progress of the output. A “Done” entry indicates that the programming of the device is complete.
PIC32MX Starter Kit Tutorial 2.8 RUNNING THE PROGRAM Either click Debugger>Run from the menu bar of the MPLAB IDE or click the Run icon (the turquoise triangle) on the Debug Tool Bar (Figure 2-12) to run the new program. FIGURE 2-12: 2.9 DEBUG WINDOW TUTORIAL PROGRAM OPERATION The starter kit tutorial demonstrates a simple application. The program responds according to the user input menu. The program prints the available menu choices to the starter kit Output window in the MPLAB IDE.
PIC32MX Starter Kit User’s Guide FIGURE 2-13: PIC32MX TUTORIAL PROGRAM FLOWCHART Pow er U p In itia lize th e L E D s Is “re p e a t” = = ‘x’ Yes D is p la y th a t th e p ro g ra m h a s te rm in a te d R e tu rn No D isp la y th e B u ild D a te a n d T im e A s k u se r fo r th e m e n u ch o ice A s k u se r fo r th e strin g o f m a xim u m 2 5 6 c h a ra c te rs Yes Is M e n u ch o ic e ‘e ’ o r ‘E ’? No D isp la y th e u s e r strin g b a c k to th e o u tp u t w in d o w T o g g le th
PIC32MX Starter Kit Tutorial The tutorial program includes the Debug Print Library, which facilitates print functionality. A peripheral library header file for flashing the LEDs is also included. The header file for print functionality is db_utils.h. Depending on the macro definition given in the print header file, the debug print macros will be expanded. The print functionality in the tutorial is routed to the Output window on the MPLAB PIC32MX tab in the interface window.
PIC32MX Starter Kit User’s Guide NOTES: DS61144D-page 22 © 2009 Microchip Technology Inc.
PIC32MX STARTER KIT USER’S GUIDE Chapter 3. Create a New Project 3.1 INTRODUCTION This chapter explains how to create a new project. 3.2 HIGHLIGHTS Items discussed in this chapter include: • • • • Creating a New Project Building the Project Programming the Device Running the Program After completing this chapter, you should be able to accomplish the following tasks: • • • • 3.
PIC32MX Starter Kit User’s Guide 3.3.1 Task 1, Select a Device 1. Start MPLAB IDE. 2. Click File>Close Workspace on the menu bar, to close any workspace that is open. 3. Click Project>Project Wizard... to start the wizard. 4. In the Welcome window, click Next. The Project Wizard Step One: window is displayed, as shown in Figure 3-1. FIGURE 3-1: SELECTING THE DEVICE 5. From the “Device” drop-down list, select “PIC32MX360F512L”. 6. Click Next.
Create a New Project FIGURE 3-2: 3.3.2 SELECTING THE TOOLSUITE Task 2, Select the Language Toolsuite 1. From the “Active Toolsuite” drop-down list, click “Microchip PIC32 C Compiler Toolsuite”. The toolsuite includes the assembler and linker that will be used. If the PIC32 compiler option is not available, check the “show all installed toolsuites” box. 2. Click Next to continue. The Project Wizard Step Three: dialog opens, as shown in Figure 3-3. © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide FIGURE 3-3: 3.3.3 NAMING YOUR PROJECT Task 3, Name Your Project 1. In the “Create New Project File” field, type C:\MyProject\BlinkLED. 2. Click Next and Ok to continue. The Project Wizard Step Four: dialog opens, as shown in Figure 3-4. DS61144D-page 26 © 2009 Microchip Technology Inc.
Create a New Project FIGURE 3-4: 3.3.4 ADDING FILES TO THE PROJECT Task 4, Add Files to Your Project This window can be skipped, since no ‘.c’ files have been created. 1. Click Next to continue. 2. Click Finish on the summary screen. 3. A project and workspace have been created in the MPLAB IDE. BlinkLED.mcw is the workspace file and BlinkLED.mcp is the project file. 4. Click File>New from the menu bar to create a new file. A new file is displayed. 5. Click File>Save As...
PIC32MX Starter Kit User’s Guide EXAMPLE 3-1: PROJECT SOURCE CODE #include
Create a New Project 7. In the Project window, right-click on the Source Files folder. Select Add Files and choose BlinkLED.c to add the file to the source directory, as shown in Figure 3-5. FIGURE 3-5: ADDING SOURCE FILES 8. Click Debugger>Select Tool>PIC32MX Starter Kit from the menu bar, for the Target board. Note: © 2009 Microchip Technology Inc. Make sure that the starter kit demo board is connected to your PC.
PIC32MX Starter Kit User’s Guide 3.3.5 Task 5, Confirm the Configuration Settings Click Configure>Configuration Bits to confirm that the configuration settings are correct. Typical configuration settings for the starter kit are shown in Figure 3-6. Note: FIGURE 3-6: The “Configuration Bits set in code” check box must be unchecked if the config bits are set via this window and not in the code. The configuration settings can also be embedded in the source file.
Create a New Project 3.3.6 Task 6, Build the Project 1. Click Project>Make from the menu bar of the main MPLAB IDE window. The build Output window displays (Figure 3-7). 2. Observe the progress of the build. When the “BUILD SUCCEEDED” message displays, you are ready to program the device. FIGURE 3-7: BUILD OUTPUT WINDOW © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide 3.3.7 Task 7, Program the Device 1. Click the Program All Memories icon on the Program Device Tool Bar, as shown in Figure 3-8. FIGURE 3-8: PROGRAM DEVICE WINDOW A Programming Warning window (Figure 3-9) opens to warn you about overwriting the memory. 2. Click Yes. FIGURE 3-9: PROGRAMMING WARNING WINDOW The Output window (Figure 3-10) tracks the progress of the output. “Done” signals that the programming of the device is complete.
Create a New Project 3.3.8 Task 8, Run the Program Click Debugger>Run from the menu bar of the MPLAB IDE or click the Run icon (the turquoise triangle) on the Debug Tool Bar, as indicated in Figure 3-11, to run the new program. FIGURE 3-11: RUN THE PROGRAM The starter kit LEDs blink to indicate that the program is running successfully. © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide NOTES: DS61144D-page 34 © 2009 Microchip Technology Inc.
PIC32MX STARTER KIT USER’S GUIDE Chapter 4. PIC32MX Starter Kit Hardware 4.1 INTRODUCTION This chapter describes the hardware features of the PIC32MX Starter Kit. 4.2 HARDWARE FEATURES The key features of the PIC32MX Starter Kit are listed below. They are presented in the order given in Section 1.4 “PIC32MX Functionality and Features”. You can refer to Figure 1-1 on page 8 for their locations on the board. 4.2.1 Processor Support The PIC32MX Starter Kit is designed with a permanently mounted (i.e.
PIC32MX Starter Kit User’s Guide 4.2.4 Switches Push-button switches provide the following functionality: • SW1: Active-low switch connected to RD6 • SW2: Active-low switch connected to RD7 • SW3: Active-low switch connected to RD13 The switches do not have any debounce circuitry and require the use of internal pullup resistors; this allows you to investigate debounce techniques. When Idle, the switches are pulled high (+3.3V). When pressed, they are grounded. 4.2.
PIC32MX STARTER KIT USER’S GUIDE Appendix A. PIC32MX Starter Kit Schematics A.1 INTRODUCTION This section provides detailed technical information about the PIC32MX Starter Kit. DEVELOPMENT BOARD BLOCK DIAGRAM FIGURE A-1: HIGH-LEVEL BLOCK DIAGRAM OF THE PIC32MX STARTER KIT VUSB or +5V_EXT Power Supply +3.3V ICSP™ JTAG USB PIC18LF4550 PIC32MX360F512L LEDs Switches A.3 Application Bd. Connector A.2 STARTER KIT BOARD SCHEMATICS Figure A-2. PIC32MX CPU Figure A-3. PIC18LF4550 Debug CPU Figure A-4.
PIC32MX Starter Kit User’s Guide DS61144D-page 38 FIGURE A-2:PIC32MX SCHEMATIC, SHEET 1 OF 6 (PIC32MX CPU) © 2009 Microchip Technology Inc.
© 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide FIGURE A-4: DS61144D-page 40 PIC32MX SCHEMATIC, SHEET 3 OF 6 (APPLICATION BOARD CONNECTOR) © 2009 Microchip Technology Inc.
FIGURE A-5: PIC32MX SCHEMATIC, SHEET 5 OF 6 (SWITCHES AND LEDS) © 2009 Microchip Technology Inc.
PIC32MX Starter Kit User’s Guide FIGURE A-6: DS61144D-page 42 PIC32MX SCHEMATIC, SHEET 6 OF 6 (POWER SUPPLY) © 2009 Microchip Technology Inc.
PIC32MX STARTER KIT USER’S GUIDE Index A P Active Toolsuite ...................................................... 25 PIC32MX Layout 32-bit microcontroller .................................. 8 Connector for expansion boards ................ 8 Debug indicator LED .................................. 8 On-board crystal ......................................... 8 PIC18LF4550 USB microcontroller ............ 8 Power supply .............................................. 8 Power-indicator LED ...................
WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.