PIC18F2221-E/ML - 8-Bit 25MHz 4KB Flash MCU 28-QFN | Microchip
MPN: PIC18F2221-E/ML ✓ 啟用中PIC18F2221-E/ML 概覽
An 8-bit microcontroller (MCU) is a programmable computing-on-a-chip that executes instructions on 8-bit data words. It belongs to the broader category of microcontrollers, which are single-chip systems integrating CPU, memory, and peripherals. The PIC18F2221 sits within Microchip's PIC18 family, which extends the PIC16 baseline architecture with linear addressing, C-friendly memory organization, and enhanced peripherals. Within the product hierarchy, an 8-bit MCU is the simplest class of programmable logic, sitting below 16-bit (MSP430, PIC24) and 32-bit (Cortex-M) controllers.
Key specifications include a 25 MHz maximum clock (40 MHz oscillator input via PLL), 16-bit instructions, 77 single-word instruction set, hardware multiply, nanoWatt power management for low-power sleep modes, an internal oscillator, and an enhanced USART, I2C, and SPI serial interface. The PIC18F2221 operates across 2.0V to 5.5V, with the E suffix denoting the extended -40C to +125C industrial temperature grade. The 28-QFN package provides a low-profile 6x6 mm footprint with an exposed pad for thermal dissipation.
The PIC18F2221 is built on Microchip's enhanced Harvard architecture with separate program and data buses, supporting pipelined fetch/decode and a 16-bit instruction word optimized for compiled C code. It features 10-bit PWM modules, a programmable 16-level hardware stack, and self-programming Flash with ICSP (In-Circuit Serial Programming). The nanoWatt technology delivers idle currents below 1 uA in sleep modes, making it well-suited for battery-powered applications.
Typical applications include industrial sensor nodes, white goods control, low-cost motor control, USB-to-UART bridges, LED lighting controllers, and automotive body modules. It is also widely used in educational and hobbyist platforms such as PICkit 3 starter kits due to its low price and mature toolchain (MPLAB X IDE + XC8 compiler).
When designing with the PIC18F2221-E/ML, ensure the exposed pad is soldered to the PCB ground plane for thermal performance and electrical reference. Use MPLAB X IDE with the free XC8 compiler and select the PIC18F2221 device for full peripheral library support. For applications above 40 MHz or requiring DSP capability, evaluate the dsPIC33 or PIC24 families instead.
直接替換替代品,適用於 PIC18F2221-E/ML — 相同封裝,腳位對腳位相容。需重新設計 PCB 的不同封裝零件不列入。
此系列的變體
與下列產品可直接替換的同系列型號: PIC18F2221-E/ML (相同外形與佔位) — 差異在於 ADC, Operating Temperature, Package, I/O Pins, Maximum CPU Speed.
PIC18F2321-E/ML
✅ 直接替換聯絡詢價
查看資料表 →PIC18F4221-E/ML
✅ 直接替換聯絡詢價
查看資料表 →PIC18LF2221-I/ML
✅ 直接替換聯絡詢價
查看資料表 →PIC18F2221-I/ML
✅ 直接替換📋 參考替代品(不在目錄中)
PIC18F2221T-I/ML
✅ 直接替換聯絡詢價
查看資料表 →PIC18F2221-E/ML 最大額定值與電氣特性
| Core Architecture | PIC18 (8-bit) |
| Program Memory (Flash) | 4 KB (2K x 16) |
| RAM | 512 bytes |
| EEPROM | 256 bytes |
| Maximum CPU Speed | 25 MHz (10 MIPS) |
| Instruction Set | 77 single-word instructions, 16-bit opcode |
| Digital I/O Pins | 25 |
| ADC | 10-bit, up to 10 input channels |
| PWM Modules | 10-bit PWM (peripheral) |
| 供應電壓 | 2.0 V to 5.5 V |
| 工作溫度 | -40 C to +125 C (E suffix) |
| 封裝 | 28-pin QFN (6x6 mm) with exposed pad (ML) |
| 安裝類型 | Surface Mount |
| RoHS 狀態 | Compliant |
| Lead-Free | Yes |
| ICSP | Yes (In-Circuit Serial Programming) |
| Self-Programming | Yes (Flash) |
PIC18F2221-E/ML 腳位配置
| 腳位 1 | RA2/AN2 — Digital I/O / Analog input channel 2 |
| 腳位 2 | RA3/AN3/VREF+ — Digital I/O / Analog input 3 / ADC positive reference |
| 腳位 3 | RA4/AN4 — Digital I/O / Analog input 4 |
| 腳位 4 | RA5/AN5/SS/HLVDIN — Digital I/O / Analog input 5 / SPI Slave Select / High/Low Voltage Detect input |
| 腳位 5 | RA6/OSC2/CLKO — Digital I/O / Oscillator output / Clock output |
| 腳位 6 | RA7/OSC1/CLKI — Digital I/O / Oscillator input / Clock input |
| 腳位 7 | VSS — Ground reference |
| 腳位 8 | VDD — Positive supply voltage (2.0-5.5 V) |
| 腳位 9 | RB0/INT0/AN12 — Digital I/O / External interrupt 0 / Analog input 12 |
| 腳位 10 | RB1/INT1/AN10 — Digital I/O / External interrupt 1 / Analog input 10 |
| 腳位 11 | RB2/INT2/AN8 — Digital I/O / External interrupt 2 / Analog input 8 |
| 腳位 12 | RB3/AN9/CCP2 — Digital I/O / Analog input 9 / Capture/Compare/PWM 2 |
| 腳位 13 | RB4/AN11 — Digital I/O / Analog input 11 |
| 腳位 14 | RB5/CCP1 — Digital I/O / Capture/Compare/PWM 1 |
| 腳位 15 | RB6/PGC — Digital I/O / ICSP clock (programming) |
| 腳位 16 | RB7/PGD — Digital I/O / ICSP data (programming) |
| 腳位 17 | RC0/T1OSO/T1CKI — Digital I/O / Timer1 oscillator output / Timer1 clock input |
| 腳位 18 | RC1/T1OSI/CCP2 — Digital I/O / Timer1 oscillator input / CCP2 |
| 腳位 19 | RC2/CCP1 — Digital I/O / Capture/Compare/PWM 1 |
| 腳位 20 | RC3/SCK/SCL — Digital I/O / SPI clock / I2C clock |
| 腳位 21 | RC4/SDI/SDA — Digital I/O / SPI data in / I2C data |
| 腳位 22 | RC5/SDO — Digital I/O / SPI data out |
| 腳位 23 | RC6/TX/CK — Digital I/O / USART asynchronous transmit / USART synchronous clock |
| 腳位 24 | RC7/RX/DT — Digital I/O / USART asynchronous receive / USART synchronous data |
| 腳位 25 | RD0 — Digital I/O (Port D bit 0) |
| 腳位 26 | RD1 — Digital I/O (Port D bit 1) |
| 腳位 27 | RD2 — Digital I/O (Port D bit 2) |
| 腳位 28 | RD3 — Digital I/O (Port D bit 3) |
典型應用
PIC18F2221-E/ML 適用於 7 應用s: Industrial Sensor Node, White Goods Control Board, LED Lighting Controller, Automotive Body Module, USB-to-UART Bridge Dongle, Educational / Hobbyist Platform, Low-Cost Motor Control (BLDC / Stepper).
Industrial Sensor Node
The PIC18F2221-E/ML is well-suited for industrial sensor nodes because of its extended -40 C to +125 C temperature range and nanoWatt low-power sleep modes drawing under 1 uA. The 10-bit ADC with up to 10 input channels reads thermocouple, RTD, or 4-20 mA sensor signals directly. The 25 MHz core executes sensor linearization algorithms while the 4 KB Flash accommodates the full state machine plus UART/I2C/SPI outputs to a host PLC.
推薦
White Goods Control Board
Washing machines, dishwashers, and ovens use the PIC18F2221-E/ML for motor and heater control. The PIC18F2221's 25 MHz CPU cycles through control loops while the 10-bit PWM modules drive TRIAC phase-angle control for heater elements. The 25 I/O pins scan keypads and drive seven-segment displays. The exposed thermal pad of the 28-QFN package dissipates heat from the 25 MHz core running continuously at 5 V.
推薦
LED Lighting Controller
Addressable RGB LED strips and architectural lighting fixtures use the PIC18F2221-E/ML for color-mixing control. The 25 MHz core runs WS2812 / APA102 protocols with bit-banging or hardware SPI, while the 10-bit PWM outputs dim analog LED drivers. The nanoWatt sleep modes extend battery life in portable LED lanterns below 1 uA standby current, and the 4 KB Flash stores lighting scenes.
推薦
Automotive Body Module
The PIC18F2221-E/ML's extended -40 C to +125 C temperature range suits under-hood automotive body modules such as window lift controllers, seat position memories, and mirror adjusters. The 25 I/O pins scan switches and drive H-bridge MOSFETs via the TC4427 driver. The 512-byte RAM handles LIN bus message buffering, and the 4 KB Flash fits the J1939 / LIN protocol stack with diagnostic services.
推薦
USB-to-UART Bridge Dongle
The PIC18F2221-E/ML can implement a low-cost USB CDC bridge by combining it with the MCP2221A USB-to-UART IC, or by directly utilizing the PIC18F USB variants. The 25 MHz core handles serial-to-parallel conversion at up to 921600 baud while the 512-byte RAM buffers packets. The 28-QFN package fits inside a USB Type-A dongle housing, and the 4 KB Flash stores the CDC ACM driver.
推薦
Educational / Hobbyist Platform
The PIC18F2221-E/ML is widely used in education because of its $2-3 unit price, MPLAB X IDE support, free XC8 C compiler, and PICkit 3 / PICkit 4 programmer compatibility. The 4 KB Flash, 512-byte RAM, and 25 I/O pins provide enough headroom for teaching embedded C, interrupts, ADC sampling, and PWM servo control. The 28-QFN package also fits the standard through-hole 28-pin DIP breakout board for breadboarding.
推薦
Low-Cost Motor Control (BLDC / Stepper)
Small BLDC fans, stepper motors in 3D printers, and robotic actuators use the PIC18F2221-E/ML for closed-loop commutation. The 25 MIPS performance runs the Field-Oriented Control (FOC) or trapezoidal commutation loop while the 10-bit PWM outputs drive the gate driver ICs. The 25 I/O pins read Hall sensors or quadrature encoders, and the 4 KB Flash stores the lookup-table-based sine commutation profile.
推薦
推薦產品摘要
工程參考資料,適用於 PIC18F2221-E/ML — 比較、設計指引及合規資訊。
選型指南
與替代品比較
| 參數 | 本產品 | PIC18F2321-E/ML | PIC18F4221-E/ML | PIC18LF2221-I/ML | PIC18F2221-I/ML |
|---|---|---|---|---|---|
| Package | 28-QFN (6x6 mm) | 28-QFN (6x6 mm) - same | 28-QFN (6x6 mm) - same | 28-QFN (6x6 mm) - same | 28-QFN (6x6 mm) - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology |
| Program Memory (Flash) | 4 KB | 8 KB | 4 KB | 4 KB | 4 KB |
| RAM | 512 bytes | 512 bytes | 512 bytes | 512 bytes | 512 bytes |
| Max CPU Speed | 25 MHz (10 MIPS) | 25 MHz (10 MIPS) | 25 MHz (10 MIPS) | 25 MHz (10 MIPS) | 25 MHz (10 MIPS) |
| Operating Voltage | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 2.0 V to 5.5 V | 2.0 V to 3.6 V | 2.0 V to 5.5 V |
| Temperature Range | -40 C to +125 C (Extended) | -40 C to +125 C (Extended) | -40 C to +125 C (Extended) | -40 C to +85 C (Industrial) | -40 C to +85 C (Industrial) |
| Digital I/O | 25 | 25 | 36 | 25 | 25 |
主要差異化特點
- Extended -40/+125 C industrial temperature grade (對比PIC18F2221-I/ML)
- Cost-optimized 4 KB Flash for high-volume embedded products (對比PIC18F2321-E/ML)
- Mature MPLAB X IDE + XC8 compiler ecosystem (對比Cross-brand 8-bit MCU (e.g., ATmega328P-AU))
設計說明
Solder the central exposed thermal pad of the 28-QFN package to a continuous ground plane via thermal vias (recommended 4-9 vias, 0.3 mm drill, 0.5 mm pitch). This both dissipates the 25 MHz core heat and provides the electrical ground reference for the PLL. Missing the thermal pad connection can cause +15 C junction temperature rise and unstable oscillator behavior above 5.0 V VDD.
Place a 100 nF ceramic decoupling capacitor within 5 mm of the VDD pin (pin 8) and a 10 uF bulk capacitor at the board-level power entry. For nanoWatt sleep mode applications, add a 100 kohm pull-up on MCLR to prevent floating reset during sleep. The PIC18F2221 datasheet section 2 recommends using two decoupling capacitors to handle both digital switching transients and analog ADC reference stability.
Do not omit the configuration bits (CONFIG1H through CONFIG2L) - the PIC18F2221 will not execute code without them properly set. Use MPLAB X IDE's Configuration Bits window or #pragma config directives in XC8 to set the oscillator mode (HS vs internal RC), watchdog timer, low-voltage programming, and code protection. Also note that RB6/RB7 are shared with ICSP programming; isolate any high-current loads on these pins during in-circuit programming to avoid programming failures.
Route the oscillator traces (OSC1/OSC2, pins 6-7) as short as possible with ground guard traces. Keep the analog inputs (AN0-AN12) physically separated from digital switching signals to avoid ADC noise coupling. The 10-bit ADC achieves +/-1 LSB accuracy only when the analog traces are guarded and the AVSS pin (when present) shares a clean ground return. For crystal operation above 20 MHz, use a fundamental-mode crystal with 20 pF load capacitors matched to the crystal's CL spec.
合規資訊
RoHS and REACH compliant per Microchip product page. Industrial-grade (-40/+125 C) but not AEC-Q100 qualified for automotive safety - use dsPIC33 or PIC32 for AEC-Q100 designs.