Skip to content
A project ofgwark.dev

Microchip · Microcontroller

PIC16F877A

The PIC that taught a generation of engineering students. 33 I/O, eight ADC channels and a DIP-40 you can still breadboard.

Cheat sheet (SVG)
Logic level
2.0-5.5 V
Package
PDIP-40 / TQFP-44 / PLCC-44

1.Pinout diagram

Highlight a signalhover to preview, click to keep

Pins 1-20

PIC16F877A

Pins 21-40

Pin detail

Hover a pin for its mappings and gotchas. Click to keep it here.

Logic level
2.0-5.5 V
Package
PDIP-40 / TQFP-44 / PLCC-44

Fig. 1. PIC16F877A, PDIP-40. Hover or tap a signal to light up every pin that carries it.

2.Watch out

3.Minimum circuit to run

What has to go around the chip before it will run.

VCCGNDPIC16F877A10 kOhm between MCLR (1) and VCC10 kOhm100 nF between VDD (11) and GND100 nF100 nF between VDD (32) and GND100 nF22 pF between OSC1 (13) and GND22 pF22 pF between OSC2 (14) and GND22 pFVDD (11) to VCCVSS (12) to GNDVSS (31) to GNDVDD (32) to VCC20 MHz crystal between OSC1 (13) and OSC2 (14)20 MHz crystalMCLR 1VDD 11VDD 11VSS 12OSC1 13OSC1 13OSC2 14OSC2 14VSS 31VDD 32VDD 32
Fig. 2. Minimum circuit to run, drawn from Table 1. Crossing wires are not connected.
Table 1. External parts, and why each one is there.
PartBetween
10 kOhmMCLR (1) to VCC
100 nFVDD (11) to GND
100 nFVDD (32) to GND
20 MHz crystalOSC1 (13) to OSC2 (14)
22 pFOSC1 (13) to GND
22 pFOSC2 (14) to GND

The configuration word has to select the oscillator mode as well, HS for 20 MHz. Fitting the crystal is not enough on its own, and the same word is where you turn the watchdog off.

4.Register configuration

Turning a pin on the diagram into a configured pin.

5.Full pin reference

Every pin, alias and mapping. This is the table that prints.

Table 2. Pin assignments.

Complete pin reference for PIC16F877A
PinNameFunctions

Found a wrong pin? The whole board is one file, data/boards/pic16f877a.json.

Edit this file on GitHubReport it instead