- breakpoint
- 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 which stops a program when it lands on a particular line of code, all the way up to complex breakpoints which 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. Hardware 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 |
|---|---|
| Line Breakpoint | |
| Address Breakpoint | |
| Data Breakpoint | |
| Event Breakpoint | |
| Sequence Breakpoint (Complex) | |
| Tuple Breakpoint (Complex) |
Software Breakpoints
There are more software breakpoints available than hardware breakpoints. Software breakpoints only support breaking on program memory events.
To use software breakpoints, they first must be enabled. Software breakpoints are only supported by the MPLAB REAL ICE™ and MPLAB ICD 3 debuggers.
| Icon | Software Breakpoint Type |
|---|---|
| Line Breakpoint | |
| Address Breakpoint |
Hardware vs. Software Breakpoints
To help you decide which type of breakpoints to use (hardware or software) the following table compares the features of each.
| 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 devices. See the online help, Limitations section, for details. | No |
| Effect on Endurance3 | No | Yes |
| Note the following: 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. Using software breakpoints for debug impacts device endurance. Therefore, it is recommended that devices used in this manner not be used as production parts. |
||

