MPLAB® REAL ICE™ In-Circuit Emulator User’s Guide For MPLAB X IDE 2013 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 REAL ICE In-Circuit Emulator 2013 Microchip Technology Inc.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 4 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Table of Contents Preface ................................................................................................................. 9 Part 1 – Getting Started Chapter 1. About the Emulator 1.1 Introduction ................................................................................................... 15 1.2 Emulator Features ........................................................................................ 15 1.
Emulator User’s Guide for MPLAB X IDE Chapter 5. Common Debug Functions 5.1 Introduction ................................................................................................... 49 5.2 Starting and Stopping Emulation .................................................................. 49 5.3 Viewing Processor Memory and Files .......................................................... 50 5.4 Breakpoints and Stopwatch .......................................................................... 50 5.
Table of Contents Part 4 – Reference Chapter 11. Emulator Function Summary 11.1 Introduction ............................................................................................... 101 11.2 Emulator Selection and Switching ............................................................ 101 11.3 Emulator Options Selection ...................................................................... 101 11.4 Emulator Windows & Dialogs ...................................................................
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 8 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE 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.
Emulator User’s Guide for MPLAB X IDE DOCUMENT LAYOUT This document describes how to use the MPLAB REAL ICE in-circuit emulator 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 Emulator – What the MPLAB REAL ICE in-circuit emulator is, and how it can help you develop your application.
Preface CONVENTIONS USED IN THIS GUIDE The following conventions may appear in this documentation: TABLE 1: DOCUMENTATION CONVENTIONS Description Represents Examples Arial font: MPLAB® X IDE User’s Guide Italic Referenced books Emphasized text ...is the only compiler...
Emulator User’s Guide for MPLAB X IDE RECOMMENDED READING This document describes how to use the MPLAB REAL ICE in-circuit emulator. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources. Release Notes for MPLAB REAL ICE In-Circuit Emulator For the latest information on using the emulator, read the release notes under “Release Notes and Support Documentation” on the Start page.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Part 1 – Getting Started Chapter 1. About the Emulator ................................................................................... 15 Chapter 2. Device and Feature Support..................................................................... 19 Chapter 3. Operation.................................................................................................... 25 2013 Microchip Technology Inc.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 14 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 1. About the Emulator 1.1 INTRODUCTION The MPLAB REAL ICE in-circuit emulator is a modern emulator that supports hardware and software development for selected Microchip PIC® microcontrollers (MCUs) and dsPIC® Digital Signal Controllers (DSCs). An overview of the emulator is provided in this chapter: • • • • 1.
Emulator User’s Guide for MPLAB X IDE 1.4 EMULATOR SYSTEM The MPLAB REAL ICE in-circuit emulator is an in-circuit emulator that is controlled by a PC running MPLAB X IDE cross-platform software. The emulator communicates with a device or debug header that has on-board debug/emulation circuitry. A device is usually connected directly to a target board, whereas a header may be connected directly to or through a transition socket. An example emulator system configuration is shown in Figure 1-1.
About the Emulator 1.5 EMULATOR KIT COMPONENTS The components of the MPLAB REAL ICE in-circuit emulator system kit are listed below. 1. Emulator pod – main unit. 2. USB cable – provides communications between the emulator and a PC and power to the emulator. 3. Standard driver board and cable – connects the emulator pod to a header module or target board. 4. Logic probes – used for external triggers and I/O port trace. 5. Loop-back test board – verifies emulator operation.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 18 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR Chapter 2. Device and Feature Support For the specified tools, the following topics show the current and future support for devices, as well as the device features, depending on the selected device. Note: • • • • MPLAB X IDE Users: For a list of currently supported devices and related features, click on “Release Notes” on the “Learn & Discover” tab of the Start Page.
Emulator User’s Guide for MPLAB X IDE 2.1 32-BIT (DATA MEMORY) DEVICES The following table shows feature support for PIC32 MCUs.
Device and Feature Support 2.2 16-BIT (DATA MEMORY) DEVICES The following table shows feature support for dsPIC30F/33F DSCs and PIC24F/H MCUs.
Emulator User’s Guide for MPLAB X IDE 2.3 8-BIT (DATA MEMORY) DEVICES - PIC18 The following table shows feature support for PIC18 MCUs.
Device and Feature Support 2.4 8-BIT (DATA MEMORY) DEVICES - PIC10/12/16 The following table shows feature support forPIC10/12/16 MCUs.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 24 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 3. Operation 3.1 INTRODUCTION A simplified description of how the MPLAB REAL ICE in-circuit emulator system works is provided here. It is intended to provide enough information so that a target board can be designed that is compatible with the emulator for both emulation and programming operations. The basic theory of in-circuit emulation and programming is described so that problems, if encountered, are quickly resolved.
Emulator User’s Guide for MPLAB X IDE 3.2 TOOLS COMPARISON The MPLAB REAL ICE in-circuit emulator system differs physically and operationally from other Microchip debug tools as shown below. Specific features may vary by device (see the online help file for “Device and Feature Support”.
Operation 3.3 OPERATIONAL OVERVIEW The emulator is connected to the PC via a USB port for communication and emulator power (but not target power). The emulator is connected to the target application for communication and data collection, such as trace. Below is a summary of possible connection configurations.
Emulator User’s Guide for MPLAB X IDE 3.4 EMULATOR COMMUNICATIONS WITH THE PC AND TARGET The MPLAB REAL ICE in-circuit emulator system consists of these items: 1. Emulator pod with indicator lights, push buttons and a logic probe connector 2. USB cable to connect a PC to the emulator pod and power the pod 3.
Operation 3.4.1 Standard Communication The emulator system can be configured to use the standard connection for communicating debug and programming instructions to the target. This 6-pin connection is the same one used by other Microchip in-circuit debuggers. The standard driver board is plugged into the emulator pod to configure the system for communication with the target.
Emulator User’s Guide for MPLAB X IDE FIGURE 3-3: STANDARD CONNECTION – ICE DEVICE Processor Pak Emulator Pod Standard Adapter Header Device-ICE ACTIVE STATUS FUNCTION Standard Driver Board 3.4.2 RESET Modular Cable Transition Socket Target Board High-Speed/LVDS Communication (Performance Pak) The emulator system can be configured to use the high-speed/LVDS connection for communicating debug and programming instructions to the target.
Operation FIGURE 3-4: HIGH-SPEED/LVDS CONNECTION – DEVICE WITH ON-BOARD ICE CIRCUITRY Performance Pak High-Speed Receiver Board* Emulator Pod J3 ACTIVE J2 Target Device or PIM STATUS FUNCTION RESET J2 Target Board J3 * Replace with isolator unit for high voltage.
Emulator User’s Guide for MPLAB X IDE 3.5 TARGET COMMUNICATION CONNECTIONS There are two driver boards available to closely match most application requirements. The standard driver board can be used to connect to the myriad of demo boards and applications that contain the RJ11 connector. The high-speed driver/receiver board combination can be used for high-speed communications, for additional trace features, for large (several feet) emulator-to-target distances and for noisy environments. 3.5.
Operation 3.5.3 Target Connection Circuitry Figure 3-8 shows the interconnections of the MPLAB REAL ICE in-circuit emulator to the connector on the target board. The diagram also shows the wiring from the connector to a device on the target PC board. A pull-up resistor (typically 10 k) is recommended to be connected from the VPP/MCLR line to VDD so that the line may be strobed low to reset the device.
Emulator User’s Guide for MPLAB X IDE 3.5.4 Circuits That Will Prevent the Emulator From Functioning Figure 3-9 shows the active emulator lines with some components that will prevent the MPLAB REAL ICE in-circuit emulator system from functioning. FIGURE 3-9: IMPROPER CIRCUIT COMPONENTS Emulator Pod 1 VPP/MCLR STATUS ACTIVE FUNCTION RESET No! No! No! 5 PGC 4 PGD No! No! For the Vpp/MCLR pin: • Do not use capacitors on MCLR – they will prevent fast transitions of VPP.
Operation 3.6 TRACE CONNECTIONS Depending on your selected device, one or more trace capabilities may be available when the emulator is selected as the debug tool. 3.6.1 Native Trace Connections No additional connections are necessary to use Native trace. The communications connection will carry the trace information using the PGD/PGC/EMUC/EMUD pins. However, the selected device must have this feature. If it does not, one of the other trace methods may be used.
Emulator User’s Guide for MPLAB X IDE 3.6.3 I/O Port Trace Connections Parallel trace is possible using a device 8-pin I/O port and the emulator logic probes. This provides greater trace speed and data quantity, but limits emulator-to-target distance by the length of the logic probes. Figure 3-11 shows these additional connections.
Operation 3.6.4 PIC32 Instruction Trace Connections PIC32 Instruction Trace is only available for PIC32 MCU devices. Also, only some PIC32 MCU devices have the trace feature. Consult your device data sheet for details.
Emulator User’s Guide for MPLAB X IDE 3.7 DEBUGGING WITH THE EMULATOR There are two steps to using the MPLAB REAL ICE in-circuit emulator system as a debugger. The first requires that an application be programmed into the target device. The second uses the internal in-circuit debug hardware of the target Flash device to run and test the application program. These two steps are directly related to the MPLAB IDE operations: 1.
Operation 3.8 REQUIREMENTS FOR DEBUGGING To debug (set breakpoints, see registers, etc.) with the MPLAB REAL ICE in-circuit emulator system, there are critical elements that must be working correctly: • The emulator must be connected to a PC. It must be powered by the PC via the USB cable, and it must be communicating with MPLAB IDE software via the USB cable. See Chapter 5. “Common Debug Functions” for details.
Emulator User’s Guide for MPLAB X IDE 3.8.2 Debugging Details Figure 3-14 illustrates the MPLAB REAL ICE in-circuit emulator system when it is ready for debugging. MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR READY FOR DEBUGGING FIGURE 3-14: VDD +12V +5V 1 VPP/MCLR Internal Circuits 4.7 k 4.
Operation 3.9 PROGRAMMING WITH THE EMULATOR Use the MPLAB REAL ICE in-circuit emulator as a programmer to program a production device, i.e., a device not on a debug header. Set the MPLAB REAL ICE in-circuit emulator as the current tool (File>Project Properties, Advanced, MPLAB Environment) to perform these actions: • When Run>Run Project is selected, the application code is programmed into the device’s memory via the ICSP protocol as described above.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 42 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Part 2 – Features Chapter 4. General Setup ............................................................................................ 45 Chapter 5. Common Debug Functions....................................................................... 49 Chapter 6. Specific Debug Functions: 8- and 16-Bit Devices .................................. 53 Chapter 7. Specific Debug Functions: 32-Bit Devices..............................................
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 44 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 4. General Setup 4.1 INTRODUCTION How to get started using the MPLAB REAL ICE in-circuit emulator is discussed. • • • • • 4.2 Installation and Setup Common Debug Features Emulator-Specific Debug Features Quick Debug/Program Reference Debugger/Programmer Limitations INSTALLATION AND SETUP Refer to the Help file “Getting Started with MPLAB X IDE” for details on installing the IDE and setting up the emulator to work with it.
Emulator User’s Guide for MPLAB X IDE 4.3 COMMON DEBUG FEATURES Refer to the Help file “Getting Started with MPLAB X IDE”, Debugging Code section, for details on debug features. This section includes: 1. 2. 3. 4. 5. 6. 4.4 Debug Running the Project (build, program and run) from Debug>Debug Project.
General Setup 4.5 QUICK DEBUG/PROGRAM REFERENCE The following table is a quick reference for using the MPLAB REAL ICE in-circuit emulator as either a debug or program tool. Please see previous chapters for information on proper emulator setup and configuration. TABLE 4-1: DEBUG VS. PROGRAM OPERATION Item Debug Needed Hardware Program A PC and target application (Microchip demo board or your own design.) Emulator pod, USB cable, communication driver board(s) and cable(s).
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 48 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 5. Common Debug Functions 5.1 INTRODUCTION Common MPLAB REAL ICE in-circuit emulator debug functions are discussed. • • • • 5.
Emulator User’s Guide for MPLAB X IDE 5.3 VIEWING PROCESSOR MEMORY AND FILES MPLAB X IDE provides several windows for viewing debug and various processor memory information, selectable from the Window menu. See MPLAB IDE online help for more information on using these windows. • Window>PIC Memory Views - View the different types of device memory. Depending on the selected device, memory types include Program Memory SRFs, Configuration Memory, etc. • Window>Debugging - View debug information.
Common Debug Functions 5.4.2 Hardware or Software Breakpoint Selection The following table compares hardware and software breakpoints: TABLE 5-1: HARDWARE VS. SOFTWARE BREAKPOINTS Feature HW Breakpoints SW Breakpoints Number of breakpoints Limited Unlimited Breakpoints written to* Debug registers Program memory Breakpoints applied to** Memory registers Code Time to set breakpoints Minimal Oscillator speed dependent; programming Flash memory Breakpoint skidding Most devices.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 52 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 6. Specific Debug Functions: 8- and 16-Bit Devices 6.1 INTRODUCTION The following debug functions are specific to 8- and 16-bit devices. • • • • • 6.2 Data Capture and Runtime Watches Instrumented Trace PC Sampling Application In/Out Additional Debug Features DATA CAPTURE AND RUNTIME WATCHES Not all 8- and 16-bit devices support data capture and/or runtime watches.
Emulator User’s Guide for MPLAB X IDE 6.2.1 Data Capture and DMCI Data capture provides streaming data from a device to the following: • Data Monitoring and Control Interface (DMCI) – Plug-in To install the DMCI plug-in: 1. 2. 3. 4. Select Tools>Plugins. The Plugins window will open. Click on the Available Plugins tab. Find DMCI and check the checkbox next to it. Click Install and follow the screens. See also the “Add Plug-in Tools” in the “Additional Tasks” section of the MPLAB X IDE help file.
Specific Debug Functions: 8- and 16-Bit Devices 6.3 INSTRUMENTED TRACE This section will discuss the available types of instrumented trace and how to use them. 6.3.1 Requirements for Trace The following is required to use trace: • Devices that support trace. See “MPLAB X IDE Limitations” on the “Learn & Discover” tab of the Start Page. • In-line assembly code (assembly code within C code) cannot be traced. 6.3.
Emulator User’s Guide for MPLAB X IDE There are three trace methods available at this time (see Section 6.3.3 “Types of Trace”). The methods can be found on the Project Properties dialog, REAL ICE Category, Trace Options Category page. The choices include Native Trace (utilizes PGC/PGD communication lines), SPI Trace, and I/O Port Trace. Not every method is available on every part; i.e., the options are device specific.
Specific Debug Functions: 8- and 16-Bit Devices 6.3.3 Types of Trace Currently there are three types of trace. All types are language tool version dependent, and stream data in real time to MPLAB IDE. The pluses and minuses of using each trace type, as well as the type of communication available (standard and/or high-speed), are summarized below. Type of Trace Speed (1) Code Size Impact Large Native Trace Fast SPI Trace Faster(1) Medium I/O Port Trace Fastest Note 1: Note 2: 6.3.3.
Emulator User’s Guide for MPLAB X IDE 6.3.3.3 I/O PORT TRACE I/O Port trace can be used with either standard or high-speed communications. Trace clock and data are provided from a device 8-pin I/O port through the MPLAB REAL ICE in-circuit emulator logic probe connector. The I/O port must have all 8 pins available for trace. The port must not be multiplexed with the currently-used PGC and PGM pins.
Specific Debug Functions: 8- and 16-Bit Devices • The recording of a variable value is performed much in the same way. First highlight the variable name or expression and then right click to select “Log Selected Language Value” from the pop-up menu, where Language can be either C or ASM.
Emulator User’s Guide for MPLAB X IDE 6.3.7 Disabling Trace To temporarily turn off trace data collection: 1. Select File>Project Properties dialog, Categories: REAL ICE, Options categories: Trace and Profiling. 2. Check “Disable Trace Macros”. 3. Click OK. To disable the full trace capability: 1. Remove all trace and log macros from code. 2. Select File>Project Properties dialog, Categories: REAL ICE, Options categories: Trace and Profiling. 3. Under “Data Collection Selection”, choose “Off”. 4.
Specific Debug Functions: 8- and 16-Bit Devices EXAMPLE 6-4: dsPIC33F DEVICE RUNNING AT 16 MIPS WITH C PROJECT Native SPI I/O Port __TRACE(id) instruction cycles 88 53 32 __LOG(id, INT) instruction cycles 227 138 106 EXAMPLE 6-5: dsPIC33F DEVICE RUNNING AT 34 MIPS WITH C PROJECT Native SPI I/O Port __TRACE(id) instruction cycles 100 53 32 __LOG(id, INT) instruction cycles 251 152 106 6.3.
Emulator User’s Guide for MPLAB X IDE 6.4 PC SAMPLING PC sampling is a method for examining C code to determine how much time is spent in each function. This information can show you where your program time is being spent so you may work to optimize your code. For PC sampling, a device timer is set up to take samples of program execution and display the results in the PC profiling window. PC profiling is similar to PC sampling. For details see Section 7.5 “PC Profiling”.
Specific Debug Functions: 8- and 16-Bit Devices 6.5 APPLICATION IN/OUT Note: This window is only available for devices that support the application in/out function used with the MPLAB REAL ICE in-circuit emulator or MPLAB ICD 3 in-circuit debugger. For details, see online help, “Device and Feature Support”. The Application In/Out window allows you to interact with a running application using the Application Input/Output feature supported on some devices.
Emulator User’s Guide for MPLAB X IDE To run this application: 1. Create a project using the Project wizard: a) Select a supported device. b) Select REAL ICE or ICD 3 as the hardware tool. c) Use the “MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs” or the “MPLAB XC16 C Compiler” as the language toolsuite. 2. Select File>New File to create and name a new C Source File. In the Editor window that opens, add the previous code and save. 3.
Specific Debug Functions: 8- and 16-Bit Devices Change Input and Output Formats by opening Set App IO Properties dialog and running the program again to see what outputs result for different inputs. For more on options avaiable in this window, see Section 11.4.2 “Application In/Out Window and Related Dialogs”. 6.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 66 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 7. Specific Debug Functions: 32-Bit Devices 7.1 INTRODUCTION The following debug functions are specific to 32-bit devices: Note: • • • • • • 7.2 For PIC32 devices, the JTAG port may need to be disabled to prevent conflicts when using trace and other ICE features where pin conflicts can result.
Emulator User’s Guide for MPLAB X IDE 7.2.1 Data Capture and DMCI Data capture provides streaming data from a device to the following: • Data Monitoring and Control Interface (DMCI) – Plug-in To install the DMCI plug-in: 1. 2. 3. 4. Select Tools>Plugins. The Plugins window will open. Click on the Available Plugins tab. Find DMCI and check the checkbox next to it. Click Install and follow the screens. See also the “Add Plug-in Tools” in the “Additional Tasks” section of the MPLAB X IDE help file.
Specific Debug Functions: 32-Bit Devices 7.2.3 Runtime Watches and the Watch Window A runtime watch provides updating of a variable in the following windows during program execution instead of on halt: • Watches – Window > Debugging menu • Memory – Window > PIC Memory Views menu To set up runtime watches: 1. Build the project (In the Projects window, right click on the project name and select “Build”). The project must be built to see the available symbols. 2.
Emulator User’s Guide for MPLAB X IDE 7.3 PIC32 INSTRUCTION TRACE This section will discuss trace for 32-bit devices and how to use it. Not all PIC32 devices have instruction trace so refer to your device data sheet. • • • • Requirements for Trace How Instruction Trace Works Setting Up and Using Trace Trace Hardware Specifications 7.3.
Specific Debug Functions: 32-Bit Devices FIGURE 7-1: 2013 Microchip Technology Inc.
Emulator User’s Guide for MPLAB X IDE 7.3.3 Setting Up and Using Trace PIC32 Instruction Trace requires hardware and software setup before you can trace. 7.3.3.1 HARDWARE SETUP – PIC32 MCU ON PIM To use the PIC32 Instruction Trace feature with the PIM do the following: 1. Plug the PIM into an unpowered target board. 2. Install communication cable(s) between the emulator and your target board. See Section 3.5 “Target Communication Connections”. 3.
Specific Debug Functions: 32-Bit Devices 5. Power the target. Note: When using trace, pins TRCLK and TRD3:0 are used. Therefore, you cannot use the other functions multiplexed on these pins. For PIC32MX360F512L, multiplexed functions are RG14:12 and RA7:6. FIGURE 7-3: TRACE CONNECTION WITH DEVICE ON TARGET Emulator Pod 7.3.3.
Emulator User’s Guide for MPLAB X IDE FIGURE 7-4: ADAPTER BOARD PIN CONNECTION DIAGRAM From Emulator Logic Probe Port J1 Reserved 13 11 9 7 5 3 1 TCLK Reserved Reserved TRIG3 TRIG1 To Trace Cable/PIM Trace Port J1 Signal Map Reserved Reserved 14 12 10 8 6 4 2 J1 Reserved Reserved TRIG4 TRIG2 J2 TCLK TRCLK TRIG1 TRD0 TRIG2 TRD1 TRIG3 TRD2 TRIG4 TRD3 1 3 5 7 9 TRCLK TRD0 TRD1 TRD2 TRD3 J2 2 4 6 8 10 GND:Blue, TRCLK:Yellow, TRDAT:Green To use the logic probes instead of the trace cab
Specific Debug Functions: 32-Bit Devices 7.4 INSTRUMENTED TRACE For some PIC32 devices, instrumented trace is available (see Chapter 2. “Device and Feature Support”). For information on this trace, see Section 6.3 “Instrumented Trace”. 7.5 PC PROFILING PC profiling is a method for examining C code to determine how much time is spent in each function. This information can show you where your program time is being spent so you may work to optimize your code.
Emulator User’s Guide for MPLAB X IDE FIGURE 7-6: 7.6 PC SAMPLING WINDOW APPLICATION IN/OUT Note: This window is only available for devices that support the application in/out function used with the MPLAB REAL ICE in-circuit emulator or MPLAB ICD 3 in-circuit debugger. For details, see online help, “Device and Feature Support”. The application in/out function cannot be used with PIC32 instruction trace.
Specific Debug Functions: 32-Bit Devices EXAMPLE 7-1: APPLICATION IN/OUT MACRO USAGE The following application code reads the application input register and writes out a padded value of the input to the application output register. // include file #include // set up config bits #pragma config FWDTEN = OFF // initialize variables unsigned int val; int i; unsigned int oval; int main(void) { while(1) { if(_DDPSTATbits.
Emulator User’s Guide for MPLAB X IDE FIGURE 7-7: SET APP I/O PROPERTIES 7. Debug Run or Run the project. 8. Enter an text value in the Input text box. Hit Enter. 9. View the output in the Output text box. FIGURE 7-8: APP IN/OUT WINDOW Change Input and Output Formats by opening Set App IO Properties dialog and running the program again to see what outputs result for different inputs. For more on options avaiable in this window, see Section 11.4.2 “Application In/Out Window and Related Dialogs”. 7.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Part 3 – Troubleshooting Chapter 8. Troubleshooting First Steps ..................................................................... 81 Chapter 9. Frequently Asked Questions (FAQ) ......................................................... 83 Chapter 10. Messages ................................................................................................. 91 2013 Microchip Technology Inc.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 80 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 8. Troubleshooting First Steps 8.1 INTRODUCTION If you are having problems with MPLAB REAL ICE in-circuit emulator operation, start here. • The 5 Questions to Answer First • Top Reasons Why You Can’t Debug • Other Things to Consider 8.2 THE 5 QUESTIONS TO ANSWER FIRST 1. What device are you working with? Often an upgrade to a newer version of MPLAB IDE is required to support newer devices. That is, yellow light = untested support.
Emulator User’s Guide for MPLAB X IDE 9. The target application has somehow become corrupted or contains errors. Try rebuilding and reprogramming the target application. Then initiate a Power-On-Reset of the target. 10. You do not have the correct PGC/PGD pin pairs programmed in your Configuration bits (for devices with multiple PGC/PGD pin pairs). 11. Other configuration settings are interfering with debugging.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 9. Frequently Asked Questions (FAQ) 9.1 INTRODUCTION Look here for answers (A) to frequently asked questions (Q) about the MPLAB REAL ICE in-circuit emulator system. • How The Emulator Works • How Trace Works – 8 and 16 Bit Devices • General Issues 9.
Emulator User’s Guide for MPLAB X IDE Q: On traditional emulators, the data must come out on the bus in order to perform a complex trigger on that data. Is this also required on the MPLAB REAL ICE in-circuit emulator? For example, could I halt based on a flag going high? A: Traditional emulators use a special emulator chip (-ME) for monitoring. There is no -ME with the MPLAB REAL ICE in-circuit emulator so there are no busses to monitor externally.
Frequently Asked Questions (FAQ) Q: To debug a dsPIC® DSC running at 30 MIPS, is high-speed communications necessary to do even basic debugging? A: Basic debugging at any device frequency can be accomplished with either standard or high-speed (Performance Pak) communications. Q: My target board connector is for standard communications but I want to use high-speed communications.
Emulator User’s Guide for MPLAB X IDE Q: For SPI trace, which two pins are used? A: The pins are: SDO (Serial Data Output) DAT (pin 7) SCK (Serial Clock Output) CLK (pin 8) Q: What are the correct port settings to use SPI trace, i.e., mode, sync/async, etc.? A: The setup is taken care of by MPLAB IDE, so you will not need to be concerned about the code required for setting this. Trace will support 64 trace points and 128 log points. SPI – Comm Protocol MODE1, clock high, sampled falling edge.
Frequently Asked Questions (FAQ) 9.4 GENERAL ISSUES Q: Performing a Verify fails after programming the device. Is this a programming issue? A: If Run (Run>Run Project) is selected, the device will automatically run immediately after programming. Therefore, if your code changes the flash memory, verification could fail. To prevent the code from running after programming, please select 'Hold in Reset'. Q: I have set a breakpoint but my program doesn't stop there.
Emulator User’s Guide for MPLAB X IDE Q: I cannot get trace to work. What’s wrong? A: Consider the following: - Certain tool versions are required to use trace. Please refer to either Chapter 6. “Specific Debug Functions: 8- and 16-Bit Devices” or Chapter 7. “Specific Debug Functions: 32-Bit Devices”. - For dsPIC30F/33F and PIC24F/H devices, only C code can be used with trace, not assembly. - In-line assembly code (assembly code within C code) cannot be traced.
Frequently Asked Questions (FAQ) Q: When using a 16-bit device, unexpected Reset occurred. How do I determine what caused it? A: Consider the following: - Ensure the Watchdog Timer is disabled in the configuration bits. - To determine a Reset source, check the RCON register. - Handle traps/interrupts in an interrupt service routine (ISR). You should include trap.c style code, i.e.
Emulator User’s Guide for MPLAB X IDE Q: I accidentally disconnected my emulator while firmware was downloading. What do I do now? A: Reconnect the emulator. It will begin to erase what had been written so it can restart. This erasing will take about 75 seconds (1:15 mins). Please be patient.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 10. Messages 10.1 INTRODUCTION The MPLAB REAL ICE in-circuit emulator produces many different output messages. Some are error messages, many of which can often be resolved with general corrective actions. And some are informational only. • Error Messages • General Corrective Actions • Informational Messages 10.2 ERROR MESSAGES MPLAB REAL ICE in-circuit emulator error messages are listed below.
Emulator User’s Guide for MPLAB X IDE 10.2.2 Emulator-to-Target Communication Errors For the errors below, read any instructions under your error message. If these fail to fix the problem or if there are no instructions, see Section 10.3.2 “Emulator-to-Target Communication Error Actions”.
Messages The MPLAB REAL ICE is missing its Program Executive. Please reconnect to the PC and try again. The MPLAB REAL ICE is missing its Debug Executive. Please reconnect to the PC and try again. The MPLAB REAL ICE is missing its Device Database. Please reconnect to the PC and try again. The MPLAB REAL ICE is missing a Memory Object. The current memory object in the MPLAB REAL ICE is corrupted. Please retry the operation.
Emulator User’s Guide for MPLAB X IDE See also Section 10.3.2 “Emulator-to-Target Communication Error Actions”. Invalid streaming data was been detected. Run time watch or trace data may no longer be valid. Is recommended that you restart your debug session. See the FAQ, “Data capture has become flaky. What is going on?”. 10.2.6 Hardware/Firmware Errors For the errors below, read any instructions within your error message. The 17.5 rail is unable to turn on.
Messages 10.2.7 Miscellaneous Errors For the errors below, read any instructions under your error message. could not open file There was a problem reading file Failed to set firmware suite. Database intitialization failure. Connection failed (timed out waiting to REAL ICE to respond) MPLAB has lost communication with REAL ICE. Unable to connect to REAL ICE (MPLABComm connect failure) REAL ICE is busy. Please wait for the current operation to finish.
Emulator User’s Guide for MPLAB X IDE 10.3 GENERAL CORRECTIVE ACTIONS These general corrective actions may solve your problem: • • • • • • • Read/Write Error Actions Emulator-to-Target Communication Error Actions Emulator-to-PC Communication Error Actions Corrupted Installation Actions USB Port Communication Error Actions Debug Failure Actions Internal Error Actions 10.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.
Messages 10.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 REAL ICE in-circuit emulator 2. Make sure the emulator is physically connected to the PC on the appropriate USB port. 3. Make sure the appropriate USB port has been selected in the emulator 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. Make sure the USB drivers are loaded.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 98 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Part 4 – Reference Chapter 11. Emulator Function Summary................................................................ 101 Chapter 12. Hardware Specification ......................................................................... 109 Chapter 13. Emulator Accessories........................................................................... 115 2013 Microchip Technology Inc.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 100 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 11. Emulator Function Summary 11.1 INTRODUCTION A summary of the MPLAB REAL ICE in-circuit emulator functions is listed here. • Emulator Selection and Switching • Emulator Options Selection • Emulator Windows & Dialogs 11.2 EMULATOR SELECTION AND SWITCHING Use the Project Properties dialog to select or switch emulators for a project.
Emulator User’s Guide for MPLAB X IDE 11.3.1 Trace and Profiling Depending on the device you have selected for your project, you may be able to use trace or PC sampling/profiling when debugging. Enable and set up these features as specified below. 8-Bit and 16-Bit Devices Options available on this page depend on the trace/profiling features of the project device. For more on trace and profiling, see Chapter 6. “Specific Debug Functions: 8and 16-Bit Devices”.
Emulator Function Summary TABLE 11-1: TRACE/PROFILING OPTION CATEGORY (CONTINUED) Timer Interval Units Select a sampling interval unit: • microseconds • milliseconds • seconds • instruction cycles 32-Bit Devices Options available on this page depend on the trace/profiling features of the project device. For more on trace and profiling, see Chapter 7. “Specific Debug Functions: 32-Bit Devices”. TABLE 11-2: TRACE/PROFILING OPTION CATEGORY Data Collection Selection Enable/Disable data collection.
Emulator User’s Guide for MPLAB X IDE 11.3.3 Clock Enter the runtime clock (instruction) speed on this tab. This does not set the speed, but informs the emulator of its value for runtime watch, data capture and trace. Note: Clock switching is available for data capture and trace, but you must set the clock correctly or you may see issues. Enter the fastest instruction speed you will be using on this tab.
Emulator Function Summary 11.3.5 Debug Options Use software breakpoints, if available for the project device. TABLE 11-5: DEBUG OPTIONS OPTION CATEGORY Use Software Breakpoints TABLE 11-6: Check to use software breakpoints. Uncheck to use hardware breakpoints. See discussion below to determine which type is best for your application.
Emulator User’s Guide for MPLAB X IDE 11.3.8 Memories to Program Select the memories to be programmed into the target. TABLE 11-9: DS52085A-page 106 MEMORIES TO PROGRAM OPTION CATEGORY Auto select memories and ranges Allow REAL ICE to Select Memories - The emulator uses your selected device and default settings to determine what to program. Manually select memories and ranges - You select the type and range of memory to program (see below.
Emulator Function Summary 11.4 EMULATOR WINDOWS & DIALOGS The following windows and dialogs are used specifically for the emulator and/or other debug tools. • Trace Window and Releated Dialogs • Application In/Out Window and Related Dialogs • PC Sampling Window and Related Dialogs 11.4.1 Trace Window and Releated Dialogs The trace window displays the results of a trace. This window is available for the emulator and the simulator.
Emulator User’s Guide for MPLAB X IDE 11.4.2 Application In/Out Window and Related Dialogs The Application In/Out window supports the App IO function where runtime control information can be sent to an application through MPLAB IDE (APPIN) and status information can be sent by the application to MPLAB IDE (APPOUT). FIGURE 11-2: APP IN/OUT WINDOW Other actions are available from the buttons. Right clicking in the Ouput text box will pop up a menu with the same functions.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 12. Hardware Specification 12.1 INTRODUCTION The hardware and electrical specifications of the basic MPLAB REAL ICE in-circuit emulator system are detailed. 12.2 HIGHLIGHTS This chapter discusses: • • • • • 12.
Emulator User’s Guide for MPLAB X IDE 12.4 EMULATOR POD The emulator pod (DV244005) consists of a main board enclosed in the casing with a port for either of two driver boards (for standard or high-speed communication with a target). On the emulator encloser are push buttons, indicator lights (LEDs) and a logic probe connector interface. 12.4.1 Main Board This component has an interface processor (dsPIC DSC), a USB 2.
Hardware Specification FIGURE 12-1: LOGIC PROBE PINOUT ON EMULATOR 13 14 1* 2 Logic probes may be attached to this connector to give the functionality described in Table 12-2. The probes are color coded and labeled for easy identification.
Emulator User’s Guide for MPLAB X IDE 12.5 STANDARD COMMUNICATION HARDWARE For standard emulator communication with a target (Section 3.4.1 “Standard Communication”), use the standard driver board. To use this type of communication with a debug header, you may need a device-specific Processor Pak, which includes an 8-pin connector debug header containing the desired ICE/ICD device and a standard adapter board (8-pin to 6-pin connection).
Hardware Specification 12.5.2 Modular Cable and Connector For standard communications, a modular cable connects the emulator and the target application. The specifications for this cable and its connectors are listed below. 12.5.2.1 MODULAR CABLE SPECIFICATION • Manufacturer, Part Number – Microchip Technology, 07-00024 The length for this cable (L) is 6 inches. If you require a longer cable, consider purchasing the Performance Pak. For details see Section 13.
Emulator User’s Guide for MPLAB X IDE 12.6 LOOP-BACK TEST BOARD This board (included with DV244005) can be used to verify that the emulator is functioning properly. To use this board: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Disconnect the emulator from the target and the PC. Insert the standard driver board if it is not already installed. Plug the loopback test board into the pod’s logic probe connector. Connect the loop-back test board to the standard driver board using the modular cable.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Chapter 13. Emulator Accessories 13.1 INTRODUCTION The MPLAB REAL ICE in-circuit emulator has several different accessories to aid in different debugging conditions. 13.2 HIGHLIGHTS This chapter discusses: • • • • 13.
Emulator User’s Guide for MPLAB X IDE 13.3.1 High-Speed Driver Board The high-speed driver board consists of two separate multipoint LVDS (Low Voltage Differential Signaling) transmitters and receivers for clock and data. Multipoint LVDS requires 100 ohm terminations at each driver output and receiver input, per the standard, and multipoint configurations type 2 receivers are used, as these are intended for control signals or where fail-safe provisions are needed.
Emulator Accessories 13.3.2 High-Speed Receiver Board A high-speed receiver board assembly is also required when using LVDS connectivity. This board is a counterpart to the high-speed driver board assembly in the pod. When the driver is active on the pod, the receiver is active in the receiver board. Alternatively, when the driver is active on the receiver board, the corresponding receiver is active in the driver board, providing transmitting and receiving capability at both ends.
Emulator User’s Guide for MPLAB X IDE FIGURE 13-4: RECEIVER BOARD SCHEMATIC – ICSPDAT AHC1G04-SOT5 NDATA_EN 4 3 100 6 7 LVD- 1 VCCA 6 VCCB VDD_TAR 4 LVD+ +3.3V DATA_EN 2 DATA 5 DATA_EN 2 3 1 DIR A B 4 GND SN65MLVD206 ICSPDAT 4.7K 74LVC1T45_SOT-6P 3 DATAEN+ 4 100 2 6 1 7 DATAEN- DATA_EN SN65MLVD206 FIGURE 13-5: RECEIVER BOARD SCHEMATIC – ICSPCLK AHC1G04-SOT5 NCLK_EN 4 2 3 100 LVC- 6 7 1 VCCA 6 VCCB VDD_TAR 4 LVC+ +3.
Emulator Accessories FIGURE 13-6: RECEIVER BOARD SCHEMATIC – DAT & CLK 3 USPID+ +3.3V 4 100 6 1 7 USPID- DAT 2 10K 10K SN65MLVD206 3 USPIC+ +3.3V 4 100 2 6 1 7 USPIC- CLK 10K POWER 10K 0.1uF SN65MLVD206 13.3.3 LVDS Cables and Target Pinout The emulator-to-target cable length for proper operation has been tested for this driver/receiver board combination and is shipped in the Performance Pak. The recommended lengths are 3 feet, with a maximum of 10 feet.
Emulator User’s Guide for MPLAB X IDE 13.4 MPLAB REAL ICE ISOLATOR UNIT (OPTO-ISOLATOR) The MPLAB REAL ICE Isolator Unit (AC244005) is a useful accessory to the MPLAB REAL ICE in-circuit emulator system. The isolator enables connectivity for AC line and high voltage applications not referenced to ground.
Emulator Accessories 13.4.1 Isolator Unit Design The isolator is a bridge where electrically hot signals are passed through transparently to the emulator. The ICSP interface signals are magnetically or optically isolated providing up to 2.5KV equivalent isolation protection. The isolator is housed in its own enclosure providing an additional measure of safety. This unit contains the same circuitry as the high-speed receiver board (see Section 13.3.
Emulator User’s Guide for MPLAB X IDE FIGURE 13-12: ISOLATOR UNIT SCHEMATIC - DAT & CLK 3 U3 4 DATAEN+ 2 R3 100 DATAEN- 6 7 1 DATA_EN SN65MLVD206 U4 CLKEN+ 4 2 R4 100 CLKEN- 3 6 7 1 CLK_EN SN65MLVD206 USPID+ +3.3V 4 USDO 2 R5 100 USPID- 3 6 7 1 1 SN65MLVD206 U6 USPIC+ R6 100 USPIC- DS52085A-page 122 3 R7 10K +3.3V 4 USCK 1 SN65MLVD206 R36 10K +3.3V U8 VDD1 VDD2 HOT_VDD 16 3 14 4 13 10 5 2 6 7 +3.
Emulator Accessories FIGURE 13-13: ISOLATOR UNIT SCHEMATIC - POWER +3.3V C18 10uF 6.3V C21 0.1uF R23 L1 D1 .05 10uH CRS08 +3.3V U18 R17 100K +3.3V 1,2,5,6 R20 100K 8 VIN 7 PG 6 MC 5 SHDN 1 EXT 2 GND 3 CS 4 FB C30 0.1uF MCP1652_MSOP8 R28 4.22K 1% R38 L4 D4 .05 10uH CRS08 1,2,5,6 U22 HOT_VDD R42 100K 8 VIN 7 PG 6 MC 5 SHDN 1 EXT 2 GND 3 CS 4 FB Q1 2013 Microchip Technology Inc. C31 10 25V R41 0.1 3 +3.3V C17-C18 0.1 R40 11.
Emulator User’s Guide for MPLAB X IDE FIGURE 13-14: ISOLATOR UNIT SCHEMATIC - VDD, VPP, MCLR VDD DETECT HOT_+5V U15 8 +5V +5V U16 5 VDD_TAR R10 IN+ 1 3 IN- 4 2 0 NC 1 U17 5 7 NC 2 6 3 5 4 R12 IN+ 1 3 IN- 4 2 500 HOT_VDD MCP601_SOT-23_5L C24 100pF HOT_VDD R14 10K LOC110_8PFLATPK R13 90.9K, 5% R11 90.9K, 5% MCP601_SOT-23_5L VPP/NMCLR 2 3 U10 1 VDD1 VPP_TAR 2 VI 3 VDD1 ENC +5V J4 1 DEC +3.3V HOT_VDD VDD2 8 GND2 7 VO 6 HOT_VPP 5 4 GND1 GND2 ADUM1100 13.4.
Emulator Accessories 13.5 MPLAB REAL ICE JTAG ADAPTOR BOARD The MPLAB REAL ICE JTAG Adaptor (AC244007) may be used to provide JTAG communication between the MPLAB REAL ICE in-circuit emultor and the target. The kit contains a JTAG adaptor board, ribbon cable, and this insert. 13.5.1 JTAG Support • The JTAG adaptor board is supported on MPLAB X IDE 1.60 and above. • The JTAG adaptor board supports all PIC32 devices. • Only basic debug features are available when using JTAG: Run, Halt, and Single Step.
Emulator User’s Guide for MPLAB X IDE FIGURE 13-15: JTAG ADAPTOR BOARD CONNECTIONS AND SET UP Emulator Pod MPLAB® X IDE - Project Properties ACTIVE STATUS FUNCTION RESET JTAG Adator Board Ribbon Cable PIC32 JTAG Target Board with JTAG connector Target Board 13.5.3 Switch from JTAG to Standard Communications To switch the hardware: 1. Device memory does not need to be erased in this case.
Emulator Accessories FIGURE 13-16: JTAG ADAPTOR BOARD SCHEMATICS - PART 1 J1 SDO TP6 TP7 SDI TP4 SCK PVPP PVDD BTMS TP3 TP1 +3.3V 1 3 5 DATA_EN 7 CLK_EN 9 11 13 15 17 19 21 23 AUX1 (DRVR_INS) 25 AUX1_EN 27 AUX2_EN 29 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 +5V TP5 DRVR_IRQ NSYS_RST UTIL_SDA UTIL_SCL VDD_SENSE TMS_EN TP2 AUX2 MB1-130_PCBMATE +5V C13 0.1 +5V 9 VDD UTIL_SCL UTIL_SDA +5V C7 0.1 +5V NSYS_RST VCC 2 1 12 SCL 13 SDA 15 A0 16 A1 17 A2 U5 5 18 RST 4 3 PCB Type.
Emulator User’s Guide for MPLAB X IDE FIGURE 13-17: JTAG ADAPTOR BOARD SCHEMATICS - PART 2 +5V +5V PVDD U1 1 VCCA 6 VCCB 5 TDI_EN SDO R2 3 22 2 PVDD C1 0.1 PTC1 PTC-MICROSMD DIR A 4 B C2 0.1 TDI 33 50mA GND R23 74LVC1T45 +5V +5V PVDD U2 1 VCCA 6 VCCB 5 TDO_EN SDI R3 3 22 2 PVDD C3 0.1 PTC4 PTC-MICROSMD DIR A C4 0.1 4 B R29 GND TDO 33 50mA 74LVC1T45 +5V +5V PVDD U3 1 VCCA 6 VCCB SCK TCK_EN R12 22 PVDD C6 0.1 C5 0.
Emulator Accessories FIGURE 13-18: JTAG ADAPTOR BOARD SCHEMATICS - PART 3 +5V U8 OUT 8 OUT 7 6 OUT 1 GND OC 5 TPS2049 VDD_SENSE VIO_VREF +5V 3 VDD_EMSRC 2 IN 3 IN 4 EN 4 PVDD R8 10k R28 10k TR1 5.0V C16 0.1 K1 C11 0.1 1 PVDD C12 1.0 VDD_ON 2 ICSP_OC AQY212GS_SO4 R9 330 PVPP 3 4 MCLR_N VPP_ON 2 1 K2 AQY212GS_SO4 R10 330 +5V C8 0.
Emulator User’s Guide for MPLAB X IDE 13.6 OTHER ACCESSORIES For additional accessories for the emulator and other hardware tools, such as Processor Extension Paks and Debug Headers, see the Microchip website for “MPLAB Emulator and Debugger Accessories”. DS52085A-page 130 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Support INTRODUCTION Please refer to the items discussed here for support issues. • • • • • • Warranty Registration myMicrochip Personalized Notification Service The Microchip Web Site Microchip Forums Customer Support About Microchip Technology WARRANTY REGISTRATION Registering your development tool entitles you to receive new product updates. Interim software releases are available at the Microchip web site: http://www.microchipdirect.
Emulator User’s Guide for MPLAB X IDE • Programmers – The latest information on Microchip programmers. These include the device (production) programmers MPLAB REAL ICE in-circuit emulator, MPLAB ICD 3 in-circuit debugger, MPLAB PM3 and development (nonproduction) programmers PICkit 2 and 3. • Starter/Demo Boards – These include MPLAB Starter Kit boards, PICDEM demo boards, and various other evaluation boards. THE MICROCHIP WEB SITE Microchip provides online support via our web site at http://www.microchip.
Support ABOUT MICROCHIP TECHNOLOGY Microchip Technology Inc. is a leading provider of microcontroller and analog semiconductors, providing low-risk product development, lower total system cost and faster time to market for thousands of diverse customer applications worldwide. Headquartered in Chandler, Arizona, Microchip offers outstanding technical support along with dependable delivery and quality. Voice: (480) 792-7200 Fax: (480) 792-7277 myMicrochip: http://www.microchip.com/pcn Website: http://www.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 134 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Appendix A. Revision History Revision A (January 2013) • Initial release of this document. 2013 Microchip Technology Inc.
Emulator User’s Guide for MPLAB X IDE NOTES: DS52085A-page 136 2013 Microchip Technology Inc.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Glossary This glossary applies to al Microchip development tools documentation. Therefore, some terms have tool-dependent meanings. An abbreviation of each tool is used to identify each meaning.
Emulator User’s Guide for MPLAB X IDE Anonymous Structure C30 – An unnamed structure. C18 – An unnamed structure that is a member of a C union. The members of an anonymous structure may be accessed as if they were members of the enclosing union. For example, in the following code, hi and lo are members of an anonymous structure inside the union caster. union castaway int intval; struct { char lo; //accessible as caster.lo char hi; //accessible as caster.
Glossary Binary The base two numbering system that uses the digits 0-1. The rightmost digit counts ones (20), the next counts multiples of two (21), the next counts multiples of four (22), etc. Bookmarks Use bookmarks to easily locate specific lines in a file. Under the Edit menu, select Bookmarks to manage bookmarks. Toggle (enable/disable) a bookmark, move to the next or previous bookmark, or clear all bookmarks. Breakpoint Hardware Breakpoint: An event whose execution will cause a halt.
Emulator User’s Guide for MPLAB X IDE Configuration Bits Special-purpose bits programmed to set PIC microcontroller modes of operation. A Configuration bit may or may not be preprogrammed. Control Directives Directives in assembly language code that cause code to be included or omitted based on the assembly-time value of a specified expression. CPU See Central Processing Unit. Cross Reference File A file that references a table of symbols and a list of files that references the symbol.
Glossary Download Download is the process of sending data from a host to another device, such as an emulator, programmer or target board. DSC See Digital Signal Controller. DSP See Digital Signal Processor. dsPIC DSCs dsPIC Digital Signal Controllers (DSCs) refers to all Microchip DSC families. DWARF Debug With Arbitrary Record Format. DWARF is a debug information format for ELF files. EEPROM Electrically Erasable Programmable Read Only Memory. A special type of PROM that can be erased electrically.
Emulator User’s Guide for MPLAB X IDE Error File A file containing error messages and diagnostics generated by a language tool. Errors Errors report problems that make it impossible to continue processing your program. When possible, errors identify the source file name and line number where the problem is apparent. Event A description of a bus cycle which may include address, data, pass count, external input, cycle type (e.g., fetch, R/W), and time stamp.
Glossary File Registers On-chip data memory, including GPRs and SFRs. Filter Determine by selection what data is included/excluded in a trace display or data file. Flash A type of EEPROM where data is written or erased in blocks instead of bytes. FNOP Forced No Operation. A forced NOP cycle is the second cycle of a two-cycle instruction. Since the PIC microcontroller architecture is pipelined, it prefetches the next instruction in the physical address space while it is executing the current instruction.
Emulator User’s Guide for MPLAB X IDE High Level Language A language for writing programs that is further removed from the processor than assembly. ICD In-Circuit Debugger. The MPLAB ICD3 In-Circuit Debugger, MPLAB ICD2 In-Circuit Debugger, PICkit 3 D.E. In-Circuit Debugger (Debug Express add-on), and PICkit 2 D.E. In-Circuit Debugger (Debug Express add-on) are the Microchip in-circuit debuggers. ICE In-Circuit Emulator. The MPLAB REAL ICE system is Microchip’s next-generation in-circuit emulator.
Glossary Interrupt Request An event which causes the processor to temporarily suspend normal instruction execution and to start executing an interrupt handler routine. Some processors have several interrupt request events allowing different priority interrupts. Interrupt Service Routine ALU30, C18, C30 – A function that handles an interrupt. IDE – User-generated code that is entered when an interrupt occurs.
Emulator User’s Guide for MPLAB X IDE Local Label A local label is one that is defined inside a macro with the LOCAL directive. These labels are particular to a given instance of a macro’s instantiation. In other words, the symbols and labels that are declared as local are no longer accessible after the ENDM macro is encountered. Logic Probes Up to 14 logic probes can be connected to some Microchip emulators. The logic probes provide external trace inputs, trigger output signal, +5V, and a common ground.
Glossary Under Project>Build Options>Project, Directories tab, you must have selected “Assemble/Compile/Link in the project directory” under “Build Directory Policy” for this feature to work. Make Project A command that rebuilds an application, recompiling only those source files that have changed since the last complete compilation. MCLR - Master Clear Master Clear (MCLR) is a function on a pin that causes a processor Reset. MCLR is usually multiplexed with other functions such as VPP.
Emulator User’s Guide for MPLAB X IDE MPLAB ICD Microchip in-circuit debuggers that work with MPLAB X IDE. The ICDs support Flash devices with built-in debug circuitry. The main component of each ICD is the pod. A complete system consists of a pod, debug header (with a device-ICD), target board, cables, and MPLAB X IDE software. MPLAB X IDE Microchip’s Integrated Development Environment. MPLAB X IDE comes with an editor, project manager, and simulator. MPLAB PM3 A device programmer from Microchip.
Glossary 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 PC. Object Code The machine code generated by an assembler or compiler. Object File 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., libraries, to produce a complete executable program.
Emulator User’s Guide for MPLAB X IDE Persistent Data Data that is never cleared or initialized. This allows an application to preserve data across a device Reset. 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.
Glossary Profile For MPLAB SIM simulator, a summary listing of executed stimulus by register. Program Counter The location that contains the address of the instruction that is currently executing. Program Counter Unit ALU30 – A conceptual representation of the layout of program memory. The program counter increments by 2 for each instruction word. In an executable section, 2 program counter units are equivalent to 3 bytes. In a read-only section, 2 program counter units are equivalent to 2 bytes.
Emulator User’s Guide for MPLAB X IDE Real-Time Watch A Watch window where the variables change in real time as the application is run. See individual tool documentation to determine how to set up a real-time watch. Not all tools support real-time watches. Recursive Calls A function that calls itself, either directly or indirectly. Recursion The concept that a function or macro, having been defined, can call itself.
Glossary Serialized Quick Turn Programming Serialization allows you to program a serial number into each microcontroller device that the Device Programmer programs. This number can be used as an entry code, password or ID number. SFR See Special Function Registers. 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 version.
Emulator User’s Guide for MPLAB X IDE Stack, Software Memory used by an application for storing return addresses, function parameters, and local variables. This memory is typically managed by the compiler when developing code in a high-level language. MPLAB Starter Kit for Device Microchip’s starter kits contains everything needed to begin exploring the specified device. View a working application and then debug and program your own changes. Static RAM or SRAM Static Random Access Memory.
Glossary System Window Control The system window control is located in the upper left corner of windows and some dialogs. Clicking on this control usually pops up a menu that has the items “Minimize,” “Maximize,” and “Close.” 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.
Emulator User’s Guide for MPLAB X IDE Upload The Upload function transfers data from a tool (such as an emulator or programmer) to the host PC, or from the target board to the emulator. 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. USB 2.0 supports data rates up to 480 Mbps and is often referred to as high-speed USB.
MPLAB® REAL ICE™ IN-CIRCUIT EMULATOR USER’S GUIDE FOR MPLAB X IDE Index Numerics 32-Bit Devices, Trace............................................... 70 A About Microchip Technology.................................. 133 AC Line Isolation .................................................... 120 AC244002 .............................................................. 115 AC244005 .............................................................. 120 AC244006 .......................................................
Emulator User’s Guide for MPLAB X IDE J R JTAG ........................................................................ 67 Reading, Recommended.......................................... 12 Readme.................................................................... 12 REALICECMD.......................................................... 47 Receiver Board, High-Speed.................................. 117 Reserved Resources by Device ............................... 41 Runtime Watch............................
Index NOTES: 2013 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.