4.13 Watching Symbol Values Change

Watch the values of global symbols or SFRs change in the Watches window. Determining if these values are as expected during program execution will help you to debug your code.

For more on this window, see 14.30 Watches Window.

Create a New Watch

Click the Finish Debugger Session icon

. Then remove the breakpoint from the previous discussion by clicking in the left margin.

To create a new watch:

  1. Select Debug > New Watch. The New Watch dialog will open.
  2. Enter a Watch expression, in this case PORTC.IN, and then click OK. The Watches window will now appear on the desktop with the symbol.
Figure 4-16. New Watch Symbol
Figure 4-17. New Watch in Window

View Value Changes in Watches Window

Click the Debug Project icon

to begin code execution. Halt the execution by clicking the Pause icon
. Click on the Watches tab to see the value of PORTC.IN after port initialization.

Figure 4-18. Watches Window - First Halt

Click the Continue icon

. This time press and hold the button on the evaluation board and then click the Pause icon. View the Watches window to see that the value has changed.

Figure 4-19. Watches Window - Second Halt

Click the Finish Debugger Session icon

.