PIC16F873A-E/SP - 8-bit 20MHz PIC MCU 7KB Flash 28-PDIP | Microchip
MPN: PIC16F873A-E/SP β Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $7.2 | $7.20 |
| 10 | $6.5 | $65.00 |
| 100 | $5.78 | $578.00 |
| 500 | $5.1 | $2,550.00 |
| 1,000 | $4.62 | $4,620.00 |
PIC16F873A-E/SP Overview
An 8-bit microcontroller (MCU) is a single-chip computer that integrates a CPU, memory, and peripherals around an 8-bit data path. The PIC16F873A belongs to the mid-range PIC16F family, sitting between the baseline PIC10/12/14 families and the enhanced PIC18 family. Within the broader taxonomy, MCUs are classified as microcontrollers (sub-class of microprocessors) within semiconductors, used for embedded control applications where deterministic real-time response matters more than raw compute throughput. The PIC16F873A is widely deployed in cost-sensitive industrial, consumer, and automotive subsystems.
Key features include 22 I/O pins, five channels of 10-bit Analog-to-Digital (A/D) conversion, two analog comparators, a synchronous serial port configurable as SPI or I2C, a USART for asynchronous serial communication, 128 bytes of EEPROM data memory, and self-programming capability with In-Circuit Debugging (ICD). The nanoWatt Technology power-management suite offers multiple oscillator options and idle/sleep modes for low-power designs. These peripherals enable direct interface to sensors, displays, EEPROMs, and RS-232/RS-485 transceivers without external glue logic.
The PIC16F873A uses a Harvard RISC architecture with separate program and data buses, allowing instruction fetch and execution in a single cycle (except branches). The 14-bit instruction word and 8-bit data path provide a favorable code density vs 8-bit CISC alternatives. The 10-bit ADC uses a successive approximation register with selectable reference voltages, while the MSSP module supports both SPI master/slave and I2C master/slave modes. The USART supports asynchronous, synchronous master, and synchronous slave modes with hardware address detection.
Typical applications include industrial sensor interfaces, HVAC control boards, motor control auxiliary logic, automotive body electronics, security panel keypads, and consumer appliance control. The 28-PDIP through-hole package supports hand-prototyping and easy firmware iteration; surface-mount variants in SOIC, SSOP, QFN, and MLF packages share the same die.
Design consideration: confirm oscillator stability by placing the crystal or resonator within 1 cm of the OSC1/CLK2 and OSC2/CLK pins, with the load capacitors grounded to the device's VSS pin to avoid ground-loop noise. Also reserve the MCLR pin with a 10 kohm pull-up to VDD and a 100 nF decoupling capacitor for reliable reset behavior.
This page synthesizes distributor pricing tiers, same-brand drop-in alternatives, and practical design considerations not aggregated in a single manufacturer datasheet, giving engineers a faster path to qualification.
Drop-in alternatives for PIC16F873A-E/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 PIC16F873A-E/SP (same form factor and footprint) β differing in ADC, Operating Temperature, Package, Supply Voltage (VDD), Timers.
Quick Comparison Tool β Select alternative parts for side-by-side comparison:
PIC16F873A-I/SP
β Drop-Inπ Reference alternative (not in catalog)
PIC16F873A-E/SO
β Drop-Inπ Reference alternative (not in catalog)
PIC16F876A-E/SP
β Drop-Inπ Reference alternative (not in catalog)
PIC16F873A-E/ML
β Drop-Inβ In Stock
$3.35 / Unit
View Datasheet βPIC16F873A-E/SS
β Drop-Inβ In Stock
$3.55 / Unit
View Datasheet βPIC16F873A-E/SP Maximum Ratings & Electrical Characteristics
| Product Family | PIC16F 8-bit Microcontroller |
| Core Architecture | 8-bit RISC PIC16 mid-range |
| Program Memory (Flash) | 7 KB (4K x 14 words) |
| Data RAM | 192 bytes |
| Data EEPROM | 128 bytes |
| Maximum Clock Frequency | 20 MHz |
| Instruction Execution Time | 200 ns (at 20 MHz) |
| Supply Voltage (VDD) | 4.0 V to 5.5 V |
| I/O Pins | 22 |
| ADC | 10-bit, 5 channels |
| Comparators | 2 analog comparators |
| Serial Interfaces | MSSP (SPI / I2C), USART |
| Timers | Timer0, Timer1, Timer2 |
| Operating Temperature | -40 C to +125 C (industrial) |
| Package | 28-pin SPDIP (300 mil) |
| Mounting Type | Through-Hole (PDIP) |
| RoHS Status | Compliant (check lot-specific) |
| Self-Programming / ICD | Yes |
PIC16F873A-E/SP Pin Configuration
| Pin 1 | MCLR/VPP β Master Clear (Reset) input / programming voltage |
| Pin 2 | RA0/AN0 β Port A bit 0 / analog channel 0 |
| Pin 3 | RA1/AN1 β Port A bit 1 / analog channel 1 |
| Pin 4 | RA2/AN2/VREF- β Port A bit 2 / analog channel 2 / ADC VREF- |
| Pin 5 | RA3/AN3/VREF+ β Port A bit 3 / analog channel 3 / ADC VREF+ |
| Pin 6 | RA4/T0CKI β Port A bit 4 / Timer0 clock input |
| Pin 7 | RA5/AN4/SS β Port A bit 5 / analog channel 4 / SPI slave select |
| Pin 8 | OSC1/CLKIN β Oscillator crystal input / external clock in |
| Pin 9 | OSC2/CLKOUT β Oscillator crystal output / clock out |
| Pin 10 | RC0/T1OSO/T1CKI β Port C bit 0 / Timer1 oscillator output / Timer1 clock |
| Pin 11 | RC1/T1OSI/CCP2 β Port C bit 1 / Timer1 oscillator input / CCP2 |
| Pin 12 | RC2/CCP1 β Port C bit 2 / CCP1 (PWM/capture/compare) |
| Pin 13 | RC3/SCK/SCL β Port C bit 3 / SPI clock / I2C clock |
| Pin 14 | RC4/SDI/SDA β Port C bit 4 / SPI data in / I2C data |
| Pin 15 | RC5/SDO β Port C bit 5 / SPI data out |
| Pin 16 | RC6/TX/CK β Port C bit 6 / USART TX / clock |
| Pin 17 | RC7/RX/DT β Port C bit 7 / USART RX / data |
| Pin 18 | GND β Ground reference |
| Pin 19 | VDD β Positive supply voltage (4.0V to 5.5V) |
| Pin 20 | RB0/INT β Port B bit 0 / external interrupt |
| Pin 21 | RB1 β Port B bit 1 |
| Pin 22 | RB2 β Port B bit 2 |
| Pin 23 | RB3/PGM β Port B bit 3 / LVP programming |
| Pin 24 | RB4 β Port B bit 4 |
| Pin 25 | RB5 β Port B bit 5 |
| Pin 26 | RB6/PGC β Port B bit 6 / ICD clock |
| Pin 27 | RB7/PGD β Port B bit 7 / ICD data |
| Pin 28 | VSS β Ground (alternate ground pin) |
Typical Applications
PIC16F873A-E/SP is suitable for 7 applications: Industrial Sensor Interface Board, HVAC Control Board, Automotive Body Electronics Aftermarket, Security Panel Keypad, Consumer Appliance Control, Educational Embedded Lab Board, Motor Control Auxiliary Logic.
Industrial Sensor Interface Board
The PIC16F873A-E/SP fits sensor-interface boards where 4-5 analog inputs, basic digital I/O, and RS-232/RS-485 communication must be processed deterministically. Its 5-channel 10-bit ADC and 22 I/O pins let designers wire four sensors plus a status LED array directly, while the USART provides a Modbus RTU link to a PLC. The industrial -40 C to +125 C operating range handles factory-floor thermal stress without external regulators, and the 28-pin SPDIP simplifies hand rework during commissioning. Compared with switching to a more powerful MCU, the PIC16F873A-E/SP keeps BOM cost low while still offering self-programming for field firmware updates.
Recommended
HVAC Control Board
Heating, ventilation, and air-conditioning controllers benefit from the PIC16F873A-E/SP's combination of analog comparators, ADC, and PWM-friendly timers. The device can read multiple temperature sensors, drive TRIAC-controlled fan relays through opto-isolators, and run a simple state machine for setpoint control. The 200 ns instruction cycle is sufficient to handle 1 ms control loops, while the 7 KB Flash accommodates small PID tables and lookup arrays. With nanoWatt Technology sleep modes, idle power drops below 1 uA, helping HVAC thermostats meet energy-star targets.
Recommended
Automotive Body Electronics Aftermarket
Aftermarket automotive accessories (alarm systems, central locking, auxiliary lighting controllers) frequently use the PIC16F873A-E/SP because of its extended temperature grade and 28-pin SPDIP footprint, which simplifies integration into sealed enclosures with through-hole wiring. The PIC16F873A's analog comparators monitor door-switch and ignition-sense lines, while the ADC reads battery voltage for brown-out handling. Self-programming allows dealers to flash firmware variants for different vehicle models using only the ICD pins, avoiding production-line SKU complexity.
Recommended
Security Panel Keypad
Intrusion alarm keypads and access-control panels use the PIC16F873A-E/SP to scan 4x4 membrane key matrices, drive LCD or LED indicators, and report events over a wired bus to a central panel. The 22 I/O pins comfortably handle a 4x4 keypad (8 lines) plus LED row/column drivers, while the USART provides a serial link to the main alarm panel. EEPROM storage preserves zone-configuration and installer codes through power cycles, and self-programming enables field firmware updates for new sensor protocols.
Recommended
Consumer Appliance Control
White-goods controllers (washing machines, dishwashers, microwave ovens) often use the PIC16F873A-E/SP to drive relays, read water-level and temperature sensors, and coordinate user-interface buttons. Its 192 bytes of RAM is sufficient for cycle state machines, while the 7 KB Flash holds the main control loop plus diagnostic routines. The dual analog comparators detect zero-cross events for TRIAC-based motor dimming, and the MSSP block can drive a small character LCD over SPI for the user interface.
Recommended
Educational Embedded Lab Board
University embedded-systems courses rely on the PIC16F873A-E/SP for student labs because of its through-hole SPDIP package, which is forgiving on breadboards, and the 35-instruction PIC16 ISA, which is small enough to teach in a single semester. Each student programs GPIO, timers, ADC, and the USART step by step, then combines them into a capstone project such as a digital thermometer or a serial-port motor driver. The MPLAB X IDE with ICD support lets students debug their code on real hardware.
Recommended
Motor Control Auxiliary Logic
Brushless DC (BLDC) and stepper-motor driver boards often pair the PIC16F873A-E/SP with a dedicated gate-driver IC. The MCU generates PWM and commutation timing while the driver handles the high-current switching. The PIC16F873A-E/SP's three timers (Timer0, Timer1, Timer2) provide PWM, capture, and time-base channels sufficient for sensorless trapezoidal commutation of small BLDC motors. The 10-bit ADC reads back-link BEMF or current-sense signals for closed-loop control, and the comparators detect zero-cross events without CPU overhead.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F873A-E/SP β comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F873A-I/SP | PIC16F876A-E/SP | PIC16F873A-E/SO | PIC16F873A-E/ML |
|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | SPDIP-28 (through-hole) | SPDIP-28 - same | SPDIP-28 - same | SOIC-28 (SMD) | QFN-28 (SMD) |
| Flash Program Memory | 7 KB | 7 KB | 14 KB (+100%) | 7 KB | 7 KB |
| Data RAM | 192 bytes | 192 bytes | 368 bytes (+92%) | 192 bytes | 192 bytes |
| Data EEPROM | 128 bytes | 128 bytes | 256 bytes (+100%) | 128 bytes | 128 bytes |
| Maximum Clock | 20 MHz | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| Operating Temperature | -40 C to +125 C (E grade) | -40 C to +85 C (I grade) | -40 C to +125 C (E grade) | -40 C to +125 C (E grade) | -40 C to +125 C (E grade) |
| I/O Pins | 22 | 22 | 22 | 22 | 22 |
| ADC | 10-bit, 5 channels | 10-bit, 5 channels | 10-bit, 5 channels | 10-bit, 5 channels | 10-bit, 5 channels |
Key Differentiators
- Doubled Flash and RAM on the same 28-pin SPDIP pinout (vs PIC16F876A-E/SP)
- Extended industrial temperature range covering automotive aftermarket (vs PIC16F873A-I/SP)
- Through-hole SPDIP simplifies hand prototyping and field rework (vs PIC16F873A-E/SO (SOIC-28))
Design Notes
Place a 100 nF decoupling capacitor between VDD (pin 20) and VSS (pin 19 or 28) as close as physically possible to the IC, with lead/trace length under 5 mm. Add a bulk 10 uF electrolytic or tantalum capacitor at the board's main 5V supply rail to handle inrush during Flash programming current spikes (the PIC16F873A can draw up to 30 mA during self-programming). Estimated: using only a 100 nF cap with no bulk supply typically causes brown-out resets during in-circuit programming; both caps are required for reliable operation.
Route the crystal or ceramic resonator within 1 cm of pins 8 (OSC1) and 9 (OSC2). Connect the load capacitors (typically 15-33 pF for a 20 MHz crystal) from each OSC pin to a low-impedance ground trace that returns directly to the VSS pin. Avoid routing digital signal traces under or near the crystal traces to prevent capacitive coupling that can shift the oscillation frequency or cause jitter. For high-noise environments (motor drives, switching power supplies), add a guard ring tied to ground around the oscillator area.
Do not leave the MCLR pin floating; tie MCLR (pin 1) to VDD through a 10 kohm pull-up resistor and a 100 nF capacitor to VSS to filter noise. Floating MCLR is the most common cause of unexplained resets in PIC16 designs. Also, when using ICD debugging, ensure RB6/PGC and RB7/PGD are not driving external loads because the debugger shares these pins; add series resistors of at least 100 ohm or use buffer gates if the design must keep RB6/RB7 as outputs during debug sessions.
When using the ADC, place the analog reference decoupling (100 nF ceramic + 10 uF electrolytic) close to the VREF+ pin (pin 5) if the ADC is configured for external reference. Source impedance to the analog input should be under 10 kohm to keep acquisition-time error below 1 LSB. Avoid routing the analog input traces near digital switching traces (PWM, oscillator) on the PCB; use a ground guard trace or place the analog section on the opposite side of the PCB with a clear ground split.
For the 28-pin SPDIP footprint, keep all I/O traces short and route them to the board edge with connector pads or to nearby peripheral components. Avoid creating signal-stub traces longer than 25 mm from the IC pad to the first destination, because long stubs can act as antennas and degrade EMI/ESD performance. Place a ground plane on the opposite PCB layer directly under the IC body to reduce radiated emissions and provide a low-inductance return path for switching currents.
Compliance Information
RoHS compliance per Microchip product page; AEC-Q100 qualification not specifically claimed for the PIC16F873A-E/SP variant (Microchip recommends PIC18 or PIC16F18854 family for new automotive designs).