Discrete Debugger Operations
MPLAB® X IDE has a Debug Project command that:
- Builds the project and includes the debug executive.
- Programs the device.
- Starts the debug session (runs the program).
But what if we don't want to do all three together? Discrete Debugging allows us to perform debug operations one step at a time (i.e, discretely):
Build for Debugging
- Builds project with debug executive.
- Does NOT program or run target.
Program Device for Debugging
- Programs target with debug build.
- Does NOT build project or run target.
Launch Debugger
- Starts debug session.
- Does NOT build project or program target.
How is this useful?
One useful application for Discrete Debugger Operations is experimenting with configuration bit settings without actually changing code.
Example
1
Build for Debugging
When we click on , the configuration bit settings are picked up from directives in the source code.2
Modify Configuration Bit Settings
Once the project has been built for debugging, we can go into our Configuration Bits window (Menu > Window > PIC Memory Views > Configuration Bits) and change a few of the settings or just one in particular.
3
Program Device for Debug
Now when we click on , the Configuration Bits window settings we just changed are the ones used when programming the device.4
Launch Debugger
The device will run with the new settings from the Configuration Bits window.
The next build (of any kind) will restore the Configuration Bit settings to what was originally being used from the directives in the source code.