Control Points
Setting Watchpoints
177
Microcontrollers Debugger Manual
stops. Current is reloaded with the value stored in the interval field to enable the counting
watchpoint again.
Defining a Conditional Watchpoint
A condition can be associated with any type of watchpoint described previously (read,
write, read/write).
The Debugger provides two ways to define a conditional watchpoint:
Using the Data Context Menu:
1. Point at a variable in the Data window and right-click. The Data Context Menu is
displayed.
2. Choose Set Watchpoint from the Context Menu. A Read/Write Watchpoint is
defined.
3. Point in the Data window and right-click. The Source Context Menu is displayed.
4. Choose Show WatchPoints from the Context Menu. The Controlpoints Configuration
window Watchpoints tab is displayed.
5. Select the watchpoint you want to define as a conditional watchpoint.
6. From the list menu, select the type of access you want to track.
7. Specify the condition for the watchpoint in the Condition field. The condition must be
specified using the ANSI C syntax (Example: counter == 7).
8. Close the window by clicking OK. A conditional watchpoint is defined for the
selected variable.
Using the Left Mouse Button and Pressing the S Key:
1. Point at a variable in the Data window, hold down the left mouse button and press the
S key. The Watchpoints tab of the Controlpoints Configuration window is displayed.
2. Select the watchpoint you want to define as a conditional watchpoint.
3. From the list menu, select the type of access you want to track.
4. Specify the condition for watchpoint activation in the Condition field. The condition
must be specified using the ANSI C syntax (Example: counter == 7). You can use
register values in the breakpoint condition field with the following syntax:
$RegisterName (Example $RX == 0x10)
5. Close the window by clicking OK. A conditional watchpoint is defined for the
selected variable.
If you continue program execution, the condition is evaluated each time an appropriate
access on the variable is detected. When the condition is TRUE, the application stops.