PIC18LF45K42-E/P - 32KB Flash, 64MHz 8-bit MCU | Microchip
MPN: PIC18LF45K42-E/P ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $3.24 | $3.24 |
| 10 | $2.91 | $29.10 |
| 100 | $2.59 | $259.00 |
| 500 | $2.27 | $1,135.00 |
| 1,000 | $1.99 | $1,990.00 |
PIC18LF45K42-E/P Overview
A microcontroller (MCU) is a single-chip computer containing a CPU core, volatile and non-volatile memory, programmable peripherals, and I/O pins. The PIC18 family from Microchip is built on an enhanced 8-bit Harvard RISC architecture optimized for deterministic real-time control, while the LF suffix denotes the low-voltage F-family variant aimed at battery and energy-harvesting applications. This part belongs to the broader hierarchy: microcontroller -> 8-bit MCU -> PIC18 -> PIC18F K42 sub-family -> low-power (LF) line -> 40-pin segment.
Key differentiating features include the 12-bit ADCC with automatic averaging and threshold comparison offloading CPU cycles, the Direct Memory Access (DMA) controller that moves data between peripherals and memory without CPU intervention, and the Peripheral Pin Select (PPS) which remaps digital I/O functions to virtually any pin. The device also includes Zero-Cross Detection (ZCD), Complementary Waveform Generator (CWG), and Windowed Watchdog Timer (WWDT) for safety-critical loop timing. A 32KB self-programmable Flash supports bootloaders and field firmware updates.
Architecturally the K42 family uses Microchip's eXtreme Low Power (XLP) technology with typical sleep currents in the nanoamp range and multiple IDLE/DOZE/PMD power-management modes. The 64MHz maximum clock derives from a 16MHz internal oscillator with a 4x PLL, and the device supports instruction-cycle throughput of 16 MIPS at 64MHz. Core-independent peripherals (CIPs) such as CWG, NCO, and PWM allow complex waveform synthesis with zero CPU involvement.
Typical applications include low-power IoT sensor nodes running on coin-cell batteries, home-automation and HVAC control units, LED lighting controllers with smooth dimming, USB-to-UART bridge devices, industrial sensor conditioning with 12-bit ADC acquisition, and motor-control signal conditioning using the CWG and PWM peripherals. The wide operating voltage range and XLP features also suit portable medical and metering instruments.
When designing with this MCU, plan for ICD/ICSP header access on every prototype to support in-circuit debugging via Microchip's MPLAB X IDE. The PPS system must be configured in firmware before peripheral use; failure to do so will leave pins floating. Finally, verify the 64MHz core speed against the chosen low-voltage mode - maximum frequency drops at lower Vdd.
This page consolidates verified distributor pricing, drop-in alternative MPNs, datasheet pointers, and practical design notes tailored for engineers selecting or sourcing this MCU.
Drop-in alternatives for PIC18LF45K42-E/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 PIC18LF45K42-E/P (same form factor and footprint) — differing in Package, ADC, Mounting Type, Program Memory (Flash), RoHS Status.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC18LF45K42-I/P
✅ Drop-In ⚠️ Specs Unverified✓ In Stock
$1.05 / Unit
View Datasheet →PIC18LF45K40-E/PT
✅ Drop-In ⚠️ Specs Unverified✓ In Stock
$1.86 / Unit
View Datasheet →PIC18LF45K22-E/P
✅ Drop-In ⚠️ Specs Unverified✓ In Stock
$2.62 / Unit
View Datasheet →PIC18LF43K22-E/P
✅ Drop-In ⚠️ Specs Unverified✓ In Stock
$1.74 / Unit
View Datasheet →PIC18LF45K42-E/P Maximum Ratings & Electrical Characteristics
| Family | PIC18F K42 (XLP) |
| Core | 8-bit PIC RISC |
| Program Memory (Flash) | 32 KB (16K x 16) |
| Data RAM | 2 KB (2048 bytes) |
| Data EEPROM | 256 bytes |
| Maximum CPU Speed | 64 MHz (16 MIPS) |
| Supply Voltage (Vdd) | 1.8 V to 3.6 V |
| I/O Pins | 36 |
| ADC | 12-bit ADC2 (ADCC), up to 35 channels |
| DAC | Yes, 5-bit/8-bit/10-bit selectable |
| Comparators | Yes |
| PWM Channels | Multiple 16-bit PWM |
| Complementary Waveform Generator (CWG) | Yes |
| DMA Channels | Yes |
| Peripheral Pin Select (PPS) | Yes |
| Zero-Cross Detect (ZCD) | Yes |
| Windowed Watchdog Timer (WWDT) | Yes |
| Communication | UART, SPI, I2C |
| Operating Temperature | -40C to +125C (E = Extended) |
| Package | 40-pin PDIP (DIP-40, 0.600 inch, 15.24 mm) |
| Mounting Type | Through-Hole (THT) |
| MSL Level | Not Applicable (through-hole) |
| RoHS Status | Compliant |
| Lead-Free | Yes |
PIC18LF45K42-E/P Pin Configuration
| Pin 1 | MCLR/RE3 — Master Clear (reset) input or digital input-only RE3 |
| Pin 2 | RA0 — PORTA bit 0 / analog / PPS |
| Pin 3 | RA1 — PORTA bit 1 / analog / PPS |
| Pin 4 | RA2 — PORTA bit 2 / analog / PPS |
| Pin 5 | RA3 — PORTA bit 3 / analog / PPS |
| Pin 6 | RA4 — PORTA bit 4 / analog / PPS |
| Pin 7 | RA5 — PORTA bit 5 / analog / PPS |
| Pin 8 | RA6 — PORTA bit 6 / analog / PPS |
| Pin 9 | RA7 — PORTA bit 7 / analog / PPS |
| Pin 10 | VSS — Ground reference |
| Pin 11 | VDD — Positive supply (1.8-3.6 V) |
| Pin 12 | RB0 — PORTB bit 0 / interrupt-on-change / PPS |
| Pin 13 | RB1 — PORTB bit 1 / interrupt-on-change / PPS |
| Pin 14 | RB2 — PORTB bit 2 / interrupt-on-change / PPS |
| Pin 15 | RB3 — PORTB bit 3 / interrupt-on-change / PPS |
| Pin 16 | RB4 — PORTB bit 4 / interrupt-on-change / PPS |
| Pin 17 | RB5 — PORTB bit 5 / interrupt-on-change / PPS |
| Pin 18 | RB6 — PORTB bit 6 / ICSCLK / interrupt-on-change / PPS |
| Pin 19 | RB7 — PORTB bit 7 / ICSDAT / interrupt-on-change / PPS |
| Pin 20 | VSS — Ground reference |
| Pin 21 | VDD — Positive supply (1.8-3.6 V) |
| Pin 22 | RC0 — PORTC bit 0 / analog / PPS |
| Pin 23 | RC1 — PORTC bit 1 / analog / PPS |
| Pin 24 | RC2 — PORTC bit 2 / analog / PPS |
| Pin 25 | RC3 — PORTC bit 3 / analog / PPS |
| Pin 26 | RC4 — PORTC bit 4 / analog / PPS |
| Pin 27 | RC5 — PORTC bit 5 / analog / PPS |
| Pin 28 | RC6 — PORTC bit 6 / analog / PPS |
| Pin 29 | RC7 — PORTC bit 7 / analog / PPS |
| Pin 30 | VSS — Ground reference |
| Pin 31 | VDD — Positive supply (1.8-3.6 V) |
| Pin 32 | RD0 — PORTD bit 0 / PPS |
| Pin 33 | RD1 — PORTD bit 1 / PPS |
| Pin 34 | RD2 — PORTD bit 2 / PPS |
| Pin 35 | RD3 — PORTD bit 3 / PPS |
| Pin 36 | RD4 — PORTD bit 4 / PPS |
| Pin 37 | RD5 — PORTD bit 5 / PPS |
| Pin 38 | RD6 — PORTD bit 6 / PPS |
| Pin 39 | RD7 — PORTD bit 7 / PPS |
| Pin 40 | RE0 — PORTE bit 0 / analog / PPS |
| Pin 41 | RE1 — PORTE bit 1 / analog / PPS |
| Pin 42 | RE2 — PORTE bit 2 / analog / PPS |
Typical Applications
PIC18LF45K42-E/P is suitable for 7 applications: Battery-Powered IoT Sensor Node, Home Automation and HVAC Control, LED Lighting Dimming Controller, Industrial Sensor Signal Conditioning, USB-to-UART Bridge Device, Portable Medical Metering Instrument, Motor-Control Signal Conditioning.
Battery-Powered IoT Sensor Node
The PIC18LF45K42-E/P suits battery-powered IoT sensor nodes because its 1.8-3.6 V supply range accepts a single Li-ion or 2x AA cell directly without external regulation, while the XLP nanoamp sleep current extends battery life to multi-year horizons. The 12-bit ADCC with computation and averaging offloads sensor sampling from the CPU, allowing the core to remain in sleep most of the time. With 32 KB Flash and 2 KB RAM, the part easily accommodates MQTT-SN, LoRaWAN, or BLE beacon stacks via UART/SPI/I2C. PPS remapping simplifies PCB layout when routing antenna or sensor interfaces.
Recommended
Home Automation and HVAC Control
In HVAC and home-automation controllers, the PIC18LF45K42-E/P's 36 I/O pins and PPS flexibility drive multiple relays, TRIAC controls, temperature sensors, and keypads from a single chip. The 12-bit ADC reads NTC thermistors and current-sense shunts for closed-loop fan or damper control, while the CWG and 16-bit PWM outputs generate zero-cross timing signals for TRIAC dimming. The Windowed Watchdog Timer (WWDT) enforces safe firmware refresh in safety-critical loops. The 64 MHz throughput handles Modbus, BACnet, or proprietary protocols on UART.
Recommended
LED Lighting Dimming Controller
LED lighting controllers benefit from the PIC18LF45K42-E/P's CWG (Complementary Waveform Generator) and Zero-Cross Detect (ZCD) peripherals which together implement smooth phase-angle dimming of TRIAC-driven LED lamps without flicker. The 16-bit PWM outputs drive high-resolution constant-current buck or boost LED drivers, while DMA channels move PWM duty updates without CPU intervention. The wide 1.8-3.6 V supply allows direct operation from rectified mains with minimal regulation. AEC-style diagnostic features and SCAN/CRC support robust industrial lighting networks.
Recommended
Industrial Sensor Signal Conditioning
The PIC18LF45K42-E/P is a strong fit for industrial 4-20 mA loop-powered sensor transmitters because its 12-bit ADCC handles ratiometric bridge, RTD, or thermocouple readings with hardware averaging and threshold-triggered CPU wake-up. The on-chip DAC generates excitation currents, while the comparators detect sensor faults. The 256-byte EEPROM stores calibration constants in the field. Robust -40C to +125C operation suits outdoor or factory-floor deployments where commercial-grade parts fail.
Recommended
USB-to-UART Bridge Device
USB-to-UART bridge dongles leverage the PIC18LF45K42-E/P's 64 MHz throughput, 2 KB RAM, and UART peripheral to bit-bang or hardware-handle CDC-ACM virtual COM-port protocols. The PPS system routes UART TX/RX to any pin for flexible PCB layout, while DMA moves serial bytes in/out of buffers with low CPU overhead. The 32 KB Flash supports USB stack plus bootloaders, and the EEPROM stores VID/PID and serial numbers. Low sleep current is not critical here but the wide Vdd range helps when bridging 1.8 V or 3.3 V targets.
Recommended
Portable Medical Metering Instrument
Portable medical devices such as glucose meters, pulse oximeters, and handheld spirometers benefit from the PIC18LF45K42-E/P's XLP low-power modes, 12-bit ADC accuracy for analog-front-end signal conditioning, and DMA-accelerated sensor acquisition. The 64 MHz core processes FIR/IIR filtering on biosignals in real time while the 32 KB Flash stores lookup tables for calibration curves. The DIP-40 package aids breadboard prototypes during medical IEC 62304 design phases. Extended -40C to +125C operation supports sterilisation and harsh transport environments.
Recommended
Motor-Control Signal Conditioning
In motor-control applications such as small BLDC or stepper drives, the PIC18LF45K42-E/P's CWG generates complementary PWM pairs with programmable dead-band for safe half-bridge switching, while the ZCD detects back-EMF zero crossings for sensorless commutation. The 12-bit ADCC samples phase currents via shunt amplifiers with simultaneous triggering. DMA offloads PWM duty updates so the CPU runs only the control loop. The -40C to +125C extended range handles under-hood or industrial-cabinet environments.
Recommended
Recommended Products Summary
Engineering reference data for PIC18LF45K42-E/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC18LF45K42-I/P | PIC18LF45K40-E/P | PIC18LF45K22-E/P | PIC18LF43K22-E/P |
|---|---|---|---|---|---|
| Package | 40-pin PDIP (DIP-40) | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same | 40-pin PDIP - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Program Memory (Flash) | 32 KB | 32 KB | 16 KB (-50%) | 32 KB | 8 KB (-75%) |
| Data RAM | 2 KB | 2 KB | 1 KB (-50%) | 1.5 KB (-25%) | 512 B (-75%) |
| Maximum CPU Speed | 64 MHz (16 MIPS) | 64 MHz | 64 MHz | 64 MHz | 64 MHz |
| Supply Voltage | 1.8 V to 3.6 V | 1.8 V to 3.6 V | 1.8 V to 3.6 V | 1.8 V to 3.6 V | 1.8 V to 3.6 V |
| ADC | 12-bit ADCC | 12-bit ADCC | 12-bit ADCC | 10-bit ADC | 10-bit ADC |
| DMA Controller | Yes | Yes | Yes | No | No |
| Temperature Grade | Extended (-40C to +125C) | Industrial (-40C to +85C) | Extended (-40C to +125C) | Extended (-40C to +125C) | Extended (-40C to +125C) |
Key Differentiators
- 12-bit ADCC with built-in computation and DMA offload (vs PIC18LF45K22-E/P)
- Higher memory density in same footprint (vs PIC18LF43K22-E/P)
- Extended temperature grade for harsh environments (vs PIC18LF45K42-I/P)
Design Notes
The PIC18LF45K42-E/P supports XLP (eXtreme Low Power) modes including Sleep with nanoamp-level current, IDLE for peripheral-only operation, and DOZE for clock-divided CPU execution. Decouple Vdd with a 100 nF ceramic capacitor placed within 5 mm of each Vdd pin (the 40-pin PDIP has three Vdd pins at 11, 21, 31) plus a 10 uF bulk cap on the main rail. Use the Power Managed Mode (PMD) bit to disable unused peripherals and reduce active current.
The PPS (Peripheral Pin Select) system requires firmware configuration before peripherals (UART, SPI, PWM, etc.) can drive physical pins - failure to call PPS_unlock and PPS_mapping routines will leave peripherals enabled but outputs invisible. The RB6/RB7 pins double as ICSP programming lines; do not place large capacitors on these pins or ICD debugging will fail. MCLR must have a pull-up resistor (typically 10 kohm) for normal operation and can be left open only if internal pull-up is enabled.
Route the 64 MHz oscillator traces as short as possible and keep them away from analog ADC inputs to avoid coupled noise into the 12-bit ADCC. Place the 100 nF Vdd decoupling caps directly under each Vdd pin with vias to a ground plane. The through-hole 40-pin PDIP package is forgiving for hand-soldered prototypes but for EMI-sensitive designs, prefer the TQFP-44 (PIC18LF45K42-E/PT) surface-mount variant which has a smaller loop area. Keep analog AGND and digital GND separated back at a single star point near the chip.
At 64 MHz / 3.3 V, the PIC18LF45K42-E/P typically draws 8-12 mA active and <100 nA in Sleep with RTCC and WDT disabled. For -40C to +125C extended-grade operation, derate clock frequency versus Vdd per the K42 datasheet DS40001972 Section 36 (Electrical Characteristics). The PDIP-40 package has thermal resistance theta_JA around 50 C/W which is acceptable for the part's power levels; no heatsink is required even at maximum CPU throughput.
Compliance Information
RoHS compliant per Microchip product page. Not AEC-Q100 qualified; for automotive choose the automotive-grade K42 variant. Lead-free process.