PIC18F45K42-I/P - 8-bit 64MHz MCU, 32KB Flash, 40-PDIP | Microchip
MPN: PIC18F45K42-I/P ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $2.85 | $2.85 |
| 10 | $2.62 | $26.20 |
| 100 | $2.21 | $221.00 |
| 500 | $1.92 | $960.00 |
| 1,000 | $1.68 | $1,680.00 |
PIC18F45K42-I/P Overview
What is a PIC18 microcontroller? A PIC18 is a family of 8-bit Harvard-architecture RISC microcontrollers from Microchip Technology that combine a modified Harvard core with rich peripheral integration. PIC18 MCUs sit above PIC16 parts in the Microchip 8-bit portfolio and below the dsPIC/PIC24 16-bit line, forming the workhorse tier for embedded control, IoT edge nodes, automotive body and white-goods applications where deterministic I/O and a familiar toolchain matter more than raw MIPS.
Key features include a 12-bit ADC with computation (ADC2), a 5-bit DAC, three op-amps, two comparators, a Complementary Waveform Generator (CWG), multiple PWM channels, Direct Memory Access (DMA), vector interrupts, a Device Information Area (DIA) and a Memory Access Partition (MAP) for bootloader/dual-image partitioning. The K42 family also integrates Core Independent Peripherals (CIPs) that operate without CPU intervention, reducing firmware complexity and improving real-time determinism.
The device operates from 2.3 V to 5.5 V on a single supply, supports the eXtreme Low Power (XLP) sleep modes, and offers up to 36 I/O pins plus one input-only pin. It uses a 4PLL clock tree from a 64 MHz internal oscillator, providing instruction-cycle timing down to 62.5 ns. Programming is supported by MPLAB X IDE, XC8 compilers and the PICkit/SNAP/MPLAB ICD programmer family.
Typical applications include industrial sensor conditioning, motor and pump control, small-form-factor consumer appliances, LED lighting controllers and home-automation gateways. The 40-pin PDIP form factor remains popular for prototypes, educational kits and low-volume production where through-hole soldering simplifies rework.
When designing with this part, allocate the 12-bit ADC2 with adequate acquisition time, de-bounce mechanical inputs in firmware, and respect the 5.5 V absolute maximum on VDD. For migration to surface-mount, the K42 family also offers 40-pin QFN and TQFP packages with the same peripheral set.
Drop-in alternatives for PIC18F45K42-I/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 PIC18F45K42-I/P (same form factor and footprint) — differing in ADC, Operating Temperature, Package, PWM Channels, Comparators.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC18F45K42-I/ML
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18F45K42-E/P
✅ Drop-In✓ In Stock
$1.85 / Unit
View Datasheet →PIC18F45K42-I/MV
✅ Drop-In✓ In Stock
$1.18 / Unit
View Datasheet →PIC18F45K40T-I/PT
✅ Drop-In✓ In Stock
$1.78 / Unit
View Datasheet →PIC18F45K22-I/P
✅ Drop-In✓ In Stock
$2.1 / Unit
View Datasheet →PIC18F45K42-I/P Maximum Ratings & Electrical Characteristics
| Core | PIC18 8-bit RISC |
| Program Memory (Flash) | 32 KB (16K x 16) |
| RAM | 2 KB |
| EEPROM | 256 B |
| Maximum CPU Frequency | 64 MHz |
| Operating Voltage (VDD) | 2.3 V to 5.5 V |
| I/O Pins | 36 (plus 1 input-only) |
| ADC | 12-bit ADC2 with computation |
| DAC | 5-bit DAC |
| Comparators | 2 |
| Op-Amps | 3 |
| PWM Channels | Multi-channel (peripheral-dependent) |
| DMA | Yes |
| Package | 40-pin PDIP (DIP-40) |
| Operating Temperature | -40C to +85C (Industrial, "-I" suffix) |
| Mounting Type | Through-Hole |
| RoHS Status | Compliant |
PIC18F45K42-I/P Pin Configuration
| Pin 1 | MCLR — Master Clear (reset) input, internal pull-up |
| Pin 2 | RA0 — Port A bit 0 / I/O |
| Pin 3 | RA1 — Port A bit 1 / I/O |
| Pin 4 | RA2 — Port A bit 2 / I/O |
| Pin 5 | RA3 — Port A bit 3 / I/O |
| Pin 6 | RA4 — Port A bit 4 / I/O |
| Pin 7 | RA5 — Port A bit 5 / I/O |
| Pin 8 | RA6 — Port A bit 6 / I/O |
| Pin 9 | RA7 — Port A bit 7 / I/O |
| Pin 10 | RC0 — Port C bit 0 / I/O |
| Pin 11 | RC1 — Port C bit 1 / I/O |
| Pin 12 | RC2 — Port C bit 2 / I/O |
| Pin 13 | RC3 — Port C bit 3 / I/O |
| Pin 14 | RC4 — Port C bit 4 / I/O |
| Pin 15 | RC5 — Port C bit 5 / I/O |
| Pin 16 | RC6 — Port C bit 6 / I/O |
| Pin 17 | RC7 — Port C bit 7 / I/O |
| Pin 18 | RD0 — Port D bit 0 / I/O |
| Pin 19 | RD1 — Port D bit 1 / I/O |
| Pin 20 | RD2 — Port D bit 2 / I/O |
| Pin 21 | RD3 — Port D bit 3 / I/O |
| Pin 22 | RD4 — Port D bit 4 / I/O |
| Pin 23 | RD5 — Port D bit 5 / I/O |
| Pin 24 | RD6 — Port D bit 6 / I/O |
| Pin 25 | RD7 — Port D bit 7 / I/O |
| Pin 26 | RE0 — Port E bit 0 / I/O |
| Pin 27 | RE1 — Port E bit 1 / I/O |
| Pin 28 | RE2 — Port E bit 2 / I/O |
| Pin 29 | RE3 — Port E bit 3 / I/O (input only) |
| Pin 30 | VSS — Ground reference |
| Pin 31 | VDD — Positive supply voltage 2.3-5.5 V |
| Pin 32 | OSC1 — External oscillator input / CLKIN |
| Pin 33 | OSC2 — External oscillator output / CLKOUT |
| Pin 34 | RB0 — Port B bit 0 / I/O |
| Pin 35 | RB1 — Port B bit 1 / I/O |
| Pin 36 | RB2 — Port B bit 2 / I/O |
| Pin 37 | RB3 — Port B bit 3 / I/O |
| Pin 38 | RB4 — Port B bit 4 / I/O |
| Pin 39 | RB5 — Port B bit 5 / I/O |
| Pin 40 | RB6 — Port B bit 6 / I/O / PGC (ICSP clock) |
Typical Applications
PIC18F45K42-I/P is suitable for 6 applications: Industrial Sensor Conditioning, Small Motor and Pump Control, Home Automation Gateways, White Goods and Appliance Control, LED Lighting and Human-Machine Interfaces, Educational and Hobbyist Prototyping.
Industrial Sensor Conditioning
The PIC18F45K42-I/P is well matched to industrial analog sensor front-ends thanks to its integrated 12-bit ADC2 with computation, three on-chip op-amps and two comparators, all on a single 2.3 V to 5.5 V rail. The on-die op-amps can buffer bridge-style pressure, load-cell or thermocouple signals directly into the ADC2 input, eliminating external instrumentation amplifiers in many designs. ADC2's hardware accumulation and averaging cut CPU overhead, while DMA moves conversion results to RAM without waking the core, preserving the eXtreme Low Power sleep modes for battery-backed sensor nodes.
Recommended
Small Motor and Pump Control
For brushless DC, brushed DC or small induction motor control, the PIC18F45K42-I/P delivers multi-channel PWM, a Complementary Waveform Generator (CWG) with dead-band control, and vector interrupts for fast fault response. The CWG block generates complementary gate-drive signals with programmable dead time, while the DMA engine offloads repetitive PWM-update work from the CPU, freeing cycles for the control loop. Operating from 2.3 V to 5.5 V at 64 MHz, it can drive low-side FETs directly through its I/O pins.
Recommended
Home Automation Gateways
In home automation hubs and edge gateways, the PIC18F45K42-I/P handles sub-gigahertz or Wi-Fi co-processor interfaces, keypad scanning and LED feedback while sipping power in sleep. The Memory Access Partition (MAP) feature lets designers implement a fail-safe bootloader with dual-image rollback over OTA firmware updates, critical for connected products. With 32 KB Flash and 2 KB RAM, the device can host lightweight wireless stacks such as MiWi or LoRa P2P, plus application logic for sensor aggregation and local control.
Recommended
White Goods and Appliance Control
Refrigerator, dishwasher and washing-machine control boards rely on the PIC18F45K42-I/P's industrial temperature grade (-40C to +85C), high-noise immunity and on-chip op-amps for current and temperature monitoring. The 36 I/O pins drive relays, triac gate couplers, seven-segment displays and keypad matrices directly. DMA and Core Independent Peripherals handle time-critical tasks like zero-crossing detection and triac firing without CPU load, while the 256-byte EEPROM stores user preference settings across power cycles.
Recommended
LED Lighting and Human-Machine Interfaces
Smart LED drivers and HMI front panels benefit from the PIC18F45K42-I/P's multi-channel PWM, 12-bit ADC2 for light-sensing feedback and capacitive touch via the CTMU peripheral. Designers can implement capacitive touch buttons, sliders and proximity sensing purely in firmware with no external touch IC. The DAC and PWM together support smooth RGB color-mixing and dimming curves, while the 5-bit DAC drives analog reference nodes for closed-loop current control of LED strings.
Recommended
Educational and Hobbyist Prototyping
The 40-pin PDIP through-hole package of the PIC18F45K42-I/P remains a favorite in university embedded courses and hobbyist labs because it fits standard 0.6 inch wide DIP sockets, breadboards and solderless prototyping. With 32 KB Flash, students can implement UART, I2C, SPI and ADC labs in a single chip. Native 5 V tolerance on I/O simplifies interfacing with legacy TTL peripherals, and the free MPLAB X IDE plus XC8 compiler removes cost barriers for first-time embedded learners.
Recommended
Recommended Products Summary
Engineering reference data for PIC18F45K42-I/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC18F45K42-I/ML | PIC18F45K42-E/P | PIC18F45K42-I/MV | PIC18F45K40T-I/PT | PIC18F45K22-I/P |
|---|---|---|---|---|---|---|
| Package | PDIP-40 | QFN-40 | PDIP-40 | UQFN-40 | TQFP-44 | PDIP-40 |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Flash Memory | 32 KB | 32 KB | 32 KB | 32 KB | 16 KB | 32 KB |
| RAM | 2 KB | 2 KB | 2 KB | 2 KB | 2 KB | 2 KB |
| Maximum CPU Frequency | 64 MHz | 64 MHz | 64 MHz | 64 MHz | 64 MHz | 64 MHz |
| Operating Voltage | 2.3 V to 5.5 V | 2.3 V to 5.5 V | 2.3 V to 5.5 V | 2.3 V to 5.5 V | 2.3 V to 5.5 V | 2.3 V to 5.5 V |
| Temperature Grade | -40C to +85C (Industrial) | -40C to +85C (Industrial) | -40C to +125C (Extended) | -40C to +85C (Industrial) | -40C to +85C (Industrial) | -40C to +85C (Industrial) |
| ADC | 12-bit ADC2 with computation | 12-bit ADC2 with computation | 12-bit ADC2 with computation | 12-bit ADC2 with computation | 12-bit ADC2 with computation | 10-bit ADC |
| On-chip Op-amps | 3 | 3 | 3 | 3 | 3 | 0 |
| DMA | Yes | Yes | Yes | Yes | Yes | No |
Key Differentiators
- Integrated analog front-end (3 op-amps, 12-bit ADC2 with computation, 5-bit DAC) (vs PIC18F45K22-I/P)
- MAP/DIA memory partitioning with DMA (vs PIC18F45K22-I/P)
- Through-hole 40-pin PDIP option for prototyping (vs PIC18F45K42-I/ML (QFN-40))
Design Notes
The PIC18F45K42-I/P operates from a single 2.3 V to 5.5 V rail; place a 100 nF decoupling capacitor within 5 mm of each VDD pin (pins 11 and 32 in PDIP-40) plus a bulk 10 uF tantalum or ceramic on the main VDD trace. For battery-powered designs, leverage the nanoWatt XLP Sleep mode with RTCC wake to achieve sub-uA quiescent current, and use Sleep and Idle mode gating of peripherals via PMD registers to cut active current further.
Even on a through-hole PDIP, route the ICSP lines (PGD/PGC on RB6/RB7) as short and direct as possible with no series resistors greater than 100 ohms; for production boards add an ICSP header footprint even if not stuffed to enable in-field firmware updates. Keep the crystal or external oscillator traces short and guard them with a ground pour to avoid injection of switching noise into the system clock.
The MCLR pin (pin 1) requires a pull-up resistor (typically 10 kohm) to VDD for reliable operation; leaving it floating causes erratic resets. Configuration words must be set in code before any other peripheral configuration; an unconfigured CONFIG can lock the device or set the wrong oscillator mode. Finally, never apply voltage to any I/O pin before VDD is powered, or current can flow through the ESD clamps and latch up the part.
The 40-pin PDIP package has a theta_JA of approximately 60 C/W in still air, providing comfortable thermal margin for typical 8-bit MCU loads (under 50 mW). Estimated: at the maximum industrial operating temperature of +85C, internal dissipation up to ~1 W still keeps the junction below +125C, so no heatsink is required. For elevated-temperature environments above +85C, migrate to the -E/P extended-temperature sibling instead of relying on derating.
Compliance Information
RoHS and lead-free per Microchip product page. Not AEC-Q100 qualified - choose AEC-Q100 grade parts (e.g. PIC18FxxK42 -Q grades) for automotive.