# Programming Pins (PGC/PGD) problem on PIC32mx

I made a design using PIC32mx and everything is working well. I was trying to debug my first program and for this case instead choosing PGEC1 and PGED1 I am using PGED2 and PGEC2. Problably that's the reason why I am getting the following message while debugging:

The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.

This is the schematic I have done:

Where can I modify the configuration bits to enable the debug mode?

• The #pragma config sentence can be used to reassign PGC,PGD. The device-specific header contains all possible values, open it and search for 'config'. Jan 23 '16 at 20:28

#pragma config   ICESEL = ICS_PGx2