MCP2221x – USB 2.0 to I2C/UART Protocol Converter with GPIO

April 2, 2023

The MCP2221x is used to allow a host computer to communicate with hardward via USB. The interface chip does not require any onboard logic to provide a bidirectional UART, and I2C interface. Using the appropriate host driver software to communicate to the chip, you can configure the remaining 4 GPIO pins as up to three 10-bit ADCs, single 5-bit DAC (one of the G0 is always a GPIO). The USB interface operates at USB 2.0 speeds – up to

The MCP2221A only differs from the non-A version in that its UART port baud rate can operate at up to 460800 versus 115200 for the MCP2221. The MCP2221 is also significantly cheaper than the FT232H solution (about 25% the cost) but you do give up the SPI interface of the FT232H.

The MCP2221x reports a default PID:VID of 04d8:00dd. According to the Linux USB Project, the values correspond to “Microchip Technology, Inc.” (VID) and “MCP2221(a) UART/I2C Bridge” (PID). This value can be changed with software tools but frequently is not.

Other important properties:

  • USB 2.0-Compliant
  • Supports full-speed USB (12 Mb/s)
  • Communication Device Class (CDC) for USB-to-UART conversion
  • Human Interface Device (HID) for I2C, chip control and configuration
  • 64 byte buffer to handle data throughput at any I2C baud rate
  • I2C interface is Host mode only
  • Fully configurable VID and PID assignments, and string descriptors
  • Fully configurable serial number
  • Bus-powered or self-powered (3.0V to 5.5V)
  • Up to three 10-bit ADCs with reference voltages of 4.096 (if VDD > 4.096V), 2.048, and 1.024 V
  • Single 5-bit DAC with reference voltages of 4.096 (if VDD > 4.096V), 2.048, and 1.024 V

USB Device Serial Number

During the enumeration process, the device can specify a serial number. If it does, this number is stored in the registry entry and it is used to assign the same COM port number to the adapter in question, no matter which USB port the adapter is connected to.

USB-to-UART adapters have the option to not present a serial number during USB enumeration. In this case, the operating system would not be able to differentiate between two identical devices if neither is providing its serial number. Each time one of these two devices (with no serial number provided during enumeration) is connected to the same USB port, it will have the same COM port number assigned.

Both functionalities (with or without serial numbers) are very useful for different applications.

When the serial number is provided, an adapter using the MCP2221A solution receives the same COM port number from a Windows machine, no matter which USB port it is connected to.

The case with no serial number is useful for test/validation of products using the MCP2221A. The fact that all the tested boards are not supplying a serial number will force Windows to assign them the same COM port number (but only if connected to the same USB port).

The MCP2221A is factory-set to not use a serial number. Later in the process, if a customer wants the benefits provided by using a serial number, the Configuration Utility from Microchip can be used to enable the MCP2221A to enumerate its serial number as well.

The MCP2221A comes with a uniquely provided serial number to be used during the USB enumeration process; however, this can be changed by the user in the Configuration Utility.

Microchip datasheet for MCP2221A

MCP2221x I/O Functions

The MCP2221x has multiple interfaces that are available over USB. While the UART and I2C interfaces cannot be reconfigured, there are four GPIO bits that can have differing functionality.

UART

The chip supports multiple standard and nonstandard data rates to 115200 baud with the MCP2221A providing rates up to 460800 baud. MCP2221A supports only eight data bits, no parity and one stop bit.

  • Rx – UART receive pin (chip input)
  • Tx – UART transmit pin (chip output)
  • Additional GPIO functions: UART Activity LED Outputs
    • LED_URX – GP0, indicates UART receive traffic
    • LED_UTX – GP1, indicates UART transmit traffic

I2C Host

Capable of sending/receiving data at a multitude of bit rates, up to 400 kbps. Supports only 7-bit or 10-bit addressing modes. Single data transfers can be up to 65,535 bytes. Clock stretching allowing slower I2C clients to communicate. Functionally, all the user data to be sent/transmitted over the I2C bus are conveyed to the USB host only through the USB HID interface.

  • SDA – I2C data line
  • SCL – I2C clock line
  • Additional GPIO functions: I2C Activity LED Output
    • LED_I2C – GP3, indicates I2C traffic

ADC/DAC/GPIO/External IRQ

See data sheet for more information.

Break Out Board

A really nice break out board is available from Adafruit. See their website for availability. At the time of this writing (April 2023), the price is $6.50.

Adafruit MCP2221A Breakout - General Purpose USB to GPIO ADC I2C - Stemma QT / Qwiic

On the top of the PCB is a USB C connector. The bottom holds one of the JST-SH 4-pin connectors that Adafruit likes to use on their STEM associated devices.