User manual

Tutorial
© 2008 Microchip Technology Inc. DS51616B-page 47
4.12 DEBUGGING CODE USING A RUNTIME WATCH
Set up a runtime watch to view changes to the counter symbol as the program runs.
For more information on runtime watches, see either Section 7.2 “Data Capture and
Runtime Watches” or Section 8.2 “Data Capture and Runtime Watches”
(PIC32MX devices only).
1. Remove all breakpoints from code. To do this, right click on any line of code and
select Breakpoints>Remove All Breakpoints
.
2. In the Watch window, click on the counter Symbol Name to select that line.
Then click the second diamond in the first column of that line to enable a runtime
watch. (See Section 11.3.9 “Watch Window - Data Capture/Runtime Watch”
for more information.)
FIGURE 4-18: WATCH WINDOW SET FOR RUNTIME WATCH
3. Rebuild the project (Project>Build All
) and reprogram the target device
(Debugger>Program
).
4. Make sure the Watch window is visible. Then Run the program and watch the
counter values change real-time in the Watch window.
5. Halt the program.
6. Remove the runtime watch by clicking again on the second (brown) diamond.
The diamond then should no longer be colored.
7. Close the Watch window.