Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP2221 / MCP2221A

The Microchip MCP2221/MCP2221A is a USB Full Speed to I2C and UART protocol converter. It enumerates as a USB HID device (no kernel driver required on Linux, macOS or Windows) and exposes an I2C master, a UART bridge, four GPIO pins, three ADC channels and one DAC channel over a single USB connection.

The MCP2221A is the current production variant. It is electrically identical to the original MCP2221 and uses the same USB VID/PID.

USB identifiers

FieldValue
Vendor ID0x04D8 (Microchip Technology)
Product ID0x00DD
USB classHID (03h)
SpeedFull Speed (12 Mbps)

Pin functions

The MCP2221A has four general-purpose pins, GP0-GP3, each configurable as GPIO or as a dedicated peripheral function:

PinGPIOAlternate function
GP0GP0SSPND (USB suspend indicator)/LED UART RX
GP1GP1Clock output/ADC1/Interrupt (edge)/LED UART TX
GP2GP2ADC2/DAC1/USB configured indicator
GP3GP3ADC3/DAC2/LED I2C traffic

SCL and SDA are dedicated I2C pins and are not shared with the GP pins.

Wiring

I2C

MCP2221A      Target
SCL    ->     SCL  (4.7 kOhm pull-up to VCC)
SDA    <->    SDA  (4.7 kOhm pull-up to VCC)
GND    <->    GND
VCC    ->     VCC  (3.3 V or 5 V depending on target)

The MCP2221A I2C pins are open-drain. External pull-up resistors are required. Use 4.7 kOhm for 100 kHz (standard mode) and 2.2 kOhm for 400 kHz (fast mode).

UART

MCP2221A      Target
TX     ->     RX
RX     <-     TX
GND    <->    GND

The UART bridge appears as a standard CDC-ACM serial port (/dev/ttyACM* on Linux). No additional kernel module is needed.

Electrical characteristics

ParameterValue
Supply voltage3.0 V - 5.5 V
I/O voltage3.0 V - 5.5 V (not 5V-tolerant on 3.3 V boards)
I2C speed (standard)100 kHz
I2C speed (fast)400 kHz
UART baud rateUp to 115200 baud (USB Full Speed limited)
ADC resolution10-bit (0-VDD or 0-1024 V/2048 V/4096 V ref)
DAC resolution5-bit (0-VDD or 0-1024 V/2048 V/4096 V ref)
GPIO current+/-25 mA per pin, 100 mA total

Linux setup (udev)

The MCP2221A enumerates as a USB HID device. Access to both the raw USB interface and the HID node requires a udev rule.

Standard Linux

echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", MODE="0666"
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", MODE="0666"' \
  | sudo tee /etc/udev/rules.d/99-mcp2221.rules
sudo udevadm control --reload-rules
sudo udevadm trigger

Reconnect the adapter after reloading.

NixOS

Add to your NixOS configuration and rebuild:

services.udev.extraRules = ''
  SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", MODE="0666", GROUP="plugdev"
  SUBSYSTEM=="hidraw", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", MODE="0666", GROUP="plugdev"
'';

The USB rule covers raw USB enumeration; the HID rule covers /dev/hidrawN access needed for I2C, GPIO, ADC, and DAC operations.

Verifying the setup

# Confirm the kernel sees the device
lsusb | grep 04d8:00dd

# Check HID node permissions (should show crw-rw-rw-)
ls -la /dev/hidraw*

# Enumerate with iottack
iottack mcp2221 device

Plugins

PluginCommandPurpose
mcp2221 deviceiottack mcp2221 deviceEnumerate connected MCP2221/MCP2221A adapters and report USB identity and capabilities
i2c scaniottack i2c scan --adapter mcp2221Scan all 112 valid 7-bit I2C addresses (0x08–0x77) and report responding devices