User manual
MPLAB
®
ICD 3 In-Circuit Debugger User’s Guide
DS51766A-page 44 © 2008 Microchip Technology Inc.
2. Under “Start Condition”, select the first breakpoint from the list. Then uncheck
“Start condition will cause the target device to halt”.
3. Under “Stop Condition”, select the second breakpoint from the list. Then check
“Stop condition will cause the target device to halt”.
4. Check “Reset stopwatch on run”.
5. Click OK.
FIGURE 5-17: STOPWATCH DIALOG
6. Run the program until it halts. In the Output window, on the ICD 3 tab, the number
of cycles between the two instructions should be shown as:
Stopwatch cycle count = 4(decimal)
7. Clear both breakpoints from the code by deleting them from the Breakpoints dia-
log, double clicking on each line to remove them, or right clicking on each line
and selecting “Remove Breakpoint”. You can also right click and select
Break
points>Remove All Breakpoints to remove both at once.
5.11.5 Setting Software Breakpoints
To change the breakpoint type from hardware to software:
•Select Debugger>Settings
and click on the Configuration tab.
• Click the radio button next to “Use Software Breakpoints”.
•Click OK.
You will now use software breakpoints instead of the hardware breakpoints used
previously.
1. To set a single software breakpoint, follow the instructions in
Section 5.11.2 “Setting a Single Hardware Breakpoint”.
- When you set a software breakpoint, you will see the following in the Output
window:
Programming software breakpoint(s)...
Software breakpoint(s) set.
- If you have already set a hardware breakpoint in this tutorial, the variables will
already be added to the Watch window for use with the software breakpoint.
Note: Using software breakpoints for debug impacts device endurance. There-
fore, it is recommended that devices used in this manner not be used as
production parts.