MPLAB® Pickit™ 4 In-Circuit Debugger User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
MPLAB® PICkit™ 4 In-Circuit Debugger User’s Guide 2018 Microchip Technology Inc. DS50002751C 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, AnyRate, AVR, and may be superseded by updates. It is your responsibility to AVR logo, AVR Freaks, BeaconThings, BitCloud, CryptoMemory, ensure that your application meets with your specifications. CryptoRF, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KEELOQ, MICROCHIP MAKES NO REPRESENTATIONS OR KEELOQ logo, Kleer, LANCheck, LINK MD, maXStylus, WARRANTIES OF ANY KIND WHETHER EXPRESS OR maXTouch, MediaLB, megaAVR, MOST, MOST logo, MPLAB, IMPLIED, WRITTEN OR ORAL, STATUTORY OR OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip OTHERWISE, RELATED TO THE INFORMATION, Designer, QTouch, RightTouch, SAM-BA, SpyNIC, SST, SST INCLUDING BUT NOT LIMITED TO ITS CONDITION, Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered QUALITY, PERFORMANCE, MERCHANTABILITY OR trademarks of Microchip Technology Incorporated in the U.S.A. FITNESS FOR PURPOSE. Microchip disclaims all liability and other countries. arising from this information and its use. Use of Microchip ClockWorks, The Embedded Control Solutions Company, devices in life support and/or safety applications is entirely at EtherSynch, Hyper Speed Control, HyperLight Load, IntelliMOS, the buyer’s risk, and the buyer agrees to defend, indemnify and mTouch, Precision Edge, and Quiet-Wire are registered hold harmless Microchip from any and all damages, claims, trademarks of Microchip Technology Incorporated in the U.S.A. suits, or expenses resulting from such use. No licenses are Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any conveyed, implicitly or otherwise, under any Microchip Capacitor, AnyIn, AnyOut, BodyCom, chipKIT, chipKIT logo, intellectual property rights unless otherwise stated. CodeGuard, CryptoAuthentication, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi, MiWi, motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, QMatrix, RightTouch logo, REAL ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, 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 Microchip received ISO/TS-16949:2009 certification for its worldwide the U.S.A. headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California Silicon Storage Technology is a registered trademark of Microchip and India. The Company’s quality system processes and procedures Technology Inc. in other countries. are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and GestIC is a registered trademark of Microchip Technology analog products. In addition, Microchip’s quality system for the design Germany II GmbH & Co. KG, a subsidiary of Microchip and manufacture of development systems is ISO 9001:2000 certified. Technology Inc., in other countries. ARM and Cortex are registered trademarks of ARM Limited in the QUALITY MANAGEMENT SYSTEM EU and other countries. CERTIFIED BY DNV All other trademarks mentioned herein are property of their respective companies. == ISO/TS 16949 == © 2018, Microchip Technology Incorporated, All Rights Reserved. ISBN: 978-1-5224-3624-9 DS50002751C-page 2 2018 Microchip Technology Inc. MPLAB® PICkit™ 4 USER’S GUIDE Table of Contents Preface ........................................................................................................................... 5 Chapter 1. About the In-Circuit Debugger 1.1 Introduction ................................................................................................... 11 1.2 MPLAB PICkit 4 In-Circuit Debugger Description ........................................ 11 1.3 MPLAB PICkit 4 In-Circuit Debugger Advantages ....................................... 12 1.4 MPLAB PICkit 4 In-Circuit Debugger Components ...................................... 13 1.5 MPLAB PICkit 4 Block Diagram ................................................................... 14 Chapter 2. Operation 2.1 Introduction ................................................................................................... 15 2.2 Debugger to Target Communication ............................................................ 15 2.3 Target Communication Connections ............................................................ 17 2.4 Debugging .................................................................................................... 19 2.5 Requirements for Debugging ....................................................................... 20 2.6 Programming ................................................................................................ 22 2.7 Resources Used by the Debugger ............................................................... 23 Chapter 3. Debugger Usage 3.1 Introduction ................................................................................................... 25 3.2 Installation and Setup ................................................................................... 25 3.3 Debug Tutorial .............................................................................................. 26 3.4 Quick Debug/Program Reference ................................................................ 26 3.5 Debugger Limitations ................................................................................... 27 3.6 Common Debug Features ............................................................................ 27 3.7 Connecting the Target Board ....................................................................... 27 3.8 Setting Up the Target Board ......................................................................... 27 3.9 Setting Up MPLAB X IDE ............................................................................. 28 3.10 Starting and Stopping Debugging ............................................................. 29 3.11 Viewing Processor Memory and Files ........................................................ 29 3.12 Breakpoints and Stopwatch ........................................................................ 29 Chapter 4. Troubleshooting First Steps 4.1 Introduction ................................................................................................... 33 4.2 Some Questions to Answer First .................................................................. 33 4.3 Top Reasons Why You Can’t Debug ........................................................... 33 4.4 Other Things to Consider ............................................................................. 34 Chapter 5. Frequently Asked Questions (FAQs) 5.1 Introduction ................................................................................................... 37 5.2 How Does It Work ........................................................................................ 37 5.3 What’s Wrong ............................................................................................... 37 2018 Microchip Technology Inc. DS50002751C-page 3 MPLAB® PICkit™ 4 User’s Guide Chapter 6. Error Messages 6.1 Introduction ................................................................................................... 39 6.2 Types of Error Messages ............................................................................. 39 6.3 General Corrective Actions .......................................................................... 48 Appendix A. Debugger Function Summary A.1 Introduction .................................................................................................. 53 A.2 Debugger