MPLAB® ICD 4 In-Circuit Debugger User’s Guide 2017 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.
Object of Declaration: MPLAB ICD-4 In-Circuit Debugger Object of Declaration: EU Declaration of Conformity This declaration of conformity is issued by the manufacturer. The development/evaluation tool is designed to be used for research and development in a laboratory environment. This development/evaluation tool is not intended to be a finished appliance, nor is it intended for incorporation into finished appliances that are made commercially available as single functional units to end users.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 4 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Table of Contents Preface ........................................................................................................................... 7 Part 1 – Getting Started Chapter 1. About the Debugger 1.1 Introduction ................................................................................................... 13 1.2 MPLAB ICD 4 In-Circuit Debugger Description ............................................ 13 1.3 MPLAB ICD 4 In-Circuit Debugger Advantages ................
MPLAB® ICD 4 User’s Guide Chapter 5. Frequently Asked Questions (FAQs) 5.1 Introduction ................................................................................................... 41 5.2 How Does It Work? ...................................................................................... 41 5.3 What’s Wrong? ............................................................................................. 42 Chapter 6. Error Messages 6.1 Introduction ..................................................
MPLAB® ICD 4 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.
MPLAB® ICD 4 User’s Guide DOCUMENT LAYOUT This document describes how to use the MPLAB ICD 4 In-Circuit Debugger as a development tool to emulate and debug firmware on a target board, as well as how to program devices. The document is organized as follows: Part 1 – Getting Started • Chapter 1. About the Debugger – What the MPLAB ICD 4 In-Circuit Debugger is and how it can help you develop your application. • Chapter 2. Operation – The theory of MPLAB ICD 4 In-Circuit Debugger operation.
Preface CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Represents Examples Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB® IDE User’s Guide ...is the only compiler...
MPLAB® ICD 4 User’s Guide RECOMMENDED READING This user's guide describes how to use MPLAB ICD 4 In-Circuit Debugger. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources. Multi-Tool Design Advisory (DS51764) Please read this first! This document contains important information about operational issues that should be considered when using the MPLAB ICD 4 with your target design.
MPLAB® ICD 4 USER’S GUIDE Part 1 – Getting Started Chapter 1. About the Debugger .................................................................................. 13 Chapter 2. Operation.................................................................................................... 17 Chapter 3. Debugger Usage ........................................................................................ 27 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 12 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Chapter 1. About the Debugger 1.1 INTRODUCTION An overview of the MPLAB® ICD 4 In-Circuit Debugger system is provided in this chapter. • • • • 1.
MPLAB® ICD 4 User’s Guide 1.3 MPLAB ICD 4 IN-CIRCUIT DEBUGGER ADVANTAGES The MPLAB ICD 4 In-Circuit Debugger system provides the following advantages: Features/Capabilities: • Connects to computer via high-speed USB 2.
About the Debugger 1.
MPLAB® ICD 4 User’s Guide 1.5 MPLAB ICD 4 BLOCK DIAGRAM DS50002596A-page 16 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Chapter 2. Operation 2.1 INTRODUCTION A simplified theory of operation of the MPLAB ICD 4 In-Circuit Debugger system is provided here. It is intended to provide enough information so that a target board can be designed that is compatible with the debugger for both debugging and programming operations. The basic theory of in-circuit debugging and programming is discussed so that problems, if encountered, are quickly resolved.
MPLAB® ICD 4 User’s Guide 2.2 DEBUGGER TO TARGET COMMUNICATION Note: The MPLAB X IDE software must be installed prior to connecting the MPLAB ICD 4 In-Circuit Debugger. The debugger is connected to the computer via a USB cable for communication and debugger power (not target power). The debugger is connected to the target application for communication and data collection. Refer to Section B.5.1 “Connecting an RJ-11 Type Cable to an RJ-45 Socket on MPLAB ICD 4 In-Circuit Debugger” for pinout information.
Operation FIGURE 2-1: STANDARD DEBUGGER SYSTEM – DEVICE WITH ON-BOARD ICE CIRCUITRY External Power supplied to either target or debugger. Device with on-board ICE circuitry Target Device Debugger Target Board USB FIGURE 2-2: STANDARD DEBUGGER SYSTEM – ICE DEVICE External Power supplied to either target or debugger. Processor Extension Pak Header Standard Adapter Device-ICE Transition Socket Target Board OR ICD Header Debugger USB Device-ICE USB 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide 2.3 TARGET COMMUNICATION CONNECTIONS 2.3.1 Standard Communication Target Connection Using the RJ-11 connector, the MPLAB ICD 4 In-Circuit Debugger is connected to the target device with the modular interface (six conductor) cable. The pin numbering for the connector is shown from the bottom of the target PCB in Figure 2-3. Note: Cable connections on the debugger and target are mirror images of each other, i.e.
Operation 2.3.3 Target Power There are two methods for externally powering the target: • Externally Powered through Target • Externally Powered through Debugger In the following descriptions, only three lines are active and relevant to core debugger operation: pins 1 (VPP/MCLR), 5 (PGC), and 4 (PGD). Pins 2 (VDD) and 3 (VSS) are shown on Figure 2-4 for completeness. When providing power to the target device, ensure that the target is not exposed to voltages higher than the device VDD rating.
MPLAB® ICD 4 User’s Guide 2.3.4 Circuits That Will Prevent the Debugger From Functioning Figure 2-5 shows the active debugger lines with some components that will prevent the MPLAB ICD 4 In-Circuit Debugger system from functioning. FIGURE 2-5: IMPROPER CIRCUIT COMPONENTS 1 VPP/MCLR No! No! No! PGC 5 4 PGD No! Interface Connector In particular, these guidelines must be followed: • Do not use pull-ups on PGC/PGD – they could disrupt the voltage levels.
Operation 2.5 REQUIREMENTS FOR DEBUGGING To debug (set breakpoints, see registers, etc.) with the MPLAB ICD 4 In-Circuit Debugger system, there are critical elements that must be working correctly: • The debugger must be connected to a computer. It must be powered by the computer via the USB cable, and it must be communicating with the MPLAB X IDE software via the USB cable. See Section 3.3 “Debug Tutorial” for details. • The target device must have power and a functional, running oscillator.
MPLAB® ICD 4 User’s Guide 2.5.2 Debugging Details Figure 2-6 illustrates the MPLAB ICD 4 In-Circuit Debugger system when it is ready to begin debugging.
Operation Another way to set a breakpoint is to select Debug>Pause. This toggles the PGC and PGD lines so that the in-circuit debug mechanism of the target device switches the Program Counter from the user’s code in program memory to the debug executive. Again, the target application program is effectively halted, and MPLAB X IDE uses the debugger communications with the debug executive to interrogate the state of the target device. 2.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 26 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Chapter 3. Debugger Usage 3.1 INTRODUCTION The following topics are discussed regarding how to install and use the MPLAB ICD 4 In-Circuit Debugger. • • • • • • • • • 3.
MPLAB® ICD 4 User’s Guide Items of note are: 1. Each debugger contains a unique identifier which, when first installed, will be recognized by the operating system, regardless of which computer USB port is used. 2. MPLAB X IDE operation connects to the hardware tool at runtime (Run or Debug Run). Configuration bits can only be viewed in the Configuration Bits window. To set them in code, select Window>PIC Memory Views.
Debugger Usage 3.6 CONNECTING THE TARGET BOARD A connection is built in to select the type of communication with the target. See Section 2.2 “Debugger to Target Communication” for more details and a diagram. 1. Connect the Mini-B USB cable between the debugger and the computer, if not already connected. 2. Attach the communication cable(s) between debugger and target. 3. Connect power to target or debugger. Note: In MPLAB X IDE, you can select the source from which to power the target.
MPLAB® ICD 4 User’s Guide 3.7 SETTING UP THE TARGET BOARD The target must be set up for the type of target device to be used. 3.7.1 Using Production Devices For production devices, the debugger may be connected directly to the target board. The device on the target board must have built-in debug circuitry in order to debug with the MPLAB ICD 4 In-Circuit Debugger. Consult the device data sheet to see whether the device has the necessary debug circuitry, i.e.
Debugger Usage 3.8 STARTING AND STOPPING DEBUGGING To debug an application in MPLAB X IDE, you must create a project that contains your source code so that the code may be built, programmed into your device, and executed as specified below: • To run your code, select either Debug>Debug Main Project or Debug Main Project from the Run toolbar. • To halt your code, select either Debug>Pause or Pause from the Debug toolbar.
MPLAB® ICD 4 User’s Guide 3.10 BREAKPOINTS AND STOPWATCH Use breakpoints to halt code execution at specific lines in your code. Use the stopwatch with breakpoints to time code execution. • Breakpoint Resources • Hardware or Software Breakpoint Selection • Breakpoint and Stopwatch Usage 3.10.1 Breakpoint Resources In 16-bit devices, breakpoints, data captures, and runtime watches use the same resources.
Debugger Usage 3.10.3 Breakpoint and Stopwatch Usage Breakpoints halt execution of code. To determine the time between the breakpoints, use the stopwatch. Refer to the MPLAB X IDE online Help for instructions on how to set up and use breakpoints and the stopwatch. 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 34 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Part 2 – Troubleshooting Chapter 4. Troubleshooting First Steps ..................................................................... 37 Chapter 5. Frequently Asked Questions (FAQs) ....................................................... 41 Chapter 6. Error Messages.......................................................................................... 45 DS50002596A-page 35 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 36 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Chapter 4. Troubleshooting First Steps 4.1 INTRODUCTION If you are having problems with MPLAB ICD 4 In-Circuit Debugger operation, start here. • The Five Questions to Answer First • Top Reasons Why You Can’t Debug • Other Things to Consider 4.2 THE FIVE QUESTIONS TO ANSWER FIRST 1. Which device are you working with? Often an upgrade to a newer version of MPLAB X IDE is required to support newer devices. 2.
MPLAB® ICD 4 User’s Guide 4.3 TOP REASONS WHY YOU CAN’T DEBUG 1. Oscillator not working. Check your Configuration bits setting for the oscillator. If you are using an external oscillator, try using an internal oscillator. If you are using an internal PLL, make sure your PLL settings are correct. 2. No power to the target board. Check the power cable connection. 3. Incorrect VDD voltage. The VDD voltage is outside the specifications for this device. See the device programming specification for details. 4.
Troubleshooting First Steps 4.4 OTHER THINGS TO CONSIDER 1. Use the ICD Test Interface module to verify that the debugger is functioning correctly (Section B.6 “ICD Test Interface Module”). 2. There may be a problem programming in general. As a test, switch to Run mode (Run>Run Project) and program the target with the simplest application possible (e.g., a program to blink an LED). If the program will not run, then you know that something is wrong with the target setup. 3.
MPLAB® ICD 4 User’s Guide c) Next, plug the Mini-B USB cable back into the debugger. d) As soon as both LEDs flash quickly, immediately unplug the power cable from the debugger or remove the screwdriver (within 1 second). If the LEDs are steady on purple, proceed to the next step. If the LEDs are blue, you did not perform the action fast enough and must repeat the process starting at step a). e) Try to reestablish communication with the MPLAB X IDE or MPLAB IPE.
MPLAB® ICD 4 USER’S GUIDE Chapter 5. Frequently Asked Questions (FAQs) 5.1 INTRODUCTION Look here for answers to frequently asked questions about the MPLAB ICD 4 In-Circuit Debugger system. • How Does It Work? • What’s Wrong? 5.2 HOW DOES IT WORK? • What's in the silicon that allows it to communicate with the MPLAB ICD 4 In-Circuit Debugger? MPLAB ICD 4 In-Circuit Debugger can communicate with Flash silicon via the ICSP interface. It uses the debug executive located in test memory.
MPLAB® ICD 4 User’s Guide • What limitations are there with the standard cable? The standard ICSP-RJ11 cable maximum clock frequency is approximately 15 MHz. Device interrogation during debugging occurs at frequencies below this rate regardless of the CPU clock rate. However, some advanced functions are synchronous to the CPU bus cycle (like instrumented trace and data capture).
Frequently Asked Questions (FAQs) while (1); } : void __attribute__((__interrupt__)) _AltOscillatorFail(void) { INTCON1bits.OSCFAIL = 0; while (1); } : - Use ASSERTs. For example: ASSERT (IPL==7) 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 44 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Chapter 6. Error Messages 6.1 INTRODUCTION The MPLAB ICD 4 In-Circuit Debugger produces various error messages; some are specific, some are informational, and others can be resolved with general corrective actions. In general, read any instructions under your error message. If those fail to fix the problem or if there are no instructions, refer to the following sections. • Specific Error Messages • General Corrective Actions • Information Messages 6.2 SPECIFIC ERROR MESSAGES 6.
MPLAB® ICD 4 User’s Guide 6.2.2 Debug Failure Errors The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. You will receive this message if you try to Run before programming your device. If you receive this message after trying to Run, or immediately after programming your device: The device is code protected. The device on which you are attempting to operate (read, program, blank check, or verify) is code protected, i.e.
Error Messages 6.2.4 List of Error Messages TABLE 6-1: ALPHABETIZED LIST OF ERROR MESSAGES AP_VER=Algorithm Plugin Version AREAS_TO_PROGRAM=The following memory area(s) will be programmed: AREAS_TO_READ=The following memory area(s) will be read: AREAS_TO_VERIFY=The following memory area(s) will be verified: BLANK_CHECK_COMPLETE=Blank check complete, device is blank. BLANK_CHECKING=Blank Checking...
MPLAB® ICD 4 User’s Guide TABLE 6-1: ALPHABETIZED LIST OF ERROR MESSAGES (CONTINUED) DISCONNECT_WHILE_BUSY=The tool was disconnected while it was busy. EEDATA_MEMORY=EEData memory EEDATA=EEData EMULATION_MEMORY_READ_WRITE_ERROR=An error occurred while trying to read/write MPLAB's emulation memory: Address=%08x END=end ENSURE_SELF_TEST_READY=Please ensure the RJ-11 cable is connected to the test board before continuing.
Error Messages TABLE 6-1: ALPHABETIZED LIST OF ERROR MESSAGES (CONTINUED) FW_DOESNT_SUPPORT_DYNBP=The current ICD 4 firmware does not support setting run time breakpoints for the selected device. Please download firmware version %02x.%02x.%02x or higher. GOOD_ID_MISMATCH=Target Device ID (0x%x) is a valid Device ID but does not match the expected Device ID (0x%x) as selected. HALTING=Halting... HIGH=High HOLDMCLR_FAILED=Hold in reset failed. IDS_SELF_TEST_BOARD_PASSED=ICD4 is functioning properly.
MPLAB® ICD 4 User’s Guide TABLE 6-1: ALPHABETIZED LIST OF ERROR MESSAGES (CONTINUED) MEM_RANGE_ERROR_UNKNOWN=An unknown error has occurred while trying to validate the user entered memory ranges. MEM_RANGE_ERROR_WRONG_DATABASE=Unable to access data object while validating user entered memory ranges. MEM_RANGE_OUT_OF_BOUNDS=The selected program range, %s, does not fall within the proper range for the memory area selected.
Error Messages TABLE 6-1: ALPHABETIZED LIST OF ERROR MESSAGES (CONTINUED) PRESERVE_MEM_RANGE_ERROR_END_LESSTHAN_START=Invalid preserve range received: end address %s < start address %s. Please check the manual program ranges on the debug tool's, "Memories to Program" property page. PRESERVE_MEM_RANGE_ERROR_ENDADDR_NOT_ALIGNED=Invalid preserve range received: end address %s is not aligned on a proper 0x%x address boundary.
MPLAB® ICD 4 User’s Guide TABLE 6-1: ALPHABETIZED LIST OF ERROR MESSAGES (CONTINUED) TARGET_FOUND=Target device %s found. TARGET_HALTED=Target Halted TARGET_NOT_READY_4_DEBUG=The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings. TARGET_VDD=Target VDD: TEST=test TOOL_IS_BUSY=ICD 4 is busy. Please wait for the current operation to finish.
Error Messages 6.3 GENERAL CORRECTIVE ACTIONS These general corrective actions may solve your problem: • • • • • • • Read/Write Error Actions Debugger to Target Communication Error Actions Debugger to Computer Communication Error Actions Corrupted Installation Actions USB Port Communication Error Actions Debug Failure Actions Internal Error Actions 6.3.1 Read/Write Error Actions If you receive a read or write error: 1. Did you hit Abort? This may produce read/write errors. 2. Try the action again.
MPLAB® ICD 4 User’s Guide 6.3.5 USB Port Communication Error Actions The problem is most likely caused by a faulty or non-existent communications port. 1. Reconnect to the MPLAB ICD 4 In-Circuit Debugger. 2. Make sure the debugger is physically connected to the computer on the appropriate USB port. 3. Make sure the appropriate USB port has been selected in the debugger Settings. 4. Make sure the USB port is not in use by another device. 5. If using a USB hub, make sure it is powered. 6.
MPLAB® ICD 4 USER’S GUIDE Part 3 – Reference Appendix A. Debugger Function Summary............................................................... 57 Appendix B. Hardware Specification.......................................................................... 63 Appendix C. Revision History..................................................................................... 71 DS50002596A-page 55 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 56 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Appendix A. Debugger Function Summary A.1 INTRODUCTION A summary of the MPLAB ICD 4 In-Circuit Debugger functions are summarized below. • Debugger Selection and Switching • Debugger Options Selection A.2 DEBUGGER SELECTION AND SWITCHING Use the Project Properties dialog to select or switch debuggers for a project. To switch you must have more than one MPLAB ICD 4 In-Circuit Debugger connected to your computer.
MPLAB® ICD 4 User’s Guide A.3.1 Memories to Program Select which memories to be programmed into the target. If “Erase All Before Program” is selected as shown in Section A.3.4 “Freeze Peripherals”, then all device memory will be erased before programming. To select specific memories to program after erase, check the specific memory type.
Debugger Function Summary A.3.2 Debug Options Use software breakpoints, if available, for the project device. TABLE A-2: DEBUG OPTIONS OPTION CATEGORY Use Software Breakpoints TABLE A-3: Check to use software breakpoints. Uncheck to use hardware breakpoints. See discussion below to determine which type is best for your application.
MPLAB® ICD 4 User’s Guide PIC12/16/18 MCU Devices To freeze/unfreeze all device peripherals on halt, check/uncheck the “Freeze on Halt” check box. If this does not halt your desired peripheral, be aware that some peripherals do not have a freeze-on-halt capability and cannot be controlled by the debugger. dsPIC30F/33F, PIC24F/H and PIC32MX Devices For peripherals in the list “Peripherals to Freeze on Halt”, check to freeze that peripheral on a halt.
Debugger Function Summary A.3.8 Clock Set the option to use the fast internal RC clock for the selected device. TABLE A-8: CLOCK OPTION CATEGORY Use FRC in Debug mode When debugging, use the device fast internal RC (FRC) for clock(dsPIC33F and PIC24F/H ing instead of the oscillator specified for the application. This is devices only) useful when the application clock is slow. Checking this check box will let the application run at the slow speed but debug at the faster FRC speed.
MPLAB® ICD 4 User’s Guide DS50002596A-page 62 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Appendix B. Hardware Specification B.1 INTRODUCTION The hardware and electrical specifications of the MPLAB ICD 4 In-Circuit Debugger system are detailed in the following sections. B.2 HIGHLIGHTS This chapter discusses: • • • • • B.
MPLAB® ICD 4 User’s Guide B.4 MPLAB ICD 4 IN-CIRCUIT DEBUGGER The debugger consists of an internal main board and an external USB connector, RJ-45 type connector, and a power connector. On the face of the debugger enclosure is an indicator light bar composed of two LEDs. B.4.1 Main Board The main board includes the following features: • • • • an interface processor (PIC32) a USB 2.
Hardware Specification B.5 STANDARD COMMUNICATION HARDWARE For standard debugger communication with a target (Section 2.2 “Debugger to Target Communication”), use an adapter with the RJ-11 connector. To use this type of communication with a header board, you may need a device-specific Processor Pak, which includes an 8-pin connector header board that contains the desired ICE/ICD device and a standard adapter board.
MPLAB® ICD 4 User’s Guide B.5.1 Connecting an RJ-11 Type Cable to an RJ-45 Socket on MPLAB ICD 4 In-Circuit Debugger The MPLAB ICD 4 In-Circuit Debugger has an RJ-45 connector for communication to the target. Connect the RJ-11 type cable into the RJ-45 connector by simply inserting it into the center of the RJ-45 connector. Refer to Figure B-2 for the pinouts for this connection.
Hardware Specification FIGURE B-3: 6-PIN STANDARD PINOUT Pin Standard Socket 2 4 6 Bottom of Target Board 1 3 5 TABLE B-2: Name Function Power 1 VPP 2 VDD_TGT Power on target 3 GND Ground 4 PGD (ICSPDAT) Standard Com Data 5 PGC (ICSPCLK) Standard Com Clock 6 - Reserved ELECTRICAL LOGIC TABLE Logic Inputs VIH = VDD x 0.7V (min.) VIL = VDD x 0.3V (max.) Logic Outputs VDD = 5V VOH = 3.8V min. VDD = 3V VDD = 2.3V VDD = 1.65V VOH = 2.4V min. VOH = 1.9V min. VOH = 1.2V min.
MPLAB® ICD 4 User’s Guide B.5.3.3 MODULAR CABLE SPECIFICATION Manufacturer, Part Number – Microchip Technology, 07-00024 The length of this cable (L) is 6 inches. It is not recommended that you use a modular cable longer than 6 inches to avoid potential communication problems. FIGURE B-5: MODULAR CABLE 6 inches L Pin 6 Pin 1 B.6 ICD TEST INTERFACE MODULE To use this module to verify that the debugger is functioning properly: 1. Disconnect the debugger from the target and the computer. 2.
Hardware Specification 7. Ensure the ICD Test Interface module and cable are connected. Click Yes to continue. 8. View the self-test results in the debugger’s Output window. If the test runs successfully, you’ll see the following: Test interface PGC clock line write succeeded. Test interface PGD data line write succeeded. Test interface PGC clock line read succeeded. Test interface PGD data line read succeeded. Test interface LVP control line test succeeded. Test interface MCLR level test succeeded.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 70 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Appendix C. Revision History Revision A (August 2017) Initial release of this document. DS50002596A-page 71 2017 Microchip Technology Inc.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 72 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Support INTRODUCTION Please refer to the items discussed here for support issues. • • • • Warranty Registration The Microchip Web Site myMicrochip Personalized Notification Service Customer Support WARRANTY REGISTRATION If your development tool package includes a Warranty Registration Card, please complete the card and mail it in promptly. Sending in your Warranty Registration Card entitles you to receive new product updates.
MPLAB® ICD 4 User’s Guide When you are selecting your preferences, choosing “Development Systems” will populate the list with available development tools. The main categories of tools are listed below: • Compilers – The latest information on Microchip C compilers, assemblers, linkers and other language tools.
MPLAB® ICD 4 USER’S GUIDE Glossary A Absolute Section A GCC compiler section with a fixed (absolute) address that cannot be changed by the linker. Absolute Variable/Function A variable or function placed at an absolute address using the OCG compiler’s @ address syntax. Access Memory PIC18 Only – Special registers on PIC18 devices that allow access regardless of the setting of the Bank Select Register (BSR).
MPLAB® ICD 4 User’s Guide ANSI American National Standards Institute is an organization responsible for formulating and approving standards in the United States. Application A set of software and hardware that may be controlled by a PIC® microcontroller. Archive/Archiver An archive/library is a collection of relocatable object modules. It is created by assembling multiple source files to object files, and then using the archiver/librarian to combine the object files into one archive/library file.
Glossary Build Compile and link all the source files for an application. C C/C++ C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. C++ is the object-oriented version of C. Calibration Memory A special function register or registers used to hold values for calibration of a PIC microcontroller on-board RC oscillator or other device peripherals.
MPLAB® ICD 4 User’s Guide Cross Reference File A file that references a table of symbols and a list of files that references the symbol. If the symbol is defined, the first file listed is the location of the definition. The remaining files contain references to the symbol. D Data Directives Data directives are those that control the assembler’s allocation of program or data memory and provide a way to refer to data items symbolically; that is, by meaningful names.
Glossary E EEPROM Electrically Erasable Programmable Read Only Memory. A special type of PROM that can be erased electrically. Data is written or erased one byte at a time. EEPROM retains its contents even when power is turned off. ELF Executable and Linking Format. An object file of this format contains machine code. Debugging and other information is specified in with DWARF. ELF/DWARF provide better debugging of optimized code than COFF. Emulation/Emulator See ICE/ICD.
MPLAB® ICD 4 User’s Guide Extended Mode (PIC18 MCUs) In Extended mode, the compiler will utilize the extended instructions (i.e., ADDFSR, ADDULNK, CALLW, MOVSF, MOVSS, PUSHL, SUBFSR and SUBULNK) and the indexed with literal offset addressing. External Label A label that has external linkage. External Linkage A function or variable has external linkage if it can be referenced from outside the module in which it is defined. External Symbol A symbol for an identifier which has external linkage.
Glossary Free-Standing An implementation that accepts any strictly conforming program that does not use complex types and in which the use of the features specified in the library clause (ANSI ‘89 standard clause 7) is confined to the contents of the standard headers , , , , , and . G GPR General Purpose Register. The portion of device data memory (RAM) available for general use. H Halt A stop of program execution.
MPLAB® ICD 4 User’s Guide Import Bring data into the MPLAB IDE/MPLAB X IDE from an outside source, such as from a hex file. Initialized Data Data which is defined with an initial value. In C, int myVar=5; defines a variable which will reside in an initialized data section. Instruction Set The collection of machine language instructions that a particular processor understands.
Glossary Linker A language tool that combines object files and libraries to create executable code, resolving references from one module to another. Linker Script Files Linker script files are the command files of a linker. They define linker options and describe available memory on the target platform. Listing Directives Listing directives are those directives that control the assembler listing file format. They allow the specification of titles, pagination and other listing control.
MPLAB® ICD 4 User’s Guide Macro Macro instruction. An instruction that represents a sequence of instructions in abbreviated form. Macro Directives Directives that control the execution and data allocation within macro body definitions. Makefile Export to a file the instructions to Make the project. Use this file to Make your project outside of MPLAB IDE/MPLAB X IDE, i.e., with a make.
Glossary MPLAB ICD Microchip in-circuit debugger that works with MPLAB IDE/MPLAB X IDE. See ICE/ICD. MPLAB IDE/MPLAB X IDE Microchip’s Integrated Development Environment. MPLAB IDE/MPLAB X IDE comes with an editor, project manager and simulator. MPLAB PM3 A device programmer from Microchip. Programs PIC18 microcontrollers and dsPIC digital signal controllers. Can be used with MPLAB IDE/MPLAB X IDE or stand-alone. Replaces PRO MATE II.
MPLAB® ICD 4 User’s Guide Non-Volatile Storage A storage device whose contents are preserved when its power is off. NOP No Operation. An instruction that has no effect when executed except to advance the program counter. O Object Code/Object File Object code is the machine code generated by an assembler or compiler. An object file is a file containing machine code and possibly debug information. It may be immediately executable or it may be relocatable, requiring linking with other object files, e.g.
Glossary Phantom Byte An unimplemented byte in the dsPIC architecture that is used when treating the 24-bit instruction word as if it were a 32-bit instruction word. Phantom bytes appear in dsPIC hex files. PIC MCUs PIC microcontrollers (MCUs) refers to all Microchip microcontroller families. PICkit 2 and 3 Microchip’s developmental device programmers with debug capability through Debug Express. See the Readme files for each tool to see which devices are supported.
MPLAB® ICD 4 User’s Guide Project A project contains the files needed to build an application (source code, linker script files, etc.) along with their associations to various build tools and build options. Prologue A portion of compiler-generated code that is responsible for allocating stack space, preserving registers and performing any other machine-specific requirement specified in the runtime model. This code executes before any user code for a given function.
Glossary Reentrant A function that may have multiple, simultaneously active instances. This may happen due to either direct or indirect recursion or through execution during interrupt processing. Relaxation The process of converting an instruction to an identical, but smaller instruction. This is useful for saving on code size. MPLAB XC16 currently knows how to relax a CALL instruction into an RCALL instruction.
MPLAB® ICD 4 User’s Guide Shell The MPASM assembler shell is a prompted input interface to the macro assembler. There are two MPASM assembler shells: one for the DOS version and one for the Windows operating system version. Simulator A software program that models the operation of devices. Single Step This command steps though code, one instruction at a time.
Glossary A region of memory managed and allocated by the compiler in which variables are statically assigned space. It replaces a software stack when such mechanisms cannot be efficiently implemented on the target device. It precludes reentrancy. Static RAM or SRAM Static Random Access Memory. Program memory you can read/write on the target board that does not need refreshing frequently.
MPLAB® ICD 4 User’s Guide T Target Refers to user hardware. Target Application Software residing on the target board. Target Board The circuitry and programmable device that makes up the target application. Target Processor The microcontroller device on the target application board. Template Lines of text that you build for inserting into your files at a later time. The MPLAB Editor stores templates in template files.
Glossary USB Universal Serial Bus. An external peripheral interface standard for communication between a computer and external peripherals over a cable using bi-serial transmission. USB 1.0/1.1 supports data transfer rates of 12 Mbps. Also referred to as high-speed USB, USB 2.0 supports data rates up to 480 Mbps. V Vector The memory locations that an application will jump to when either a Reset or interrupt occurs.
MPLAB® ICD 4 User’s Guide NOTES: DS50002596A-page 94 2017 Microchip Technology Inc.
MPLAB® ICD 4 USER’S GUIDE Index A H AVdd ........................................................................ 21 AVss......................................................................... 21 Header Board Specification...................................................... 10 Hibernate mode.............................................42, 43, 63 Hubs, USB ............................................................... 63 B Bootload Mode How to Force Bootload Mode ...........................
MPLAB® ICD 4 User’s Guide Q Quick Reference Debug/Program................................................. 28 R Reading, Recommended.......................................... 10 Readme.................................................................... 10 Resources Used by the Debugger ........................... 25 S Software Breakpoints Selection ............................... 59 SQTP ....................................................................... 28 Standard Communication Connections .........
Index NOTES: 2017 Microchip Technology Inc.
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://www.microchip.com/ support Web Address: www.microchip.