PIC16F628-04/SO - 4MHz 8-bit Flash MCU 3.5KB | 18-SOIC
MPN: PIC16F628-04/SO ✗ End of Life| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $1.68 | $1.68 |
| 10 | $1.55 | $15.50 |
| 100 | $1.32 | $132.00 |
| 500 | $1.18 | $590.00 |
| 1,000 | $1.05 | $1,050.00 |
PIC16F628-04/SO Overview
A mid-range 8-bit microcontroller (MCU) is a single-chip computer integrating a CPU, memory, and peripherals. The PIC16F62X architecture is classified within the taxonomy: 8-bit MCU -> mid-range MCU -> RISC microcontroller -> embedded controller -> semiconductor. The "F" suffix indicates flash memory, allowing in-circuit reprogramming. This category of device is widely used in cost-sensitive embedded designs where deterministic execution, low power, and simple peripheral integration outweigh the need for high clock speed.
Key features include the 35-instruction RISC instruction set, single-cycle execution (except branches), interrupt handling, power-on reset, brown-out detection, a watchdog timer with dedicated oscillator, and a programmable code protection mechanism. Compared with earlier PIC16C5X parts, the 16F628 adds flash memory, internal oscillator calibration, and on-chip EEPROM, eliminating external program memory and reducing BOM cost for small embedded nodes.
Typical applications span consumer electronics, appliance controls, security keypads, sensor interfaces, small motor drives (gate-driven, with external FETs), lighting controllers, and hobby/educational platforms such as the PICkit 1 baseline development environment. Pin-compatible migration paths within the PIC16F62X family allow designers to scale flash, RAM, and peripherals without PCB rework.
When designing with this part, pay attention to the analog-comparator input impedance and the USART baud-rate error at low clock frequencies. Use a 4 MHz crystal or the calibrated internal 4 MHz oscillator to free board space, and reserve the MCLR pin with a 10 kΩ pull-up if in-circuit serial programming (ICSP) is needed.
This page synthesizes distributor pricing, drop-in alternatives, and practical design notes that are not consolidated in the manufacturer datasheet, giving engineers an at-a-glance engineering summary for sourcing and migration decisions.
Drop-in alternatives for PIC16F628-04/SO — 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 PIC16F628-04/SO (same form factor and footprint) — differing in Package, Operating Temperature, Analog Comparators, Core Architecture, Internal Oscillator.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F628A-I/SO
✅ Drop-In✓ In Stock
$2.32 / Unit
View Datasheet →PIC16F628A-E/SO
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F628T-04E/SO
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F627-04/SO
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F627-04I/SO
✅ Drop-In✓ In Stock
$1.59 / Unit
View Datasheet →PIC16F88-I/SO
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F628-04/SO Maximum Ratings & Electrical Characteristics
| Core | PIC16 mid-range 8-bit RISC |
| Instruction Set | 35 instructions, single-cycle (200 ns at 4 MHz) |
| Program Memory | 3.5 KB (2K x 14) Flash |
| Data SRAM | 224 bytes |
| Data EEPROM | 128 bytes |
| CPU Speed | 4 MHz |
| Supply Voltage | 3.3 V to 5.5 V (extended) / 4.5 V to 5.5 V (standard) |
| I/O Pins | 16 digital I/O |
| Analog Comparators | 2 on-chip |
| Communication | Hardware USART |
| Timers | Timer0, Timer1, Timer2 with PWM |
| Watchdog Timer | Yes, with dedicated oscillator |
| Brown-out Reset | Yes |
| Internal Oscillator | 4 MHz calibrated |
| Package | 18-pin SOIC (SO) |
| Operating Temperature | -40°C to +85°C (industrial) |
| Mounting Type | Surface Mount |
| RoHS | Compliant |
PIC16F628-04/SO Pin Configuration
| Pin 1 | RA2/AN2/VREF — Digital I/O / analog comparator input / voltage reference |
| Pin 2 | RA3/AN3/CMP1 — Digital I/O / analog comparator input / comparator 1 output |
| Pin 3 | RA4/T0CKI/CMP2 — Digital I/O (open-drain) / Timer0 clock input / comparator 2 output |
| Pin 4 | MCLR/VPP — Master clear reset (active low) / programming voltage |
| Pin 5 | VSS — Ground reference |
| Pin 6 | RB0/INT — Digital I/O / external interrupt input |
| Pin 7 | RB1/RX/DT — Digital I/O / USART RX / synchronous data |
| Pin 8 | RB2/TX/CK — Digital I/O / USART TX / synchronous clock |
| Pin 9 | RB3/CCP1 — Digital I/O / CCP1 PWM output |
| Pin 10 | RB4/PGM — Digital I/O / LVP programming pin |
| Pin 11 | RB5 — Digital I/O |
| Pin 12 | RB6/T1OSO/T1CKI/PGC — Digital I/O / Timer1 oscillator / Timer1 clock / ICSP clock |
| Pin 13 | RB7/T1OSI/PGD — Digital I/O / Timer1 oscillator / ICSP data |
| Pin 14 | VDD — Positive supply (3.3 V to 5.5 V) |
| Pin 15 | OSC2/CLKO/RA6 — Crystal oscillator output / clock output / digital I/O |
| Pin 16 | OSC1/CLKI/RA7 — Crystal oscillator input / clock input / digital I/O |
| Pin 17 | RA0/AN0 — Digital I/O / analog comparator input |
| Pin 18 | RA1/AN1 — Digital I/O / analog comparator input |
Typical Applications
PIC16F628-04/SO is suitable for 6 applications: Consumer Electronics Control Boards, Security System Keypads, Industrial Sensor Interface Modules, Small Motor and Lighting Controllers, Educational and Hobby Development Boards, Automotive Auxiliary Controllers.
Consumer Electronics Control Boards
The PIC16F628-04/SO is well suited for cost-sensitive consumer control boards such as remote-control transmitters, small appliance timers, and toy controllers. Its 3.5 KB flash accommodates compact state-machine firmware, while 16 digital I/O pins can drive LEDs, relays, and keypads directly without external glue logic. The 4 MHz CPU clock is sufficient for slow human-interface tasks like debounced button scanning at 10-100 Hz and PWM beeper tones at 1-4 kHz. The hardware USART enables diagnostics via a debug UART bridge, while the internal 4 MHz oscillator eliminates the crystal, reducing BOM cost by about $0.10 per unit. For high-volume consumer runs of tens of thousands of units, this part's simple SO-18 footprint and broad distributor support keep supply chain and SMT assembly risk low.
Recommended
Security System Keypads
PIC16F628-04/SO fits 4x4 matrix keypad scanners in security panels and access controllers where low power, deterministic scanning, and EEPROM-backed credential storage matter. The 128-byte EEPROM supports up to 32 four-byte user codes plus configuration parameters, while the 16 I/O pins easily handle 8 keypad lines (4 rows + 4 cols) plus status LEDs, a buzzer, and a serial link to a master panel. The two on-chip analog comparators can monitor a tamper loop or backup-battery voltage without extra components. Watchdog timer and brown-out reset provide robustness against supply glitches. Designers can pair it with an external 4x4 matrix and a piezo buzzer to build a complete access module on a 30x40 mm two-layer PCB.
Recommended
Industrial Sensor Interface Modules
In industrial sensor-interface modules, the PIC16F628-04/SO acts as a protocol translator between a 4-20 mA analog loop or a digital sensor and an RS-232/485 master. Its hardware USART directly drives RS-485 transceivers at 9600-115200 baud, while the two on-chip comparators can be configured as window detectors for sensor threshold alarms. The 224-byte RAM is enough to buffer short telemetry packets without external memory. At 4 MHz, instruction cycles of 200 ns are sufficient for deterministic response within 1 ms for typical 4-20 mA loop updates. Industrial designers appreciate the extended 3.3 V to 5.5 V supply range and the -40°C to +85°C industrial temperature rating for factory floor operation.
Recommended
Small Motor and Lighting Controllers
For small DC-motor and LED-lighting controllers, the PIC16F628-04/SO delivers PWM generation through Timer2 plus I/O pins capable of sourcing or sinking 25 mA per pin. With a 4 MHz CPU clock the PWM resolution reaches about 10 bits at 4 kHz, adequate for LED dimming and 1-2 A brushed DC motor speed control via an external logic-level MOSFET. The hardware USART enables DMX-512-like lighting-protocol reception by interrupt, while the EEPROM stores user-defined scenes or motor profiles. The 18-pin SOIC occupies only ~80 mm² of board area, leaving ample room for power-FET footprints and decoupling capacitors on a 30x50 mm single-sided PCB.
Recommended
Educational and Hobby Development Boards
The PIC16F628-04/SO remains a popular part in educational kits and hobby projects because of its simple 35-instruction RISC architecture and its compatibility with low-cost programmers such as the PICkit 3 and PICkit 5. The flash memory supports hundreds of erase/write cycles for student lab exercises, while the 128-byte EEPROM is enough for storing lab parameters or small data logs. Through-hole sibling PIC16F628-04/P is preferred for breadboarding, but the -04/SO SOIC variant fits compact solder-training PCBs. The internal oscillator removes a barrier for first-time learners, and the USART enables printf-style debugging to a PC terminal at 9600 baud with just three wires.
Recommended
Automotive Auxiliary Controllers
In non-safety automotive auxiliaries such as interior lighting controllers, mirror-adjust modules, and seat-heater keypads, the PIC16F628-04/SO handles logic-level tasks at 12 V through external regulators. The 16 digital I/O pins drive relays, MOSFET gates, and indicator LEDs, while the hardware USART communicates with the body-control module via LIN or simple UART. The PIC16F627-04E/SO and PIC16F628A-E/SO are the better-specified variants for automotive thermal ranges up to +125°C. Designers should pair the MCU with a TVS-protected 5 V LDO and a reverse-battery diode for reliable in-vehicle operation across cranking transients down to 6 V.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F628-04/SO — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F628A-I/SO | PIC16F628A-E/SO | PIC16F627-04/SO | PIC16F88-I/SO |
|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | 18-SOIC | 18-SOIC - same | 18-SOIC - same | 18-SOIC - same | 18-SOIC - same |
| Clock Speed | 4 MHz | 20 MHz | 20 MHz | 4 MHz | 20 MHz |
| Program Memory | 3.5 KB Flash | 3.5 KB Flash | 3.5 KB Flash | 1.75 KB Flash | 7 KB Flash |
| RAM | 224 bytes | 224 bytes | 224 bytes | 128 bytes | 368 bytes |
| EEPROM | 128 bytes | 128 bytes | 128 bytes | 128 bytes | 256 bytes |
| ADC | None | None | None | None | 10-bit, 7 channels |
| Lifecycle | NRND | NRND | NRND | NRND | Active |
| Internal Oscillator | 4 MHz | 4 MHz calibrated | 4 MHz calibrated | 4 MHz | 8 MHz calibrated |
Key Differentiators
- Lowest-cost flash MCU in the PIC16F62X family (vs PIC16F88-I/SO)
- More flash than PIC16F627 in same footprint (vs PIC16F627-04/SO)
- NRND with active migration path to PIC16F15244 (vs PIC16F628A-I/SO)
Design Notes
Estimated: at 4 MHz, 5 V supply, and full I/O load, the PIC16F628-04/SO typically draws 2-5 mA active. Add a 100 nF decoupling capacitor directly at the VDD pin (within 5 mm) and a 10 µF bulk capacitor at the regulator output. Power-on reset and brown-out reset (BOR) are enabled by configuration bits; configure BOR voltage threshold to 4.0 V or 2.5 V depending on supply rail to avoid spurious resets during 12 V battery cranking transients.
For the 18-pin SOIC package, route the ICSP signals (MCLR/VPP, PGC, PGD) to a 5-pin header so that a PICkit 3/5 can program the device in-circuit. Keep traces to MCLR short (under 25 mm) and add a 10 kΩ pull-up to VDD. Place the 4 MHz crystal (if used) within 10 mm of OSC1/OSC2 with short traces and a ground guard ring to reduce EMI coupling into adjacent analog comparator inputs.
Do not leave the MCLR pin floating - if unused as reset, tie to VDD via 10 kΩ. The RA4 pin is open-drain and cannot source current; an external pull-up is required to drive an LED high. When migrating from PIC16F84A code, the configuration word bit positions differ; recompile or hand-set the CONFIG register. Finally, verify the oscillator mode bits (HS, XT, LP, RC, INTOSC) match the hardware to avoid silent clock-startup failures.
When driving long cables from the USART, add a 100 Ω series resistor at the TX pin and a TVS diode at the connector to suppress ESD and ringing. The hardware USART can drive up to 115200 baud at 4 MHz; for higher baud rates or noise-sensitive links, switch to the PIC16F628A-I/SO which runs at 20 MHz and provides higher baud-rate resolution with smaller error.
Compliance Information
Per Microchip product page: RoHS compliant, lead-free finish. Not AEC-Q100 qualified - for automotive use, prefer PIC16F628A-E/SO with extended temperature grade. Lifecycle is NRND per Microchip product page as of 2026-09-21.