Difference Between Watches and Variables Windows

Both the Watches and Variables windows are used to view and modify microcontroller (MCU) data memory during a debug session. The difference between the two windows is the type of variable that can be viewed in each.

Watches Window Variables Window
Global variables Local variables
Peripheral configuration registers Function parameters
Static local variables

The Watches window can only view variables and MCU registers that have a permanent memory address. These include global variables (variables defined outside of any function), peripheral configuration registers (also known as special function registers or SFRs), and local variables defined as static.


The Variables window is used to view local variables. These variables are defined inside functions, and are created (allocated on the stack) when a function is called and destroyed (de-allocated from the stack) when the function exits. Local variables do not have a permanent address.


If you want to see all variables in one window, you can add the Watches window content to the Variables window (see the "Watches In Local Variables View" page).

Note the values in these windows are only valid when the debug session is paused. 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.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.