PIC12F1840-E/P - 8-bit MCU, 7KB Flash, nanoWatt XLP DIP-8
MPN: PIC12F1840-E/P ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $1.74 | $1.74 |
| 10 | $1.56 | $15.60 |
| 100 | $1.34 | $134.00 |
| 500 | $1.18 | $590.00 |
| 1,000 | $1.05 | $1,050.00 |
PIC12F1840-E/P Overview
A PIC microcontroller is a compact, deterministic CMOS processor built on a Harvard RISC architecture with separate program and data buses, widely used in embedded designs that require low power, low cost, and small footprint. Within the broader taxonomy, the PIC12F1840 sits in the hierarchy: PIC microcontroller -> 8-bit MCU -> enhanced mid-range core -> flash MCU with XLP -> embedded controller. This positioning explains why the part is so common in consumer, IoT, and industrial sensor front-ends where deterministic interrupt latency and ultra-low standby current matter more than raw compute throughput.
Key features include six I/O pins with independent weak pull-ups and interrupt-on-change, four 10-bit ADC channels, two 8-bit timers and one 16-bit timer, a Capture/Compare/PWM (CCP) module, an Enhanced Universal Synchronous/Asynchronous Receiver/Transmitter (EUSART), and an integrated configurable reference and temperature indicator. The device supports in-circuit serial programming (ICSP) and in-circuit debugging through PICkit 3, MPLAB ICD 3, or the MPLAB Snap programmer.
Architecturally, the PIC12F1840 uses Microchip's enhanced mid-range core with a 14-bit instruction word and an internal 32 MHz oscillator, alongside an 8 MHz calibrated HFINTOSC factory-trimmed to ±1%. The internal oscillator eliminates external crystals in most designs and reduces BOM cost. The XLP family design minimizes dynamic and leakage power, allowing years of operation from a single coin cell.
Typical applications include battery-backed sensor nodes, LED lighting controllers, low-power remote controls, simple motor drivers, and home automation peripherals. The combination of nanoWatt sleep modes and fast wake-up from interrupt makes the part well suited to event-driven IoT endpoints.
When designing with this device, plan the I/O pinout carefully - only six of the eight pins are general-purpose because VDD, VSS, and ICSPCLK/ICSPDAT also share pins. Use MPLAB X IDE with XC8 compiler and reserve a pull-up on MCLR unless the internal MCLR is enabled. For low-power designs, configure unused peripherals to OFF and use the deep-sleep current of approximately 20 nA.
Drop-in alternatives for PIC12F1840-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 PIC12F1840-E/P (same form factor and footprint) — differing in Package, Operating Temperature, Timers, MSL Level, ADC.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
PIC12F1840-I/P
✅ Drop-In✓ In Stock
$0.85 / Unit
View Datasheet →PIC12F1840-E/MF
✅ Drop-In✓ In Stock
$0.84 / Unit
View Datasheet →PIC12LF1840-I/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC12LF1840-E/P
✅ Drop-In📋 Reference alternative (not in catalog)
PIC12F1822-E/P
✅ Drop-In✓ In Stock
$1.05 / Unit
View Datasheet →PIC12F1840-E/P Maximum Ratings & Electrical Characteristics
| Architecture | 8-bit Enhanced Mid-Range PIC core |
| Instruction Set Size | 49 instructions, 16 stack levels |
| Program Memory (Flash) | 7 KB |
| Data EEPROM | 256 bytes |
| Data SRAM | 256 bytes |
| Operating Voltage Range | 1.8 V to 5.5 V |
| Maximum CPU Speed | 32 MHz (8 MIPS) |
| I/O Pins | 6 |
| ADC | 4 channels, 10-bit |
| Timers | 2x 8-bit, 1x 16-bit |
| CCP Modules | 1 |
| Communication | EUSART |
| Internal Oscillator | 32 MHz HFINTOSC, ±1% factory calibrated |
| Active Current | 50 µA/MHz typical at 3V |
| Sleep Current (XLP) | 20 nA typical (deep sleep) |
| Package | PDIP-8 (P), 300 mil |
| Operating Temperature | -40 °C to +125 °C (E suffix) |
| Programming/Debug | ICSP via PICkit 3, MPLAB ICD 3, MPLAB Snap |
PIC12F1840-E/P Pin Configuration
| Pin 1 | VDD — Positive power supply |
| Pin 2 | RA5 — Digital I/O / AN4 / CCP1 / T1CKI |
| Pin 3 | RA4 — Digital I/O / AN3 / CLKOUT / SOSCO |
| Pin 4 | RA3/MCLR/VPP — Digital input / Master Clear reset / Programming voltage |
| Pin 5 | RA2 — Digital I/O / AN2 / T0CKI / INT |
| Pin 6 | RA1 — Digital I/O / AN1 / ICSPCLK / EUSART RX |
| Pin 7 | RA0 — Digital I/O / AN0 / ICSPDAT / EUSART TX |
| Pin 8 | VSS — Ground reference |
Typical Applications
PIC12F1840-E/P is suitable for 6 applications: Battery-Powered IoT Sensor Node, Remote Control / IR Transmitter, Industrial Sensor Front-End, LED Lighting Controller, Home Automation Peripherals, Automotive Accessory Module.
Battery-Powered IoT Sensor Node
The PIC12F1840-E/P's 20 nA deep-sleep current and 50 µA/MHz active draw make it ideal for coin-cell-powered IoT sensor endpoints that wake on interrupt, sample, and transmit. The 7 KB Flash accommodates small TCP/HTTP or LoRaWAN stack fragments while 256 bytes of SRAM is sufficient for local buffer management. Place the MCU between the sensor (e.g., a temperature/humidity element) and a low-power RF module, using the internal 32 MHz oscillator to eliminate external crystals. The E temperature grade supports outdoor enclosures from -40 °C to +125 °C.
Recommended
Remote Control / IR Transmitter
The 6 I/O pins and integrated EUSART/CCP module of the PIC12F1840-E/P suit handheld remote controls driving an IR emitter via PWM-modulated CCP. The 32 MHz internal oscillator ensures accurate 38 kHz carrier frequency without external components, and the 200 ns instruction execution keeps button-to-IR latency under 5 ms. Sleep current of 20 nA extends battery life beyond 1 year on a single CR2032. Connect tactile switches directly to interrupt-on-change pins and use MCLR as a hardware reset tied to a wake-up button.
Recommended
Industrial Sensor Front-End
The PIC12F1840-E/P's 10-bit ADC with 4 input channels, plus the extended -40 °C to +125 °C operating range of the E suffix, support industrial sensor front-ends reading 4-20 mA loops, thermistors, or 0-10V signals. Use the internal fixed voltage reference (FVR) for ratiometric measurements and the EUSART to forward calibrated values to a host PLC. The 7 KB Flash is sufficient for linearization tables, and the 256-byte EEPROM stores calibration constants that survive power cycles. Industrial EMC robustness comes from the MCU's wide supply tolerance.
Recommended
LED Lighting Controller
PWM-dimmed LED drivers benefit from the PIC12F1840-E/P's CCP module generating precise 0-100% duty cycles at frequencies above 100 Hz to avoid visible flicker. Drive 6 LED channels directly from the 6 I/O pins at 8 mA each, or use external MOSFETs (e.g., Infineon IPD series) for higher-current strings. The XLP sleep modes enable standby power below 50 nA when lighting is off, meeting Energy Star and ErP lot-6 standby limits. The 7 KB Flash supports DMX or DALI receive fragments for architectural lighting.
Recommended
Home Automation Peripherals
Smart-home peripherals such as door/window sensors, leak detectors, and wall switches leverage the PIC12F1840-E/P's low power and small footprint. The interrupt-on-change feature wakes the MCU on a magnetic-reed or Hall-sensor event, and the EUSART talks to a host MCU or radio module. The 256-byte EEPROM stores configuration and pairing data without external non-volatile memory. With the E temperature suffix, the device is suitable for unheated attic and outdoor junction boxes down to -40 °C.
Recommended
Automotive Accessory Module
While not AEC-Q100 qualified, the PIC12F1840-E/P's extended -40 °C to +125 °C range suits non-safety automotive accessories such as interior lighting, ambient color controllers, or auxiliary sensors. The wide 1.8-5.5V supply tolerance survives load-dump transients when paired with a TVS and bulk capacitance. The CCP module drives PWM-controlled RGB strips, while the ADC monitors a photocell for automatic brightness. Designers should add external reverse-battery and overvoltage protection for under-hood proximity.
Recommended
Recommended Products Summary
Engineering reference data for PIC12F1840-E/P — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | PIC12F1840-I/P | PIC12F1840-E/MF | PIC12LF1840-I/P | PIC12LF1840-E/P | PIC12F1822-E/P |
|---|---|---|---|---|---|---|
| Package | PDIP-8 | PDIP-8 (same) | DFN-8 (different footprint) | PDIP-8 (same) | PDIP-8 (same) | PDIP-8 (same) |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Flash Memory | 7 KB | 7 KB | 7 KB | 7 KB | 7 KB | 3.5 KB |
| SRAM | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 128 bytes |
| EEPROM | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 256 bytes | 256 bytes |
| Operating Voltage | 1.8 V to 5.5 V | 1.8 V to 5.5 V | 1.8 V to 5.5 V | 1.8 V to 3.6 V | 1.8 V to 3.6 V | 1.8 V to 5.5 V |
| Temperature Range | -40 °C to +125 °C | -40 °C to +85 °C | -40 °C to +125 °C | -40 °C to +85 °C | -40 °C to +125 °C | -40 °C to +125 °C |
| Deep-Sleep Current | 20 nA | 20 nA | 20 nA | 20 nA | 20 nA | 50 nA |
Key Differentiators
- Wider temperature range than the -I variant (vs PIC12F1840-I/P)
- Deeper memory than PIC12F1822 family (vs PIC12F1822-E/P)
- Broader supply range than LF variant (vs PIC12LF1840-I/P)
Design Notes
Estimated: at 3.3V VDD, 32 MHz HFINTOSC, and 50 µA/MHz active current, the PIC12F1840-E/P consumes roughly 1.6 mA in full-speed run mode. In deep sleep with WDT disabled, the datasheet typical is 20 nA. To minimize average current in event-driven designs, spend >99% of the time in deep sleep and wake via interrupt-on-change or a peripheral interrupt, then complete the work and re-enter sleep within 1 ms. Always disable unused peripherals in firmware and gate the ADC reference between conversions.
Place a 100 nF decoupling capacitor within 5 mm of VDD (pin 1) and a 10 µF bulk capacitor near the IC for transient suppression. Because only six I/O pins are available, choose the pinout carefully and reserve RA3/MCLR (pin 4) for reset unless using internal MCLR configuration. For reliable ICSP programming, dedicate RA0/RA1 as ICSPDAT/ICSPCLK with no series resistors - keep programming lines isolated from high-current traces. Add a 10 kΩ pull-up on MCLR if the internal weak pull-up is disabled.
Common pitfalls include forgetting to configure the analog pins as digital when ADC is unused (floating pins increase sleep current), exceeding the 25 mA per-pin absolute maximum when driving LEDs directly, and overlooking that the LF variants (PIC12LF1840) cap VDD at 3.6V. The internal 32 MHz oscillator has ±1% factory calibration at 3V/25 °C but drifts over voltage and temperature - for UART timing-critical designs, verify baud-rate error at the corners. Always read the configuration word protection bit settings before field updates.
Compliance Information
RoHS and REACH compliance per Microchip product environmental documentation. Not AEC-Q100 qualified - automotive programs requiring AEC-Q100 should evaluate PIC16F or automotive-screened PIC12 variants explicitly. Lead-free terminations, halogen-free mold compound.