PIC16F887-I/P - 8-Bit 20MHz 14KB Flash MCU 40-PDIP | Microchip
MPN: PIC16F887-I/P β Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $2.85 | $2.85 |
| 10 | $2.61 | $26.10 |
| 100 | $2.34 | $234.00 |
| 500 | $2.1 | $1,050.00 |
| 1,000 | $1.88 | $1,880.00 |
PIC16F887-I/P Overview
A microcontroller (MCU) is a single-chip computer containing a CPU, program and data memory, peripherals, and I/O. Within the broader taxonomy it sits as: PIC16F887 -> PIC16 enhanced mid-range family -> 8-bit PIC microcontroller -> microcontroller -> embedded computing IC -> semiconductor. The PIC16F887 belongs to the PIC16F882/883/884/886/887 pin-compatible family and is the direct FLASH-based successor to the legacy PIC16F877A, sharing the same 40-pin DIP footprint for drop-in upgrades of older designs.
Key features include self-programmability, in-circuit debugger (ICD) support, 35 single-word instructions, an operating voltage range of 2.0 V to 5.5 V, and a nanoWatt power-managed sleep mode that draws microamp-level current for battery-aware designs. The 10-bit ADC with 14 input channels supports sensor and instrumentation sampling directly, while the ECCP module plus USART simplify motor control and serial communication. Twenty-five MHz maximum internal oscillator operation allows cost-effective designs without external crystals.
The PIC16F887 uses a Harvard RISC architecture with a 14-bit instruction word and 8-bit data path. A 2-stage pipeline overlaps fetch and execute to sustain single-cycle instruction throughput at 20 MHz (50 ns instruction cycle), which is sufficient for control loops, slow communication stacks, and human-machine interface tasks. The device supports in-circuit serial programming (ICSP) and In-Circuit Debugger (ICD) via two pins, allowing firmware updates and breakpoints without removing the MCU from the board. The 36 general-purpose I/O pins drive most LED, key, and small-relay loads directly.
Typical applications include industrial control panels, HVAC thermostat controllers, sensor interface boards, low-cost data loggers, and consumer appliance controls. Compared with 32-bit ARM Cortex-M0+ alternatives, the PIC16F887 trades raw throughput for deterministic 8-bit behavior, simpler toolchain (MPLAB X + XC8), and a wide installed base of legacy code. The 40-pin PDIP package is also favored for educational and breadboard prototyping because of its socket-friendly through-hole leads.
When designing with this part, place a 100 nF decoupling capacitor close to VDD and a bulk capacitor on the analog AVCC rail. Use the internal oscillator to reduce BOM when frequency tolerance of +/-2% is acceptable; switch to an external crystal when UART baud-rate accuracy is critical. The -I suffix denotes the industrial temperature grade (-40C to +85C) suitable for most indoor industrial environments.
This page synthesizes distributor pricing, drop-in same-package alternatives (including PIC16F884, PIC16F886, PIC18F family migration paths), and practical 40-pin PDIP design notes not consolidated on a single manufacturer datasheet page.
Drop-in alternatives for PIC16F887-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 PIC16F887-I/P (same form factor and footprint) β differing in Package, Core Architecture, Watchdog Timer, Timers, Operating Temperature.
Quick Comparison Tool β Select alternative parts for side-by-side comparison:
PIC16F886-I/P
β Drop-Inπ Reference alternative (not in catalog)
PIC16F884-I/P
β Drop-Inβ In Stock
$2.62 / Unit
View Datasheet βPIC16F883-I/P
β Drop-Inπ Reference alternative (not in catalog)
PIC16F882-I/P
β Drop-Inπ Reference alternative (not in catalog)
PIC16F877A-I/P
β Drop-Inπ Reference alternative (not in catalog)
PIC16F887-E/P
β Drop-Inβ In Stock
$3.4 / Unit
View Datasheet βPIC18F4520-I/P
β Drop-Inπ Reference alternative (not in catalog)
PIC16F887-I/P Maximum Ratings & Electrical Characteristics
| Core Architecture | PIC16 enhanced mid-range 8-bit RISC |
| CPU Speed (Max) | 20 MHz (50 ns instruction cycle) |
| Program Flash Memory | 14 KB (8K x 14 words) |
| Data RAM | 368 bytes |
| Data EEPROM | 256 bytes |
| I/O Pins | 36 |
| ADC | 14 channels x 10-bit |
| Comparators | 2 |
| CCP / ECCP Modules | 1 CCP + 1 ECCP |
| Communication Peripherals | 1x USART, 1x MSSP (SPI / I2C) |
| Operating Voltage | 2.0 V to 5.5 V |
| Operating Temperature (I grade) | -40C to +85C |
| Instruction Set | 35 single-word instructions |
| Power-Saving Modes | nanoWatt (multiple sleep modes, low-power ADC) |
| Package | 40-pin PDIP (DIP-40) through-hole |
| In-Circuit Programming | ICSP + ICD |
| Internal Oscillator | 31 kHz - 8 MHz selectable, PLL to 32 MHz |
| RoHS Status | Compliant |
| Mounting Type | Through-Hole |
PIC16F887-I/P Pin Configuration
| Pin 1 | MCLR/VPP/RE3 β Master Clear (active-low reset) / Programming voltage / Digital input RE3 |
| 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/VREF- β PORTA bit 2 / Analog input channel 2 / ADC negative reference |
| Pin 5 | RA3/AN3/VREF+ β PORTA bit 3 / Analog input channel 3 / ADC positive reference |
| Pin 6 | RA4/T0CKI/C1OUT β PORTA bit 4 / Timer0 clock input / Comparator 1 output |
| Pin 7 | RA5/AN4/SS/C2OUT β PORTA bit 5 / Analog input channel 4 / SPI Slave Select / Comparator 2 output |
| 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/CLKI/RA7 β Crystal oscillator input / External clock input / PORTA bit 7 |
| Pin 14 | OSC2/CLKO/RA6 β Crystal oscillator output / Clock output / PORTA bit 6 |
| 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 / Enhanced CCP2 output |
| Pin 17 | RC2/P1A/CCP1 β PORTC bit 2 / PWM output P1A / CCP1 I/O |
| Pin 18 | RC3/SCK/SCL β PORTC bit 3 / SPI clock / I2C clock |
| Pin 19 | RD0 β PORTD bit 0 |
| Pin 20 | RD1 β PORTD bit 1 |
| Pin 21 | RD2 β PORTD bit 2 |
| Pin 22 | RD3 β PORTD 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 asynchronous transmit / USART synchronous clock |
| Pin 26 | RC7/RX/DT β PORTC bit 7 / USART asynchronous receive / USART synchronous data |
| Pin 27 | RD4 β PORTD bit 4 |
| Pin 28 | RD5/P1B β PORTD bit 5 / PWM output P1B |
| Pin 29 | RD6/P1C β PORTD bit 6 / PWM output P1C |
| Pin 30 | RD7/P1D β PORTD bit 7 / PWM output P1D |
| Pin 31 | VSS β Ground reference |
| Pin 32 | VDD β Positive supply voltage (2.0 V to 5.5 V) |
| Pin 33 | RB0/INT/AN12 β PORTB bit 0 / External interrupt / Analog input channel 12 |
| Pin 34 | RB1/AN10 β PORTB bit 1 / Analog input channel 10 |
| Pin 35 | RB2/AN8 β PORTB bit 2 / Analog input channel 8 |
| Pin 36 | RB3/AN9/PGM β PORTB bit 3 / Analog input channel 9 / LVP programming |
| Pin 37 | RB4/AN11 β PORTB bit 4 / Analog input channel 11 |
| Pin 38 | RB5/AN13 β PORTB bit 5 / Analog input channel 13 |
| Pin 39 | RB6/ICSPCLK β PORTB bit 6 / In-Circuit Serial Programming clock |
| Pin 40 | RB7/ICSPDAT β PORTB bit 7 / In-Circuit Serial Programming data |
Typical Applications
PIC16F887-I/P is suitable for 6 applications: Industrial Control Panels, HVAC Thermostat Controllers, Sensor Interface Boards, Battery-Powered Data Loggers, Consumer Appliance Controls, Educational Prototyping Platforms.
Industrial Control Panels
The PIC16F887-I/P fits industrial control panels because its 36 GPIO pins directly drive indicator LEDs, push-button inputs, keypads, and small relays without external drivers. Its 14-channel 10-bit ADC reads 4-20 mA loop and 0-10 V sensor inputs simultaneously, while the 2.0-5.5 V range accepts 24 V industrial rails after a simple resistive divider. The -40C to +85C industrial temperature grade covers indoor factory and panel-shop environments, and the nanoWatt sleep mode holds the panel in microamp standby between operator interactions, extending battery-backed RTC life. ECCP can generate PWM for proportional valve control or motor speed command. Compared with newer Cortex-M0+ parts, the F887's deterministic 8-bit timing simplifies IEC 61131-3 PLC ladder logic translation and existing field technician training.
Recommended
HVAC Thermostat Controllers
The PIC16F887-I/P is well-suited for HVAC thermostat controllers because its 14 ADC channels read room temperature, setpoint, humidity, and supply-air sensors with 10-bit resolution, while the 2 comparators provide zero-crossing detection for triac-fired heater control without external op-amps. The USART drives a serial-interface LCD or Wi-Fi module, and the ECCP generates 10-bit PWM to modulate damper actuators and variable-speed fan drives. The nanoWatt sleep mode with WDT wake-up keeps idle thermostat draw below 100 uA on common-wire (C-wire) installations. Wide 2.0-5.5 V supply accepts rectified 24 VAC thermostats after regulation. Compared with Wi-Fi-first smart thermostats, a PIC16F887-based controller runs deterministic bare-metal firmware with no OS overhead, improving reliability in long-life residential HVAC installations.
Recommended
Sensor Interface Boards
The PIC16F887-I/P serves as a multi-sensor interface board controller because its 14-channel 10-bit ADC samples multiple analog sensors (temperature, pressure, light, strain) simultaneously without external multiplexers. The MSSP port drives I2C sensor arrays (MEMS accelerometers, environmental sensors) at up to 3.4 MHz high-speed mode, while the USART bridges to RS-485 transceivers for industrial Modbus RTU networks. The 256-byte EEPROM stores calibration coefficients and sensor IDs persistently across power cycles, and the ICSP+ICD pins allow firmware updates on deployed boards via a 2-wire header. The 20 MHz CPU sustains 50 ns instruction cycles to handle polling loops on multiple sensor channels in real time. Compared with 32-bit alternatives, the F887's fixed-latency interrupt response simplifies deterministic safety-critical sensor loops.
Recommended
Battery-Powered Data Loggers
The PIC16F887-I/P fits battery-powered data loggers because its nanoWatt sleep modes draw under 1 uA between ADC samples, while the 256-byte EEPROM and 14 KB Flash provide months of local timestamp storage before offload. The internal 31 kHz - 8 MHz oscillator eliminates external crystal power draw, and the WDT wakes the MCU at programmable intervals to take periodic measurements. Operating down to 2.0 V enables 2x AA alkaline or NiMH battery operation for the full discharge curve, maximizing energy harvested from each cell. Compared with 32-bit Cortex-M0+ MCUs, the F887's 50 ns instruction cycle at 20 MHz is overkill for slow sensor sampling, but its 8-bit core consumes roughly 1/3 the active current of equivalent ARM parts, a critical factor in multi-year remote deployments.
Recommended
Consumer Appliance Controls
The PIC16F887-I/P is widely used in consumer appliance controls (washing machines, dishwashers, microwave ovens, rice cookers) because its 36 GPIO pins drive LED segment displays, keypads, buzzer indicators, and triac-fired heater/relay loads directly. The ECCP module generates precise 10-bit PWM for motor speed control in universal motors and brushless DC fans, while the 2 comparators detect zero-crossing for synchronous triac triggering, eliminating inductive switching noise. The MSSP connects to I2C-based user-interface boards and capacitive touch controllers. Industrial -40C to +85C operation covers kitchen and laundry environments, and ICSP programming allows factory line firmware updates via the same 2-pin header used in production. Compared with capacitive-touch-screen SoCs, the F887's 8-bit simplicity keeps appliance BOM cost under $3 in volume.
Recommended
Educational Prototyping Platforms
The PIC16F887-I/P is a popular choice for university microcontroller courses and breadboard-based prototyping because its 40-pin PDIP through-hole form factor drops directly into standard solderless breadboards and 40-pin DIP sockets. The 36 GPIO pins are accessible on standard 0.1-inch headers, simplifying wiring of LEDs, switches, and 7-segment displays for student labs. The free MPLAB X IDE and XC8 compiler lower the cost of entry for engineering programs, and ICSP+ICD allows instructors to debug student code in real time via a PICkit 4 programmer. The 35-instruction RISC core simplifies teaching assembly fundamentals before students move to 32-bit parts. Compared with Arduino UNO (ATmega328P), the PIC16F887-I/P exposes more peripherals (ECCP, dual comparators, 14 ADC) at a similar price point, making it ideal for second-semester embedded systems curricula.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F887-I/P β comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F886-I/P | PIC16F884-I/P | PIC16F883-I/P | PIC16F882-I/P | PIC16F877A-I/P | PIC16F887-E/P | PIC18F4520-I/P |
|---|---|---|---|---|---|---|---|---|
| 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 | 40-pin PDIP - same | 40-pin PDIP - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Program Flash | 14 KB | 7 KB | 7 KB | 7 KB | 3.5 KB | 14 KB | 14 KB | 32 KB |
| Data RAM | 368 bytes | 368 bytes | 256 bytes | 256 bytes | 128 bytes | 368 bytes | 368 bytes | 1536 bytes |
| EEPROM | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 128 bytes | 256 bytes | 256 bytes | 256 bytes |
| ADC Channels | 14 x 10-bit | 14 x 10-bit | 14 x 10-bit | 12 x 10-bit | 11 x 10-bit | 8 x 10-bit | 14 x 10-bit | 13 x 10-bit |
| CPU Speed | 20 MHz (200 ns) | 20 MHz (200 ns) | 20 MHz (200 ns) | 20 MHz (200 ns) | 20 MHz (200 ns) | 20 MHz (200 ns) | 20 MHz (200 ns) | 40 MHz (100 ns) |
| 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 | 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 |
| Operating Temperature | -40C to +85C (Industrial) | -40C to +85C | -40C to +85C | -40C to +85C | -40C to +85C | -40C to +85C | -40C to +125C (Extended) | -40C to +85C |
| Core Architecture | PIC16 enhanced mid-range 8-bit | PIC16 enhanced mid-range 8-bit | PIC16 enhanced mid-range 8-bit | PIC16 enhanced mid-range 8-bit | PIC16 enhanced mid-range 8-bit | PIC16 enhanced mid-range 8-bit | PIC16 enhanced mid-range 8-bit | PIC18 enhanced 8-bit |
Key Differentiators
- Maximum memory in 40-pin PDIP PIC16 enhanced family (vs PIC16F886-I/P)
- Most ADC channels in 40-pin PDIP PIC16F8xx family (vs PIC16F877A-I/P)
- NanoWatt power-managed sleep modes (vs PIC16F877A-I/P)
- Enhanced CCP module with PWM bridge control (vs PIC16F877A-I/P)
Design Notes
The PIC16F887-I/P requires two decoupling capacitors: a 100 nF ceramic (X7R) placed within 5 mm of each VDD/VSS pair (pins 11/12 and 31/32), plus a 10 uF bulk capacitor on the AVCC rail if the ADC is used. According to the datasheet, AVCC must be tied to VDD when the ADC is unused. Place a ferrite bead between VDD and AVCC for noisy 5 V supplies to prevent ADC reference corruption. The nanoWatt sleep modes drop IDD to <1 uA at 3 V but require the internal oscillator to be reconfigured on wake-up, adding 4 oscillator cycles latency.
Reserve pins RB6 (ICSPCLK) and RB7 (ICSPDAT) for in-circuit serial programming and ICD - do not populate pull-ups or LEDs directly on these pins. The MCLR pin (pin 1) requires a 10 kohm pull-up to VDD for normal operation; if MCLR is disabled in CONFIG, the internal weak pull-up replaces the external resistor. For high-voltage ICSP, route VPP through a 10 kohm resistor to avoid damaging the MCLR pin during accidental shorts. Use a 6-pin header (5V, GND, ICSPCLK, ICSPDAT, MCLR, NC) for production programming access.
The internal 31 kHz - 8 MHz oscillator is factory-trimmed to within +/-2% over voltage and temperature for low-cost designs. For UART communication requiring accurate baud rates, use a 20 MHz external crystal with 22 pF load capacitors on OSC1/OSC2. The 4x PLL can synthesize up to 32 MHz from an 8 MHz internal source but adds 1 mA active current. According to the datasheet, switching between internal and external oscillators mid-run requires OSCCON register reconfiguration and a 4-cycle oscillator-stabilization delay before code continues.
Do not leave the ADC analog input channels floating - tie unused ANx pins to either VDD or VSS to prevent shoot-through current in the input multiplexer. When migrating code from PIC16F877A, remember that F887 has additional ADC channels (AN8-AN13 on PORTB) and an Enhanced CCP module; CONFIG bits at 0x2007 must be reprogrammed to match the F887 memory map. Avoid driving MCLR below VIL=0.15*VDD during ICSP or the part may enter high-voltage programming mode unexpectedly. Brown-out Reset (BOR) should always be enabled in CONFIG2 to prevent Flash corruption at low supply voltages below 2.0 V.
Compliance Information
RoHS and REACH compliant per Microchip product page. Not AEC-Q100 qualified - for automotive designs use PIC16F887-I/P only in non-safety-critical subsystems or select AEC-Q100 qualified PIC16F1xxx variants. Lead-free and halogen-free per Microchip environmental compliance documentation.