Watches Window

 Summary

When debugging an MPLAB® X project you may find it useful to view the variables and PIC® Special Function Registers (SFRs). Global Variables and SFRs have permanent and fixed memory devices. All programs can access these data elements at any time. This page shows how to access Global variables and SFRs. At the end of this page is a link to a tutorial demonstrating how to access Watches.

What is the Watches Window

The Watches Window is the MPLAB X utility which allows the user to observe and modify Global Variables and SFRs This window is the part of the standard MPLAB X debug tools and can be used anytime during an active debug session. The variables window operates with all MPLAB X support debug tools (software simulator, ICD 3, REAL ICE™, and PICKit™ 3) Many 3rd party debug tools and simulators also allow the Watches Window to operate

In order to operate the Watches Window MPLAB X must be in operating in a debug session Main_Debug_Project.png

How to Open the Watches Window

To open the Watches window:

  1. Make sure you are in a debug session
  2. Select Windows->-Debugging->Watches or ( atl + shft + 2)
OpeningWatches.png

The Watches window will open up in the output window section (usually the lower right-hand side)

OpenedWatches.png

Any value left in the Watches Window from a previous debug session will remain in the Watches window when it is reopened. This avoids the necessity of reloading Watches. To erase the watches from a previous session. Right Click in the Watches Window, then select Delete All

DeleteAllWatches.png

Adding Items to the Watches Window

To add an element to the list of items being watched first "Right Click" in the open Watches Window then select "Add New Watch" from the menu.

NewWatch.png

A pop-up menu will display allow you to select either a Global Variable or a Special Function Register to add to the Watch. Select the either SFR or Global Symbol. Once Selected the box will fill with a list of all the Global Symbols or SFRs. Select the individual item you wish to add to the Watches Window then select "OK".

NewGlobalWatch1.png NewSFRWatch1.png


Repeat these steps until you have added all the desired Watches

Watchesloaded.png

Modifying the Display Properties

"Right Clicking" on the menu bar of the Watches Window will cause the "Display Visible Options" window to pop-up. This will allow you to add and remove display columns. You can change the width of each column or sot the table by the elements in each

rightclickdisplay.png DisplayVisible.png


By "left clicking" on either the Type or Name heading you will be able to sort the entries in the Watches window

WatchesSort.png

Saving Watches to a file

User's have the option to save the current list of item in the Watches Window to a file. User can also reload the list of watch from a saved file. Two icons on the left hand side of the Watches Window control these functions.

WatchesFile.png

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
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.