Breakpoints and Stopwatch
Use breakpoints to halt code execution at specific lines in your code. Use the stopwatch with breakpoints to time code execution.
In 16-bit devices, breakpoints, data captures, and runtime watches use the same resources. Therefore, the available number of breakpoints is actually the available number of combined breakpoints/triggers.
In 32-bit devices, breakpoints use different resources than data captures and runtime watches. Therefore, the available number of breakpoints is independent of the available number of triggers.
The number of hardware and software breakpoints available and/or used is displayed in the Dashboard window (
Window>Dashboard). See the MPLAB X IDE documentation for more on this feature. Not all devices have software breakpoints.
For limitations on breakpoint operation, including the general number of hardware breakpoints per device, and hardware breakpoint skidding amounts, see the online Help file in MPLAB X IDE for the MPLAB ICD 4 In-Circuit Debugger limitations.
Hardware or Software Breakpoint Selection
To select hardware or software breakpoints:
1. |
Select your project in the Projects window. Then, select File>Project Properties or right click and select “Properties”. |
2. |
In the Project Properties dialog, select “ICD4” under “Categories”. |
3. |
Under “Option Categories,” select “Debug Options”. |
4. |
Check “Use software breakpoints” to use software breakpoints. Uncheck to use hardware breakpoints. |
Note: |
Using software breakpoints for debugging impacts device endurance. Therefore, it is recommended that devices used in this manner are not be used as production parts. |
|
To help you decide which type of breakpoints to use (hardware or software), the following table compares the features of each.
Table: Hardware vs. Software Breakpoints
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Program Memory/Data Memory
|
|
|
|
|
Dependent on oscillator speed, time to program Flash Memory, and page size
|
|
|
Most devices. See the online Help, Limitations section, for details.
|
|
* Where information about the breakpoint is written in the device.
** What kind of device feature applies to the breakpoint. This is where the breakpoint is set.
|
Breakpoint and Stopwatch Usage
Breakpoints halt execution of code. To determine the time between the breakpoints, use the stopwatch.
Refer to the MPLAB X IDE online Help for instructions on how to set up and use breakpoints and the stopwatch.