PIC16F871-I/P - 8-Bit 20MHz 3.5KB Flash MCU 40-PDIP | Microchip
MPN: PIC16F871-I/P β Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $5.1 | $5.10 |
| 10 | $4.6 | $46.00 |
| 100 | $4.1 | $410.00 |
| 500 | $3.7 | $1,850.00 |
| 1,000 | $3.3 | $3,300.00 |
PIC16F871-I/P Overview
A microcontroller (MCU) is a single-chip computer that contains a processor core, memory, and programmable input/output peripherals. Within the broader taxonomy, the PIC16F871 is a member of the 8-bit MCU class (below 32-bit Cortex-M microcontrollers), specifically the PIC16F mid-range family introduced by Microchip Technology as an evolution of the PIC16C5X, PIC12CXXX, and PIC16C7X lines. It belongs to the integrated circuit (semiconductor) hierarchy and serves as a power management/control subsystem in embedded designs.
Key differentiating features include 8 channels of 10-bit Analog-to-Digital conversion, two additional timers (extending the standard timer count to three), a Capture/Compare/PWM (CCP) module, and a Universal Synchronous/Asynchronous Receiver Transmitter (USART). The 33 I/O pins are organized into five ports (RA, RB, RC, RD, RE) and can source/sink up to 25 mA per pin, enabling direct LED drive without external buffers. In-circuit debugging is supported via the ICD interface, while in-application self-programming allows field firmware updates.
The PIC16F871 uses a Harvard bus architecture with separate program and data paths, allowing instruction fetch and operand read in a single cycle. Built around a CMOS flash process, it provides typical power consumption below 2 mA at 5 V and 20 MHz, with sleep current in the microampere range, making it suitable for both line-powered industrial equipment and battery-influenced designs. The USART supports RS-232/RS-485 communication, while the CCP module enables precision timing, PWM motor control, and event capture.
Typical applications include industrial control logic boards, white-goods and appliance control, sensor signal conditioning, simple human-machine interfaces, motor-driver control with PWM, and legacy PIC16 system upgrades. The 40-pin PDIP package makes it friendly for hobbyists, education, and through-hole prototyping, while still offering industrial-grade (-40C to +85C) temperature operation under the "-I" suffix designation.
When designing with this part, pay attention to the 40-pin DIP footprint versus the 28-pin PIC16F870/871 variants - the 40-pin device exposes PORTE (RE0/RE1/RE2) and additional PORTD pins. Ensure the MCLR pin is properly pulled high and that the oscillator configuration (RC/HS/XT/LP) matches the chosen resonator. The "I" suffix indicates the industrial temperature grade of -40C to +85C, so verify your application thermal envelope.
This page synthesizes distributor pricing for PIC16F871-I/P from DigiKey, Mouser, and Octopart alongside drop-in alternatives, application context, and design notes that are not aggregated in the manufacturer datasheet alone. Engineers can use the comparison and FAQ sections to evaluate this part against newer PIC18 and ATSAM alternatives.
Drop-in alternatives for PIC16F871-I/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 PIC16F871-I/P (same form factor and footprint) β differing in Mounting Type, Package, Core Architecture, In-Circuit Debug, RoHS Status.
Quick Comparison Tool β Select alternative parts for side-by-side comparison:
PIC16F870-I/P
β Drop-In β οΈ εζ°εΎ ιͺθ―π Reference alternative (not in catalog)
PIC16F871-I/L
β Drop-Inβ In Stock
$2.75 / Unit
View Datasheet βPIC16F871-E/P
β Drop-Inπ Reference alternative (not in catalog)
PIC16F871-I/P Maximum Ratings & Electrical Characteristics
| Core | PIC16 8-bit RISC |
| Instruction Set | 35 single-word instructions |
| Max CPU Speed | 20 MHz (200 ns instruction cycle) |
| Program Memory (Flash) | 3.5 KB (2K x 14) |
| Data SRAM | 128 bytes |
| Data EEPROM | 64 bytes |
| I/O Pins | 33 |
| ADC | 8 channels x 10-bit |
| Timers | 3 (Timer0, Timer1, Timer2) |
| CCP Modules | 1 (Capture/Compare/PWM) |
| Serial | USART (AUSART) |
| In-Circuit Debug | ICD supported |
| Self-Programming | Yes (in-application) |
| Operating Voltage | 2.0 V to 5.5 V |
| Temperature Grade | Industrial (-40C to +85C) |
| Package | 40-pin PDIP |
| Mounting Type | Through-Hole (DIP) |
| RoHS Status | Compliant |
PIC16F871-I/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 / VREF- |
| Pin 5 | RA3/AN3/VREF+ β PORTA bit 3 / Analog input 3 / 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 | OSC1/CLKIN β Oscillator input / external clock |
| Pin 9 | OSC2/CLKOUT β Oscillator output |
| Pin 10 | RC0/T1OSO/T1CKI β PORTC bit 0 / Timer1 oscillator output |
| Pin 11 | RC1/T1OSI/CCP2 β PORTC bit 1 / Timer1 oscillator input / CCP2 |
| Pin 12 | RC2/CCP1 β PORTC bit 2 / Capture/Compare/PWM 1 |
| Pin 13 | RC3/SCK/SCL β PORTC bit 3 / SPI clock / I2C clock |
| Pin 14 | RC4/SDI/SDA β PORTC bit 4 / SPI data in / I2C data |
| Pin 15 | RC5/SDO β PORTC bit 5 / SPI data out |
| Pin 16 | RC6/TX/CK β PORTC bit 6 / USART TX / clock |
| Pin 17 | RC7/RX/DT β PORTC bit 7 / USART RX / data |
| Pin 18 | VSS β Ground reference |
| Pin 19 | VDD β Positive supply voltage (2.0 V to 5.5 V) |
| Pin 20 | RB0/INT β PORTB bit 0 / external interrupt |
| Pin 21 | RB1 β PORTB bit 1 |
| Pin 22 | RB2 β PORTB bit 2 |
| Pin 23 | RB3/PGM β PORTB bit 3 / low-voltage programming |
| Pin 24 | RB4 β PORTB bit 4 |
| Pin 25 | RB5 β PORTB bit 5 |
| Pin 26 | RB6/PGC β PORTB bit 6 / ICSP clock |
| Pin 27 | RB7/PGD β PORTB bit 7 / ICSP data |
| Pin 28 | VSS β Ground reference (digital) |
| Pin 29 | VDD β Positive supply voltage |
| Pin 30 | RD0 β PORTD bit 0 |
| Pin 31 | RD1 β PORTD bit 1 |
| Pin 32 | RD2 β PORTD bit 2 |
| Pin 33 | RD3 β PORTD bit 3 |
| Pin 34 | RD4 β PORTD bit 4 |
| Pin 35 | RD5 β PORTD bit 5 |
| Pin 36 | RD6 β PORTD bit 6 |
| Pin 37 | RD7 β PORTD bit 7 |
| Pin 38 | VSS β Ground reference (digital) |
| Pin 39 | VDD β Positive supply voltage |
| Pin 40 | RE0/RD β PORTE bit 0 / parallel slave port read |
| Pin 41 | RE1/WR β PORTE bit 1 / parallel slave port write |
| Pin 42 | RE2/CS β PORTE bit 2 / parallel slave port chip select |
| Pin 43 | VSS β Ground reference (PORTE) [via internal bonding - not externally pinned on 40-PDIP] |
| Pin 44 | NC β Not connected on 40-pin PDIP (44-pin PLCC package has these extra PORTE and ground pins) |
Typical Applications
PIC16F871-I/P is suitable for 6 applications: Industrial Control Logic Boards, White-Goods / Appliance Control, Sensor Signal Conditioning Hubs, Motor Driver PWM Control, Legacy PIC16 System Upgrades, Education and Prototyping Platforms.
Industrial Control Logic Boards
The PIC16F871-I/P is a strong fit for industrial control logic boards thanks to its 33 I/O pins (5 ports), 8-channel 10-bit ADC, and USART, which together can monitor sensors, drive relays, and communicate with master PLCs. The 3.5 KB FLASH and 128 bytes of RAM host state-machine logic, while the industrial -40C to +85C temperature grade tolerates factory-floor thermal envelopes. Place the MCU near connector interfaces, use one ADC channel per analog sensor, and route the USART lines through a protection TVS to RS-485 transceivers.
Recommended
White-Goods / Appliance Control
White-goods and household appliance controllers benefit from the PIC16F871-I/P's CCP module for PWM-driven motor or heater control, combined with the 10-bit ADC for thermistor or pressure-sensor feedback. The 35-instruction RISC core allows tight control loops, and the 64-byte EEPROM stores user settings. Use the PWM output to drive a TRIAC or IGBT via an opto-isolated gate driver, with the MCLR pin held high by a 10k pull-up for clean resets during brown-out events.
Recommended
Sensor Signal Conditioning Hubs
The PIC16F871-I/P acts as a sensor-conditioning hub by reading multiple analog sensors through its 8-channel 10-bit ADC, applying on-chip math, and relaying results via USART. The 128 bytes of SRAM support 16-bit averaging buffers, while the in-circuit debugger via ICD shortens development cycles. Place 100nF ceramic bypass capacitors within 5 mm of VDD/AVDD/VSS, and route analog inputs (AN0-AN7) away from digital switching lines to preserve 10-bit accuracy.
Recommended
Motor Driver PWM Control
The PIC16F871-I/P drives brushed DC motors and small steppers through the Capture/Compare/PWM (CCP) module, generating up to 10-bit resolution PWM at the system clock rate. The 33 I/O pins provide direction and enable control, while the USART feeds back RPM data from hall sensors. Use a discrete H-bridge (or external driver IC) with the PWM output fed through a gate resistor; current sensing can be routed through one ADC channel for closed-loop torque control.
Recommended
Legacy PIC16 System Upgrades
The PIC16F871-I/P is widely used to upgrade legacy PIC16C5X, PIC12CXXX, and PIC16C7X designs where pinout compatibility is desired for a minimal PCB rework. The 35-instruction RISC core simplifies code porting, and the FLASH memory allows field firmware updates through the self-programming bootloader. For systems migrating from 18- or 28-pin PICs, the 40-pin PDIP offers more I/O and ADC channels without redesigning the socket.
Recommended
Education and Prototyping Platforms
The PIC16F871-I/P is a popular choice in university embedded courses and hobbyist prototyping because of its through-hole 40-pin PDIP form factor, breadboard-friendly footprint, and the freely available MPLAB X IDE toolchain. The 35-instruction RISC core teaches assembly fundamentals, while in-circuit debugging via ICD accelerates lab troubleshooting. Pair the MCU with a simple character LCD and a few buttons for an introductory development board that maps directly to datasheet example code.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F871-I/P β comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F870-I/P | PIC16F871-I/L | PIC16F871-E/P |
|---|---|---|---|---|
| Package | 40-Pin PDIP | 40-Pin PDIP - same | 44-Pin PLCC (NOT a true drop-in) | 40-Pin PDIP - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| FLASH Memory | 3.5 KB (2K x 14) | 2 KB (-43%) | 3.5 KB (same) | 3.5 KB (same) |
| SRAM | 128 bytes | 64 bytes (-50%) | 128 bytes (same) | 128 bytes (same) |
| EEPROM | 64 bytes | 64 bytes (same) | 64 bytes (same) | 64 bytes (same) |
| I/O Pins | 33 | 33 (same) | 33 + 3 PLCC-only | 33 (same) |
| ADC | 8 x 10-bit | 8 x 10-bit (same) | 8 x 10-bit (same) | 8 x 10-bit (same) |
| Temperature Grade | Industrial -40C to +85C | Industrial -40C to +85C | Industrial -40C to +85C | Extended -40C to +125C |
| Operating Voltage | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 2.0 V to 5.5 V |
| Max CPU Speed | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
Key Differentiators
- Largest FLASH memory in 40-pin PIC16F870/871 family (vs PIC16F870-I/P)
- Industrial temperature grade optimized for cost-sensitive designs (vs PIC16F871-E/P)
- Same die as PIC16F871-I/L but in breadboard-friendly 40-PDIP package (vs PIC16F871-I/L)
Design Notes
Estimated: at VDD=5V, 20 MHz operation, the PIC16F871-I/P typically draws about 5-10 mA active. Place a 100 nF decoupling capacitor within 5 mm of each VDD pin (pins 11, 21, 32) and a 10 uF bulk capacitor near the device to handle inrush. The MCLR pin must be pulled high through a 10 k resistor and may include a 100 nF cap for noise immunity; leave MCLR/VPP accessible for in-circuit programming.
Estimated: route analog inputs (RA0-RA5) and digital I/O on separate sides of the MCU when possible. The 8-channel ADC shares pins with PORTA, so digital noise on RA0-RA5 can couple into the ADC - adding a 100 nF cap on VREF+ and short traces for analog signals improves 10-bit conversion stability. Keep clock traces (OSC1/OSC2) short and guard the crystal with a ground ring to reduce EMI.
Do not confuse PIC16F870 with PIC16F871 - the 870 has only 2 KB FLASH and 64 bytes RAM, and firmware designed for the 871 may exceed the 870's memory map. Verify your CONFIG bits (oscillator, watchdog, low-voltage programming, brown-out voltage) match your application before code generation. For in-circuit debug via ICD, leave RB6 (PGC) and RB7 (PGD) free of external pull-ups so the debugger can drive them; otherwise, debugging will fail intermittently.
The USART pins (RC6/TX, RC7/RX) operate at CMOS logic levels - for RS-232 communication, use a MAX232 or equivalent level translator. For RS-485, use an MAX485 or similar transceiver; remember to bias the bus with a fail-safe resistor network when no driver is active. The CCP1 PWM output on RC2 toggles up to the system clock rate - route PWM traces away from analog inputs to avoid switching-noise coupling into ADC readings.
Compliance Information
RoHS compliant per Microchip product page. Not AEC-Q100 qualified - automotive applications should consider PIC16F871-E/P or PIC18F family with automotive qualification. Lead-free terminal finish with matte-tin plating compatible with lead-free wave soldering.