User manual
MPLAB
®
REAL ICE
™
IN-CIRCUIT EMULATOR
© 2008 Microchip Technology Inc. DS51616B-page 65
Chapter 6. Basic Debug Functions
6.1 INTRODUCTION
Basic MPLAB REAL ICE in-circuit emulator debug functions are discussed.
• Breakpoints and Stopwatch
• External Triggers
6.2 BREAKPOINTS AND STOPWATCH
Use breakpoints to halt code execution at specified lines in your code. Use the
stopwatch with breakpoints to time code execution.
Breakpoints and real-time data capture triggers use the same resources. Therefore,
the available number of breakpoints is actually the available number of combined
breakpoints/triggers.
The number of hardware and software breakpoints available and/or used is displayed
in the Device Debug Resource toolbar. See the MPLAB IDE documentation for more
on this feature.
To select hardware or software breakpoints:
1. Select Debugger>Settings
and click the Configuration tab.
2. Select the desired type of breakpoints for your application. A list of features for
each breakpoint type - hardware or software - is shown under that type. (See
Section 11.5.2 “Settings Dialog, Configuration Tab” for more information.)
To set a breakpoint in code, do one of the following:
• Double-click or right click on a line of code to set up an individual breakpoint.
•Select Debugger>Breakpoints
to open the Breakpoints dialog and set up multiple
breakpoints and breakpoint conditions. See Section 11.3.1 “Breakpoints Dia-
log” for more information.
To determine the time between the breakpoints, use the stopwatch:
1. Open the Breakpoints dialog (Debugger>Breakpoints
).
1. Click Stopwatch on the Breakpoints dialog to open the Stopwatch dialog.
2. Under “Start Condition”, click Select Start Condition and choose a breakpoint.
Also decide if “Start condition will cause the target device to halt”.
3. Under “Stop Condition”, click Select Stop Condition and choose another
breakpoint. Also decide if “Stop condition will cause the target device to halt”.
4. Decide if there will be a “Reset stopwatch on run”.
5. Click OK.
Note: Using software breakpoints for debug impacts device endurance.
Therefore, it is recommended that devices used in this manner not be
used as production parts.