8-Bit PIC® Microcontroller Design Recommendations

When developing a product with an 8-Bit PIC® Microcontroller there are a few basic design recommendations to consider for any application. The most common are listed in this short summary. Always refer to the device data sheet for specific technical data.

Basic Connection Requirements

Getting started with the PIC 8-bit microcontrollers requires attention to a minimal set of device pin connections before proceeding with development.

The following pins are typically the first to focus on in your design. Each of these will be explained further in this tutorial.

  • All VDD and VSS Operating Voltage pins properly connected to power.
  • Master Clear (MCLR) pin connected either internally or externally to VDD supply voltage through a pull-up arrangement.
  • OSCI and OSCO oscillator pins properly connected when an external oscillator source is used.
  • VREF+/VREF- pins are properly connected to circuitry power and ground when the analog to digital peripherals are used.
  • ICSPCLK/ICSPDAT pins used for In-Circuit Serial Programming™ (ICSP) and debugging purposes are properly isolated.

The minimum mandatory connections are shown.

basiccircuit.png
* Optional Settings can be replaced by external circuitry

C2: 0.1 F, 20 V ceramic

Power Supply Pins

The use of decoupling capacitors on every pair of power supply pins (VDD and VSS) is required.
Consider the following criteria when using decoupling capacitors:

  • Value and type of capacitor: A 0.1 µF (100 nF), 10-20 V capacitor is recommended. The capacitor should be a low-ESR device, with a resonance frequency in the range of 200 MHz and higher. Ceramic capacitors are recommended.
  • Placement on the printed circuit board: The decoupling capacitors should be placed as close to the pins as possible. It is recommended to place the capacitors on the same side of the board as the device. If space is constricted, the capacitor can be placed on another layer on the PCB using a via; however, ensure that the trace length from the pin to the capacitor is no greater than 0.25 of an inch (6 mm).
  • Handling high-frequency noise: If the board is experiencing high-frequency noise (upward of tens of MHz), add a second ceramic type capacitor in parallel to the recommended decoupling capacitor. The value of the second capacitor can be in the range of 0.01 µF to 0.001 µF. Place this second capacitor next to each primary decoupling capacitor.

In high-speed circuit designs, consider implementing a decade pair of capacitances as close to the power and ground pins as possible (e.g., 0.1 µF in parallel with 0.001 µF).

  • Maximizing performance: On the board layout from the power supply circuit, run the power and return traces to the decoupling capacitors first, and then to the device pins. This ensures that the decoupling capacitors are first in the power chain. Equally important is to keep the trace length between the capacitor and the power pins to a minimum, thereby reducing PCB trace inductance.
  • Bulk Capacitor: On boards with power traces running longer than six inches in length, it is suggested to use a bulk capacitor for integrated circuits, including microcontrollers, to supply a local power source. The value of the bulk capacitor should be determined based on the trace resistance that connects the power supply source to the device, and the maximum current drawn by the device in the application. In other words, select the bulk capacitor so that it meets the acceptable voltage sag at the device. Typical values range from 4.7 µF to 47 µF.

VREF+/VREF- Pins

The VREF+ and VREF- pins should be treated with the same circuitry protection as the VDD and VSS pins.

MCLR Pin

The MCLR pin provides two specific device functions:

  • Device Reset
  • Device Programming and Debugging

The MCLR pin can be shared with a digital input pin on some devices, enabled by the configuration settings. In that case, the MCLR internal circuitry is used.

If programming and debugging are not required in the end application, a direct connection through a resistor to VDD may be all that is required. The addition of other components, to help increase the application’s resistance to spurious Resets from voltage sags, may be beneficial. A typical configuration is shown.

mclrcircuit.png
  1. R1 ≤ 10 kΩ is recommended. A suggested starting value is 10 kΩ. Ensure that the MCLR pin VIH and VIL specifications are met.
  2. R2 ≤ 470 Ω will limit any current flowing into MCLR from the external capacitor, C1, in the event of MCLR pin breakdown, due to Electrostatic Discharge (ESD) or Electrical Overstress (EOS). Ensure that the MCLR pin VIH and VIL specifications are met.

During programming and debugging, the resistance and capacitance that can be added to the pin must be considered. Device programmers and debuggers drive the MCLR pin. Consequently, specific voltage levels (VIH and VIL) and fast signal transitions must not be adversely affected. Therefore, specific values of R1 and C1 will need to be adjusted based on the application and PCB requirements. For example, it is recommended that the capacitor, C1, be isolated from the MCLR pin during development programming and debugging operations by using a jumper (JP). The jumper is replaced by a direct connection for normal run-time operations. Any components associated with the MCLR pin should be placed within 0.25 inch (6 mm) of the pin.

In-Circuit Serial Programming (ICSP™) Pins

The ICSPCLK and ICSPDAT pins are used for In-Circuit Serial Programming™ (ICSP) and debugging purposes. It is recommended to keep the trace length between the ICSP connector and the ICSP pins on the device as short as possible. If the ICSP connector is expected to experience an ESD event, a series resistor is recommended, with the value in the range of a few tens of ohms, not to exceed 100Ω.

To use the ICSPCLK, ICSPDAT and MCLR pins also as I/O pins, it is best to isolate them from the external circuitry. Simple series resistors of low resistance (≤ 100Ω) will typically work well without affecting the external circuitry operation.

ICSPconnections.png

Ri ≤ 100 Ω is recommended. Resistance value should be low enough to not affect the external circuit but still isolate the ICSP connections from the application circuitry.

Pull-up resistors, series diodes and capacitors on the ICSPCLK and ICSPDAT pins are not recommended as they will interfere with the programmer/debugger communications to the device. If such discrete components are an application requirement, they should be removed from the circuit during programming and debugging. Alternatively, refer to the AC/DC characteristics and timing requirements information in the respective device Flash programming specification for information on capacitive loading limits, as well as pin input voltage high (VIH) and input low (VIL) requirements.

External Oscillator Pins

Many PIC microcontrollers have options for at least two oscillators—a high-frequency primary oscillator and a low-frequency secondary oscillator. 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 of an 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.
Layout suggestions are shown.

osclayout.png

In-line packages may be handled with a single-sided layout that completely encompasses the oscillator pins. With fine-pitch packages, it is not always possible to completely surround the pins and components. A suitable solution is to tie the broken guard sections to a mirrored ground layer. In all cases, the guard trace(s) must be returned to ground.

In planning the application’s routing and I/O assignments, ensure that adjacent port pins, and other signals in close proximity to the oscillator, are benign (i.e., free of high frequencies, short rise and fall times, and other similar noise).

Unused Input/Output (I/O) Pins

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 VSS on unused pins and drive the output to logic low.

© 2018 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.