MPLAB X IDE User's Guide

Total Page:16

File Type:pdf, Size:1020Kb

MPLAB X IDE User's Guide MPLAB X IDE User’s Guide MPLAB® X IDE User’s Guide Notice to Customers Important: 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 website (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 alphabetic revision level of the document. For the most up-to-date information on development tools, see the MPLAB® IDE online help. Select the Help menu, and then Help Content to open a list of available online help files. © 2019 Microchip Technology Inc. User Guide DS-50002027E-page 1 MPLAB X IDE User’s Guide Table of Contents Notice to Customers.......................................................................................................................................1 1. What is MPLAB X IDE?...........................................................................................................................7 1.1. An Overview of Embedded Systems............................................................................................7 1.2. The Development Cycle.............................................................................................................19 1.3. Project Manager.........................................................................................................................19 1.4. Language Tools..........................................................................................................................20 1.5. Target Debugging.......................................................................................................................21 1.6. Device Programming..................................................................................................................22 1.7. Components of MPLAB X IDE................................................................................................... 22 1.8. MPLAB X IDE Help.................................................................................................................... 23 1.9. Other MPLAB X IDE Documentation..........................................................................................23 1.10. Microchip Website...................................................................................................................... 24 1.11. Microchip Store.......................................................................................................................... 24 1.12. Programming Center..................................................................................................................24 1.13. MPLAB X IDE Updates.............................................................................................................. 25 1.14. Working Outside the IDE............................................................................................................25 2. Before You Begin.................................................................................................................................. 26 2.1. Review Installation Requirements..............................................................................................26 2.2. Install JRE and MPLAB X IDE....................................................................................................26 2.3. Install the USB Device Drivers (for Hardware Tools)..................................................................26 2.4. Connect to a Target (for Hardware Tools).................................................................................. 29 2.5. Install the Language Tools..........................................................................................................30 2.6. Launch the IDE and View the Desktop.......................................................................................30 2.7. Shop the MPLAB X Store...........................................................................................................31 2.8. Launch Multiple Instances of the IDE.........................................................................................32 2.9. Launch Multiple Versions of the IDE.......................................................................................... 33 2.10. Launch using Startup Parameters..............................................................................................33 3. Tutorial.................................................................................................................................................. 35 3.1. Installing and Setting Up the Software....................................................................................... 35 3.2. Connecting the Hardware...........................................................................................................35 3.3. Downloading the Example Code................................................................................................36 3.4. Opening the Example Project in MPLAB X IDE......................................................................... 36 3.5. Setting Project Properties...........................................................................................................38 3.6. Running the Code...................................................................................................................... 39 3.7. Debugging the Code.................................................................................................................. 40 3.8. Setting Breakpoints.................................................................................................................... 40 3.9. Stepping Through Code............................................................................................................. 42 3.10. Viewing Variable Values............................................................................................................. 43 3.11. Watching Symbol Values Change.............................................................................................. 44 3.12. Viewing I/O Registers.................................................................................................................45 3.13. Viewing Device Memory (including Configuration Bits)..............................................................46 3.14. Programming a Device...............................................................................................................47 4. Basic Tasks........................................................................................................................................... 49 © 2019 Microchip Technology Inc. User Guide DS-50002027E-page 2 MPLAB X IDE User’s Guide 4.1. Create a New Project................................................................................................................. 49 4.2. View Changes to Desktop.......................................................................................................... 59 4.3. Open Project Properties.............................................................................................................60 4.4. View or Make Changes to Project Properties.............................................................................61 4.5. Set Up or Change Debugger/Programmer Tool Options............................................................62 4.6. Set Up or Change Language Tool Options.................................................................................63 4.7. Set Language Tool Locations.....................................................................................................64 4.8. Set Other Tool Options...............................................................................................................66 4.9. Add Files to a Project................................................................................................................. 67 4.10. Set Build Properties....................................................................................................................75 4.11. Build a Project............................................................................................................................ 79 4.12. Run Code................................................................................................................................... 79 4.13. Debug Code............................................................................................................................... 80 4.14. Control Program Execution with Breakpoints.............................................................................82 4.15. Step Through Code....................................................................................................................87 4.16. Watch Symbol Values Change...................................................................................................87 4.17. Watch Local Variable Values Change........................................................................................ 89 4.18. View or Change Device Memory................................................................................................89 4.19. Set Configuration Values in the Configuration Bits Window.......................................................91
Recommended publications
  • Programming-8Bit-PIC
    Foreword Embedded microcontrollers are everywhere today. In the average household you will find them far beyond the obvious places like cell phones, calculators, and MP3 players. Hardly any new appliance arrives in the home without at least one controller and, most likely, there will be several—one microcontroller for the user interface (buttons and display), another to control the motor, and perhaps even an overall system manager. This applies whether the appliance in question is a washing machine, garage door opener, curling iron, or toothbrush. If the product uses a rechargeable battery, modern high density battery chemistries require intelligent chargers. A decade ago, there were significant barriers to learning how to use microcontrollers. The cheapest programmer was about a hundred dollars and application development required both erasable windowed parts—which cost about ten times the price of the one time programmable (OTP) version—and a UV Eraser to erase the windowed part. Debugging tools were the realm of professionals alone. Now most microcontrollers use Flash-based program memory that is electrically erasable. This means the device can be reprogrammed in the circuit—no UV eraser required and no special packages needed for development. The total cost to get started today is about twenty-five dollars which buys a PICkit™ 2 Starter Kit, providing programming and debugging for many Microchip Technology Inc. MCUs. Microchip Technology has always offered a free Integrated Development Environment (IDE) including an assembler and a simulator. It has never been less expensive to get started with embedded microcontrollers than it is today. While MPLAB® includes the assembler for free, assembly code is more cumbersome to write, in the first place, and also more difficult to maintain.
    [Show full text]
  • Extreme Low Power (XLP) PIC® Microcontrollers
    XLP PIC® MCUs eXtreme Low Power (XLP) PIC® Microcontrollers www.microchip.com/xlp Looking Beyond Low-Power MCUs Microchip’s XLP PIC® MCUs As more wearables, wireless sensor networks, and other Internet of Things (IoT) enabled smart devices are getting powered from battery, energy conservation becomes paramount. Today’s connected appli- cations must consume little power and, in extreme cases, last for up to 20+ years while running from a single battery. To enable applica- tions like these, products with Microchip’s eXtreme Low Power (XLP) technology offer the industry’s lowest Run and Sleep currents. Benefits of XLP PIC MCUs Low Sleep Currents Battery-Friendly VBAT Battery Back-Up Large Portfolio of XLP with Flexible Wake-Up Features • Automatic switch-over MCUs Sources • Enable battery lifetime upon loss of VDD • 8–121 pins, • Sleep current down greater than 20 years • Maintains Real-Time 4 KB–1 MB Flash to 9 nA • Low-power supervisors Clock/Calendar (RTCC) • Wide selection of • Brown-Out Reset (BOR) for safer operation and user registers packages down to 45 nA (BOR, WDT) • Powered seperately • Active mode currents as • Real-time clock down to • Core Independent Pe- from 1.8–3.6V source low as 30 µA/MHz with 300 nA ripherals (CIPs) take the (coin cell) efficient instruction set • Watch-Dog Timer (WDT) load off the CPU and per- with over 90% single- down to 200 nA form extremely complex cycle instructions tasks in self-sustaining mode at lowest possible energy requirement XLP PIC MCU Application Examples Internet of Things Smart Energy
    [Show full text]
  • MPLAB XC8 PIC Assembler User's Guide
    MPLAB® XC8 PIC® Assembler User's Guide 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 can differ from those in this document. Please refer to our web site (https://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® IDE online help. Select the Help menu, and then Topics to open a list of available online help files. © 2020 Microchip Technology Inc. User Guide DS50002974A-page 1 Table of Contents Notice to Customers.......................................................................................................................................1 1. Preface....................................................................................................................................................4 1.1. Conventions Used in This Guide..................................................................................................4 1.2. Recommended Reading...............................................................................................................5 1.3. Document Revision History..........................................................................................................5
    [Show full text]
  • Atmega328p Xplained Mini User Guide
    USER GUIDE ATmega328P Xplained Mini User Guide Introduction This user guide describes how to get started with the Atmel® ATmega328P Xplained Mini board. The ATmega328P Xplained Mini evalutation kit is a hardware platform to evaluate the Atmel ATmega328P microcontroller. The evaluation kit comes with a fully integrated debugger that provides seamless integration with Atmel Studio 6.2 (and later version). The kit provides access to the features of the ATmega328P enabling easy integration of the device in a custom design. 42287A-MCU-05/2014 Table of Contents Introduction .................................................................................... 1 1. Getting Started ........................................................................ 3 1.1. Features .............................................................................. 3 1.2. Design Documentation and Related Links .................................. 3 1.3. Board Assembly .................................................................... 3 1.3.1. In Customer Development Assembly ............................. 3 1.3.2. Connecting an Arduino Shield ..................................... 3 1.3.3. Standalone Node ...................................................... 3 1.4. Connecting the Kit ................................................................. 3 1.4.1. Connect the Kit to Atmel Studio ................................... 3 1.4.2. Connect the Target UART to the mEBDG COM Port ......... 3 1.5. Programming and Debugging .................................................
    [Show full text]
  • Getting Started with STK200 Dragon Introduction This Guide Is Designed to Get You up and Running with Main Software and Hardware
    Getting Started with STK200 Dragon Introduction This guide is designed to get you up and running with main software and hardware. As you work through it, there could be lots of details you do not understand, but these are covered in books and other documentation that you can read later. The main software package is AVRStudio, which is Atmel’s Integrated Development Environment or IDE. There is also a plugin C Compiler module called WinAVR that compiles C programs within AVRStudio. The Kanda installer will install these packages and copy documentation to a folder on your hard drive. Default install path is C:\Program Files\STK200 Dragon AVRStudio has its own Atmel-AVR Tools folder in Program Files, and can be run from there or you can run from desktop icon. WinAVR never needs to be run directly, only from AVRStudio. The AVRStudio IDE is designed for writing source code, in C (.c files) or assembler (.asm files). These are then built or compiled into object code (.hex files) for programming into the AVR using ISP or debug files (.elf files) to step through the code. The AVR Dragon hardware is a programmer and In Circuit Emulator (ICE) in one tool. Once source code is built, it can be programmed into the AVR using ISP, which will just run the code or it can be set in Debug mode (using DebugWire or JTAG )that allows you to examine the code operation to find bugs. There are two Debug methods depending on the AVR device you are using • JTAG Mode for AVR devices with 40-pins or more • DebugWire for smaller pin-count devices.
    [Show full text]
  • Power Debugger [USER GUIDE] 2 Atmel-42696D-Power-Debugger User Guide-10/2016 5.2.5
    Programmers and Debuggers Power Debugger USER GUIDE Atmel-42696D-Power-Debugger_User Guide-10/2016 Table of Contents 1. The Atmel Power Debugger...................................................................................... 4 1.1. Kit Contents..................................................................................................................................5 2. Getting Started with the Power Debugger................................................................. 6 3. Connecting the Power Debugger...............................................................................8 3.1. Connecting to AVR and SAM Target Devices...............................................................................8 4. Detailed Use Cases.................................................................................................10 4.1. Low-power Application............................................................................................................... 10 4.1.1. Requirements.............................................................................................................. 10 4.1.2. Initial Hardware Setup................................................................................................. 10 4.1.3. Connections.................................................................................................................12 4.1.4. Disabling the debugWIRE Interface.............................................................................13 4.1.5. Disabling On-board Power Supply on the Xplained
    [Show full text]
  • MPLAB XC8 PIC Assembler User's Guide for Embedded Engineers
    MPLAB® XC8 PIC Assembler User's Guide for Embedded Engineers 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 can differ from those in this document. Please refer to our web site (https://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® IDE online help. Select the Help menu, and then Topics to open a list of available online help files. © 2020 Microchip Technology Inc. User Guide 50002994A-page 1 Table of Contents 1. Preface....................................................................................................................................................4 Notice to Customers................................................................................................................................1 1.1. Conventions Used in This Guide..................................................................................................4 1.2. Recommended Reading...............................................................................................................5 1.3. Document Revision History..........................................................................................................5
    [Show full text]
  • Picmicro Mid-Range MCU Family Reference Manual
    M PICmicro™ Mid-Range MCU Family Reference Manual 1997 Microchip Technology Inc. December 1997 /DS33023A M Internationally Recognized Quality System Certifications Microchip’s Quality System embodies the requirements of ISO9001:1994. Our Microchip Chandler and Tempe Design and Manufacturing facilities have been certified to ISO 9001. The Microchip Kaohsiung Test facility, and primary Assembly houses have been certified to ISO 9002. ISO certification plans are in-process for an esti- mated certification grant by year-end 1997. In addition, Microchip has received numerous customer certifica- tions, including a Delco issued certificate of compliance to AEC-A100/QS9000. Microchip received ISO 9001 Quality System certifica- tion for its worldwide headquarters, design, and wafer fabrication facilities in January, 1997. Our field-pro- grammable PICmicro™ 8-bit MCUs, Serial EEPROMs, related specialty memory products and development systems conform to the stringent quality standards of the International Standard Organization (ISO). “All rights reserved. Copyright © 1997, Microchip Technology Trademarks Incorporated, USA. Information contained in this publication regarding device applications and the like is intended through The Microchip name, logo, PIC, KEELOQ, PICMASTER, suggestion only and may be superseded by updates. No rep- PICSTART, PRO MATE, and SEEVAL are registered resentation or warranty is given and no liability is assumed by trademarks of Microchip Technology Incorporated in the Microchip Technology Incorporated with respect to the accu- U.S.A. racy or use of such information, or infringement of patents or other intellectual property rights arising from such use or oth- MPLAB, PICmicro, ICSP and In-Circuit Serial Programming erwise. Use of Microchip’s products as critical components in are trademarks of Microchip Technology Incorporated.
    [Show full text]
  • Experience of Teaching the Pic Microcontrollers
    Session 1520 EXPERIENCE OF TEACHING THE PIC MICROCONTROLLERS Han-Way Huang, Shu-Jen Chen Minnesota State University, Mankato, Minnesota/ DeVry University, Tinley Park, Illinois Abstract This paper reports our experience in teaching the Microchip 8-bit PIC microcontrollers. The 8-bit Motorola 68HC11 microcontroller has been taught extensively in our introductory microprocessor courses and used in many student design projects in the last twelve years. However, the microcontroller market place has changed considerably in the recent years. Motorola stopped new development for the 68HC11 and introduced the 8- bit 68HC908 and the 16-bit HCS12 with the hope that customers will migrate their low- end and high-end applications of the 68HC11 to these microcontrollers, respectively. On the other hand, 8-bit microcontrollers from other vendors also gain significant market share in the last few years. The Microchip 8-bit microcontrollers are among the most popular microcontrollers in use today. In addition to the SPI, USART, timer functions, and A/D converter available in the 68HC11 [6], the PIC microcontrollers from Microchip also provide peripheral functions such as CAN, I2C, and PWM. The controller-area- network (CAN) has been widely used in automotive and process control applications. The Inter-Integrated Circuit (I2C) has been widely used in interfacing peripheral chips to the microcontroller whereas the Pulse Width Modulation (PWM) function has been used extensively in motor control. After considering the change in microcontrollers and the technology evolution, we decided to teach the Microchip 8-bit microcontrollers. 1 Several major issues need to be addressed before a new microcontroller can be taught: textbook, demo boards, and development software and hardware tools.
    [Show full text]
  • Mplab C18 C Compiler Getting Started
    MPLAB® C18 C COMPILER GETTING STARTED © 2005 Microchip Technology Inc. DS51295F 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 Trademarks applications and the like is provided only for your convenience The Microchip name and logo, the Microchip logo, Accuron, and may be superseded by updates. It is your responsibility to dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, ensure that your application meets with your specifications.
    [Show full text]
  • Digital and System Design
    Digital System Design — Use of Microcontroller RIVER PUBLISHERS SERIES IN SIGNAL, IMAGE & SPEECH PROCESSING Volume 2 Consulting Series Editors Prof. Shinsuke Hara Osaka City University Japan The Field of Interest are the theory and application of filtering, coding, trans- mitting, estimating, detecting, analyzing, recognizing, synthesizing, record- ing, and reproducing signals by digital or analog devices or techniques. The term “signal” includes audio, video, speech, image, communication, geophys- ical, sonar, radar, medical, musical, and other signals. • Signal Processing • Image Processing • Speech Processing For a list of other books in this series, see final page. Digital System Design — Use of Microcontroller Dawoud Shenouda Dawoud R. Peplow University of Kwa-Zulu Natal Aalborg Published, sold and distributed by: River Publishers PO box 1657 Algade 42 9000 Aalborg Denmark Tel.: +4536953197 EISBN: 978-87-93102-29-3 ISBN:978-87-92329-40-0 © 2010 River Publishers All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, mechanical, photocopying, recording or otherwise, without prior written permission of the publishers. Dedication To Nadia, Dalia, Dina and Peter D.S.D To Eleanor and Caitlin R.P. v This page intentionally left blank Preface Electronic circuit design is not a new activity; there have always been good designers who create good electronic circuits. For a long time, designers used discrete components to build first analogue and then digital systems. The main components for many years were: resistors, capacitors, inductors, transistors and so on. The primary concern of the designer was functionality however, once functionality has been met, the designer’s goal is then to enhance per- formance.
    [Show full text]
  • COOLANT OIL CONTROL SYSTEM in VMC MACHINE ”Is the Bonafide Work Of
    COOLANT OIL CONTROL SYSTEM IN VMC MACHINE A PROJECT REPORT Submitted by RAJAGANAPATHY.S (13BEI111) GOWTHAMVEL.P (13BEI018) SANTHOSE PRABU.R (13BEI050) in partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING in ELECTRONICS AND INSTRUMENTATION ENGINEERING KUMARAGURU COLLEGE OF TECHNOLOGY (An Autonomous Institution, Affiliated to Anna University,Chennai) COIMBATORE 641049 APRIL 2017 1 COOLANT OIL CONTROL SYSTEM IN VMC MACHINE A PROJECT REPORT Submitted by RAJAGANAPATHY.S (13BEI111) GOWTHAMVEL.P (13BEI018) SANTHOSE PRABU.R (13BEI050) in partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING in ELECTRONICS AND INSTRUMENTATION ENGINEERING KUMARAGURU COLLEGE OF TECHNOLOGY (An Autonomous Institution, Affiliated to Anna University,Chennai) COIMBATORE 641049 APRIL 2017 2 BONAFIDE CERTIFICATE Certified that this project report “COOLANT OIL CONTROL SYSTEM IN VMC MACHINE ”is the bonafide work of RAJAGANAPATHY.S (13BEI111) GOWTHAMVEL.P (13BEI018) SANTHOSE PRABU.R (13BEI050) who carried out the project work under my supervision. SIGNATURE SIGNATURE Dr.N.EZHILARASI Mr.S.SARAVANA KUMAR HEAD OF THE DEPARTMENT SUPERVISOR Dept. of Electronics and Instrumentation Assistant Professor Kumaraguru College of Technology Dept. of Electronics and Instrumentation Coimbatore-641049 Kumaraguru College of Technology Coimbatore-641049 The candidates were examined by us in the project viva voce examination held on INTERNAL EXAMINER EXTERNAL EXAMINER 3 ACKNOWLDEGEMENT The satisfaction that accompanies the successful completion of any task would be incomplete without mentioning about the people whose constant guidance and encouragement crowns all effort with success. We are greatly indebted to our beloved Principal Dr.R.S.KUMAR, who has been the backbone of all our deeds. We express our gratitude to Dr.N.EZHILARASI, Head, Department of Electronics and Instrumentation Engineering, Kumaraguru College of Technology for her constant encouragement.
    [Show full text]