Datasheet

PICkit™ 3 Debug Express Lessons
© 2009 Microchip Technology Inc. DS41370C-page 37
3.6 LESSON 6: USING PICkit 3 DEBUG EXPRESS
This lesson covers using the PICkit 3 as an In-Circuit-Debugger (ICD). It uses the same
MPLAB IDE workspace and project as Lesson 5. Set T0CON assignment back to the
“no prescale” statement if it was changed in the last lesson.
3.6.1 Resources Reserved by the PICkit 3 Debug Express
The PICkit 3 Debug Express uses some on-chip resources to enable debugging. The
resources are not available to the user application code.
3.6.1.1 GENERAL RESOURCES
•MCLR
pin reserved for debugging; this pin cannot be used as digital I/O while
debugging.
The PGD and PGC port pins are reserved for programming and in-circuit debug-
ging. Therefore, other functions multiplexed on these pins will not be available
during debug.
One stack level is used by the debugger and not available.
3.6.1.2 PROGRAM AND DATA MEMORY RESOURCES
The PICkit™ 3 Debug Express uses program memory and file register locations in the
target device during debugging. These locations are not available for use by user code.
In the MPLAB IDE, registers marked with an “R” in register displays represent reserved
registers, as shown in Figure 3-26.
FIGURE 3-26: RESERVED ICD FILE REGISTER LOCATIONS IN THE PIC18F45K20
Key Concepts
- An In-Circuit-Debugger like PICkit 3 uses some on-chip resources to enable
debugging. These reserved file registers and program memory locations are
marked ‘R’ in the MPLAB IDE views, and are not available for use by the
user application.
- Debugging also reserves one level of the hardware return address stack and
two I/O pins.
- Debugging allows the program to be run, halted, stepped-through statement
by statement, and for breakpoints to be set on program statements.
- The number of available breakpoints depends on the PIC microcontroller
being used.
Note: This lesson uses the project and source code from Lesson 5: Using Timer0.