Watch the values of symbols that you have selected change in the Watches window. Knowing whether these values are set as expected during program execution will help you to debug your code.
The following symbols may be added to a Watches window:
In general, you must Pause from debugging to be able to see updated values. However, some tools allow runtime updates (you can see the values change as your program is running). Check your tool documentation to see if it supports this feature.
For all devices except PIC32 MCUs, symbols used in a runtime watch must be sized to match the device memory. That is, you need 8-bit symbols when using an 8-bit device.
For C-language enumerated types, you may enter either the enum label (text) or integer value in the window. For labels, be aware that they are case sensitive.
To view the Watches window do one of the following:
To create a new watch directly:
You can add a symbol directly to the Watches window by doing one of the following:
To create a new watch using the New Watch dialog:
You can add a symbol or SFR to the Watches window by doing one of the following:
To create a new runtime watch:
Before you add a runtime watch to the Watches window, you need to set up the clock:
To add a global symbol or SFR as a runtime watch, follow the instructions under To create a new watch using the New Watch dialog:, except select “New Runtime Watch” instead of “New Watch.”
For all devices except PIC32 MCUs, symbols used in a runtime watch must be sized to match the device memory. That is, you need 8-bit symbols when using an 8-bit device.
To view symbol changes:
You must be in a debug session to see the values of symbols – global symbols, SFRs, arrays, register bitfields, etc.
To change the radix of a watch symbol:
Right click in the line of the symbol and select “Display Value As.”
To perform other tasks:
For more on watches, see Watches Window.