MCP2221

by Adafruit

Image of Board

Wouldn’t it be cool to drive a tiny OLED display, read a color sensor, or even just flash some LEDs directly from your computer? Sure you can program an Arduino or Trinket to talk to these devices and your computer, but why can’t your computer just talk to those devices and sensors itself? Well, now your computer can talk to devices using the Adafruit MCP2221A breakout board!

What can the MCP2221 chip do? This chip from Microchip is similar to a USB to serial converter chips but adds a GPIO and I2C interface as well. The analog/digital GPIO pins can act as 10-bit analog inputs (ADC) and there’s even a 5-bit DAC output. The I2C interface is great for talking to OLEDs, sensors, PWM drivers, its the most popular interface for small devices. You can use the GPIO to do things like flash LEDs, read switches or buttons, and more. The MCP2221A breakout is like adding a little swiss army knife for serial protocols to your computer!

This chip is powerful and useful to have when you want to use Python (for example) to quickly iterate and test a device that uses I2C or general purpose digital and analog I/O. There’s no firmware to deal with, so you don’t have to deal with how to “send data to and from an Arduino which is then sent to and from” an electronic sensor or display or part.

Purchase

Contribute

Have some info to add for this board? Edit the source for this page here.

Adafruit Blinka Installation

We use a special library called adafruit_blinka (named after Blinka, the CircuitPython mascot) to provide the layer that translates the CircuitPython hardware API to whatever library the Linux board provides.

For example, on Raspberry Pi we use the python RPi.GPIO library. For any I2C interfacing we'll use ioctl messages to the /dev/i2c device. For SPI we'll use the spidev python library, etc. These details don't matter so much because they all happen underneath the adafruit_blinka layer.