PIC16F877-20I/P - 8-Bit 20MHz 14KB Flash MCU | Microchip | DIP-40
MPN: PIC16F877-20I/P ✗ End of Life| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $8.95 | $8.95 |
| 10 | $7.92 | $79.20 |
| 100 | $6.88 | $688.00 |
| 500 | $5.83 | $2,915.00 |
| 1,000 | $5.1 | $5,100.00 |
PIC16F877-20I/P Overview
A microcontroller (MCU) is a single-chip computer containing a CPU, program memory, data memory, and integrated peripherals such as ADCs, timers, and communication interfaces. The PIC16F877 belongs to the mid-range PIC16 family, which sits within Microchip's 8-bit PIC architecture (PIC -> 8-bit MCU -> microcontroller -> semiconductor). This category targets cost-sensitive embedded designs that benefit from RISC instruction simplicity (only 35 single-word instructions) and on-chip peripherals.
Key features of the PIC16F877-20I/P include a 20 MHz maximum operating frequency, 8-channel 10-bit ADC, two 8-bit timers plus one 16-bit timer, a 200 ns instruction cycle, brown-out reset (BOR), a watchdog timer, and hardware USART, MSSP (SPI/I2C) and parallel slave port. The wide operating voltage range (2.0V-5.5V), four oscillator modes (RC, LP, XT, HS), and ICD (In-Circuit Debugger) support make it flexible for both battery-powered and mains-fed designs.
The architecture employs a Harvard-style RISC CPU with separate program and data buses, 14-bit wide instruction words, and a two-stage pipeline. The 25 mA source/sink per I/O pin directly drives LEDs and small relays, eliminating driver transistors in many interfaces. The integrated 10-bit ADC provides 8 input channels at conversion speeds suitable for sensor monitoring at sub-millisecond sample rates.
Typical applications include industrial control panels, sensor interface nodes, motor control peripheral logic, educational development platforms, instrumentation front-ends, and legacy equipment maintenance. The through-hole PDIP-40 package is preferred for breadboarding, repair of legacy boards, and harsh-environment designs where through-hole leads improve mechanical robustness.
Designers should note that Microchip recommends migrating to the PIC16F887 (1:1 pin-compatible with enhanced peripherals) or PIC18F4520 for new designs. The 40-pin PDIP footprint is shared with many PIC16/PIC18 devices, simplifying migration. Always enable the watchdog timer in noise-prone industrial environments and place a 100 nF decoupling capacitor directly between VDD and VSS pins.
This page synthesizes distributor pricing, drop-in alternatives, and practical design notes for the PIC16F877-20I/P not found in the original manufacturer datasheet, with all specifications cross-referenced to Microchip's published documentation.
Drop-in alternatives for PIC16F877-20I/P — same package, pin-to-pin compatible. Different-package parts requiring PCB rework are excluded.
Variants in this series
Same-series models that are drop-in compatible with PIC16F877-20I/P (same form factor and footprint) — differing in Package, Core Architecture, Timers, Mounting Type, Operating Temperature.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F887-I/P
✅ Drop-In✓ In Stock
$1.88 / Unit
View Datasheet →PIC16F877A-I/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F877-04I/P
✅ Drop-In✓ In Stock
$4.95 / Unit
View Datasheet →PIC16F877-10E/P
✅ Drop-In✓ In Stock
$4.3 / Unit
View Datasheet →PIC16F877-20/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F877-20I/L
✅ Drop-In✓ In Stock
$9.05 / Unit
View Datasheet →PIC16F877-20I/P Maximum Ratings & Electrical Characteristics
| Core Architecture | 8-bit PIC RISC (PIC16 mid-range) |
| Program Memory (Flash) | 14 KB (8K x 14 words) |
| RAM | 368 bytes |
| Data EEPROM | 256 bytes |
| Maximum CPU Frequency | 20 MHz |
| Instruction Cycle | 200 ns |
| Operating Voltage (VDD) | 2.0 V to 5.5 V |
| I/O Pins | 33 (PORTA-PORTE) |
| ADC | 10-bit, 8 channels |
| Timers | 2 x 8-bit + 1 x 16-bit |
| Communication | USART, MSSP (SPI/I2C), PSP |
| Package | 40-pin PDIP (DIP-40) |
| Operating Temperature | -40 C to +85 C (Industrial) |
| Instruction Set Size | 35 single-word instructions |
| I/O Sink/Source Current | 25 mA per pin |
| RoHS Status | Compliant |
| MSL Level | 1 (unlimited floor life at <30 C / 85% RH) |
| Brown-Out Reset | Yes |
| Watchdog Timer | Yes (software-enabled, dedicated RC oscillator) |
PIC16F877-20I/P Pin Configuration
| Pin 1 | MCLR/VPP — Master clear reset input / programming voltage |
| Pin 2 | RA0/AN0 — PORTA bit 0 / Analog input 0 |
| Pin 3 | RA1/AN1 — PORTA bit 1 / Analog input 1 |
| Pin 4 | RA2/AN2/VREF- — PORTA bit 2 / Analog input 2 / ADC VREF- |
| Pin 5 | RA3/AN3/VREF+ — PORTA bit 3 / Analog input 3 / ADC VREF+ |
| Pin 6 | RA4/T0CKI — PORTA bit 4 / Timer0 clock input |
| Pin 7 | RA5/AN4/SS — PORTA bit 5 / Analog input 4 / SPI slave select |
| Pin 8 | RE0/RD/AN5 — PORTE bit 0 / Read control for PSP / Analog input 5 |
| Pin 9 | RE1/WR/AN6 — PORTE bit 1 / Write control for PSP / Analog input 6 |
| Pin 10 | RE2/CS/AN7 — PORTE bit 2 / Chip select for PSP / Analog input 7 |
| Pin 11 | VDD — Positive supply voltage (2.0V-5.5V) |
| Pin 12 | VSS — Ground reference |
| Pin 13 | OSC1/CLKIN — Oscillator crystal input / external clock input |
| Pin 14 | OSC2/CLKOUT — Oscillator crystal output / clock output |
| Pin 15 | RC0/T1OSO/T1CKI — PORTC bit 0 / Timer1 oscillator output / Timer1 clock input |
| Pin 16 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator input / CCP2 output |
| Pin 17 | RC2/CCP1 — PORTC bit 2 / CCP1 PWM output |
| Pin 18 | RC3/SCK/SCL — PORTC bit 3 / SPI clock / I2C clock |
| Pin 19 | RD0/PSP0 — PORTD bit 0 / Parallel slave port bit 0 |
| Pin 20 | RD1/PSP1 — PORTD bit 1 / Parallel slave port bit 1 |
| Pin 21 | RD2/PSP2 — PORTD bit 2 / Parallel slave port bit 2 |
| Pin 22 | RD3/PSP3 — PORTD bit 3 / Parallel slave port bit 3 |
| Pin 23 | RC4/SDI/SDA — PORTC bit 4 / SPI data in / I2C data |
| Pin 24 | RC5/SDO — PORTC bit 5 / SPI data out |
| Pin 25 | RC6/TX/CK — PORTC bit 6 / USART transmit / USART clock |
| Pin 26 | RC7/RX/DT — PORTC bit 7 / USART receive / USART data |
| Pin 27 | RD4/PSP4 — PORTD bit 4 / Parallel slave port bit 4 |
| Pin 28 | RD5/PSP5 — PORTD bit 5 / Parallel slave port bit 5 |
| Pin 29 | RD6/PSP6 — PORTD bit 6 / Parallel slave port bit 6 |
| Pin 30 | RD7/PSP7 — PORTD bit 7 / Parallel slave port bit 7 |
| Pin 31 | VSS — Ground reference |
| Pin 32 | VDD — Positive supply voltage (2.0V-5.5V) |
| Pin 33 | RB0/INT — PORTB bit 0 / External interrupt input |
| Pin 34 | RB1 — PORTB bit 1 |
| Pin 35 | RB2 — PORTB bit 2 |
| Pin 36 | RB3/PGM — PORTB bit 3 / Low-voltage programming input |
| Pin 37 | RB4 — PORTB bit 4 |
| Pin 38 | RB5 — PORTB bit 5 |
| Pin 39 | RB6/PGC — PORTB bit 6 / In-circuit debugger clock |
| Pin 40 | RB7/PGD — PORTB bit 7 / In-circuit debugger data |
Typical Applications
PIC16F877-20I/P is suitable for 6 applications: Industrial Control Panels, Sensor Interface Nodes, Educational Development Platforms, Motor Control Peripheral Logic, Legacy Equipment Maintenance, Instrumentation Front-Ends.
Industrial Control Panels
The PIC16F877-20I/P fits industrial control panels thanks to its 33 GPIO pins (each with 25 mA source/sink), 8-channel 10-bit ADC for sensor monitoring, and hardware USART for Modbus RTU or RS-485 links. The 14 KB Flash accommodates typical control-loop logic plus a small HMI menu, while the 256-byte EEPROM stores calibration constants that survive power cycles. The wide 2.0V-5.5V supply range tolerates industrial 24V-derived rails after regulation. The brown-out reset and watchdog timer - mandatory in noisy factory environments - are built in. Pin-compatible migration to PIC16F887-I/P is straightforward when production volumes scale.
Recommended
Sensor Interface Nodes
For sensor interface nodes, the PIC16F877-20I/P's integrated 8-channel 10-bit ADC eliminates the need for an external converter in temperature, pressure, or light-sensor reading applications. The 200 ns instruction cycle supports sub-millisecond sampling of multiple analog channels in round-robin fashion. The MSSP peripheral implements I2C or SPI for digital sensors, and the hardware USART connects to wireless modules (XBee, LoRa, Bluetooth). With 368 bytes of RAM, multi-channel averaging and digital filtering fit comfortably alongside the I/O scheduler. The DIP-40 package is repair-friendly for field-deployed sensor nodes.
Recommended
Educational Development Platforms
The PIC16F877-20I/P is widely used in university embedded-systems courses because the 40-pin PDIP package fits standard breadboards without soldering, and the 35-instruction RISC set is approachable for first-year students. The ICD (In-Circuit Debugger) header on the part enables real-time debugging via MPLAB X and a PICkit programmer, accelerating the learn-debug-iterate cycle. The integrated peripherals (ADC, timers, USART, MSSP) let students explore all major MCU subsystems on a single chip without external component complexity. The mature toolchain (MPLAB X IDE, XC8 compiler) provides free, well-documented development support.
Recommended
Motor Control Peripheral Logic
For peripheral motor-control logic (H-bridge drivers, BLDC commutation sequencing, PWM generation), the PIC16F877-20I/P offers the CCP (Capture/Compare/PWM) module generating up to 10-bit PWM resolution, plus the 16-bit Timer1 for precise commutation timing. The 20 MHz CPU provides 5 MIPS, sufficient for sensorless BLDC commutation at moderate RPM. The 33 I/O pins drive phase-enable signals, fault inputs, and current-sense feedback paths without external logic. The industrial -40 C to +85 C temperature range suits motor compartments. Migration to PIC18F4520-I/P is recommended for higher-RPM FOC applications requiring more MIPS.
Recommended
Legacy Equipment Maintenance
The PIC16F877-20I/P is commonly sourced for maintaining legacy industrial equipment where the original MCU is no longer manufactured but the through-hole DIP-40 footprint must be preserved for direct PCB replacement. The industrial -40 C to +85 C temperature rating matches factory-floor environments, and the 20 MHz CPU performs identically to the original part, preserving firmware behavior. Microchip's continued shipping of this part supports long-term support contracts. The 256-byte EEPROM allows technicians to update calibration constants in the field via ICSP without removing the chip from the board.
Recommended
Instrumentation Front-Ends
For instrumentation front-ends (digital panel meters, hand-held multimeters, simple oscilloscope front-ends), the PIC16F877-20I/P's 10-bit ADC provides adequate resolution for voltage/current readout applications, while the LCD-driving capability through PORTA/PORTB simplifies direct segment or character-LCD interfacing without external driver ICs. The hardware USART outputs measurement data to PCs or data loggers, and the I2C MSSP connects to external 16/24-bit ADCs when higher resolution is required. The 14 KB Flash holds calibration tables and user-interface state machines. The DIP-40 form factor is repairable with through-hole rework tools.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F877-20I/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F887-I/P | PIC16F877A-I/P | PIC16F877-04I/P | PIC16F877-10E/P | PIC16F877-20/P |
|---|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 40-pin PDIP (DIP-40) | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same |
| Maximum CPU Frequency | 20 MHz | 20 MHz | 20 MHz | 4 MHz (-80%) | 10 MHz (-50%) | 20 MHz |
| Program Flash Memory | 14 KB | 14 KB | 14 KB | 14 KB | 14 KB | 14 KB |
| RAM | 368 bytes | 368 bytes | 368 bytes | 368 bytes | 368 bytes | 368 bytes |
| Data EEPROM | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 256 bytes |
| ADC Channels | 8 channels, 10-bit | 14 channels, 10-bit (+75%) | 8 channels, 10-bit | 8 channels, 10-bit | 8 channels, 10-bit | 8 channels, 10-bit |
| I/O Pins | 33 | 36 | 33 | 33 | 33 | 33 |
| Operating Temperature | -40 C to +85 C (Industrial) | -40 C to +85 C | -40 C to +85 C | -40 C to +85 C | -40 C to +125 C (Extended) | 0 C to +70 C (Commercial) |
| Lifecycle Status | NRND (Not Recommended for New Designs) | Active | NRND | NRND | NRND | NRND |
Key Differentiators
- Industrial temperature rating with 20 MHz operation (vs PIC16F877-20/P)
- Active production vs NRND status (vs PIC16F877-20I/P vs PIC16F887-I/P)
- Maximum throughput in the PIC16F877 family (vs PIC16F877-04I/P)
Design Notes
Place a 100 nF (0.1 uF) decoupling capacitor as close as physically possible to each VDD pin (pins 11 and 32) with the ground return directly to the adjacent VSS pin (pins 12 and 31). For designs with switching peripherals or relays, add a bulk 10 uF tantalum or aluminum electrolytic capacitor near the MCU supply input. The PIC16F877-20I/P draws approximately 5-15 mA at 20 MHz with all peripherals active - budget accordingly for the regulator. Avoid routing high-current switching traces under the MCU to minimize supply-rail disturbances.
For oscillator stability, keep crystal traces short (under 10 mm) and surround them with a grounded guard ring on the PCB to isolate from digital switching noise. Place the load capacitors (typically 15-33 pF for HS mode at 20 MHz per Microchip datasheet table) directly between each oscillator pin and ground. Avoid routing OSC1/OSC2 traces parallel to high-frequency digital lines; cross them at 90 degrees if necessary. The MCLR pin requires a 10 kohm pull-up to VDD and a 100 nF capacitor to ground for proper reset behavior during power-up.
Do not confuse the PIC16F877 with the PIC16F877A - the 'A' suffix indicates an enhanced Flash memory cell with different programming voltages and timing. Attempting to program a PIC16F877 with PIC16F877A firmware (or vice versa) can fail or produce unreliable Flash endurance. Also note the operating frequency: the -20 suffix in PIC16F877-20I/P denotes 20 MHz max, while -04 and -10 variants are 4 MHz and 10 MHz respectively - inserting a -04 part where -20 is expected will cause timing failures. Always verify the full ordering code including speed suffix before sourcing replacements.
Compliance Information
RoHS compliance per Microchip product page ordering information. Pb-free (lead-free) assembly per Microchip standard. Not AEC-Q100 qualified - the -20I/P variant is industrial-grade, not automotive-qualified; for AEC-Q100 PIC16 options, consult Microchip's PIC16F1x automotive family.