MPLAB® X IDE: Preparing to Debug a Project

Debug Startup Options

Step-by-Step Instructions:
Setting the Debug Startup options

Upon entering a debug session, MPLAB® X IDE's default condition is to go through the PIC® microcontroller start-up code then begin executing your application code. Under this default condition, the program will continue to run until either a breakpoint is reached or until you manually pause the execution.

Having the application program begin and continue to execute without any action from you may not be suitable for all debugging needs. There are two other possible modes of operation when entering a debug session. MPLAB X IDE can be configured to pause at either the RESET vector or at the first line of source code within the main routine. When either of these alternate modes is set, MPLAB X IDE will not execute your application code until you instruct it to.

If you wish to change the debug startup option, you will need to configure MPLAB X IDE. Configuration of the startup option is done on MPLAB X IDE's Options window.

  • If you are using PC or Linux®, you can access the Options window by selecting Tool>Options.
  • If you are using Mac OS®, can access the Options window by selecting mplab_ide>preferences

Once the Options window is opened, select the Embedded menu then the 'Generic Settings' tab. Near the bottom of the page, you will see a pulldown allowing you to modify the debug startup options.

When MPLAB X IDE's debug startup option has been set, it applies to all projects. Once set, there is no need to reconfigure the debug startup option for each new project.

Debug Tool Selection

You have the responsibility of informing MPLAB X IDE which debug tools to use for a particular project. Upon installation, MPLAB X IDE provides the ability to debug using either the MPLAB X software simulator or one of Microchip's programmer/debuggers. Currently, Microchip offers three programmer/debuggers: PICKit 3, MPLAB ICD 3, and the MPLAB REAL ICE. Each of these offers different levels of performance and features.

Step-by-Step Instructions:
Opening an MPLAB X IDE project

Selecting a debug tool is done on a project by project basis. The project to be debugged must be opened before the debug tool can be selected.

Step-by-Step Instructions:
Selecting the Debug Tool

To select which tool to use during debugging, open the Project Properties window by right-clicking on the project name in the Project Window. Select 'Properties' at the very bottom of the displayed menu. When the dialog box appears, select your desired debug tool within the Hardware Tools box.

MPLAB X IDE allows you to simultaneously plug in several programmer/debuggers. To differentiate the installed devices, MPLAB X IDE displays the serial number for each programmer/debugger. Please note that MPLAB X IDE's software simulator is listed in the box called 'Hardware Tools' even though this simulator exists only in software.

© 2022 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.