PIC18F2520-I/SP - 8-bit 40MHz 32KB Flash MCU | Microchip | 28-SPDIP
MPN: PIC18F2520-I/SP ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $5.2 | $5.20 |
| 10 | $4.68 | $46.80 |
| 100 | $4.16 | $416.00 |
| 500 | $3.74 | $1,870.00 |
| 1,000 | $3.33 | $3,330.00 |
PIC18F2520-I/SP Overview
A microcontroller (MCU) is a single-chip computer that integrates a CPU core, non-volatile program memory, working RAM, and configurable peripherals such as ADC, PWM, timers, and serial interfaces. Within the broader taxonomy, the PIC18F2520 belongs to the 8-bit MCU class, sits in the PIC18 enhanced RISC family, and is positioned by Microchip between baseline PIC10/12/16 parts and the 16-bit dsPIC/PIC24 line. The 28-pin SPDIP variant is the classic DIP-28 form factor used for prototyping, breadboarding, and legacy industrial controller cards where socketed replacement is desirable.
Key features include a C-optimized enhanced Harvard architecture with 8x8 single-cycle hardware multiply, an internal oscillator block covering 31 kHz to 8 MHz, a Fail-Safe Clock Monitor, two 8-bit and three 16-bit timers, an Enhanced Capture/Compare/PWM (ECCP) module, two MSSP blocks supporting SPI and I2C (master/slave), an Enhanced USART, 10-bit ADC with up to 10 channels, two analog comparators, and a programmable Low-Voltage Detect module. The on-board nanoWatt technology offers Idle, Sleep, and low-power Timer1 oscillator operation.
Typical applications include industrial control panels, motor drive signal conditioning, sensor interface boards, low-power remote sensor nodes, legacy PIC18 firmware upgrades that need more Flash and peripherals than older PIC16 designs, and educational kits where the SPDIP-28 footprint simplifies breadboard use and socketed replacement.
Designers should provide a stable 4.2 V to 5.5 V supply, place a 100 nF decoupling capacitor close to VDD, route MCLR with a 10 kohm pull-up, and budget for the in-circuit serial programming (ICSP) header required by PICkit programmers. Industrial-temperature (-40C to +85C) operation is supported.
This page consolidates verified distributor pricing, drop-in pin-compatible alternatives in the SPDIP-28 footprint, and application guidance drawn from the Microchip PIC18F2420/2520/4420/4520 datasheet that the bare DigiKey or Mouser listing does not provide.
Drop-in alternatives for PIC18F2520-I/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 PIC18F2520-I/SP (same form factor and footprint) — differing in Package, Operating Temperature, Core, ADC, Program Memory (Flash).
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC18F2420-I/SP
✅ Drop-In✓ In Stock
$5.22 / Unit
View Datasheet →PIC18F2620-I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18LF2520-I/SP
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18F2520-E/SP
✅ Drop-In✓ In Stock
$5.1 / Unit
View Datasheet →PIC18F2520-I/SP Maximum Ratings & Electrical Characteristics
| Core | PIC 8-bit (PIC18 enhanced Harvard) |
| Maximum CPU Speed | 40 MHz (10 MIPS) |
| Program Memory (Flash) | 32 KB (16K x 16) |
| Data SRAM | 1.5 KB (1536 bytes) |
| Data EEPROM | 256 bytes |
| Supply Voltage (VDD) | 4.2 V to 5.5 V |
| I/O Pins | 25 |
| Package | 28-pin SPDIP (0.300 in, 7.62 mm) |
| Mounting Type | Through-Hole (DIP) |
| ADC | 10-bit, up to 10 channels |
| Timers | 2 x 8-bit, 3 x 16-bit |
| PWM / ECCP | Enhanced CCP + 2 CCP |
| Serial Interfaces | MSSP x2 (SPI / I2C), Enhanced USART |
| Comparators | 2 analog comparators |
| Internal Oscillator | 31 kHz to 8 MHz, with PLL and Fail-Safe Clock Monitor |
| Operating Temperature | -40 C to +85 C (Industrial) |
| RoHS Status | Compliant |
| Programming Method | ICSP (In-Circuit Serial Programming) via PGD/PGC/MCLR |
PIC18F2520-I/SP Pin Configuration
| Pin 1 | MCLR/RE3 — Master Clear (reset) input / digital I/O RE3 |
| Pin 2 | RA0/AN0 — PORTA bit 0 / analog input AN0 |
| Pin 3 | RA1/AN1 — PORTA bit 1 / analog input AN1 |
| Pin 4 | RA2/AN2/VREF- — PORTA bit 2 / analog input AN2 / negative voltage reference |
| Pin 5 | RA3/AN3/VREF+ — PORTA bit 3 / analog input AN3 / positive voltage reference |
| Pin 6 | RA4/T0CKI/C1OUT — PORTA bit 4 / Timer0 clock input / Comparator 1 output |
| Pin 7 | RA5/AN4/SS/HLVDIN/C2OUT — PORTA bit 5 / analog input AN4 / SPI slave select / HLVD input / Comparator 2 output |
| Pin 8 | OSC1/CLKI/RA7 — Crystal oscillator input / external clock input / PORTA bit 7 |
| Pin 9 | OSC2/CLKO/RA6 — Crystal oscillator output / clock output / PORTA bit 6 |
| Pin 10 | VSS — Ground reference |
| Pin 11 | VDD — Positive supply voltage (4.2 V to 5.5 V) |
| Pin 12 | AVSS — Analog ground reference |
| Pin 13 | AVDD — Analog positive supply voltage |
| Pin 14 | RB7/PGD — PORTB bit 7 / In-Circuit Debugger data pin |
| Pin 15 | RB6/PGC — PORTB bit 6 / In-Circuit Debugger clock pin |
| Pin 16 | RB5/PGM — PORTB bit 5 / Low-Voltage Programming enable |
| Pin 17 | RB4 — PORTB bit 4 (interrupt-on-change) |
| Pin 18 | RB3/AN9/CCP2 — PORTB bit 3 / analog input AN9 / Capture/Compare/PWM 2 |
| Pin 19 | RB2/AN8/INT2 — PORTB bit 2 / analog input AN8 / external interrupt 2 |
| Pin 20 | RB1/AN10/INT1 — PORTB bit 1 / analog input AN10 / external interrupt 1 |
| Pin 21 | RB0/AN12/INT0 — PORTB bit 0 / analog input AN12 / external interrupt 0 |
| Pin 22 | RC7/RX/DT — PORTC bit 7 / USART RX / synchronous data |
| Pin 23 | RC6/TX/CK — PORTC bit 6 / USART TX / synchronous clock |
| Pin 24 | RC5/SDO — PORTC bit 5 / SPI data out |
| Pin 25 | RC4/SDI/SDA — PORTC bit 4 / SPI data in / I2C data |
| Pin 26 | RC3/SCL/SCK — PORTC bit 3 / I2C clock / SPI clock |
| Pin 27 | RC2/CCP1/P1A — PORTC bit 2 / Capture/Compare/PWM 1 / PWM 1 output A |
| Pin 28 | RC1/T1OSI/CCP2 — PORTC bit 1 / Timer1 oscillator input / Capture/Compare/PWM 2 |
Typical Applications
PIC18F2520-I/SP is suitable for 6 applications: Industrial Control Panels, Sensor Interface Boards, Motor Drive Signal Conditioning, Legacy PIC18 Firmware Upgrades, Educational and Prototyping Kits, Low-Power Remote Sensor Nodes.
Industrial Control Panels
The PIC18F2520-I/SP fits legacy industrial control panels that need a socketed 28-SPDIP MCU running deterministic firmware. Its 40 MHz (10 MIPS) PIC18 core drives ladder-logic replacement and relay sequencing, the 25 I/O pins handle digital inputs from limit switches and outputs to contactors via optocouplers, and the 10-bit ADC reads 4-20 mA loopback voltages for analog sensor monitoring. With 32 KB of Flash, the part supports full Modbus RTU slave stacks via the Enhanced USART. Per the PIC18F2x20 datasheet, the industrial -40C to +85C temperature grade and robust ESD on digital pins make it a long-life controller for factory-floor panels.
Recommended
Sensor Interface Boards
The PIC18F2520-I/SP is well suited to multi-sensor interface boards because it offers up to 10 channels of 10-bit ADC for analog sensors plus two MSSP blocks for SPI and I2C digital sensors. Its 40 MHz core can service up to 100 kHz ADC conversions while maintaining serial communication, and 1536 bytes of SRAM are sufficient for short sensor-data buffers and protocol stacks. The internal oscillator block (31 kHz to 8 MHz) eliminates an external crystal in space-constrained layouts. Per the Microchip PIC18F2x20 datasheet, the nanoWatt Sleep current lets the MCU idle at microamp-levels between sensor reads, ideal for battery-powered remote telemetry.
Recommended
Motor Drive Signal Conditioning
The PIC18F2520-I/SP drives BLDC and stepper motor control boards by combining its Enhanced CCP (ECCP) module for PWM generation with the 16-bit timers for commutation timing. The 25 I/O pins handle Hall-sensor inputs, gate-driver signals, current-sense ADC channels, and direction/enable control lines. Its 32 KB Flash accommodates sensorless back-EMF or FOC firmware, while 1536 bytes of SRAM hold short current-control loops. Per the Microchip PIC18F2x20 datasheet, the Enhanced USART plus an MSSP running SPI can connect to external gate drivers such as the MCP8024 family. The 40 MHz PIC18 core delivers deterministic 100 ns PWM resolution.
Recommended
Legacy PIC18 Firmware Upgrades
The PIC18F2520-I/SP is the canonical upgrade target for designers porting from older PIC16 designs that have outgrown 16-bit-wide instruction ROM or limited I/O. Its 32 KB Flash and 1536 bytes of SRAM comfortably fit enhanced protocol stacks (Modbus, LIN, I2C peripheral managers) while keeping the same SPDIP-28 footprint for retrofit PCBs. Per the Microchip PIC18F2x20 datasheet, the enhanced Harvard architecture with 8x8 hardware multiply cuts execution time on DSP-style math versus PIC16 cores. Existing ICSP programming infrastructure works unchanged, simplifying migration for service and replacement markets.
Recommended
Educational and Prototyping Kits
The PIC18F2520-I/SP is widely used in university microcontroller courses and hobbyist prototyping kits because the 28-SPDIP package fits standard 28-pin IC sockets and breadboards. Its 40 MHz PIC18 core, 25 I/O pins, 32 KB Flash, and rich peripheral set (ADC, PWM, I2C, SPI, USART) give students a single device to learn timers, interrupts, ADC sampling, and serial protocols. Per the Microchip PIC18F2x20 datasheet, ICSP via PGD/PGC/MCLR works directly with the MPLAB PICkit 5 programmer, providing an in-circuit debug and single-step flow. The /SP variant's through-hole leads survive repeated insertion cycles for hands-on labs.
Recommended
Low-Power Remote Sensor Nodes
The PIC18F2520-I/SP supports battery-powered remote sensor nodes through its nanoWatt technology, including Idle, Sleep, and low-power Timer1 oscillator modes that drop current to microamp-levels between sensor reads. With 1536 bytes of SRAM and 256 bytes of EEPROM for local data logging, it can buffer readings and transmit them periodically via the Enhanced USART or a 2.4 GHz module on the SPI bus. Per the Microchip PIC18F2x20 datasheet, the 31 kHz to 8 MHz internal oscillator with Fail-Safe Clock Monitor eliminates external crystals and provides automatic recovery from clock failures. The wide industrial temperature grade supports outdoor deployments.
Recommended
Recommended Products Summary
Engineering reference data for PIC18F2520-I/SP — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC18F2420-I/SP | PIC18F2620-I/SP | PIC18LF2520-I/SP | PIC18F2520-E/SP |
|---|---|---|---|---|---|
| Package | 28-SPDIP | 28-SPDIP - same | 28-SPDIP - same | 28-SPDIP - same | 28-SPDIP - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Program Flash | 32 KB | 16 KB (-50%) | 64 KB (+100%) | 32 KB (same) | 32 KB (same) |
| Data SRAM | 1.5 KB | 1.5 KB (same) | 3.9 KB (+160%) | 1.5 KB (same) | 1.5 KB (same) |
| Data EEPROM | 256 bytes | 256 bytes (same) | 1 KB (+300%) | 256 bytes (same) | 256 bytes (same) |
| Maximum CPU Speed | 40 MHz (10 MIPS) | 40 MHz (10 MIPS) | 40 MHz (10 MIPS) | 40 MHz (10 MIPS) | 40 MHz (10 MIPS) |
| Operating Voltage | 4.2 V to 5.5 V | 4.2 V to 5.5 V | 4.2 V to 5.5 V | 2.0 V to 5.5 V | 4.2 V to 5.5 V |
| Operating Temperature | -40 C to +85 C | -40 C to +85 C | -40 C to +85 C | -40 C to +85 C | -40 C to +125 C (extended) |
| I/O Pins | 25 | 25 | 25 | 25 | 25 |
| ADC | 10-bit, up to 10 channels | 10-bit, up to 10 channels | 10-bit, up to 10 channels | 10-bit, up to 10 channels | 10-bit, up to 10 channels |
Key Differentiators
- Higher Flash density versus the PIC18F2420-I/SP (vs PIC18F2420-I/SP)
- Low-voltage LF variant for 3.3 V designs (vs PIC18LF2520-I/SP)
- Industrial operating temperature grade standard (vs PIC18F2520-E/SP)
- Mature lifecycle with active production (vs Discontinued legacy PIC16F MCUs)
Design Notes
Estimated: at 40 MHz the PIC18F2520-I/SP core draws ~16 mA from VDD per the Microchip PIC18F2x20 datasheet DC characteristics. Add 100 nF and 10 uF decoupling capacitors on VDD close to the MCU pins, and place a bulk 47 uF electrolytic on the 5 V rail. For battery-powered designs, use the LF variant (2.0 V to 5.5 V) and place the part in Sleep between events; nanoWatt Sleep current is below 100 nA typical.
Per the Microchip PIC18F2x20 datasheet, route MCLR to VDD through a 10 kohm pull-up with a 100 nF decoupling capacitor to ground (capacitor pin-side). Keep the MCLR trace short to avoid noise-induced resets. Place the ICSP header (PGD, PGC, MCLR, VDD, VSS) on the PCB edge to allow PICkit 5 in-circuit debug without removing the part. A ferrite bead between digital and analog VDD reduces ADC noise by 1-2 LSBs.
Do not configure RB7/RB6 as ordinary digital I/O without first disabling PGD/PGC in the configuration bits, or ICSP programming will fail on the final locked board. Avoid driving the MCLR pin below VIL below 1.5 V without proper slew-rate control; slow MCLR rise can cause intermittent resets. When migrating firmware from PIC18F2420, double-check interrupt vector table boundaries because the larger 2520 code space can shift vector offsets if not relinked.
Estimated: the PIC18F2520-I/SP 10-bit ADC achieves approximately +/- 1 LSB INL when AVdd is decoupled with a separate 10 uH ferrite bead from digital VDD and a 100 nF + 10 uF capacitor pair is placed within 5 mm of the AVdd pin. Per the Microchip PIC18F2x20 datasheet, the internal voltage reference has ~50 ppm/C drift; for precision work, use an external reference such as MCP1525 driving VREF+. Sample-and-hold acquisition time at 10-bit resolution is approximately 1.4 us.
Compliance Information
RoHS compliant per Microchip product page; not AEC-Q100 qualified (industrial-grade MCU for commercial/industrial, not automotive). Lead-free and halogen-free packaging per Microchip product family datasheet.