30.9 In-Circuit Debugger

When MPLAB® ICD 3 or the REAL ICE™ emulator is selected as a debugger, the in-circuit debugging functionality is enabled. This function allows simple debugging functions when used with MPLAB IDE. Debugging functionality is controlled through the PGCx (Emulation/Debug Clock) and PGDx (Emulation/Debug Data) pin functions.

Any of the three pairs of debugging clock/data pins can be used:

  • PGC1 and PGD1 Host Debug or Client Debug.
  • PGC2 and PGD2 Host Debug or Client Debug.
  • PGC3 and PGD3 Host Debug or Client Debug for debugging Host and Client simultaneously; two ICD or the REAL ICE™ emulator are required. This mode of debugging, where the Host and Client are simultaneously debugged, is called the Dual Debug mode.

To use the in-circuit debugger function of the device, the design must implement ICSP connections to MCLR, VDD, VSS and the PGCx/PGDx pin pair. In addition, when the feature is enabled, some of the resources are not available for general use. These resources include the first 80 bytes of data RAM and two or five (in Dual Debug mode) I/O pins (PGCx and PGDx).