PIC16F877-04I/P - 8-bit 4MHz 14KB Flash MCU, 40-PDIP | Microchip
MPN: PIC16F877-04I/P ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $7.5 | $7.50 |
| 10 | $6.85 | $68.50 |
| 100 | $6.2 | $620.00 |
| 500 | $5.55 | $2,775.00 |
| 1,000 | $4.95 | $4,950.00 |
PIC16F877-04I/P Overview
An 8-bit MCU (microcontroller) is a small self-contained computer on a single integrated circuit that combines a CPU, non-volatile program memory (Flash/ROM), volatile data memory (RAM), non-volatile data storage (EEPROM), and a rich set of programmable peripherals. The 8-bit PIC16F877 sits in the power-management hierarchy between simple 8-bit controllers and 16/32-bit MCUs, offering a balance of low cost, deterministic interrupt response, and sufficient peripherals for embedded control in industrial, automotive, and consumer applications. The "I" suffix indicates the industrial temperature grade of -40C to +85C.
Key differentiating features of the PIC16F877-04I/P include a 10-bit multi-channel Analog-to-Digital Converter (ADC) with eight input channels, two 8-bit and one 16-bit Timer/Counter modules, two Capture/Compare/PWM (CCP) peripherals, a USART for asynchronous and synchronous serial communication, and a Master Synchronous Serial Port (MSSP) configurable as SPI or I2C. The device also integrates a brown-out reset (BOR), power-on reset (POR), watchdog timer (WDT) with its own on-chip RC oscillator, and In-Circuit Serial Programming (ICSP) for field-upgradeable firmware.
Architecturally, the PIC16F877 uses a RISC-style Harvard architecture with separate program and data buses, allowing simultaneous instruction fetch and operand access in a single instruction cycle. The 14-bit wide instruction word supports 35 single-word instructions, providing compact code density and deterministic timing. The 04 speed grade denotes a maximum oscillator frequency of 4 MHz, while the 20 MHz variant (PIC16F877-20I/P) doubles throughput at the cost of slightly higher power consumption.
Typical applications include industrial control systems, sensor interfacing with the 10-bit ADC, motor control via the PWM modules, consumer electronics with USART-based device connectivity, educational platforms such as the PICDEM and development boards, automotive body electronics, and any legacy through-hole design requiring 5V-tolerant digital I/O. The 40-pin PDIP form factor remains popular for breadboarding, hobbyist projects, and through-hole manufacturing lines.
When designing with the PIC16F877-04I/P, ensure the MCLR reset pin is pulled high through a resistor for normal operation and that the Vdd/Vss supply pair is bypassed with a 100 nF ceramic capacitor within a few millimeters of the IC. Designers transitioning to newer Microchip silicon should consider the PIC16F887, which provides pin-to-pin compatibility with additional peripherals, more memory, and an extended instruction set while preserving the same 40-pin PDIP footprint.
This page synthesizes distributor pricing, drop-in PIC16F family alternatives, and practical design notes not found in the standalone manufacturer datasheet, accelerating engineering selection for legacy 8-bit embedded designs.
Drop-in alternatives for PIC16F877-04I/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-04I/P (same form factor and footprint) — differing in Core Architecture, Package, ADC, Operating Temperature, Timers.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F877-04I/PT
✅ Drop-In✓ In Stock
$4.95 / Unit
View Datasheet →PIC16F877A-I/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F887-I/P
✅ Drop-In✓ In Stock
$1.88 / Unit
View Datasheet →PIC16F877-20I/P
✅ Drop-In✓ In Stock
$5.1 / Unit
View Datasheet →PIC16F874-04I/P
✅ Drop-In✓ In Stock
$5.55 / Unit
View Datasheet →PIC16F877-04I/P Maximum Ratings & Electrical Characteristics
| Product Family | PIC16F 8-bit Microcontroller |
| Core Architecture | 8-bit PIC RISC Harvard |
| Program Memory (Flash) | 14 KB (8K x 14 words) |
| Data RAM | 368 bytes |
| Data EEPROM | 256 bytes |
| Maximum Clock Frequency | 4 MHz |
| Instruction Cycle Time | 200 ns |
| Number of I/O Pins | 33 |
| ADC | 10-bit, 8 channels |
| Timers | 2 x 8-bit + 1 x 16-bit |
| CCP Modules | 2 (Capture/Compare/PWM) |
| Serial Interfaces | USART + MSSP (SPI/I2C) |
| Package | 40-pin PDIP (DIP-40, 600 mil) |
| Operating Temperature | -40C to +85C (industrial grade) |
| Supply Voltage (Vdd) | 2.0 V to 5.5 V |
| Watchdog Timer | Yes, with dedicated RC oscillator |
| In-Circuit Programming | ICSP (In-Circuit Serial Programming) |
| RoHS Status | Compliant |
PIC16F877-04I/P Pin Configuration
| Pin 1 | MCLR/Vpp — Master Clear (reset) input / programming voltage |
| Pin 2 | RA0/AN0 — Port A bit 0 / analog input channel 0 |
| Pin 3 | RA1/AN1 — Port A bit 1 / analog input channel 1 |
| Pin 4 | RA2/AN2/Vref- — Port A bit 2 / analog input 2 / ADC Vref- |
| Pin 5 | RA3/AN3/Vref+ — Port A bit 3 / analog input 3 / ADC Vref+ |
| Pin 6 | RA4/T0CKI — Port A bit 4 / Timer0 clock input |
| Pin 7 | RA5/AN4/SS — Port A bit 5 / analog input 4 / SPI slave select |
| Pin 8 | RE0/RD/AN5 — Port E bit 0 / read control for parallel slave port / analog input 5 |
| Pin 9 | RE1/WR/AN6 — Port E bit 1 / write control / analog input 6 |
| Pin 10 | RE2/CS/AN7 — Port E bit 2 / chip select / analog input 7 |
| Pin 11 | VDD — Positive supply voltage (2.0V to 5.5V) |
| Pin 12 | VSS — Ground reference |
| Pin 13 | OSC1/CLKI — Oscillator input / external clock input |
| Pin 14 | OSC2/CLKO — Oscillator output / clock output |
| Pin 15 | RC0/T1OSO/T1CKI — Port C bit 0 / Timer1 oscillator output / Timer1 clock input |
| Pin 16 | RC1/T1OSI/CCP2 — Port C bit 1 / Timer1 oscillator input / CCP2 |
| Pin 17 | RC2/CCP1 — Port C bit 2 / Capture/Compare/PWM 1 |
| Pin 18 | RC3/SCK/SCL — Port C bit 3 / SPI clock / I2C clock |
| Pin 19 | RD0/PSP0 — Port D bit 0 / parallel slave port data bit 0 |
| Pin 20 | RD1/PSP1 — Port D bit 1 / parallel slave port data bit 1 |
| Pin 21 | RD2/PSP2 — Port D bit 2 / parallel slave port data bit 2 |
| Pin 22 | RD3/PSP3 — Port D bit 3 / parallel slave port data bit 3 |
| Pin 23 | RC4/SDI/SDA — Port C bit 4 / SPI data in / I2C data |
| Pin 24 | RC5/SDO — Port C bit 5 / SPI data out |
| Pin 25 | RC6/TX/CK — Port C bit 6 / USART TX / USART clock |
| Pin 26 | RC7/RX/DT — Port C bit 7 / USART RX / USART data |
| Pin 27 | RD4/PSP4 — Port D bit 4 / parallel slave port data bit 4 |
| Pin 28 | RD5/PSP5 — Port D bit 5 / parallel slave port data bit 5 |
| Pin 29 | RD6/PSP6 — Port D bit 6 / parallel slave port data bit 6 |
| Pin 30 | RD7/PSP7 — Port D bit 7 / parallel slave port data bit 7 |
| Pin 31 | VSS — Ground reference |
| Pin 32 | VDD — Positive supply voltage (2.0V to 5.5V) |
| Pin 33 | RB0/INT — Port B bit 0 / external interrupt input |
| Pin 34 | RB1 — Port B bit 1 |
| Pin 35 | RB2 — Port B bit 2 |
| Pin 36 | RB3/PGM — Port B bit 3 / low-voltage programming input |
| Pin 37 | RB4 — Port B bit 4 |
| Pin 38 | RB5 — Port B bit 5 |
| Pin 39 | RB6/PGC — Port B bit 6 / ICSP clock |
| Pin 40 | RB7/PGD — Port B bit 7 / ICSP data |
Typical Applications
PIC16F877-04I/P is suitable for 6 applications: Industrial Control and Sensor Interfacing, Motor Control with PWM and CCP Modules, Consumer Electronics and USART-Based Connectivity, Educational Platforms and Development Boards, Automotive Body Electronics (Legacy 12V Systems), Data Acquisition and Instrumentation Front-Ends.
Industrial Control and Sensor Interfacing
The PIC16F877-04I/P is well suited for industrial control panels and sensor-interface boards where its 10-bit 8-channel ADC, 33 digital I/O lines, and industrial -40C to +85C temperature grade match harsh-environment requirements. The 4 MHz clock provides ample throughput for sampling thermocouples, pressure transducers, and 4-20 mA loops at typical 10 Hz update rates. Designers commonly route analog inputs to RA0-RA5 for ADC and use RB0-RB7 for digital limit-switch polling. Compared to a PLC, the PIC16F877 cuts bill-of-materials cost by integrating ADC, PWM, USART, and EEPROM on a single die. The 40-pin PDIP remains the package of choice for through-hole industrial backplanes and screw-terminal daughter cards.
Recommended
Motor Control with PWM and CCP Modules
The PIC16F877-04I/P drives brushed DC motors, small stepper motors, and servo valves via its two Capture/Compare/PWM (CCP) peripherals generating 10-bit PWM at the 4 MHz instruction rate. The PWM resolution and frequency can be software-tuned by setting Timer2 prescale and PR2 register values; a typical 1 kHz PWM at 10-bit resolution fits comfortably in firmware overhead. The 33 I/O pins accommodate H-bridge direction logic, encoder feedback, and end-stop limit switches. Industrial temperature grade -40C to +85C supports factory-floor ambient, while 2.0-5.5V operation tolerates unregulated 24V rails stepped down via a linear regulator. The 14 KB Flash holds state-machine code for closed-loop PID at kHz sample rates.
Recommended
Consumer Electronics and USART-Based Connectivity
The PIC16F877-04I/P provides USART and MSSP (SPI/I2C) peripherals for connecting consumer devices to displays, sensors, and Bluetooth/Wi-Fi modules. The 4 MHz clock supports 9600 baud UART comfortably, while the MSSP can drive I2C LCDs or SPI EEPROMs at full throughput. Typical designs use the USART to send telemetry over an HC-05 Bluetooth module or to debug-print firmware state during development. The 368-byte RAM buffers small UART packets, and the 14 KB Flash holds menu logic for consumer appliances. The 40-pin PDIP package suits hand-soldered prototypes and small-batch production runs typical of consumer electronics development labs.
Recommended
Educational Platforms and Development Boards
The PIC16F877-04I/P is the canonical MCU of university embedded-systems curricula and Microchip's PICDEM development ecosystem due to its 40-pin PDIP footprint that drops into standard 0.6 inch wide DIP sockets and breadboards. The 33 I/O pins map cleanly to student-lab exercises covering GPIO, ADC, PWM, UART, I2C, and SPI without needing surface-mount soldering. The 4 MHz instruction rate keeps execution deterministic for teaching real-time scheduling. MPLAB X IDE, XC8 compiler, and PICkit programmers target this part natively, providing a complete free toolchain. The 14 KB Flash accommodates student projects of meaningful complexity while staying within programming-time budgets typical of one-semester labs.
Recommended
Automotive Body Electronics (Legacy 12V Systems)
The PIC16F877-04I/P powers automotive body-control modules including interior lighting drivers, HVAC blend-door actuators, and mirror-control circuits in legacy 12V systems. The 2.0-5.5V supply operates from a regulated 5V rail after the vehicle's 12V battery, and the 33 I/O pins drive relays, MOSFET gates, and Hall-effect sensor inputs. The industrial -40C to +85C temperature grade covers cabin and engine-bay environments, though under-hood applications should use AEC-Q100-qualified PIC16 counterparts. The two CCP PWM modules drive DC motor speed and LED dimming, while the 10-bit ADC reads thermistor and potentiometer inputs. The 40-pin PDIP suits prototyping but production automotive designs typically migrate to PIC16F876A-I/SS or QFN equivalents.
Recommended
Data Acquisition and Instrumentation Front-Ends
The PIC16F877-04I/P serves as the front-end controller in low-cost data-acquisition systems, multiplexing up to 8 analog channels through its 10-bit ADC and streaming samples over UART to a host PC or embedded gateway. The 4 MHz clock drives successive-approximation ADC conversions at the datasheet-specified rate, and the 368-byte RAM holds small circular sample buffers. The MSSP peripheral reads external I2C sensors while the USART outputs formatted CSV data to a terminal. The 14 KB Flash fits firmware for channel scanning, calibration constants in EEPROM, and serial-protocol parsing. The 40-pin PDIP package and 5V-tolerant I/O simplify lab instrumentation where users may apply out-of-range analog signals that would damage 3.3V-only MCUs.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F877-04I/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F877-04I/PT | PIC16F877A-I/P | PIC16F887-I/P | PIC16F877-20I/P | PIC16F874-04I/P |
|---|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 40-pin PDIP | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same |
| Program Memory (Flash) | 14 KB | 14 KB | 14 KB | 14 KB | 14 KB | 7 KB (-50%) |
| Maximum Clock Frequency | 4 MHz | 4 MHz | 20 MHz | 20 MHz | 20 MHz (5x faster) | 4 MHz |
| Data RAM | 368 bytes | 368 bytes | 368 bytes | 368 bytes | 368 bytes | 192 bytes (-48%) |
| Data EEPROM | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 128 bytes (-50%) |
| ADC Channels | 8 channels, 10-bit | 8 channels, 10-bit | 8 channels, 10-bit (improved) | 14 channels, 10-bit | 8 channels, 10-bit | 8 channels, 10-bit |
| Operating Temperature | -40C to +85C (industrial) | -40C to +85C | -40C to +85C | -40C to +85C | -40C to +85C | -40C to +85C |
| Lifecycle Status | Active | Active | Active | Active (recommended) | Active | Active |
Key Differentiators
- Canonical 40-pin PDIP educational and legacy MCU (vs PIC16F887-I/P)
- Speed grade matched to low-power industrial applications (vs PIC16F877-20I/P)
- Industrial -40C to +85C temperature grade (vs PIC16F874-04I/P)
Design Notes
Place a 100 nF ceramic decoupling capacitor within 5 mm of each Vdd pin (pins 11 and 32 on the 40-pin PDIP) with a short, wide trace to Vss. For designs with significant digital switching noise, add a 10 uF tantalum or ceramic bulk capacitor on the supply rail near the MCU. The PIC16F877-04I/P operates from 2.0 V to 5.5 V; a regulated 5V rail from an MC78M05 or equivalent is recommended for noisy industrial environments. Estimated: at 4 MHz clock and 5V supply, typical I_dd is approximately 2-5 mA, requiring negligible heatsinking in PDIP.
Configure the MCLR pin (pin 1) with a 10 kohm pull-up to Vdd and a 100 nF capacitor to Vss for proper reset behaviour; leaving MCLR floating can cause intermittent resets in noisy environments. For ICSP programming, isolate the MCLR pull-up with a series resistor so the programmer can drive MCLR low during programming. The CONFIG register must be programmed with the correct oscillator mode (HS, XT, or RC for the 4 MHz speed grade) and watchdog timer setting before the first instruction executes.
The 40-pin PDIP occupies 0.600 inch row spacing; route power and ground on opposite sides of the package for clean signal integrity. Keep the analog traces (RA0-RA5, RE0-RE2) short and away from digital switching signals to minimize ADC crosstalk; a ground pour under the analog section improves noise rejection. The OSC1/OSC2 crystal traces (pins 13-14) should be as short as possible with the crystal load capacitors (typically 15-33 pF) placed within 5 mm of the oscillator pins.
For 4 MHz operation with a 4 MHz crystal or ceramic resonator, use a 22 pF load capacitor pair; for HS-mode 20 MHz operation, reduce to 15 pF. The I2C bus pins (RC3/SCL, RC4/SDA) require external pull-up resistors (typically 4.7 kohm at 5V, 100 kHz bus speed). The PGC/PGD pins (RB6/RB7) used for ICSP should not be permanently pulled low by external circuitry during programming; design with a current-limiting resistor or buffer if peripheral sharing is required.
Compliance Information
RoHS-compliant lead-free PDIP package per Microchip product page. Not AEC-Q100 qualified - choose PIC16F876A automotive-grade variant for under-hood automotive applications. Industrial temperature grade -40C to +85C.