PIC18F252-E/SP - 8-Bit MCU, 32KB Flash, 40MHz, SPDIP-28 | Microchip
MPN: PIC18F252-E/SP ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $9.46 | $9.46 |
| 10 | $8.95 | $89.50 |
| 100 | $7.95 | $795.00 |
| 500 | $7.1 | $3,550.00 |
| 1,000 | $6.5 | $6,500.00 |
PIC18F252-E/SP Overview
What is a PIC18F microcontroller? PIC18F is Microchip Technology's family of high-performance 8-bit Reduced Instruction Set Computer (RISC) microcontrollers built on a Harvard memory architecture. They sit within the broader 8-bit MCU taxonomy (MCU -> microcontroller -> 8-bit MCU -> RISC MCU -> Harvard architecture MCU -> embedded controller) and target applications needing moderate computational throughput, low power, abundant peripherals, and broad developer tool support including MPLAB X IDE, XC8 compilers, and PICkit debuggers.
Key technical features of the PIC18F252-E/SP include the self-programmable flash permitting in-field firmware updates, C compiler-optimized instruction set with 77 single-word instructions, an extended instruction set variant, and wide 4.2V to 5.5V supply tolerance. The -E temperature grade spans -40C to +125C, qualifying the device for industrial and harsh-environment use. The 28-pin SPDIP-28 (SP) form factor suits breadboarding, legacy designs, through-hole manufacturing, and hand-soldered prototypes where SMD reflow is impractical.
Architecturally, PIC18F252-E/SP combines an 8-bit data path with a 16-bit instruction word, two address spaces for program and data memories, hardware multiplier for single-cycle 8x8 operations, and a vectored interrupt controller with prioritized sources. Two CCP modules can be configured for PWM, capture, or compare, enabling motor control, timing measurement, and waveform generation. The MSSP supports both SPI (4-wire with separate I/O) and I2C (master/slave, 7/10-bit addressing), giving designers a flexible peripheral mix.
Typical applications include industrial control systems, HVAC thermostats, sensor signal conditioning, low-end motor drivers, instrumentation, and consumer appliances. The PIC18F252-E is well suited for designs migrating from PIC16F parts that need more code space, additional I/O, or higher ADC resolution.
A key design consideration when selecting this part is its wide operating voltage range combined with high ADC accuracy. Unlike newer nanoWatt XLP PIC18FxxKxx series, the 'F252 draws higher active current but offers mature code libraries, broad toolchain support, and an extensive base of proven reference designs.
This page synthesizes verified distributor pricing, official Microchip datasheet parameters, drop-in alternatives in the same 28-pin footprint, and practical design notes beyond those found in the manufacturer datasheet.
Drop-in alternatives for PIC18F252-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 PIC18F252-E/SP (same form factor and footprint) — differing in Package, ADC, Core, Program Memory (Flash), Timers.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC18F252-I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18F2520-E/SP
✅ Drop-In✓ In Stock
$5.1 / Unit
View Datasheet →PIC18F2523-E/SP
✅ Drop-In✓ In Stock
$5.85 / Unit
View Datasheet →PIC18F2525-I/SP
✅ Drop-In✓ In Stock
$5.45 / Unit
View Datasheet →PIC18F2620-I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18F258-I/SP
✅ Drop-In✓ In Stock
$6.55 / Unit
View Datasheet →PIC18F252-E/SP Maximum Ratings & Electrical Characteristics
| Architecture | 8-bit PIC18F Harvard RISC |
| Core | Microchip PIC18 enhanced core |
| Program Memory (Flash) | 32 KB (16K x 16 words) |
| SRAM | 1.5 KB (1536 bytes) |
| EEPROM | 256 bytes |
| Maximum CPU Clock | 40 MHz |
| Instruction Throughput | 10 MIPS |
| Supply Voltage | 4.2 V to 5.5 V |
| I/O Pins | 23 |
| ADC | 10-bit, up to 5 channels |
| CCP Modules | 2 (Capture/Compare/PWM) |
| EUSART | 1 |
| MSSP (SPI / I2C) | 1 (SPI or I2C configurable) |
| Operating Temperature | -40 C to +125 C (E grade) |
| Package | 28-pin SPDIP (0.300 inch, 7.62 mm) |
| Mounting Type | Through-Hole |
| Self-Programming | Yes (in-field flash updates) |
| In-Circuit Debugger | Yes |
PIC18F252-E/SP Pin Configuration
| Pin 1 | MCLR/VPP — Master Clear (active low) / Programming voltage input |
| Pin 2 | RA0/AN0 — PORTA bit 0 / ADC analog input channel 0 |
| Pin 3 | RA1/AN1 — PORTA bit 1 / ADC analog input channel 1 |
| Pin 4 | RA2/AN2/VREF- — PORTA bit 2 / ADC analog input channel 2 / ADC negative reference |
| Pin 5 | RA3/AN3/VREF+ — PORTA bit 3 / ADC analog input channel 3 / ADC positive reference |
| Pin 6 | RA4/T0CKI — PORTA bit 4 (open-drain) / Timer0 clock input |
| Pin 7 | RA5/AN4/SS — PORTA bit 5 / ADC analog input channel 4 / SPI slave select |
| Pin 8 | VSS — Ground reference |
| Pin 9 | OSC1/CLKIN — Crystal oscillator input / external clock input |
| Pin 10 | OSC2/CLKOUT — Crystal oscillator output / clock output |
| Pin 11 | RC0/T1OSO/T13CKI — PORTC bit 0 / Timer1 oscillator output / Timer1 clock input |
| Pin 12 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator input / CCP2 I/O |
| Pin 13 | RC2/CCP1 — PORTC bit 2 / CCP1 I/O |
| Pin 14 | RC3/SCK/SCL — PORTC bit 3 / SPI clock / I2C clock |
| Pin 15 | RC4/SDI/SDA — PORTC bit 4 / SPI data in / I2C data |
| Pin 16 | RC5/SDO — PORTC bit 5 / SPI data out |
| Pin 17 | RC6/TX/CK — PORTC bit 6 / EUSART TX / EUSART synchronous clock |
| Pin 18 | RC7/RX/DT — PORTC bit 7 / EUSART RX / EUSART synchronous data |
| Pin 19 | VSS — Ground reference |
| Pin 20 | VDD — Positive supply (+5V nominal) |
| Pin 21 | RB0/INT0 — PORTB bit 0 / External interrupt 0 |
| Pin 22 | RB1/INT1 — PORTB bit 1 / External interrupt 1 |
| Pin 23 | RB2/INT2 — PORTB bit 2 / External interrupt 2 |
| Pin 24 | RB3/CCP2 — PORTB bit 3 / CCP2 I/O (alternate) |
| Pin 25 | RB4 — PORTB bit 4 (interrupt-on-change) |
| Pin 26 | RB5/PGM — PORTB bit 5 / Low-voltage ICSP programming |
| Pin 27 | RB6/PGC — PORTB bit 6 / ICSP clock |
| Pin 28 | RB7/PGD — PORTB bit 7 / ICSP data |
Typical Applications
PIC18F252-E/SP is suitable for 7 applications: Industrial Sensor Hub, HVAC Thermostat Controller, Small BLDC Motor Pre-Driver, Consumer Appliance Control, Automotive Interior Lighting, Instrumentation and Test Equipment, Educational and Legacy Replacement Designs.
Industrial Sensor Hub
The PIC18F252-E/SP suits distributed industrial sensor hubs where multiple 4-20mA or 0-10V analog signals must be digitized and reported to a host PLC over RS-485. Its 10-bit 5-channel ADC provides sufficient resolution for process monitoring of temperature, pressure, and flow, while the 1.5KB SRAM buffers time-stamped samples before UART transmission at 115200 baud. The wide 4.2V to 5.5V supply range tolerates regulated 5V industrial rails with transients, and the -40C to +125C grade supports outdoor and under-cabinet installations.
Recommended
HVAC Thermostat Controller
For HVAC thermostat designs the PIC18F252-E/SP handles temperature sensing, setpoint scheduling, relay control, and 7-day programming. The two CCP modules drive PID-based damper or compressor PWM outputs, while the 10-bit ADC reads NTC thermistors with a 1.2 C resolution typical at 25 C span. The 32KB flash stores full firmware with multi-language menus and EEPROM retains user schedules through power loss. Extended -40C to +125C operation tolerates attic and equipment-room environments.
Recommended
Small BLDC Motor Pre-Driver
The PIC18F252-E/SP is suitable as a low-cost pre-driver for small brushless DC motors (fans, blowers, appliance pumps). Its two CCP modules generate complementary PWM with dead-band control, while the ADC samples back-EMF on commutation events with 10-bit resolution. The EUSART enables RS-485 speed command reception from a host inverter controller. Compared with the PIC18FxxKxx family, the 'F252 has lower peak PWM resolution but offers robust design heritage and mature MPLAB code examples.
Recommended
Consumer Appliance Control
Domestic appliances such as coffee machines, washing machines, and induction cookers use the PIC18F252-E/SP for keypad matrix scanning, LCD driving, and PID temperature regulation. Its 23 I/O pins allow direct drive of multiplexed 4-digit 7-segment displays, multiple LEDs, and triac-triggered heater elements without external I/O expanders. The MSSP can slave an I2C EEPROM or RTC module (such as the MCP79410) for scheduling, while 32KB flash is ample for full multi-mode firmware.
Recommended
Automotive Interior Lighting
Vehicle interior RGB ambient lighting modules use the PIC18F252-E/SP to drive PWM dimming channels, decode LIN-bus commands, and report fault status. The CCP modules provide 8-bit PWM for smooth brightness transitions over 0-100% duty cycle, while the EUSART can be software-configured for LIN protocol via UART break generation. Compared with full AEC-Q100 parts, the E-grade -40C to +125C rating supports cabin environments, though underhood or AEC-Q100 applications require PIC18FxxK22-Q1 or dsPIC33 grade parts.
Recommended
Instrumentation and Test Equipment
Portable test and measurement instruments using the PIC18F252-E/SP benefit from its 10-bit ADC for voltage, current, and resistance measurements across multiple ranges. The wide input voltage range accepts unregulated 6V battery packs regulated to 5V, and the 256-byte EEPROM stores last-used calibration constants. The MSSP drives 4-wire SPI LCD modules or DAC chips for stimulus, and the EUSART streams ASCII data to Bluetooth or USB-CDC bridges for PC logging.
Recommended
Educational and Legacy Replacement Designs
Universities, makers, and product engineers refreshing end-of-life legacy designs frequently select the PIC18F252-E/SP to replace outdated PIC16F877A and similar mid-range parts. The 32KB flash offers ample code space for C-based curricula, the through-hole SPDIP-28 package is breadboard-friendly for classroom use, and the PICkit 3/4 programmer/debugger ecosystem provides low-cost debug via the ICD pins. This makes the part a long-term teaching and prototyping staple for 8-bit systems.
Recommended
Recommended Products Summary
Engineering reference data for PIC18F252-E/SP — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC18F252-I/SP | PIC18F2520-E/SP | PIC18F2523-E/SP | PIC18F2525-I/SP | PIC18F2620-I/SP | PIC18F258-I/SP |
|---|---|---|---|---|---|---|---|
| Package | 28-SPDIP (0.300 in) | 28-SPDIP (0.300 in) - same | 28-SPDIP (0.300 in) - same | 28-SPDIP (0.300 in) - same | 28-SPDIP (0.300 in) - same | 28-SPDIP (0.300 in) - same | 28-SPDIP (0.300 in) - same |
| Brand | Microchip Technology | Microchip Technology - same | Microchip Technology - same | Microchip Technology - same | Microchip Technology - same | Microchip Technology - same | Microchip Technology - same |
| Flash Memory | 32 KB | 32 KB - same | 32 KB - same | 32 KB - same | 32 KB - same | 64 KB (+100%) | 32 KB - same |
| Maximum Clock | 40 MHz | 40 MHz - same | 40 MHz - same | 40 MHz - same | 40 MHz - same | 40 MHz - same | 40 MHz - same |
| Temperature Grade | E: -40C to +125C | I: -40C to +85C | E: -40C to +125C - same | E: -40C to +125C - same | I: -40C to +85C | I: -40C to +85C | I: -40C to +85C |
| ADC | 10-bit, 5 ch | 10-bit, 5 ch - same | 10-bit, 8 ch | 12-bit, 8 ch (enhanced) | 10-bit, 8 ch | 10-bit, 8 ch | 10-bit, 5 ch - same |
| CAN Module | No | No | No | No | No | No | Yes (CAN) |
| nanoWatt Sleep Current | Standard (no nanoWatt) | Standard (no nanoWatt) | Yes (nanoWatt) | Yes (nanoWatt) | Yes (nanoWatt) | Yes (nanoWatt) | Standard (no nanoWatt) |
Key Differentiators
- Extended -40C to +125C temperature grade (vs PIC18F252-I/SP)
- Doubled flash vs 16KB mid-range PIC16F parts (vs PIC16F877A-I/P)
- Through-hole SPDIP-28 form factor (vs PIC18F252-E/SO (SOIC-28))
- Self-programmable flash with ICSP (vs PIC16F series with ICD support only)
Design Notes
The PIC18F252-E/SP operates over 4.2V to 5.5V with a typical 5V supply derived from a 7805 or DC-DC regulator. Decouple VDD with a 100nF ceramic capacitor within 5 mm of pin 20 plus a bulk 10 uF tantalum or aluminum electrolytic on the 5V rail. For battery or USB-powered designs where 4.2V supply headroom matters, the nanoWatt PIC18F2520/2525 series provides better sleep performance.
Do not leave MCLR/VPP (pin 1) floating. Always pull up to VDD via a 10k resistor; otherwise the device sees spurious resets from leakage or ESD events. For ICSP debugging, populate a 10k pull-up AND an in-circuit ICD connector isolation scheme (per Microchip DS39564 figure 2-3). Floating OSC1/OSC2 will cause phantom clock domains when an external crystal is not fitted; use a software-selectable internal oscillator mode instead.
Through-hole SPDIP-28 designs benefit from placing decoupling capacitors directly adjacent to the VDD (pin 20) and VSS (pin 19/8) pins. Route analog VREF+/VREF- (RA3/RA2) traces away from PWM switching lines to preserve ADC accuracy. For mixed-signal designs, separate digital and analog ground planes joined only at the MCU VSS pin.
For SPI/I2C bus lengths above 100 mm, series-terminate the SCK line with 33-100 ohm resistors to suppress ringing into the MSSP input. The PIC18F252-E SP drives 5V TTL signaling; when interfacing to 3.3V peripherals a level shifter such as the LTC4317 or PCA9306 is required. The EUSART remains a robust noise-tolerant debug path on long cable runs.
The PIC18F252-E SP dissipates a maximum of approximately 250 mW in active 40 MHz operation across -40 C to +125 C. Thermal resistance theta_JA for SPDIP-28 is approximately 65 C/W on a typical 2-layer test PCB (no heatsink required). For continuous heavy GPIO toggling that approaches the absolute current budget (200 mA total I/O sink), verify with a thermal probe at the package body.
Compliance Information
RoHS and REACH compliance per Microchip PIC18F product family statement. The -E suffix designates Extended temperature grade and does NOT carry AEC-Q100 automotive qualification - for AEC-Q100 applications use automotive-grade PIC18F46K22-I/SP or PIC18F258-I/SP variants.