PIC18F04Q40-I/SL - 8-bit MCU 64MHz 16KB Flash 14-SOIC | Microchip
MPN: PIC18F04Q40-I/SL ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $1.22 | $1.22 |
| 10 | $1.1 | $11.00 |
| 100 | $0.98 | $98.00 |
| 500 | $0.86 | $430.00 |
| 1,000 | $0.74 | $740.00 |
PIC18F04Q40-I/SL Overview
A PIC microcontroller (MCU) is a single-chip computer that integrates a CPU core, non-volatile program memory, RAM, EEPROM, peripherals and I/O on one die. PIC18 devices use an enhanced 8-bit Harvard RISC architecture with 16-bit instructions, sitting in the Microchip taxonomy between PIC16 mid-range parts and PIC24/dsPIC 16-bit devices. The PIC18-Q40 sub-family targets space-constrained IoT, medical and industrial designs that need higher analog integration than PIC16 provides but do not require dsPIC DSP performance.
Key features of the PIC18F04Q40-I/SL include a 12-bit ADC with Computation (ADCC) that automates Capacitive Voltage Divider (CVD) techniques for advanced capacitive touch, averaging, filtering, oversampling and threshold comparison; two independent 8-bit DAC modules; a 16-bit Pulse-Width Modulation (PWM) peripheral; and multiple communication interfaces. The 14-SOIC package exposes up to 12 I/O pins, the device runs from 1.8 V to 5.5 V, and integrated Core Independent Peripherals (CIPs) such as configurable logic cells and signal measurement timers offload tasks from the core.
Architecturally, the part uses Microchip's enhanced mid-range PIC18 core with a 31-level hardware stack, single-cycle 8×8 hardware multiplier and a four-phase PLL that doubles an internal 32 MHz oscillator to 64 MHz. The 12-bit ADCC can sample at hundreds of ksps while running automated post-processing, reducing firmware burden for touch and sensor applications.
Typical applications include capacitive touch user interfaces, LED driving with the 16-bit PWM, low-cost sensor nodes for IoT, battery-powered medical wearables, and small industrial control boards. The PIC18F04Q40-I/SL is well suited when a system needs touch sensing, an integrated DAC for set-point generation, and fast deterministic control loops in a 14-pin outline.
When designing with this MCU, plan for an external decoupling capacitor on VDD and reserve the ICSP/ICD pins (typically RA0/RA1) for in-circuit programming. The ADCC's CVD touch library from Microchip streamlines capacitive button and slider implementation but requires careful PCB guard layout to avoid false triggers.
Drop-in alternatives for PIC18F04Q40-I/SL — 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 PIC18F04Q40-I/SL (same form factor and footprint) — differing in ADC, PWM, DAC, Program Memory (Flash), Core Architecture.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC18F04Q41-I/SL
✅ Drop-In✓ In Stock
$0.85 / Unit
View Datasheet →PIC18F06Q40-I/SL
✅ Drop-In✓ In Stock
$1.18 / Unit
View Datasheet →PIC18F04Q40-I/ST
✅ Drop-In✓ In Stock
$0.82 / Unit
View Datasheet →PIC18F04Q20-I/SL
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18F04Q40-E/SL
✅ Drop-In📋 Reference alternative (not in catalog)
PIC18F04Q40-I/SL Maximum Ratings & Electrical Characteristics
| Core | PIC18 8-bit RISC Harvard |
| CPU Family | PIC® 18F (PIC18-Q40 sub-family) |
| Maximum CPU Frequency | 64 MHz |
| Flash Program Memory | 16 KB (16K x 8) |
| SRAM | 1 KB |
| EEPROM | 512 bytes |
| ADC | 12-bit ADC with Computation (ADCC) |
| DAC | 2 x 8-bit DAC |
| PWM | 16-bit PWM |
| Supply Voltage (VDD) | 1.8 V to 5.5 V |
| Operating Temperature Range | -40 °C to +85 °C (industrial, -I grade) |
| I/O Pins | Up to 12 |
| Package | 14-pin SOIC (SL) |
| Mounting Type | Surface Mount |
| RoHS Status | Compliant |
| Lead-Free | Yes |
| Communication Interfaces | UART, SPI, I2C (per Microchip product page) |
PIC18F04Q40-I/SL Pin Configuration
| Pin 1 | RA5 — I/O port A bit 5 / ICSPCLK |
| Pin 2 | RA4 — I/O port A bit 4 |
| Pin 3 | RA3 — I/O port A bit 3 / MCLR |
| Pin 4 | RA2 — I/O port A bit 2 |
| Pin 5 | RA1 — I/O port A bit 1 / ICSPDAT |
| Pin 6 | RA0 — I/O port A bit 0 |
| Pin 7 | VSS — Ground reference |
| Pin 8 | RC2 — I/O port C bit 2 |
| Pin 9 | RC1 — I/O port C bit 1 |
| Pin 10 | RC0 — I/O port C bit 0 |
| Pin 11 | RB7 — I/O port B bit 7 (per datasheet pin alternate) |
| Pin 12 | VDD — Positive supply voltage (1.8 V to 5.5 V) |
| Pin 13 | RA7 — I/O port A bit 7 (OSC1/CLKI alternate) |
| Pin 14 | RA6 — I/O port A bit 6 (OSC2/CLKO alternate) |
Typical Applications
PIC18F04Q40-I/SL is suitable for 6 applications: Capacitive Touch User Interface, Sensor Signal Conditioning and IoT Edge Node, LED Lighting and PWM Dimming Control, Small Industrial Control Board, Battery-Powered Medical Wearable, Consumer Appliance Control Module.
Capacitive Touch User Interface
The PIC18F04Q40-I/SL is purpose-built for capacitive touch sensing thanks to its on-chip 12-bit ADC with Computation (ADCC). The ADCC automates Capacitive Voltage Divider (CVD) scans, hardware averaging, oversampling and threshold comparison, letting the 14-pin SOIC MCU drive 4-8 touch buttons or a small slider without an external touch IC. Designers benefit from Microchip's mTouch CVD library, which provides ready-to-port firmware for water-tolerant and proximity sensing. The 16 KB Flash and 1 KB SRAM comfortably hold a CVD touch state machine plus a lightweight communication stack, making this part a strong fit for appliance panels, smart-lighting keypads and entry-level HMI boards.
Recommended
Sensor Signal Conditioning and IoT Edge Node
The 12-bit ADCC and two 8-bit DACs make the PIC18F04Q40-I/SL a compact analog front end for IoT edge nodes that read resistive or voltage-output sensors and emit a 0-5 V excitation or set-point. The ADCC's automated filtering reduces firmware load, freeing the 64 MHz core to run an I2C/SPI sensor stack. With only 12 I/O in the SOIC-14, designers typically pair it with an external ADC or transceiver for higher-channel systems. The 1.8-5.5 V supply range lets the MCU share the same battery rail as the sensor, simplifying low-power wireless sensor boards targeting industrial monitoring or smart-home deployments.
Recommended
LED Lighting and PWM Dimming Control
The on-chip 16-bit PWM peripheral of the PIC18F04Q40-I/SL produces high-resolution dimming for LED drivers, supporting smooth fades down to sub-1 % duty cycles without flickering. Combined with the two 8-bit DACs for tunable-white color mixing or analog reference generation, the part can act as the controller for low-cost decorative or architectural lighting fixtures. The 64 MHz core handles DMX-style or proprietary LED protocols over UART/SPI while the PWM runs autonomously via Core Independent Peripherals. Operating from 1.8-5.5 V, the MCU is comfortable with both 3.3 V logic LEDs and 5 V analog driver stages.
Recommended
Small Industrial Control Board
In industrial control boxes the PIC18F04Q40-I/SL can read a 4-20 mA loop (via scaling resistor to ADC), drive relays with its PWM + gate-driver stages, and run a Modbus RTU slave on UART. The 14-pin SOIC industrial -40 °C to +85 °C grade survives factory-floor temperatures, and Core Independent Peripherals deliver deterministic response independent of firmware latency. CIPs like the Configurable Logic Cell (CLC) and Signal Measurement Timer (SMT) simplify quadrature decoding or pulse counting on the same die, allowing one MCU to consolidate what previously required two 8-bit chips.
Recommended
Battery-Powered Medical Wearable
Low-power sleep modes combined with the 1.8 V minimum VDD make the PIC18F04Q40-I/SL a fit for battery-driven medical wearables such as single-parameter patient monitors and pill dispensers. The 12-bit ADCC is sufficient for heart-rate or SpO2 sensor front ends, while the integrated DACs generate bias voltages for analog sensor conditioning. With Microchip's eXtreme Low Power (XLP) techniques, the part idles below 50 nA in sleep, extending coin-cell life for multi-month deployments. Designers should still validate IEC 60601 EMI/EMC compliance at the system level, as the MCU alone does not constitute a medical certification.
Recommended
Consumer Appliance Control Module
Household appliances such as coffee machines, air purifiers and kitchen hoods benefit from the PIC18F04Q40-I/SL's combination of capacitive touch, 16-bit PWM for motor or fan speed control, and 5 V tolerance on the SOIC-14 footprint. Designers can replace multiple 8-bit MCUs with this single part by using the CLC to handle interlocks and the SMT for pulse counting on tachometer feedback. The PIC18-Q40 family also offers automotive-grade siblings (Q40 +125 °C variants) for appliances placed near heat sources. Plenty of Microchip application notes simplify BLDC and PMSM control loops on this MCU.
Recommended
Recommended Products Summary
Engineering reference data for PIC18F04Q40-I/SL — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC18F04Q41-I/SL | PIC18F06Q40-I/SL | PIC18F04Q40-I/ST | PIC18F04Q20-I/SL | PIC18F04Q40-E/SL |
|---|---|---|---|---|---|---|
| Package | 14-SOIC (SL) | 14-SOIC - same | 14-SOIC - same | 14-TSSOP (different) | 14-SOIC - same | 14-SOIC - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Flash Memory | 16 KB | 16 KB | 32 KB | 16 KB | 8 KB | 16 KB |
| SRAM | 1 KB | 1 KB | 2 KB | 1 KB | 512 B | 1 KB |
| EEPROM | 512 B | 512 B | 512 B | 512 B | 256 B | 512 B |
| Maximum CPU Frequency | 64 MHz | 64 MHz | 64 MHz | 64 MHz | 64 MHz | 64 MHz |
| ADC | 12-bit ADCC | 12-bit ADCC | 12-bit ADCC | 12-bit ADCC | 10-bit ADC (no ADCC) | 12-bit ADCC |
| DAC | 2 x 8-bit | 2 x 8-bit | 2 x 8-bit | 2 x 8-bit | 1 x 8-bit (no second DAC) | 2 x 8-bit |
| 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 +85 °C | -40 °C to +125 °C (extended) |
Key Differentiators
- On-chip 12-bit ADCC for capacitive touch without external ICs (vs PIC18F04Q20-I/SL)
- Two independent 8-bit DACs (vs PIC18F04Q20-I/SL)
- 16 KB Flash + 1 KB SRAM with 64 MHz core (vs PIC18F04Q20-I/SL)
- Industrial -40 °C to +85 °C grade as standard (vs PIC18F04Q40-E/SL)
Design Notes
Place a 100 nF X7R decoupling capacitor within 5 mm of the VDD pin and a bulk 10 µF tantalum or ceramic capacitor on the supply rail. The PIC18F04Q40-I/SL draws < 50 nA in sleep and ~ 5 mA active at 64 MHz / 3.3 V, so the MCU alone does not require complex power tree design, but adding 100 nF at every AVdd/AVss pair (if used) eliminates ADC noise pickup from digital transients.
Reserve RA0/RA1 for ICSPDAT/ICSPCLK if you plan in-circuit programming - reusing them as GPIO can lock the board out of firmware updates. The MCLR pin (RA3) must have a 10 kΩ pull-up to VDD; without it the device will not start. The 12-bit ADCC needs an adequate acquisition time (set TACQ in software) or you will see noisy readings at high source impedance.
Route the ICSP lines (RA0/RA1/RA3/VDD/VSS) to a 5-pin header that matches the Microchip ICD header footprint, even on production boards - field returns can then be re-flashed without removing the MCU. For capacitive touch, surround touch pads with a grounded guard ring and flood the unused board area with a hatched ground plane; the ADCC CVD measurement is highly sensitive to ground return paths.
If using the 16-bit PWM at high frequency (above 100 kHz), keep the PWM output trace short and avoid routing it parallel to the ADCC analog inputs. The CLC and SMT peripherals can offload quadrature decoding or pulse-train capture so the ADC can sample without firmware jitter; enable the ADC in burst-averaging mode for low-noise touch measurements.
Compliance Information
RoHS and lead-free confirmed on Microchip product page; AEC-Q100 not applicable for industrial-grade -I variant. Halogen-free status not stated in retrieved web data - flagged as unknown.