PIC16F873-04/SP - 8-Bit 4MHz MCU 7KB Flash 28-SPDIP | Microchip
MPN: PIC16F873-04/SP ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $8.1 | $8.10 |
| 10 | $7.3 | $73.00 |
| 25 | $6.92 | $173.00 |
| 100 | $6.18 | $618.00 |
| 500 | $5.74 | $2,870.00 |
PIC16F873-04/SP Overview
A microcontroller (MCU) is a single-chip computer that integrates a CPU core, program memory, working RAM, non-volatile data storage, and peripheral interfaces such as ADC, USART, I/O ports, timers, and capture/compare/PWM modules. The PIC16F873 belongs to Microchip's mid-range 14-bit instruction-word PIC architecture, sitting in the device hierarchy of 8-bit MCU -> PIC16 family -> PIC16F87x sub-family -> peripheral-rich general-purpose MCUs.
Key features include five 10-bit Analog-to-Digital Converter (ADC) input channels (actually 8 channels on 28-pin variants), a USART/SCI serial port, MSSP for SPI and I2C, two 8-bit timers plus one 16-bit timer with Capture/Compare/PWM, a 14-bit wide instruction set, and 22 digital I/O pins. The device operates from 2.0 V to 5.5 V, supports ICD (In-Circuit Debugger) via two pins, and includes a watchdog timer with on-chip RC oscillator for reliable operation without external supervision.
The architecture is built on Microchip's enhanced Harvard RISC design with separate program and data buses, enabling most instructions to execute in a single instruction cycle. On-chip Flash allows in-circuit serial programming (ICSP) for fast firmware iteration without UV erasure, a major advantage over the older EPROM-based PIC16C73 and PIC16C73A predecessors.
Typical applications include industrial control systems, HVAC sensor interfaces, low-end data acquisition, appliance control, instrumentation front ends, and educational development platforms where the 28-pin DIP form factor simplifies breadboarding. The PIC16F873-04/SP is widely used as a teaching MCU because the DIP package fits standard 0.1" pitch breadboards and the 4 MHz speed grade provides ample headroom for instruction-cycle-based timing analysis.
When designing with this part, note that the 4 MHz speed grade limits instruction execution to 1 MIPS; for higher throughput, consider the PIC16F873-20 (20 MHz / 5 MIPS) or PIC16F873A (up to 20 MHz with nanoWatt technology). Ensure that the configuration bits (oscillator selection, watchdog, brown-out, code protection) are set correctly during programming to avoid lock-out scenarios.
This page synthesizes distributor stock data, drop-in alternatives across the PIC16F873 family, and practical ICD/ICSP design notes not consolidated in the manufacturer datasheet, giving engineers a single reference for sourcing, substitution, and bring-up.
Drop-in alternatives for PIC16F873-04/SP — 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 PIC16F873-04/SP (same form factor and footprint) — differing in ADC, Timers.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F873-20/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F873A-I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F873-04I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F873-20I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F874-04/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F873-04/SP Maximum Ratings & Electrical Characteristics
| Series | PIC16F |
| Core Processor | PIC |
| Core Size | 8-Bit |
| Max CPU Speed | 4 MHz (1 MIPS) |
| Program Memory Size | 7 KB (4K x 14) Flash |
| RAM Size | 192 bytes |
| EEPROM Size | 128 bytes |
| Number of I/O | 22 |
| Supply Voltage | 2.0 V to 5.5 V |
| Operating Temperature | -40C to +85C (industrial) |
| Package / Case | 28-DIP (0.300", 7.62mm) |
| Package Style Code | SPDIP (Skinny Plastic DIP) |
| ADC | 8 channels x 10-bit |
| Timers | 3 (2 x 8-bit + 1 x 16-bit with CCP) |
| Communication Interfaces | USART/SCI, MSSP (SPI/I2C) |
| Mounting Type | Through-Hole |
PIC16F873-04/SP Pin Configuration
| Pin 1 | MCLR#/VPP — Master clear reset (active low) / programming voltage input |
| 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 / positive voltage reference |
| Pin 6 | RA4/T0CKI — PORTA bit 4 / Timer 0 clock input (open-drain) |
| Pin 7 | RA5/AN4/SS#/CVREF — PORTA bit 5 / Analog input channel 4 / SPI slave select / comparator VREF |
| Pin 8 | VSS — Ground reference |
| Pin 9 | OSC1/CLKIN — Oscillator crystal input / external clock input |
| Pin 10 | OSC2/CLKOUT — Oscillator crystal output / clock output (Fosc/4) |
| Pin 11 | RC0/T1OSO/T1CKI — PORTC bit 0 / Timer 1 oscillator output / Timer 1 clock input |
| Pin 12 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer 1 oscillator input / CCP2 PWM output |
| Pin 13 | RC2/CCP1 — PORTC bit 2 / Capture Compare PWM 1 output |
| Pin 14 | RC3/SCK/SCL — PORTC bit 3 / SPI clock / I2C clock |
| Pin 15 | RC4/SDI/SDA — PORTC bit 4 / SPI data in / I2C data |
| Pin 16 | RC5/SDO — PORTC bit 5 / SPI data out |
| Pin 17 | RC6/TX/CK — PORTC bit 6 / USART asynchronous transmit / I2C clock |
| Pin 18 | RC7/RX/DT — PORTC bit 7 / USART asynchronous receive / I2C data |
| Pin 19 | VSS — Ground reference |
| Pin 20 | VDD — Positive supply voltage (2.0 V to 5.5 V) |
| Pin 21 | RB0/INT — PORTB bit 0 / External interrupt input |
| Pin 22 | RB1 — PORTB bit 1 |
| Pin 23 | RB2 — PORTB bit 2 |
| Pin 24 | RB3/PGM — PORTB bit 3 / LVP programming enable |
| Pin 25 | RB4 — PORTB bit 4 |
| Pin 26 | RB5 — PORTB bit 5 |
| Pin 27 | RB6/PGC — PORTB bit 6 / ICSP clock (ICD) |
| Pin 28 | RB7/PGD — PORTB bit 7 / ICSP data (ICD) |
Typical Applications
PIC16F873-04/SP is suitable for 7 applications: Industrial Sensor Interface Module, HVAC Damper and Valve Controller, Educational Microcontroller Trainer, Home Appliance Control Board, Automotive Aftermarket Accessory Module, Low-Cost Data Acquisition Front End, Battery-Powered Sensor Node.
Industrial Sensor Interface Module
The PIC16F873-04/SP suits industrial sensor interface modules because its 8-channel 10-bit ADC multiplexed onto PORTA and PORTB simplifies direct connection to thermistors, strain gauges, and 4-20 mA loop transducers. With 7 KB of Flash the firmware can host a Modbus RTU slave via the USART, a 4-20 mA loop transmitter routine, and on-the-fly calibration tables without external EEPROM. The 4 MHz instruction rate delivers 1 MIPS which is sufficient for 100 Hz loop sampling while the watchdog timer ensures field-recoverable operation. Recommended companion MPNs: PIC16F873-20/SP for higher-speed variants.
Recommended
HVAC Damper and Valve Controller
The PIC16F873-04/SP fits HVAC damper and valve controllers by integrating a 16-bit timer with Capture/Compare/PWM for precise actuator pulse generation, plus 8 ADC channels to read mixed-air temperature, return-air temperature, and duct pressure. Its 22 digital I/O can drive triac interfaces for line-voltage damper motors and tri-color status LEDs, while the USART handles RS-485 communication with the building automation controller. The 28-SPDIP package simplifies field-service replacement with through-hole sockets.
Recommended
Educational Microcontroller Trainer
The PIC16F873-04/SP is widely used in university microcontroller courses because the 28-SPDIP through-hole package fits standard 0.1" pitch breadboards and the 4 MHz instruction rate is easy to compute by hand (4 clocks per instruction cycle, 1 microsecond per instruction). Its 192-byte RAM and 7 KB Flash let students implement UART echo, ADC sampling, and PWM without running out of memory. The ICSP programming interface via RB6/RB7 lets instructors demonstrate in-circuit reprogramming without UV erasure.
Recommended
Home Appliance Control Board
The PIC16F873-04/SP serves washing machine, dishwasher, and small appliance control boards thanks to its 22 I/O pins driving relays, keypads, seven-segment displays, and buzzer loads. The MSSP peripheral operates either SPI or I2C for digital temperature sensors, EEPROM memory expansion, or LED driver chips. Industrial temperature grade -40C to +85C ensures reliable operation in appliance enclosures where ambient temperatures exceed 50C.
Recommended
Automotive Aftermarket Accessory Module
The PIC16F873-04/SP drives aftermarket automotive accessories like alarm systems, lighting controllers, and gauge drivers because its 22 I/O pins can read switches, drive MOSFET gates, and serve PWM outputs to LED strips or gauge motors. The 8-channel 10-bit ADC monitors battery voltage, oil pressure, and temperature sensors, while the USART interfaces to GPS modules or Bluetooth OBD adapters. Note: PIC16F873-04/SP is not AEC-Q100 qualified; use PIC16F873A-E/SP for AEC-Q100-compliant automotive designs.
Recommended
Low-Cost Data Acquisition Front End
The PIC16F873-04/SP implements low-cost USB-via-RS232 data acquisition front ends by combining its 8-channel 10-bit ADC with the USART, sending digitized samples to a host PC at up to 115.2 kbps. The 192-byte RAM buffers incoming ADC samples while the 7 KB Flash stores calibration coefficients, scaling tables, and a command interpreter. The brown-out reset and watchdog timer maintain field robustness without host intervention.
Recommended
Battery-Powered Sensor Node
Although not the lowest-power PIC, the PIC16F873-04/SP can drive battery-powered sensor nodes that sleep most of the time, waking on watchdog timer interrupt to read sensors and transmit via USART or MSSP. The brown-out reset circuit protects against battery droop below 2.0 V, and the watchdog prevents firmware lockup in unattended deployments. The 28-SPDIP package supports through-hole assembly for rugged field enclosures. For aggressive low-power designs, consider PIC16F873A-I/SP with nanoWatt technology instead.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F873-04/SP — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F873-20/SP | PIC16F873A-I/SP | PIC16F873-04I/SP | PIC16F873-20I/SP | PIC16F874-04/SP |
|---|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 28-SPDIP | 28-SPDIP | 28-SPDIP | 28-SPDIP | 28-SPDIP | 28-SPDIP |
| Core / Architecture | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range |
| Max CPU Speed | 4 MHz (1 MIPS) | 20 MHz (5 MIPS) | 20 MHz (5 MIPS) | 4 MHz (1 MIPS) | 20 MHz (5 MIPS) | 4 MHz (1 MIPS) |
| Flash Program Memory | 7 KB | 7 KB | 7 KB | 7 KB | 7 KB | 7 KB |
| RAM / EEPROM | 192 B / 128 B | 192 B / 128 B | 192 B / 128 B | 192 B / 128 B | 192 B / 128 B | 192 B / 128 B |
| ADC Channels x Resolution | 8 x 10-bit | 8 x 10-bit | 8 x 10-bit (faster conversion) | 8 x 10-bit | 8 x 10-bit | 8 x 10-bit |
| Operating Temperature | -40C to +85C (industrial) | 0C to +70C (commercial) | -40C to +85C (industrial) | -40C to +85C (industrial) | -40C to +85C (industrial) | -40C to +85C (industrial) |
| Supply 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 |
Key Differentiators
- Cost-optimized 4 MHz speed grade for budget-conscious designs (vs PIC16F873-20/SP)
- Same 28-SPDIP pinout enables direct substitution across the family (vs PIC16F873A-I/SP)
- Through-hole 28-SPDIP simplifies breadboard prototyping and field repair (vs PIC16F873-04/SO (SOIC-28))
Design Notes
Decouple VDD (pin 20) and AVdd (shared with VDD) with a 100 nF ceramic capacitor placed within 5 mm of the pin, plus a bulk 10 µF tantalum or aluminum capacitor on the same rail. The PIC16F873-04/SP draws up to 2 mA at 4 MHz and 5 V; in sleep mode current drops below 1 µA when the watchdog is disabled. Avoid long PCB traces between the ICSP connector (RB6/RB7) and the MCU pins to ensure reliable in-circuit programming.
Route the analog inputs (RA0-RA5) away from digital switching traces such as the PWM CCP1 (RC2) and the oscillator pins (OSC1/OSC2). If AVREF+ (RA3) is used, decouple it locally with 100 nF + 10 µF to maintain ADC accuracy to within ±1 LSB. The MCLR#/VPP pin (1) should have a 10 kΩ pull-up to VDD and a 100 nF cap to ground for noise immunity and to avoid spurious resets.
Do not exceed 4 MHz on the OSC1 input - this is the -04 speed grade's hard ceiling, and operation above this corrupts Flash reads and may damage the part. Configure the watchdog timer with caution during ICD debugging: enable WDT_DIS (configuration bit WDTE = 0) before ICD attach, otherwise the watchdog can reset the part during long single-step debug sessions. Always set the LVP (low-voltage programming) configuration bit consistently with your programmer; mixing LVP and HVP modes can lock out the device.
Compliance Information
RoHS compliance status not explicitly verified in provided web data; check distributor lot documentation. Not AEC-Q100 qualified - select PIC16F873A-E/SP variants for AEC-Q100 automotive designs. Lead-free yes per Microchip product family standards.