PIC16F877-20/PT - 8-Bit 20MHz 14KB Flash MCU | Microchip
MPN: PIC16F877-20/PT ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $11.2 | $11.20 |
| 10 | $10.08 | $100.80 |
| 100 | $8.96 | $896.00 |
| 500 | $7.84 | $3,920.00 |
| 1,000 | $6.72 | $6,720.00 |
PIC16F877-20/PT Overview
What is a PIC16F microcontroller? The PIC16F family is Microchip's mid-range 8-bit RISC microcontroller series built on a Harvard architecture. It belongs to the broader category of microcontrollers (MCU), which are single-chip computers containing a CPU, memory, and peripherals. The PIC16F family is widely adopted in industrial control, consumer electronics, and educational markets due to its compact instruction set (only 35 single-word instructions), deterministic timing, and rich peripheral integration including ADC, PWM, and serial communication interfaces.
Key features of the PIC16F877-20/PT include 33 digital I/O pins, an 8-channel 10-bit Analog-to-Digital Converter (ADC), 2 capture/compare/PWM modules, 2 additional 8-bit timers, a USART for asynchronous serial communication, and a synchronous serial port configurable as either 3-wire SPI or 2-wire I2C. It also features In-Circuit Debugging (ICD) support and self-programming capability via FLASH memory, enabling firmware updates in the field.
Architecturally, the PIC16F877 uses a RISC CPU with single-cycle instruction execution (except program branches which take two cycles). All 35 instructions are single-word, simplifying code density. The 20 MHz clock input delivers 5 MIPS of throughput, sufficient for moderate real-time control loops. The device operates from 2.0 V to 5.5 V across the industrial temperature range (-40C to +85C).
Typical applications include industrial automation controllers, sensor signal conditioning, motor control via PWM, data acquisition systems using the integrated 10-bit ADC, and embedded communication gateways leveraging USART, SPI, or I2C. It is also widely used in educational platforms and legacy product designs due to long-term stability of the PIC16F family.
When designing with this part, note that the 14 KB FLASH is suited to firmware under approximately 8K instructions. The 44-pin TQFP (PT) package requires standard SMD reflow; if through-hole assembly is required, consider the PIC16F877-20/P variant in PDIP-40. The internal oscillator is not present, so an external crystal or clock source must be provided on OSC1/OSC2.
This page synthesizes distributor pricing, drop-in alternative MPNs sharing the 44-TQFP package, and practical design notes not consolidated on the manufacturer datasheet alone.
Drop-in alternatives for PIC16F877-20/PT — 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-20/PT (same form factor and footprint) — differing in Timers, Package, Operating Temperature, Program Memory Size, Core Architecture.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F877-20I/PT
✅ Drop-In✓ In Stock
$5.1 / Unit
View Datasheet →PIC16F877-04E/PT
✅ Drop-In✓ In Stock
$3.25 / Unit
View Datasheet →PIC16F874T-20I/PT
✅ Drop-In✓ In Stock
$6.1 / Unit
View Datasheet →PIC16F874AT-I/PT
✅ Drop-In✓ In Stock
$6.95 / Unit
View Datasheet →PIC16F871-I/PT
✅ Drop-In✓ In Stock
$2.82 / Unit
View Datasheet →PIC16F77T-I/PT
✅ Drop-In✓ In Stock
$6.25 / Unit
View Datasheet →PIC16F877-20/PT Maximum Ratings & Electrical Characteristics
| Core Architecture | 8-bit PIC16 RISC |
| Program Memory Type | FLASH |
| Program Memory Size | 14 KB (8K x 14 words) |
| Data RAM | 368 bytes |
| EEPROM Data Memory | 256 bytes |
| Maximum CPU Clock | 20 MHz |
| Instruction Cycle | 200 ns |
| Operating Voltage | 2.0 V to 5.5 V |
| Digital I/O Pins | 33 |
| ADC | 8 channels, 10-bit |
| Timers | 3 (Timer0, Timer1, Timer2) |
| Capture/Compare/PWM | 2 modules |
| Serial Interfaces | USART, SPI, I2C (MSSP) |
| Package | 44-TQFP (PT), 10x10 mm |
| Operating Temperature | -40C to +85C (industrial) |
| In-Circuit Debug | Yes (ICD) |
| Instruction Set Size | 35 single-word instructions |
| RoHS Status | Compliant |
PIC16F877-20/PT Pin Configuration
| Pin 1 | MCLR/VPP — Master Clear (Reset) input / Programming voltage |
| Pin 2 | RA0/AN0 — PORTA bit 0 / Analog input channel 0 |
| Pin 3 | RA1/AN1 — PORTA bit 1 / Analog input channel 1 |
| Pin 4 | RA2/AN2 — PORTA bit 2 / Analog input channel 2 |
| Pin 5 | RA3/AN3/VREF- — PORTA bit 3 / Analog input channel 3 / ADC VREF- |
| Pin 6 | RA4/T0CKI — PORTA bit 4 / Timer0 clock input |
| Pin 7 | RA5/AN4/SS — PORTA bit 5 / Analog input channel 4 / SPI Slave Select |
| Pin 8 | RE0/RD/AN5 — PORTE bit 0 / Read control for parallel slave port / Analog input channel 5 |
| Pin 9 | RE1/WR/AN6 — PORTE bit 1 / Write control for parallel slave port / Analog input channel 6 |
| Pin 10 | RE2/CS/AN7 — PORTE bit 2 / Chip Select for parallel slave port / Analog input channel 7 |
| Pin 11 | VDD — Positive supply voltage (2.0 V to 5.5 V) |
| Pin 12 | VSS — Ground reference |
| Pin 13 | OSC1/CLKIN — Oscillator crystal input / External clock input |
| Pin 14 | OSC2/CLKOUT — Oscillator crystal output / Clock output (Fosc/4) |
| 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 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.0 V to 5.5 V) |
| 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 enable |
| Pin 37 | RB4 — PORTB bit 4 |
| Pin 38 | RB5 — PORTB bit 5 |
| Pin 39 | RB6/PGC — PORTB bit 6 / ICSP clock / ICD clock |
| Pin 40 | RB7/PGD — PORTB bit 7 / ICSP data / ICD data |
| Pin 41 | NC — Not connected (per datasheet TQFP pinout) |
| Pin 42 | NC — Not connected (per datasheet TQFP pinout) |
| Pin 43 | NC — Not connected (per datasheet TQFP pinout) |
| Pin 44 | NC — Not connected (per datasheet TQFP pinout) |
Typical Applications
PIC16F877-20/PT is suitable for 6 applications: Industrial Automation Controller, Data Acquisition System, Motor Control with PWM, Sensor Hub / IoT Edge Node, Consumer Electronics Control Board, Educational / Development Platform.
Industrial Automation Controller
The PIC16F877-20/PT is well suited for industrial automation PLC and machine controller nodes where its 33 I/O pins directly drive relays, solenoids, and indicator LEDs without external muxing. The 8-channel 10-bit ADC reads analog sensors (temperature, pressure, flow) at adequate resolution for process monitoring loops. At 20 MHz it executes 5 MIPS, sufficient for PID control loops at typical industrial update rates of 1-10 kHz. The 14 KB FLASH accommodates state-machine logic plus Modbus RTU or proprietary protocols over the integrated USART. The 256-byte EEPROM stores calibration constants and fault logs that persist across power cycles. The wide 2.0-5.5 V supply tolerates industrial 24 V bus rails after regulation. Compared with newer Cortex-M0 parts, the PIC16F877-20/PT offers proven long-term availability and a familiar toolchain (MPLAB X, XC8) that many industrial OEMs already validate.
Recommended
Data Acquisition System
In multi-channel data acquisition front-ends, the PIC16F877-20/PT sequences an 8-channel 10-bit ADC to digitize sensor arrays and buffers results in its 368-byte RAM before transmitting over USART or SPI to a host processor. The 20 MHz clock provides ~5 MIPS throughput, enough to sample 8 channels at rates up to ~30 kSPS aggregate with simple averaging. The 14 KB FLASH holds calibration tables and Modbus framing for industrial sensor transmitters. Brown-out reset and the integrated watchdog timer protect against field power glitches in remote installations. Compared with external ADC + MCU designs, integrating the ADC reduces BOM cost and PCB area. For higher channel counts, multiple PIC16F877-20/PT units can be cascaded via SPI with chip-select lines.
Recommended
Motor Control with PWM
The PIC16F877-20/PT drives DC motors, stepper motors, and small BLDC motors using its two Capture/Compare/PWM (CCP) modules. The PWM outputs can control MOSFET H-bridges or gate drivers at switching frequencies up to ~20 kHz while the CPU continues executing the control loop. Quadrature encoder inputs on Timer0/Timer1 provide closed-loop position feedback. The 8-channel ADC reads motor current via shunt resistors for torque limiting. With 14 KB FLASH and 5 MIPS, this MCU handles trapezoidal commutation for small 3-phase BLDC motors at moderate speeds. The PIC16F877-20/PT is widely used in appliance motor controllers, fan speed regulators, and small servo drives.
Recommended
Sensor Hub / IoT Edge Node
The PIC16F877-20/PT acts as an edge sensor hub aggregating readings from I2C or SPI sensors (temperature, humidity, accelerometers) and forwarding aggregated data over USART to a Wi-Fi or cellular module. Its MSSP port handles either I2C or SPI sensor interfacing. The 368-byte RAM buffers sensor frames before transmission. Operating from 2.0 V to 5.5 V, the device runs directly from a 3.3 V regulator commonly used in battery-powered sensor nodes. EEPROM stores sensor calibration coefficients and node identity. Compared with 32-bit Cortex-M0+ alternatives, the PIC16F877-20/PT consumes less active power at moderate throughput and benefits from a mature, royalty-free toolchain.
Recommended
Consumer Electronics Control Board
In consumer appliances (washing machines, microwave ovens, HVAC thermostats), the PIC16F877-20/PT provides all essential control functions in a single chip: keypad scanning on PORTB, LCD driving via I/O expansion, relay driving via PORTD, and sensor readout via the 10-bit ADC. Its 14 KB FLASH accommodates menu-driven user interfaces and safety state machines. The 256-byte EEPROM retains user preferences (mode, timer settings) across power cycles. The wide operating voltage range simplifies power supply design. The 44-TQFP package fits compact consumer appliance PCBs. Compared with discrete logic implementations, this MCU reduces component count by 60-80%.
Recommended
Educational / Development Platform
The PIC16F877-20/PT is a staple of university microcontroller courses and embedded systems training due to its simple architecture, 35-instruction RISC ISA, and abundant educational materials. The 44-TQFP package is breadboard-compatible via breakout boards, and the ICD interface allows real-time debugging with MPLAB X. Students learn ADC sampling, PWM generation, UART communication, and interrupt-driven programming on a single device. The PIC16F877-20/PT's longevity in production means teaching materials stay current across multiple student cohorts. The XC8 compiler's free tier supports educational use without licensing fees.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F877-20/PT — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F877-20I/PT | PIC16F877-04E/PT | PIC16F874T-20I/PT | PIC16F874AT-I/PT | PIC16F871-I/PT | PIC16F77T-I/PT |
|---|---|---|---|---|---|---|---|
| Package | 44-TQFP (PT), 10x10 mm | 44-TQFP (PT) - same | 44-TQFP (PT) - same | 44-TQFP (PT) - same | 44-TQFP (PT) - same | 44-TQFP (PT) - same | 44-TQFP (PT) - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| FLASH Program Memory | 14 KB (8K x 14) | 14 KB | 14 KB | 7 KB | 7 KB | 7 KB | 7 KB |
| Data RAM | 368 bytes | 368 bytes | 368 bytes | 192 bytes | 192 bytes | 128 bytes | 368 bytes |
| Maximum Clock Speed | 20 MHz | 20 MHz | 4 MHz | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| ADC Channels | 8 x 10-bit | 8 x 10-bit | 8 x 10-bit | 8 x 10-bit | 8 x 10-bit (enhanced) | 8 x 10-bit | 8 x 10-bit |
| Operating Temperature | -40C to +85C | -40C to +85C | -40C to +125C (extended) | -40C to +85C | -40C to +85C | -40C to +85C | -40C to +85C |
Key Differentiators
- Identical die, industrial temp grade, same 44-TQFP package (vs PIC16F877-20I/PT)
- Same 44-TQFP package, 50% less FLASH (vs PIC16F874T-20I/PT)
- Modern successor with internal oscillator and enhanced ADC (vs PIC16F887-I/PT (recommended replacement))
Design Notes
Place a 100 nF decoupling capacitor as close as possible to each VDD pin (pins 11 and 32 on the 44-TQFP package), with a bulk 10 uF tantalum or ceramic at the supply input. The PIC16F877-20/PT draws up to ~20 mA active at 20 MHz / 5 V, so a low-dropout regulator with at least 50 mA headroom is recommended for noise-sensitive ADC applications. Tie the AVDD reference pin to the same clean 5 V rail or use a dedicated LDO for ADC VREF+ to avoid digital switching noise coupling into analog measurements.
The MCLR pin (pin 1) must be pulled high through a 10 kohm resistor to VDD for normal operation; leaving it floating causes intermittent resets. For ICSP programming, MCLR is driven to ~13 V during programming - ensure the MCLR pull-up does not exceed the programming voltage regulator's current limit. A diode (1N4148) from MCLR to VDD is recommended to prevent programming voltage back-feeding into the supply rail. Brown-out reset configuration bits must be enabled for reliable industrial operation.
Route the 20 MHz oscillator traces (OSC1/OSC2) short and keep them away from analog input traces and PWM switching lines. The 44-TQFP package has pins 41-44 as no-connect; use these as ground-pour stitching vias to improve thermal dissipation and EMI. Place the crystal within 5 mm of the OSC1/OSC2 pins with load capacitors grounded to the same ground plane as the MCU VSS pins. Avoid running digital signals under the analog input pins to minimize crosstalk into the 10-bit ADC.
Compliance Information
RoHS and REACH compliant per Microchip product page. Not AEC-Q100 qualified (industrial grade MCU, not automotive). Lead-free and halogen-free per Microchip material declaration.