The IC MCP2221/MCP2221A is an interface converter that performs protocol conversion from USB to I2C.
This IC can send I2C commands via the USB HID interface, so you can operate I2C devices from generic PCs. There is no need to bring any special devices such as Arduino or Raspberry Pi, and also no need to install any drivers.
The package Smdn.Devices.MCP2221.GpioAdapter can control this IC and can be used with Smdn.Devices.US2066
.
This example shows operating the OLED display module SO1602A using MCP2221A. You can run this example with following instruction.
Required devices and parts are as follows:
- PC with USB ports
- Windows, Linux, or etc., where Smdn.Devices.MCP2221.GpioAdapter can work.
- USB breakout board or breakout cable
- MCP2221/MCP2221A and
- 0.22μF capacitor × 1
- 0.1μF capacitor × 1
- 10kΩ resistor × 1
- 3.3V voltage regulator and
- external capacitors which required by the regulator
- SO1602A OLED display module and
- 0.1μF capacitor × 1
- 4.7kΩ resistor × 2
- 3P slide switch × 1 (Optional. This switch is used to switching I2C address of SO1602A.)
秋月電子通商で購入する場合は、以下で必要なパーツを揃えることができます。 Required parts can be purchased from the following links (Japanese supplier).
パーツリスト
- USB⇔シリアル変換IC MCP2221A-I/P
- 有機ELキャラクタディスプレイモジュール 16×2行 白色
- USBtype-CコネクタDIP化キット(シンプル版エコノミータイプ)
- 低損失三端子レギュレーター 3.3V1A TA48033S (外部コンデンサとのセット)
- 積層セラミックコンデンサー 0.22μF50V X7R 2.54mmピッチ (10個入)
- 絶縁ラジアルリード型積層セラミックコンデンサー 0.1μF50V2.54mm (10個入)
- カーボン抵抗(炭素皮膜抵抗) 1/4W10kΩ (100本入)
- カーボン抵抗(炭素皮膜抵抗) 1/4W4.7kΩ (100本入)
- スライドスイッチ 1回路2接点 基板用
Wire up the devices and parts as shown in the wiring diagram below.
This diagram shows the case where TA48033S
is used as a 3.3V regulator. If you will attempt to use other regulators, replace capacitors with compliant ones.
Run command dotnet build
to build project, or dotnet run
to run project.
If the project run properly, SO1602A shows the text Hello, world!
like this: