External Oscillator Pins
Many microcontrollers have options for at least two
oscillators: a high-frequency Primary Oscillator and a
Section 8.0 “Oscillator Configuration” for details).
The oscillator circuit should be placed on the same
side of the board as the device. Place the oscillator
circuit close to the respective oscillator pins, with no
more than 0.5 inch (12 mm) between the circuit
components and the pins. The load capacitors should
be placed next to the oscillator itself, on the same side
of the board.
Use a grounded copper pour around the oscillator
circuit to isolate it from surrounding circuits. The
grounded copper pour should be routed directly to the
MCU ground. Do not run any signal traces or power
traces inside the ground pour. Also, if using a
two-sided board, avoid any traces on the other side of
the board where the crystal is placed. A suggested
layout is shown in Figure 2-3.
For additional information and design guidance on
oscillator circuits, please refer to these Microchip
Application Notes, available at the corporate web site
• AN826, “Crystal Oscillator Basics and Crystal
Selection for rfPIC™ and PICmicro
• AN849, “Basic PICmicro
• AN943, “Practical PICmicro
• AN949, “Making Your Oscillator Work”
OF THE OSCILLATOR
Configuration of Analog and
Digital Pins During ICSP
If MPLAB ICD 2, ICD 3 or REAL ICE emulator is
selected as a debugger, it automatically initializes all of
the A/D input pins (ANx) as “digital” pins, by setting all
bits in the AD1PCFGL register.
The bits in this register that correspond to the A/D pins
that are initialized by MPLAB ICD 2, ICD 3 or the REAL
ICE emulator, must not be cleared by the user
application firmware; otherwise, communication errors
will result between the debugger and the device.
If your application needs to use certain A/D pins as
analog input pins during the debug session, the user
application must clear the corresponding bits in the
AD1PCFGL register during initialization of the ADC
When MPLAB ICD 2, ICD 3 or the REAL ICE emulator
is used as a programmer, the user application firmware
must correctly configure the AD1PCFGL register.
Automatic initialization of this register is only done
during debugger operation. Failure to correctly
configure the register(s) will result in all A/D pins being
recognized as analog input pins, resulting in the port
value being read as a logic ‘0’, which may affect user
Unused I/O pins should be configured as outputs and
driven to a logic low state. Alternatively, connect a 1 kΩ
to 10 kΩ resistor to V
output to logic low.
on unused pins and drive the
© 2009 Microchip Technology Inc.