
Running the demo project
UM0299
3.6
Monitoring variables in the Watch window
1.
Click STOP to stop running the program.
2.
Double-click the variable name
blink_delay
at the beginning of the
main()
function
to highlight it. Right-click on it, then select "Add Watch". Alternatively, press F6.
You can now monitor this variable in the Watch Window at bottom left of the screen as
shown in
Figure 5.
Watch window
3.
Remove any existing breakpoints, then Click "Reset".
4.
Click "Go" and then click "Stop" to see that the blink_delay value is updated in the
watch window.
It should report the value 0x0A (see
5.
Click "Go" again. While the code is running, place the mouse over the Value field
(should read as 0xA), right-click and select Evaluate, enter 0x64 in the New Value field,
then click on Modify.
The LED should now blink at a rate 10 times slower because the 0x64 value causes a
blink frequency that is 10 times longer than 0xA. This action shows that the debugger is
active while the code is running.
6.
Close the Evaluate Expression window. Click "Reset" and then "Go".
The LED is blinking again at the faster rate.
explains how to make this
change permanent in the flash memory.
3.7 Iterating
code
You can make the code change described in
permanent in the flash memory, as
explained in the following procedure.