PIC16F628-20E/SO - 8-bit 20MHz PIC MCU 3.5KB Flash | Microchip
MPN: PIC16F628-20E/SO ✗ End of Life| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $4.1 | $4.10 |
| 10 | $3.69 | $36.90 |
| 100 | $3.25 | $325.00 |
| 500 | $2.85 | $1,425.00 |
| 1,000 | $2.55 | $2,550.00 |
PIC16F628-20E/SO Overview
A microcontroller (MCU) is a single-chip computer that integrates a CPU core, program memory (Flash/ROM), working memory (RAM), non-volatile data storage (EEPROM), and configurable digital and analog peripherals onto one die. PIC16-series MCUs belong to Microchip's mid-range 8-bit RISC architecture family, sitting within the broader PIC10/12/16 mid-range hierarchy that spans 6 to 100 pins and supports migration with little code change. They are widely used as drop-in 8051 and other 8-bit MCU replacements where deterministic timing, low cost, and proven toolchain support are priorities.
Key features include 16 I/O pins with individual direction control, high-current sink/source for direct LED drive, two analog comparators with a programmable on-chip voltage reference (VREF) module, programmable input multiplexing from device and reference inputs, and comparator outputs available externally. The part integrates power-on reset (POR), power-up timer (PWRT), oscillator start-up timer (OST), brown-out detect (BOD), watchdog timer (WDT) with its own on-chip RC oscillator, multiplexed MCLR pin, and programmable weak pull-ups on PORTB for noise-immune digital I/O.
Architecturally the device uses a 14-bit instruction-word Harvard RISC core with a single accumulator (W) and 4-bank RAM/Flash/EEPROM addressing, plus an 8-level deep hardware stack. Instruction cycles execute in 4 clock periods, giving 200 ns per instruction at 20 MHz. The CMOS process keeps typical active current around 2 mA at 4 MHz and standby current under 1 uA with the WDT enabled, making it suitable for battery-powered or always-on designs.
Typical applications include appliance control boards, sensor signal conditioning with on-chip comparators, automotive body and lighting subsystems, hobbyist and educational projects, simple SMPS housekeeping, low-end motor control, and replacement of legacy 16F84A/PIC16C84 designs where extra peripherals and Flash memory are needed. Designers transitioning from PIC16F84A can use the same instruction set with expanded address space and additional on-chip peripherals.
When designing with this MCU, observe the supply voltage range of 3.0 V to 5.5 V (Flash operation) and decouple VDD with at least 0.1 uF plus 10 uF bulk capacitance near the package. The MCLR reset pin typically requires a 10 kohm pull-up to VDD; add a transient suppressor if the pin is exposed to board-level ESD. For new designs, prefer the PIC16F628A successor which adds internal oscillator, ICD debugging and additional peripherals while keeping the same pinout.
This page synthesizes distributor pricing, drop-in compatible same-family alternatives, and practical PCB/temperature design notes not found in the manufacturer datasheet alone.
Drop-in alternatives for PIC16F628-20E/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-20E/SO (same form factor and footprint) — differing in MSL Level, Operating Temperature, Instruction Set, Package, Analog Comparators.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F628A-E/SO
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F628-20I/SO
✅ Drop-In✓ In Stock
$2.4 / Unit
View Datasheet →PIC16F628-04E/SO
✅ Drop-In✓ In Stock
$1.78 / Unit
View Datasheet →PIC16F627A-I/SO
✅ Drop-In📋 Reference alternative (not in catalog)
PIC16F628-20E/SO Maximum Ratings & Electrical Characteristics
| Product Type | Microcontroller (MCU) |
| Core | PIC16 8-bit RISC |
| Instruction Set | PIC16 mid-range (14-bit instruction word) |
| Program Memory | 3.5 KB Flash (2K x 14) |
| Data RAM | 224 bytes |
| Data EEPROM | 128 bytes |
| Maximum CPU Frequency | 20 MHz |
| Supply Voltage (VDD) | 3.0 V to 5.5 V |
| Number of I/O Pins | 16 |
| Analog Comparators | 2 (with programmable VREF) |
| Timers | 3 (Timer0, Timer1, Timer2) |
| Capture/Compare/PWM | 1 CCP module |
| Watchdog Timer | Yes, with dedicated on-chip RC oscillator |
| Brown-out Detect | Yes |
| Operating Temperature | -40C to +125C (Extended, 'E' suffix) |
| Package | 18-pin SOIC (SO), 300-mil body, tube |
| Mounting Type | Surface Mount |
| MSL Level | MSL 1 (unlimited floor life at <30C/85% RH) |
| RoHS Status | Compliant (lead-free) |
PIC16F628-20E/SO Pin Configuration
| Pin 1 | RA2/AN2/VREF — Bidirectional I/O / analog channel 2 / external VREF input |
| Pin 2 | RA3/AN3/CMP1 — Bidirectional I/O / analog channel 3 / comparator-1 output |
| Pin 3 | RA4/T0CKI/CMP2 — Bidirectional I/O / Timer0 clock input / comparator-2 output |
| Pin 4 | RA5/MCLR/VPP — Input only / Master Clear reset (active-low) / programming voltage |
| Pin 5 | VSS — Ground reference |
| Pin 6 | RB0/INT — Bidirectional I/O / external interrupt input |
| Pin 7 | RB1/RX/DT — Bidirectional I/O / USART RX / data line for synchronous mode |
| Pin 8 | RB2/TX/CK — Bidirectional I/O / USART TX / clock line for synchronous mode |
| Pin 9 | RB3/CCP1 — Bidirectional I/O / CCP1 PWM/capture/compare output |
| Pin 10 | RB4/PGM — Bidirectional I/O / LVP programming input (interrupt-on-change) |
| Pin 11 | RB5 — Bidirectional I/O (interrupt-on-change) |
| Pin 12 | RB6/PGC — Bidirectional I/O / ICSP clock (interrupt-on-change) |
| Pin 13 | RB7/PGD — Bidirectional I/O / ICSP data (interrupt-on-change) |
| Pin 14 | VDD — Positive supply voltage (3.0 V to 5.5 V) |
| Pin 15 | OSC2/CLKOUT — Oscillator output / Fosc/4 clock output |
| Pin 16 | OSC1/CLKIN — Oscillator input / external clock input |
| Pin 17 | RA6/OSC3 — Bidirectional I/O / secondary oscillator output (Timer1) |
| Pin 18 | RA7/OSC4 — Bidirectional I/O / secondary oscillator input (Timer1) |
Typical Applications
PIC16F628-20E/SO is suitable for 6 applications: Appliance Control Boards, Automotive Body and Lighting Modules, Sensor Signal Conditioning with On-Chip Comparators, Hobbyist and Educational Development Projects, SMPS Housekeeping and Auxiliary Control, Legacy 16F84A Replacement and Migration.
Appliance Control Boards
The PIC16F628-20E/SO is well suited to appliance control boards (washing machines, dishwashers, microwave ovens, refrigerators) where its -40C to +125C extended temperature rating, 16 high-current I/O lines capable of direct LED drive, and on-chip analog comparators with VREF simplify sensor interfaces. The 3.5 KB Flash comfortably holds typical state-machine control firmware with room for EEPROM-stored user settings, while brown-out detect and watchdog timer with dedicated RC oscillator deliver the supervisory robustness required by IEC 60335 household-appliance safety standards. The SOIC-18 package reflows cleanly onto lead-free production lines.
Recommended
Automotive Body and Lighting Modules
Automotive body controllers, lighting modules, and door-handle sensors benefit from the PIC16F628-20E/SO's +125C thermal tolerance and on-chip peripherals that reduce external component count. The two analog comparators with programmable VREF can directly interface with thermistor or Hall-effect sensors without an op-amp front-end, while the 25 mA sink/source I/O drives LEDs, relays, and small solenoids directly. Its Flash-based memory supports in-circuit re-flashing for late firmware revisions, and the SOIC-18 package withstands automotive vibration profiles when properly board-mounted with under-pad glue or mechanical retention.
Recommended
Sensor Signal Conditioning with On-Chip Comparators
The PIC16F628-20E/SO integrates two analog comparators with a programmable VREF module and input multiplexing from device pins or the internal reference, eliminating an external op-amp or comparator IC in many sensor-conditioning paths. At 20 MHz instruction rate, latency from comparator trip to GPIO reaction is under 1 microsecond - fast enough for overcurrent protection, level detection, and zero-crossing switching. Combined with 3.5 KB Flash for state-machine logic and 128-byte EEPROM for calibration storage, it is a one-chip solution for low-cost analog-front-end designs in industrial sensors.
Recommended
Hobbyist and Educational Development Projects
The PIC16F628-20E/SO is a favorite in hobbyist and university curricula because it combines the classical PIC16 mid-range instruction set taught in most embedded textbooks with modern Flash-based in-circuit serial programming (ICSP) and affordable development tools like the PICkit 3/5. Students can implement timers, PWM motor control, UART comms, and interrupt-driven designs using the on-chip Timer0/Timer1/Timer2 and CCP module, while only needing a 5 V supply, decoupling caps, and a resonator. The SOIC-18 package fits standard 0.3-inch breadboard adapters for through-hole prototyping.
Recommended
SMPS Housekeeping and Auxiliary Control
In switch-mode power supplies, the PIC16F628-20E/SO commonly serves as a housekeeping chip handling enable sequencing, fan-speed tachometer feedback, fault logging, and I2C/UART communication with the primary controller. Its 5 MIPS throughput at 20 MHz is sufficient for these background tasks, and the 128-byte EEPROM stores fault history across power cycles. The on-chip comparator can directly monitor an auxiliary voltage rail against the internal VREF for over/under-voltage protection, reducing analog BOM versus a discrete supervisor. Extended -40C to +125C temperature range suits industrial PSUs.
Recommended
Legacy 16F84A Replacement and Migration
The PIC16F628-20E/SO is the canonical upgrade path for designs originally built around the now-discontinued PIC16F84A or PIC16C84. It doubles program memory (3.5 KB vs 1.75 KB), adds RAM and EEPROM, and integrates peripheral features that previously required external components (analog comparators, brown-out detect, weak pull-ups on PORTB, watchdog with dedicated oscillator). Code recompiles with minimal changes because the PIC16 mid-range instruction set is identical. Existing 18-pin SOIC layouts are pin-compatible, allowing drop-in PCB replacement with no board rework required.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F628-20E/SO — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F628A-E/SO | PIC16F628-20I/SO | PIC16F628-04E/SO | PIC16F627A-I/SO |
|---|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | SOIC-18 | SOIC-18 - same | SOIC-18 - same | SOIC-18 - same | SOIC-18 - same |
| Program Memory | 3.5 KB Flash | 3.5 KB Flash | 3.5 KB Flash | 3.5 KB Flash | 1.75 KB Flash |
| RAM | 224 bytes | 224 bytes | 224 bytes | 224 bytes | 224 bytes |
| Maximum Clock | 20 MHz | 20 MHz | 20 MHz | 4 MHz | 20 MHz |
| Supply Voltage | 3.0 V to 5.5 V | 3.0 V to 5.5 V | 3.0 V to 5.5 V | 3.0 V to 5.5 V | 3.0 V to 5.5 V |
| Operating Temperature | -40C to +125C (E) | -40C to +125C (E) | -40C to +85C (I) | -40C to +125C (E) | -40C to +85C (I) |
| Internal Oscillator | No | Yes (4 MHz) | No | No | Yes (4 MHz) |
| Lifecycle Status | NRND | Active | NRND | NRND | NRND |
Key Differentiators
- Extended -40C to +125C operating range for automotive/industrial (vs PIC16F628-20I/SO)
- True drop-in replacement available with internal oscillator and ICD (vs PIC16F628A-E/SO)
- Full 20 MHz CPU throughput at 5 V versus 4 MHz speed grade (vs PIC16F628-04E/SO)
Design Notes
Decouple VDD (pin 14) with both a 100 nF ceramic and a 10 uF tantalum or ceramic bulk capacitor placed within 5 mm of the package. Use short, wide PCB traces (>=0.4 mm) on both VDD and VSS to minimize voltage spikes during I/O transitions; each I/O pin can source/sink up to 25 mA, but the total package dissipation budget is 800 mW - sum the per-pin dissipation and derate above +70C. Brown-out detect (BOD) must be configured in the configuration word to assert reset on VDD drops; leaving BOD disabled on 5 V designs can lead to corrupted EEPROM writes during supply brown-out events.
Although the SOIC-18 has a relatively high thermal resistance (theta_JA approximately 100 C/W on a 1-oz 4-layer board), the PIC16F628-20E/SO is rated to +125C junction at Extended grade. Estimated: with all 16 I/O driving 20 mA continuously at 5 V, the per-pin dissipation is roughly 5 V x 0.02 A = 0.1 W each, totalling 1.6 W for the package - sufficient to push the junction 160C above ambient without copper heat-spreading. For high-current outputs, distribute the load across non-adjacent pins and add a ground-pour heat-spreader beneath the SOIC to lower theta_JA. Always measure junction temperature in worst-case production conditions.
Use a ground plane on the layer beneath the SOIC-18 to provide a low-impedance return path for high-frequency switching noise; route the MCLR pull-up resistor (10 kohm to VDD) directly to the MCU and place a 100 nF bypass cap on MCLR if it is exposed to ESD-prone environments. For ICSP, dedicate the PGC (RB6) and PGD (RB7) signals with 4.7 kohm series resistors close to the MCU; these pins also serve as PORTB interrupts, so avoid putting them on connector edges. A 10 kohm pull-up on MCLR is required in all applications - leaving MCLR floating leads to spurious resets or latch-up.
Do not assume the PIC16F628-20E/SO works at 20 MHz on a 3.3 V rail - verify the VDD minimum for the chosen frequency: at 20 MHz, the device requires VDD >= 4.5 V per Microchip datasheet DC characteristics. Below 4.5 V, oscillator drive becomes marginal and instruction timing may drift. Also, when migrating from PIC16F84A code, check that any access to registers above 0x0F uses the correct bank-select sequence; the 16F628 has a 4-bank memory map versus the 16F84A's 2 banks, and unbanked direct addressing can corrupt the PCLATH register on interrupts. Finally, ensure the configuration-word oscillator setting matches the actual resonator in-circuit; selecting HS mode with a 32 kHz watch crystal will not start.
Compliance Information
RoHS-compliant lead-free SOIC-18 per Microchip product page. Not AEC-Q100 qualified; the E temperature grade alone does not constitute AEC-Q100. For AEC-Q100 automotive qualification, consult Microchip automotive-grade part numbers separately.