MPLAB® X IDE Breakpoints
A breakpoint is a mechanism for suspending program execution when a specific set of criteria are met.

The criteria for suspending program execution can range from a simple line breakpoint that stops a program when it lands on a particular line of code, all the way up to complex breakpoints that combine multiple conditions into a detailed set of criteria that can target very specific circumstances.

Types of Breakpoints

Breakpoints fall into two broad categories: hardware breakpoints and software breakpoints. At the Integrated Development Environment (IDE) level, both types will appear to work the same way but there are differences in their implementations behind the scenes.

Hardware Breakpoints

Hardware breakpoints are versatile in their ability to suspending program execution. These breakpoints are limited in number by the target microcontroller's hardware.

MPLAB® X IDE will automatically use hardware breakpoints by default.

Icon Hardware Breakpoint Type
LineBreakpoint.png Line Breakpoint
AddressBreakpoint.png Address Breakpoint
DataBreakpoint.gif Data Breakpoint
EventBreakpoint.gif Event Breakpoint
SequenceBreakpoint.gif Sequence Breakpoint (Complex)
TupleBreakpoint.gif Tuple Breakpoint (Complex)

Software Breakpoints

There are more software breakpoints available than hardware breakpoints. These breakpoints only support breaking on program memory events.

To use software breakpoints, they must first be enabled. Software breakpoints are only supported by the MPLAB® REAL ICE™ and MPLAB ICD 3 debuggers.

Icon Software Breakpoint Type
LineBreakpoint.png Line Breakpoint
AddressBreakpoint.png Address Breakpoint

Hardware vs. Software Breakpoints

The following table compares the features of each to help you decide which type of breakpoint to use.

Feature Hardware Breakpoints Software Breakpoints
Number of breakpoints Limited Unlimited
Breakpoints written to1 Internal debug registers Flash Program Memory
Breakpoints applied to2 Program Memory/Data Memory Program Memory only
Time to set breakpoints Minimal Dependent on oscillator speed, time to program Flash Memory and page size
Breakpoint skidding Most devices3 No
Effect on Endurance4 No Yes
1. Where information about the breakpoint is written in the device.
2. What kind of device feature applies to the breakpoint. This is where the breakpoint is set.
3. For details, check the 'Limitations section' on Online Help.
4. Using software breakpoints for debug impacts device endurance. Therefore, it is recommended that devices used in this manner not be used as production parts.
© 2024 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.