PIC16F877A-E/P - 8-Bit 20MHz MCU, 14KB Flash, 40-PDIP | Microchip
MPN: PIC16F877A-E/P ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $8.02 | $8.02 |
| 10 | $7.18 | $71.80 |
| 100 | $5.85 | $585.00 |
| 500 | $5.1 | $2,550.00 |
| 1,000 | $4.45 | $4,450.00 |
PIC16F877A-E/P Overview
A PIC16F-series 8-bit microcontroller (MCU) belongs to the broader category of microcontrollers -> embedded processors -> semiconductors. The PIC architecture uses a RISC-based Harvard design with a fixed instruction set of 35 single-word instructions, executing in 200 ns at 20 MHz. PIC MCUs are characterized by deterministic instruction timing, low power consumption, and easy in-system programming via ICSP, making them a long-standing industry workhorse for embedded control designs since the 1990s.
Key features include 14 KB self-programmable FLASH program memory, 256 bytes of EEPROM data memory, 368 bytes of RAM, 33 digital I/O pins, an internal 10-bit ADC with up to 8 channels, two 8-bit and one 16-bit timers, dual analog comparators, a USART, MSSP (SPI/I2C), and an ICD (In-Circuit Debug) interface. The 20 MHz instruction execution delivers approximately 5 MIPS of throughput, sufficient for sensor interfacing, motor control loops, and Human-Machine Interface (HMI) tasks.
Architecturally, the PIC16F877A implements the enhanced mid-range 14-bit instruction set core with interrupt-driven peripherals and a 14-bit program word. Its 8-level hardware stack and 2.0V-5.5V wide operating voltage allow direct battery or 5V regulated operation. The device supports power-saving INTOSC oscillator modes, BOR (Brown-Out Reset), and WDT (Watchdog Timer) for robust unattended operation.
Typical applications include industrial automation controllers, automotive dashboard subsystems, HVAC controls, sensor data acquisition, educational development boards, UPS and battery management, RFID readers, and legacy PIC16 system upgrades where the drop-in PIC16F887 can replace it with doubled FLASH. Designers benefit from a mature MPLAB X IDE ecosystem with free XC8 compilers and extensive peripheral libraries.
When designing with this MCU, place a 100 nF decoupling capacitor close to each VDD pin and maintain the 5V supply within 2.0V-5.5V for reliable FLASH programming. The -E extended-grade variant tolerates industrial temperature ranges but verify timing constraints against the in-system oscillator configuration you select for the application.
Drop-in alternatives for PIC16F877A-E/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 PIC16F877A-E/P (same form factor and footprint) — differing in Package, Core Architecture, Operating Temperature, Watchdog Timer, Serial Interfaces.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F887-E/P
✅ Drop-In✓ In Stock
$3.4 / Unit
View Datasheet →PIC16F877A-I/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F874A-I/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F877-20I/P
✅ Drop-In✓ In Stock
$5.1 / Unit
View Datasheet →PIC16F877-20/L
✅ Drop-In✓ In Stock
$4.85 / Unit
View Datasheet →PIC16F877-04I/P
✅ Drop-In✓ In Stock
$4.95 / Unit
View Datasheet →PIC16F877A-E/P Maximum Ratings & Electrical Characteristics
| Program Memory Type | FLASH |
| Program Memory Size | 14 KB (8K x 14) |
| CPU Architecture | PIC16 8-bit RISC (14-bit instruction word) |
| Maximum CPU Clock | 20 MHz |
| Instruction Execution Time | 200 ns (1 MIPS effective) |
| Instruction Set Size | 35 single-word instructions |
| RAM Size | 368 bytes |
| EEPROM Data Memory | 256 bytes |
| I/O Pins | 33 |
| ADC | 10-bit, 8 channels |
| Timers | 2 x 8-bit + 1 x 16-bit |
| Analog Comparators | 2 |
| Serial Interfaces | USART + MSSP (SPI / I2C) |
| Operating Voltage | 2.0 V to 5.5 V |
| Operating Temperature | -40C to +125C (extended, -E grade) |
| Package | 40-pin PDIP (DIP-40) |
| Mounting Type | Through-Hole |
| Self-Programming Support | Yes (FLASH, via ICSP) |
| In-Circuit Debug | Yes (ICD) |
| Internal Oscillator | Yes (8 MHz INTOSC selectable) |
| MSL Level | 1 (unlimited floor life, PDIP) |
| RoHS Status | Compliant |
PIC16F877A-E/P Pin Configuration
| Pin 1 | MCLR/VPP — Master clear (reset) input or programming voltage input |
| Pin 2 | RA0/AN0 — PORTA bit 0 / Analog channel 0 |
| Pin 3 | RA1/AN1 — PORTA bit 1 / Analog channel 1 |
| Pin 4 | RA2/AN2 — PORTA bit 2 / Analog channel 2 |
| Pin 5 | RA3/AN3 — PORTA bit 3 / Analog channel 3 / VREF+ |
| Pin 6 | RA4/TOCKI — PORTA bit 4 / Timer0 clock input (open-drain) |
| Pin 7 | RA5/AN4/SS — PORTA bit 5 / Analog channel 4 / SPI slave select |
| Pin 8 | RE0/RD/AN5 — PORTE bit 0 / Parallel port read control / Analog ch 5 |
| Pin 9 | RE1/WR/AN6 — PORTE bit 1 / Parallel port write control / Analog ch 6 |
| Pin 10 | RE2/CS/AN7 — PORTE bit 2 / Parallel port chip select / Analog ch 7 |
| Pin 11 | VDD — Positive supply voltage (2.0V to 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 |
| Pin 16 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator input / CCP2 out |
| Pin 17 | RC2/CCP1 — PORTC bit 2 / Capture-Compare-PWM channel 1 |
| Pin 18 | RC3/SCK/SCL — PORTC bit 3 / SPI clock / I2C clock |
| Pin 19 | RD0/PSP0 — PORTD bit 0 / Parallel Slave Port data 0 |
| Pin 20 | RD1/PSP1 — PORTD bit 1 / Parallel Slave Port data 1 |
| Pin 21 | RD2/PSP2 — PORTD bit 2 / Parallel Slave Port data 2 |
| Pin 22 | RD3/PSP3 — PORTD bit 3 / Parallel Slave Port data 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 asynchronous transmit / sync clock |
| Pin 26 | RC7/RX/DT — PORTC bit 7 / USART async receive / sync data |
| Pin 27 | RD4/PSP4 — PORTD bit 4 / Parallel Slave Port data 4 |
| Pin 28 | RD5/PSP5 — PORTD bit 5 / Parallel Slave Port data 5 |
| Pin 29 | RD6/PSP6 — PORTD bit 6 / Parallel Slave Port data 6 |
| Pin 30 | RD7/PSP7 — PORTD bit 7 / Parallel Slave Port data 7 |
| Pin 31 | VSS — Ground reference |
| Pin 32 | VDD — Positive supply voltage (2.0V to 5.5V) |
| Pin 33 | RB0/INT — PORTB bit 0 / External interrupt input |
| Pin 34 | RB1 — PORTB bit 1 (interrupt-on-change) |
| Pin 35 | RB2 — PORTB bit 2 (interrupt-on-change) |
| Pin 36 | RB3/PGM — PORTB bit 3 / Low-voltage ICSP programming |
| Pin 37 | RB4 — PORTB bit 4 (interrupt-on-change) |
| Pin 38 | RB5 — PORTB bit 5 (interrupt-on-change) |
| Pin 39 | RB6/PGC — PORTB bit 6 / ICSP clock (interrupt-on-change) |
| Pin 40 | RB7/PGD — PORTB bit 7 / ICSP data (interrupt-on-change) |
Typical Applications
PIC16F877A-E/P is suitable for 7 applications: Industrial Automation Controllers, Sensor Data Acquisition Systems, Educational Development Platforms, HVAC and Building Control, Automotive Dashboard Subsystems, UPS and Battery Management Front-End, Human-Machine Interface (HMI) and Keypad Panels.
Industrial Automation Controllers
The PIC16F877A-E/P fits industrial controller applications because its 33 digital I/O pins, 8-channel 10-bit ADC, and 5 MIPS throughput handle PLC-style discrete and analog sensor acquisition in real time. Its 14 KB FLASH supports ladder-logic or state-machine firmware with room for protocol stacks, while 256 B EEPROM stores calibration constants across power cycles. Placed on a backplane with optoisolated I/O, the wide -40C to +125C extended temperature and 2.0V-5.5V VDD tolerance handle factory-floor voltage transients without damage.
Recommended
Sensor Data Acquisition Systems
For multi-sensor acquisition boards, the PIC16F877A-E/P's 8-channel 10-bit ADC, dual comparators, and three timers deliver deterministic sampling within the 200 ns instruction cycle, ideal for thermocouple, pressure, and 4-20 mA loop sensing. The 368-byte RAM holds sliding-window averaging buffers while the 14 KB FLASH stores calibration lookup tables. Pairing this MCU with SPI-driven ADC front-ends or external EEPROMs (e.g., 25LC256) lets the design scale beyond the on-chip channels without redesigning the controller.
Recommended
Educational Development Platforms
The PIC16F877A-E/P is widely used in university embedded systems courses and hobbyist platforms because the 40-pin DIP package fits breadboards and 0.1-inch prototype boards, the 35-instruction set simplifies assembly teaching, and the ICSP interface enables in-circuit programming without disturbing the chip. The mature MPLAB X + XC8 toolchain is free for educational use with extensive tutorials from Microchip's academic program. With 14 KB FLASH and multiple peripherals (USART, I2C, SPI), students build progressively from blinking LEDs to multi-protocol IoT nodes on the same hardware base.
Recommended
HVAC and Building Control
The PIC16F877A-E/P serves HVAC thermostat, damper actuator, and building-automation controllers where its 8 analog inputs read temperature/humidity sensors while its I/O drives relays, TRIACs, and PWM-controlled fan motors. The 2.0V-5.5V supply operates directly from rectified 24VAC via simple regulators, and the extended temperature grade tolerates rooftop and boiler-room installations. USART/MSSP links to the central controller via RS-485 transceivers, with 256 B EEPROM retaining setpoint schedules through power loss events.
Recommended
Automotive Dashboard Subsystems
The PIC16F877A-E/P interfaces odometer, fuel-level, tachometer, and indicator-driver boards in aftermarket automotive dashboards by reading 8 sensor channels via the 10-bit ADC and driving multiplexed LED or VFD displays through PORTB/PORTC. The -40C to +125C extended grade handles under-dash thermal extremes, while 2.0V-5.5V operation tolerates automotive battery cranking down to 4.5V at 12V bus. Note this part is NOT automotive-qualified - for OEM automotive use, migrate to PIC16F18855 or dsPIC33A family.
Recommended
UPS and Battery Management Front-End
The PIC16F877A-E/P suits battery-management front-ends in UPS backup systems by sampling individual cell voltages through the 8-channel 10-bit ADC, driving MOSFET gate drivers via PWM, and logging events to the 256-byte EEPROM. Its 20 MHz clock executes state-of-charge algorithms in real time while the comparator interfaces directly with current-sense amplifiers for over-current detection. With 33 I/O, a single MCU manages 4-8 cell monitoring without external mux chips, simplifying FCC EMI compliance.
Recommended
Human-Machine Interface (HMI) and Keypad Panels
The PIC16F877A-E/P drives small HMI panels with 4x4 matrix keypads, character LCDs via the MSSP (SPI mode), and indicator LEDs through its 33 I/O pins. The USART links to host controllers for centralized configuration, while 14 KB FLASH stores menu trees and Beep/click feedback patterns. The 5 MIPS throughput keeps LCD refresh and key-debounce rates sub-millisecond with no visible lag, and EEPROM remembers last-set state during power-down or operator handover shifts.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F877A-E/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F887-E/P | PIC16F877A-I/P | PIC16F874A-I/P | PIC16F877-20I/P |
|---|---|---|---|---|---|
| Brand | 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 |
| Program Memory (FLASH) | 14 KB | 14 KB | 14 KB | 7 KB | 14 KB |
| RAM Size | 368 B | 368 B | 368 B | 192 B | 368 B |
| Max CPU Clock | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| Temperature Range | -40C to +125C (extended) | -40C to +125C | -40C to +85C | -40C to +85C | -40C to +85C |
| ADC Channels / Resolution | 8 ch / 10-bit | 14 ch / 10-bit | 8 ch / 10-bit | 8 ch / 10-bit | 8 ch / 10-bit |
| nanoWatt Power Modes | No | Yes (multiple low-power modes) | No | No | No |
| Programming Type | FLASH (self-programmable) | FLASH (self-programmable) | FLASH (self-programmable) | FLASH (self-programmable) | FLASH (self-programmable) |
Key Differentiators
- Enhanced temperature grade -40C to +125C (vs PIC16F877A-I/P)
- Drop-in 40-pin PDIP with 14 KB FLASH and identical pinout (vs PIC16F887-E/P)
- Mature ecosystem with free XC8 compiler and MPLAB X IDE (vs PIC16F874A-I/P)
Design Notes
Place one 100 nF (0.1 uF) ceramic decoupling capacitor between each VDD pin (11 and 32) and the nearest VSS pin (12 and 31). For the 40-PDIP package, keep capacitor traces shorter than 5 mm to minimize switching-noise feedthrough into analog VREF. Bulk 10 uF + 100 nF is recommended at the regulator input. Estimated: assuming average digital I/O switching current of 5 mA, total IC current draw stays below 50 mA at full operation, so the regulator must source at least 100 mA for margin.
Route the ICSP pins (PGD = pin 40, PGC = pin 39, MCLR/VPP = pin 1) to a dedicated 5-pin header (with VDD + GND) for in-circuit programming without removing the chip from the board. Keep MCLR/VPP trace short and pull high through a 10 kOhm resistor to VDD, with a 100 nF cap to ground for noise immunity. Place the ICSP header on the board edge for easy probe access during factory programming. Do not place any capacitor on MCLR except the bypass cap, and never tie MCLR directly to VDD without the resistor.
Do not exceed 5.5V on any VDD pin or 5.5V on any I/O pin (per datasheet DS39582B absolute maximums). Brown-out conditions below BOR threshold (configurable 2.0V-4.3V) may erase EEPROM if BOR is disabled - always enable BOR in configuration bits for production firmware. The MCLR pin requires a rise time less than 5 ms for reliable reset - excessive capacitance here prevents startup. Watchdog Timer must be configured to clear within 18 ms (WDT postscale) to avoid unwanted resets in interrupt-heavy code.
Route the analog inputs (AN0-AN7 on PORTA/PORTE) with guarded differential traces away from digital switching lines, especially RC2 (CCP1 PWM) and USART pins (RC6/RC7) on DIP pins 25-26. Place the 8 analog channels on a separate analog ground plane tied to the digital ground at one point near VSS pins. Estimated: assuming analog input impedance of 10 kOhm source, ADC acquisition time should hold the sample capacitor for 12 us minimum at 10-bit resolution (per DS39582B AC electricals) - configure the ACQT register for at least 8 TAD.
The PIC16F877A is not AEC-Q100 qualified - do not use in automotive OEM safety-critical applications without separate Microchip automotive-grade replacement (e.g., PIC16F18855). The 33 I/O pins each sink or source 25 mA (per pin) and 200 mA (total); exceeding these during PWM-driven loads or LED arrays will damage the device. Always compute each pin's drive current including transient back-EMF from inductive loads - place flyback diodes on relays and solenoids driven by PIC outputs.
Compliance Information
RoHS compliant per Microchip material declaration; not AEC-Q100 qualified (use PIC16F18855 or dsPIC33A for automotive). Microchip QS-9000 quality system compliance covers PIC16F877A production at Chandler and Tempe facilities per datasheet footnote. Halogen-free status not explicitly stated in datasheet DS39582B and not independently verified - set to 'unknown' per data authenticity rules.