PIC16F628-20E/P - 8-bit MCU 20MHz 3.5KB Flash DIP-18 | Microchip
MPN: PIC16F628-20E/P ✗ End of Life| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $4.2 | $4.20 |
| 10 | $3.78 | $37.80 |
| 100 | $3.4 | $340.00 |
| 500 | $3.05 | $1,525.00 |
| 1,000 | $2.75 | $2,750.00 |
PIC16F628-20E/P Overview
A microcontroller (MCU) is a single-chip computer that integrates a CPU core, non-volatile program memory (Flash/ROM), volatile working memory (RAM), and configurable peripherals such as timers, communication interfaces and analog blocks. Within the broader taxonomy, a microcontroller belongs to the integrated circuit (semiconductor) family and specifically to the embedded-control sub-category. The PIC16F628 sits in Microchip's mid-range PIC16F6xxx family of 8-bit Harvard-architecture MCUs, which target low-cost, low-power general-purpose embedded control in industrial and consumer equipment.
Key features of this part include 20 MHz maximum clock (200 ns instruction cycle), 4.5-5.5 V single-supply operation, internal 4 MHz and 37 kHz RC oscillators, hardware USART for serial communication, and 100,000 erase/write cycle Flash endurance. The 'E' suffix denotes the Enhanced (-40C to +125C) industrial operating temperature range, and '20' denotes the 20 MHz speed grade.
Architecturally, the device uses a RISC instruction set with 35 single-word instructions, a 14-bit instruction word, an 8-level hardware stack, and Harvard-separated program and data buses. Power-saving features include SLEEP mode, internal oscillator options, and programmable code protection. Compared with newer PIC16F1xxx parts, the PIC16F628 trades peripheral richness for simplicity and low cost.
Typical applications include appliance control, sensor-interface front ends, LED drivers, small motor-control boards, hobby/education platforms, and legacy industrial replacement designs. Its DIP-18 through-hole package also makes it popular for breadboard prototyping, university labs, and field-service repairs where socketed parts simplify replacement. Because Microchip marks the family 'Not Recommended for new designs', the part is best suited to maintenance of existing installations rather than new platform starts.
When designing with this device, place a 100 nF decoupling capacitor within 5 mm of VDD and a bulk capacitor on the MCLR/VPP reset line if in-circuit programming is required. Use the internal oscillator when PCB area or BOM cost must be minimized, but select an external crystal when timing accuracy or USART baud-rate stability matters. The DIP-18 footprint also enables hand-soldered rework without hot-air equipment.
Drop-in alternatives for PIC16F628-20E/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 PIC16F628-20E/P (same form factor and footprint) — differing in Operating Temperature, Package, I/O Pins, RoHS Status, Core Architecture.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC16F628A-I/P
✅ Drop-In✓ In Stock
$1.62 / Unit
View Datasheet →PIC16F628-20/P
✅ Drop-In✓ In Stock
$1.96 / Unit
View Datasheet →PIC16F627-20E/P
✅ Drop-In✓ In Stock
$1.95 / Unit
View Datasheet →PIC16F627A-I/P
✅ Drop-In ⚠️ 参数待验证📋 Reference alternative (not in catalog)
PIC16F627-04E/P
✅ Drop-In✓ In Stock
$1.85 / Unit
View Datasheet →PIC16F628-04E/P
✅ Drop-In ⚠️ 参数待验证✓ In Stock
$2.55 / Unit
View Datasheet →PIC16F628-20E/P Maximum Ratings & Electrical Characteristics
| Core Architecture | 8-bit PIC16 mid-range RISC |
| Program Memory (Flash) | 3.5 KB (2K x 14) |
| SRAM | 224 bytes |
| EEPROM | 128 bytes |
| Maximum Clock Frequency | 20 MHz |
| Instruction Cycle | 200 ns |
| Supply Voltage (VDD) | 4.5 V to 5.5 V |
| I/O Pins | 16 |
| Timers | Two 8-bit + one 16-bit |
| CCP Modules | 1 |
| USART | 1 (hardware) |
| On-chip Analog Comparator | Yes |
| Internal Oscillator | 4 MHz and 37 kHz |
| Operating Temperature | -40C to +125C (E suffix) |
| Package | 18-pin PDIP (DIP-18, through-hole) |
| Mounting Type | Through-Hole |
| RoHS Status | Lead-free (Pb-free), see datasheet |
PIC16F628-20E/P Pin Configuration
| Pin 1 | RA2/AN2 — PORTA bit 2 (digital I/O, analog comparator input) |
| Pin 2 | RA3/AN3/CMP1 — PORTA bit 3 (digital I/O, analog comparator non-inverting input) |
| Pin 3 | RA4/TOCKI/CMP2 — PORTA bit 4 (digital I/O, Timer0 clock input, comparator inverting input) |
| Pin 4 | RA5/MCLR/VPP — PORTA bit 5 / Master Clear reset (active low) / programming voltage input |
| Pin 5 | VSS — Ground reference |
| Pin 6 | RB0/INT — PORTB bit 0 (digital I/O, external interrupt input) |
| Pin 7 | RB1/RX/DT — PORTB bit 1 (digital I/O, USART RX / synchronous data) |
| Pin 8 | RB2/TX/CK — PORTB bit 2 (digital I/O, USART TX / synchronous clock) |
| Pin 9 | RB3/CCP1 — PORTB bit 3 (digital I/O, Capture/Compare/PWM output) |
| Pin 10 | RB4/PGM — PORTB bit 4 (digital I/O, low-voltage programming input) |
| Pin 11 | RB5 — PORTB bit 5 (digital I/O) |
| Pin 12 | RB6/T1OSC1/PGC — PORTB bit 6 (digital I/O, Timer1 oscillator input, ICSP clock) |
| Pin 13 | RB7/T1OSC2/PGD — PORTB bit 7 (digital I/O, Timer1 oscillator output, ICSP data) |
| Pin 14 | VDD — Positive supply voltage (4.5 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 | RA0/AN0 — PORTA bit 0 (digital I/O, analog comparator reference) |
| Pin 18 | RA1/AN1 — PORTA bit 1 (digital I/O, analog comparator input) |
Typical Applications
PIC16F628-20E/P is suitable for 6 applications: Appliance Control Board, Hobby Electronics & Education, Sensor Interface Front End, LED Lighting Controller, Legacy Industrial Replacement, Remote Control & RF Transmitter.
Appliance Control Board
The PIC16F628-20E/P fits appliance control boards thanks to its 3.5 KB Flash (enough for state-machine firmware and timing tables), 224 B SRAM for runtime variables, and 16 GPIO that map directly to relays, triac drivers and user-interface buttons. Its internal 4 MHz RC oscillator removes the cost of an external crystal in cost-sensitive white-goods designs. The -40C to +125C 'E' temperature rating covers under-cabinet and outdoor appliance environments where an industrial-grade MCU is required.
Recommended
Hobby Electronics & Education
The PIC16F628-20E/P's DIP-18 through-hole package is breadboard-friendly and socketable, making the part a staple for university embedded-systems labs, hobby robotics and maker projects. Its 35-instruction RISC core is well documented in textbooks and supported by free MPLAB X IDE plus the PICkit 3/4 programmer. The on-chip USART and CCP peripherals let students implement serial protocols, PWM motor control, and timing labs without external components, while 3.5 KB of Flash accommodates reasonably complex teaching firmware.
Recommended
Sensor Interface Front End
With 16 GPIO, a hardware USART, an analog comparator and PWM-able timers, the PIC16F628-20E/P serves as a low-cost sensor front end for thermostats, light controllers and HVAC damper actuators. The 10-bit-resolution timer capture and 128 B EEPROM let designers store calibration constants and last-known-state across power cycles, which is important for thermostats and tamper-resistant sensor nodes. Brown-out Detect and the Watchdog Timer improve field reliability against supply transients common in industrial installations.
Recommended
LED Lighting Controller
The PIC16F628-20E/P drives LED strips, signage and architectural lighting via its CCP module, which produces accurate PWM for color mixing and dimming at 20 MHz. Three timers (two 8-bit plus one 16-bit) handle concurrent refresh and user-input tasks without burdening the main loop, and the internal 4 MHz oscillator saves BOM in decorative fixtures where precise baud rates are not needed. The USART enables DMX-512 or RS-485 reception for stage and architectural lighting controlled from a central console.
Recommended
Legacy Industrial Replacement
Many legacy industrial controllers still rely on PIC16F-series DIP parts, and the PIC16F628-20E/P remains in distributor stock precisely to support this installed base. Its DIP-18 package is socketed, so field-service technicians can swap a failed MCU without reworking surface-mount assemblies. The 100,000 erase/write Flash endurance and 128 B EEPROM support field firmware updates via the ICSP/MCLR pins using a PICkit programmer, keeping decades-old machines running without redesign.
Recommended
Remote Control & RF Transmitter
For simple RF key-fob transmitters, garage-door remotes, and wireless sensor nodes, the PIC16F628-20E/P offers just enough Flash for encoding routines plus a low-power SLEEP mode that extends battery life. The 16 GPIO directly drive low-cost 315/433 MHz SAW-based transmitters via OOK/ASK modulation timed from the 16-bit timer. Brown-out Detect prevents corrupted transmits during battery end-of-life, and the 'E' temperature range supports outdoor keyfob use in cold climates.
Recommended
Recommended Products Summary
Engineering reference data for PIC16F628-20E/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC16F628A-I/P | PIC16F628-20/P | PIC16F627-20E/P |
|---|---|---|---|---|
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Package | PDIP-18 (DIP-18) | PDIP-18 - same | PDIP-18 - same | PDIP-18 - same |
| Core | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range (enhanced) | 8-bit PIC16 mid-range | 8-bit PIC16 mid-range |
| Flash Program Memory | 3.5 KB (2K x 14) | 3.5 KB (2K x 14) | 3.5 KB (2K x 14) | 1.75 KB (1K x 14) |
| SRAM | 224 B | 224 B | 224 B | 128 B |
| EEPROM | 128 B | 128 B | 128 B | 64 B |
| Max Clock Frequency | 20 MHz | 20 MHz | 20 MHz | 20 MHz |
| Supply Voltage | 4.5 V to 5.5 V | 2.0 V to 5.5 V (A revision extends to lower VDD) | 4.5 V to 5.5 V | 4.5 V to 5.5 V |
| Operating Temperature | -40C to +125C (E suffix) | -40C to +85C (industrial) | 0C to +70C (commercial) | -40C to +125C (E suffix) |
| USART | 1 hardware USART | 1 hardware USART | 1 hardware USART | 1 hardware USART |
Key Differentiators
- Highest 20 MHz speed grade in the PIC16F627/628 family with -40C to +125C industrial temperature range (vs PIC16F627-20E/P)
- Enhanced 'A' silicon offers 8-level stack and additional interrupts while remaining pin-compatible (vs PIC16F628A-I/P)
- Industrial -40C to +125C operating temperature vs commercial 0C to +70C on the non-E variant (vs PIC16F628-20/P)
Design Notes
Place a 100 nF decoupling capacitor (X7R or better) within 5 mm of the VDD pin (pin 14) and a 10 uF bulk tantalum or aluminum on the same rail near the MCU. The PIC16F628-20E/P draws typically 2-5 mA active and < 1 uA in SLEEP; bypass layout directly affects oscillator stability and ADC-free analog comparator noise pickup. Estimated: at 20 MHz and 5 V the active current per the datasheet is around 5 mA typical.
Keep the MCLR/VPP pin (pin 4) high-impedance only when using the internal RC oscillator. For external crystal or resonator modes, add a 10 kohm pull-up on MCLR and a small (10-100 nF) capacitor to ground for noise filtering, or use the internal weak pull-up enabled by configuration fuse. The ICSP clock (PGC, RB6) and data (PGD, RB7) lines should each have a series resistor near the MCU to limit inrush during programming.
Do not assume the internal 4 MHz oscillator is accurate enough for USART baud rates above 9600; the internal RC is typically +-1% but drifts with temperature and VDD, so for reliable serial links use an external crystal or resonator. Also note that the PIC16F628-20E/P does NOT include an ADC; designers expecting analog-to-digital conversion must choose the PIC16F88 (with ADC) or external ADC. Watchdog Timer postscaler must be cleared in firmware via CLRWDT, or a reset will occur.
Route the OSC1/OSC2 traces short and symmetric, surrounded by a ground guard ring if high noise is expected from adjacent relay or triac drivers. Keep the ICSP connector accessible on the board edge to enable field firmware updates without desoldering; the DIP-18 footprint makes socket-based replacement practical. For high-EMI environments, place an RC snubber (100 ohm + 100 nF) on the MCLR/VPP line close to the pin.
Compliance Information
Per the Microchip product page, the PIC16F628 family is lead-free and RoHS compliant. Not AEC-Q100 qualified; the part targets industrial and consumer applications rather than automotive.