Preparing to Debug a Project (rev. 3.00)

NOTE: Microchip updates its tools regularly. This page is an older version that we have preserved for the convenience of those who are supporting existing designs based upon older versions of our tools. Please check https://microchip-dev.wikidot.com/tls0101:debug-setup for the updated version of this page.

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 though the PIC® microcontroller start-up code then begin executing the user's application code. Under this default condition the program will continue to run until either a breakpoint is reached or the user manually "pauses" the execution.

Having the application program begin and continue to execute without any user action 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 user application code until instructed to to do by the user.

User's who wish to change the debug start up option will need to configure MPLAB X IDE. Configuration of the startup option is done on MPLAB X IDE's "Options" menu.

PC and Linux user's can access the Options window by selecting Tool->Options.

Mac OS users can access the options page 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 re-configure the debug startup option for each new project

Debug Tool Selection

The user has 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 Programmer/Debuggers. Currently Microchip offers three programmer/debuggers: PICKit™ 3, MPLAB ICD 3, and the MPLAB REAL ICE. Each of these programmer/debuggers offers different levels of performance and features.

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

Selecting a debug tools 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 desired debug tool within the "Hardware Tools" box.

MPLAB X IDE allows you to simulatneously 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 consists entirely in software.

© 2023 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.