• To end code execution, select either
Debug > Finish Debugger Session
or
from the Debug toolbar.
• To perform a processor Reset on your code, select either
Debug > Reset
or
from the Debug toolbar.
Depending on the device, additional Resets, such as POR/BOR, MCLR, and System, may be available. Refer to the
product data sheet for more information.
4.10
Viewing Processor Memory and Files
MPLAB X IDE provides several windows for viewing debug and memory information. These are selectable from the
Window menu. See the MPLAB X IDE online Help for more information on using these windows.
•
Window > Target Memory Views
- view data (Data Memory) and code (Execution Memory) in device memory.
Other memory can also be viewed as defined by the device including Peripherals, Configuration Bits, CPU
Registers, External EBI Memory, External SQI Memory, User ID Memory, etc.
•
Window > Debugging
- view debug information. Select from Variables, Watches, Call Stack, Breakpoints,
Stopwatch, and many others.
To view your source code, find the source code file you wish to view in the Projects window and double-click to open
it in a Files window. Code in this window is color-coded according to the processor and build tool that you have
selected. To change the style of color-coding, select
Tools > Options
,
Fonts & Colors, Syntax
tab.
4.11
Breakpoints and Stopwatch
Use breakpoints to halt code execution at specific lines in your code. Use the stopwatch with breakpoints to time
code execution.
4.11.1
Breakpoint Resources
In 16-bit devices - breakpoints, data captures, and run-time watches use the same resources. Therefore, the
available number of breakpoints is actually the available number of combined breakpoints/triggers.
In 32-bit devices - breakpoints use different resources than data captures and run-time watches. Therefore, the
available number of breakpoints is independent of the available number of triggers.
The number of hardware and software breakpoints available and/or used is displayed in the Dashboard window
(
Window > Dashboard
). See the MPLAB X IDE online Help file for more on this feature.
Not all devices have software
breakpoints.
For limitations on breakpoint operation, including the general number of hardware breakpoints per device, and
hardware breakpoint skidding amounts, see the online Help file in MPLAB X IDE for the debugger limitations
(Help >
Help Contents > Hardware Tool Reference > Limitations - Emulators and Debuggers)
.
4.11.2
Hardware or Software Breakpoint Selection
To select hardware or software breakpoints:
1.
Select your project in the Projects window. Then select
File > Project Properties
or right click and select
Properties
.
2.
In the Project Properties dialog under “Categories,” select
PICkit 4
.
3.
Under “Option Categories,” select
Debug Options
.
4.
Select
Use software breakpoints
to use software breakpoints. Clear the selection to use hardware
breakpoints.
Tip:
Using software breakpoints for debugging impacts device endurance. Therefore, it is recommended
that devices used in this manner are not be used as production parts.
Debugger Usage
©
2020 Microchip Technology Inc.
User Guide
DS50002751D-page 22