The following oscillator considerations address proper set up of software and hardware.
Primary Oscillator
Often when starting a new project with a debugger or emulator, there is a high probability that the default settings of MPLAB X IDE will not match the specific configuration of the target application since there are a wide range of oscillator variations offered by the device. These differences between the MPLAB X IDE default settings and the unique target requirements cause a message to display in the Output window such as “The target device is not ready for debugging. Please check your Configuration bit settings and program the device before proceeding.” This is the result of an oscillator configuration mismatch between the target hardware setup and the default Configuration bits in MPLAB X IDE. To correct this, set the Configuration bits to match the oscillator settings of the target configuration.
For debugging operations, the application (target) oscillator must be functioning before in-circuit debugging can take place. Ensure the oscillator configuration and the MPLAB X IDE Configuration bit setup are configured properly. For example, if your application uses a 20 MHz crystal oscillator, select the HS (High Speed) selection in MPLAB X IDE. For any other applicable device oscillator modes, consult the device data sheet.
Crystal Oscillator Timer Oscillator/Secondary Oscillator
If a header board or Processor Extension Pak is used to connect to the target, there may be problems with starting the 32 kHz crystal resonator. To avoid potential problems, consider the following:
- Ensure the 32 kHz crystal is connected near the device footprint.
- Keep all lines as short as possible in the target application without unnecessary discontinuities such as PCB interconnect vias and test points.
- Minimize any capacitive loading on these nodes.
- Avoid using a socket for the placement of the crystal and capacitor. Solder the devices directly to PCB pads.