PIC16F874-04I/P - 8-bit 4MHz 7KB Flash MCU 40-PDIP | Microchip
MPN: PIC16F874-04I/P ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $9.85 | $9.85 |
| 10 | $8.92 | $89.20 |
| 100 | $7.45 | $745.00 |
| 500 | $6.3 | $3,150.00 |
| 1,000 | $5.55 | $5,550.00 |
PIC16F874-04I/P Overview
A microcontroller (MCU) is a single-chip computer that integrates a CPU core, program memory, data RAM, peripherals, and I/O on one die. Within the broader semiconductor hierarchy, an MCU sits under microcontrollers, which in turn are a subset of digital logic integrated circuits (ICs) used for embedded control. The PIC16F family from Microchip is one of the longest-running 8-bit RISC architectures, prized for deterministic timing, low power, and a small instruction set that shortens firmware development cycles.
Key features of the PIC16F874-04I/P include the 4 MHz maximum oscillator, 4K x 14 Flash word program memory (7KB), 192 bytes of data SRAM, and 128 bytes of EEPROM. It provides 33 I/O pins, an integrated 10-bit A/D converter, two 8-bit timers plus one 16-bit timer, a USART with addressing, a Master Synchronous Serial Port (MSSP) for SPI/I2C, and two Capture/Compare/PWM modules. These peripherals address motor control, sensor readout, and human-machine interface (HMI) functions without external support chips.
The 40-pin PDIP form factor and pinout are compatible with PIC16C73B/74B/76/77 devices, simplifying board-level migration. According to Microchip's product page, Microchip recommends the newer PIC16F884 as a modern replacement offering more memory and peripherals in the same 40-pin footprint for new designs. The 4 MHz speed grade is appropriate for control loops, slow communication, and battery-powered sensor nodes rather than high-throughput DSP workloads.
Typical applications include industrial automation controllers, building HVAC systems, appliance control boards, instrumentation front panels, and legacy embedded retrofits. The wide operating voltage range (2.0 V to 5.5 V) allows direct connection to 3.3 V or 5 V rails. Engineers should observe proper decoupling (0.1 uF ceramic near VDD) and consider the in-circuit serial programming (ICSP) interface for firmware updates in fielded units.
Drop-in alternatives for PIC16F874-04I/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 PIC16F874-04I/P (same form factor and footprint) — differing in Package, Core Architecture, Timers, ADC, Mounting Type.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F874-04/PQ
✅ Drop-In✓ In Stock
$5.9 / Unit
View Datasheet →PIC16F874-04I/L
✅ Drop-In✓ In Stock
$5.4 / Unit
View Datasheet →PIC16F874-04E/PQ
✅ Drop-In✓ In Stock
$5.1 / Unit
View Datasheet →PIC16F874-04/L
✅ Drop-In✓ In Stock
$6.85 / Unit
View Datasheet →PIC16F884-I/P
✅ Drop-In✓ In Stock
$2.62 / Unit
View Datasheet →PIC16F877A-I/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F871-I/P
✅ Drop-In✓ In Stock
$3.3 / Unit
View Datasheet →PIC16F874-04I/P Maximum Ratings & Electrical Characteristics
| Core Architecture | PIC16 8-bit RISC |
| Maximum Clock Frequency | 4 MHz |
| Instruction Cycle Time | 200 ns |
| Program Memory (Flash) | 7 KB (4K x 14 words) |
| Data SRAM | 192 bytes |
| Data EEPROM | 128 bytes |
| Number of I/O Pins | 33 |
| ADC Resolution | 10-bit |
| Supply Voltage Range | 2.0 V to 5.5 V |
| Operating Temperature Range | -40C to +85C (Industrial) |
| Package | 40-pin PDIP (P) |
| Mounting Type | Through Hole |
| Timers | Two 8-bit + One 16-bit |
| Communication Peripherals | USART, MSSP (SPI/I2C) |
| PWM Modules | 2 (CCP) |
| RoHS Status | Compliant |
| Pinout Compatibility | PIC16C73B/74B/76/77 |
PIC16F874-04I/P Pin Configuration
| Pin 1 | MCLR — Master Clear (Reset) input, active low |
| Pin 2 | RA0/AN0 — PORTA bit 0 / ADC input 0 |
| Pin 3 | RA1/AN1 — PORTA bit 1 / ADC input 1 |
| Pin 4 | RA2/AN2 — PORTA bit 2 / ADC input 2 |
| Pin 5 | RA3/AN3/VREF+ — PORTA bit 3 / ADC input 3 / VREF+ |
| Pin 6 | RA4/AN4 — PORTA bit 4 / ADC input 4 (open-drain) |
| Pin 7 | RA5/AN5/SS — PORTA bit 5 / ADC input 5 / SPI slave select |
| Pin 8 | OSC1/CLKIN — Oscillator crystal input / external clock |
| Pin 9 | OSC2/CLKOUT — Oscillator crystal output / clock out |
| Pin 10 | RC0/T1OSO/T1CKI — PORTC bit 0 / Timer1 oscillator out / clock in |
| Pin 11 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator in / CCP2 PWM |
| Pin 12 | RC2/CCP1 — PORTC bit 2 / CCP1 PWM output |
| 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 / LVP 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 | RD0/PSP0 — PORTD bit 0 / Parallel Slave Port bit 0 |
| Pin 29 | RD1/PSP1 — PORTD bit 1 / Parallel Slave Port bit 1 |
| Pin 30 | RD2/PSP2 — PORTD bit 2 / Parallel Slave Port bit 2 |
| Pin 31 | RD3/PSP3 — PORTD bit 3 / Parallel Slave Port bit 3 |
| Pin 32 | RD4/PSP4 — PORTD bit 4 / Parallel Slave Port bit 4 |
| Pin 33 | RD5/PSP5 — PORTD bit 5 / Parallel Slave Port bit 5 |
| Pin 34 | RD6/PSP6 — PORTD bit 6 / Parallel Slave Port bit 6 |
| Pin 35 | RD7/PSP7 — PORTD bit 7 / Parallel Slave Port bit 7 |
| Pin 36 | RE0/RD — PORTE bit 0 / PSP read control |
| Pin 37 | RE1/WR — PORTE bit 1 / PSP write control |
| Pin 38 | RE2/CS — PORTE bit 2 / PSP chip select |
| Pin 39 | VSS — Ground reference (second VSS pin) |
| Pin 40 | VDD — Positive supply voltage (second VDD pin) |
Typical Applications
PIC16F874-04I/P is suitable for 7 applications: Industrial Automation Controllers, HVAC and Building Control Boards, Appliance Control Boards, Instrumentation Front Panels, Legacy Embedded Retrofits, Sensor Node Edge Devices, Educational and Development Platforms.
Industrial Automation Controllers
The PIC16F874-04I/P is well matched to industrial PLC node and machine controller designs where its industrial temperature grade (-40C to +85C), 33 I/O pins, and 10-bit ADC support direct sensor interfacing and relay driving. The 4 MHz clock provides deterministic instruction timing suitable for polling loops in the 1-10 ms range typical of SCADA nodes, while the 7KB Flash accommodates Modbus or CANopen state-machine firmware. Designers place 0.1 uF ceramic decoupling at each VDD pin and add a TVS on the MCLR line to survive factory-floor ESD events.
Recommended
HVAC and Building Control Boards
HVAC damper and thermostat controllers benefit from the PIC16F874-04I/P's wide 2.0-5.5 V supply range, allowing direct operation from 24 VAC rectified rails with regulation, and from its integrated USART plus MSSP peripherals for talking to remote temperature/humidity sensors over I2C. The 10-bit ADC handles thermistor and pressure transducer inputs with sufficient resolution for setpoint control, while the 33 I/O lines drive triac outputs for compressor and fan switching. The -40C to +85C industrial range supports unconditioned mechanical rooms.
Recommended
Appliance Control Boards
White-goods control boards for washers, dishwashers, and ovens use the PIC16F874-04I/P because its 33 I/O lines handle keypad scanning, LED/LCD multiplexing, and motor-driver logic without external glue chips. The 192-byte SRAM and 7KB Flash run simple state machines for cycle timing, and the integrated USART supports diagnostic or smart-appliance connectivity. EEPROM (128 bytes) preserves user settings across power cycles, a critical feature for appliance UX.
Recommended
Instrumentation Front Panels
Bench-top instruments and panel meters leverage the PIC16F874-04I/P's USART for command-line interfaces, MSSP for SPI displays or ADC chips, and 10-bit ADC for direct transducer readout. The 4 MHz clock is sufficient for refresh rates up to a few hundred Hz on small segment displays. The 40-pin PDIP package is also friendly to hand-soldered prototypes and through-hole assembly favored in low-volume instrumentation. The industrial temp grade handles equipment-room environments.
Recommended
Legacy Embedded Retrofits
The PIC16F874-04I/P is the go-to MCU for maintaining installed equipment originally designed around the PIC16C73B/74B/76/77 family, since its pinout is electrically and mechanically compatible. Existing PCBs accept the part without rework, and legacy firmware ports with minimal changes thanks to the same 35-instruction PIC16 mid-range core. The Flash memory also supports ICSP for in-field firmware patches, an advantage over the older one-time-programmable and ROM variants in legacy fleets.
Recommended
Sensor Node Edge Devices
Battery-powered remote sensor nodes use the PIC16F874-04I/P for its low operating voltage (down to 2.0 V), modest 4 MHz clock enabling sleep-mode duty cycling, and integrated 10-bit ADC for periodic transducer readings. The 192-byte SRAM is sufficient for short data buffers before UART transmission, while the 33 I/O lines interface multiple low-power sensors. EEPROM preserves calibration constants across battery swaps, and ICSP allows field firmware updates.
Recommended
Educational and Development Platforms
The PIC16F874-04I/P's simple 35-instruction RISC core, generous 7KB Flash, and through-hole 40-pin PDIP package make it ideal for university embedded-systems courses and hobbyist development boards. Students can hand-solder the part and probe every pin with standard lab equipment, while the ICSP interface supports frequent firmware reloads. PICkit programmers and the MPLAB X IDE ecosystem provide free tools, and the same package family is supported across PIC16F84 through PIC16F877A.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F874-04I/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F874-04/P | PIC16F874-04I/L | PIC16F874-04E/P | PIC16F884-I/P | PIC16F877A-I/P |
|---|---|---|---|---|---|---|
| Package | 40-PDIP | 40-PDIP - same | 44-PLCC - same die | 40-PDIP - same | 40-PDIP - same | 40-PDIP - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Program Memory (Flash) | 7 KB | 7 KB | 7 KB | 7 KB | 14 KB | 8 KB |
| Data SRAM | 192 bytes | 192 bytes | 192 bytes | 192 bytes | 368 bytes | 368 bytes |
| Maximum Clock Frequency | 4 MHz | 4 MHz | 4 MHz | 4 MHz | 10 MHz | 20 MHz |
| Operating Temperature | -40C to +85C | 0C to +70C | -40C to +85C | -40C to +125C | -40C to +85C | -40C to +85C |
| Number of I/O Pins | 33 | 33 | 33 | 33 | 36 | 33 |
| ADC Resolution | 10-bit | 10-bit | 10-bit | 10-bit | 10-bit | 10-bit |
| Lifecycle Status | Active | Active | Active | Active | Active (recommended) | Active |
Key Differentiators
- Pin-compatible with PIC16C73B/74B/76/77 legacy parts (vs PIC16C74B-04/P)
- Industrial temperature grade in identical 40-PDIP (vs PIC16F874-04/P)
- Lower power consumption than newer PIC16F884 replacement (vs PIC16F884-I/P)
Design Notes
Place a 0.1 uF ceramic decoupling capacitor as close as physically possible to each VDD pin (pins 19 and 40) and a single 10 uF bulk tantalum or aluminum polymer capacitor on the board supply rail. The PIC16F874-04I/P operates across 2.0 V to 5.5 V but is most commonly run at 5.0 V for industrial retrofits. Use a low-dropout regulator such as MCP1700 for 3.3 V battery-powered nodes. Add a 10 kohm pull-up on MCLR (pin 1) and a 100 nF cap to ground for clean power-on reset behavior.
The "-04" speed grade suffix limits the oscillator to 4 MHz maximum; substituting a 20 MHz crystal without changing to the PIC16F874-20 variant will cause the chip to malfunction because the internal clock-divider configuration bits default differently across speed grades. Always verify the speed grade in your BOM matches the crystal or resonator installed. Also, ensure ICSP pins (RB6/RB7) are not permanently pulled low or high by external circuitry during programming - this is a frequent cause of in-circuit programming failures.
Route the oscillator traces (OSC1/OSC2, pins 8 and 9) as short as possible with a ground guard ring on both sides; place the crystal or resonator within 5 mm of the MCU. Keep ADC analog inputs (RA0-RA5) away from digital switching traces to minimize crosstalk, and use a separate analog ground return if mixed-signal accuracy is required. The MCLR pin benefits from a 100 nF cap directly to ground and a series resistor if the board will be exposed to ESD.
Compliance Information
Industrial temperature grade -40C to +85C. RoHS and lead-free per Microchip product page; not AEC-Q100 qualified (use automotive-grade PIC16F874-04E/P or PIC variant for Q100).