Nicolai Electronics’ rp2040-ic2-interface open-source firmware for the Raspberry Pi Pico (or other Raspberry Pi RP2040 boards) converts the board into an I2C to USB bridge to connect any I2C sensor or module to a PC or other hardware without GPIOs.
The firmware implements the USB protocol expected by the I2C-Tiny-USB kernel driver used by the original I2C-Tiny-USB project for Microchip ATMega 8-bit AVR microcontrollers. The RP2040 is however not a fork of the original project, but instead a complete re-implementation of the firmware.
You’ll need to connect your I2C sensor, display, or another module to the SDA (GPIO 2) and SCL (GPIO 3) pins of the Raspberry Pi RP2040 microcontroller and flash the “pre-release” firmware to the board. You’ll find it together with the source code written in C language on GitHub. Note the project has a “proof of concept status” and more testing is needed to make sure that everything works as expected.
The project is best used with a Linux host as the i2c-tiny-usb kernel part of the official kernel source tree. I could load it easily on Ubuntu 20.04:
1 2 3 |
jaufranc@cnx-laptop-4:~$ sudo modprobe i2c-tiny-usb jaufranc@cnx-laptop-4:~$ lsmod | grep tiny i2c_tiny_usb 20480 0 |
But you’ll also find drivers for Windows and macOS and documentation on the aforelinked I2C-Tiny-USB project. Once you attach the RP2040 board to your host through a USB cable, the I2C sensor/module should be visible with standard client applications such as the ones found in the lm_sensors framework (sensors-detect, sensors, etc…).
Via Hackster.io
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
the original I2C-USB-Tiny is also supported by the FPGA-Emulator MiST as RTC-device. Mayby the Pico version will serve this as well?