Microchip Technology MPLAB Starter Kit for PIC18F MCU DM180021 DM180021 User Manual
Product codes
DM180021
MPLAB Starter Kit for PIC18F User’s Guide
DS51852A-page 18
© 2009 Microchip Technology Inc.
3.2
RUNNING THE EXAMPLE APPLICATION
The starter kit executes in either real time (Run) or steps (Step Into, Step Over,
Animate). Real-time execution occurs when you select Run in MPLAB IDE. Once the
device code is halted, either by a Halt or a breakpoint, you can step.
Animate). Real-time execution occurs when you select Run in MPLAB IDE. Once the
device code is halted, either by a Halt or a breakpoint, you can step.
The following toolbar buttons can be used for quick access to commonly used debug
operations:
operations:
TABLE 3-1:
PIC18F STARTER KIT DEBUGGER TOOLBAR
To see how these options function, do the following:
1.
Select Debugger>Reset>Processor Reset or click the Reset button to reset the
program.
program.
2.
Select Debugger>Run or click the Run button. Observe how the application
operates.
operates.
3.
Select Debugger>Halt or click the Halt button to stop the program execution. A
green solid arrow marks the line of code in the File window where the program
Halted.
green solid arrow marks the line of code in the File window where the program
Halted.
4.
Select Debugger>Step Into or click the Step Into button to step the program
execution once. The green solid arrow will move down one line of code in the File
window. Click the button several times to step through some code.
execution once. The green solid arrow will move down one line of code in the File
window. Click the button several times to step through some code.
5.
Select Debugger>Reset>Processor Reset and click the Reset button to reset the
program again. The arrow disappears, meaning the device is Reset.
program again. The arrow disappears, meaning the device is Reset.
3.3
DEBUGGING THE EXAMPLE APPLICATION
For the example code given, everything works fine. However, when you are developing
code, it will likely not work the first time and need to be debugged. MPLAB IDE provides
an editor and several debug features, such as breakpoints and Watch windows, to aid
in application code debugging.
code, it will likely not work the first time and need to be debugged. MPLAB IDE provides
an editor and several debug features, such as breakpoints and Watch windows, to aid
in application code debugging.
This section includes:
• Editing Application Code
• Using Breakpoints and Mouseovers
• Using Watch Windows
Debugger Menu
Toolbar Buttons
Run
Halt
Animate
Step Into
Step Over
Reset