Given its abundance and simplicity, the RP2040 has no doubt become a favourite for USB peripheral building – in particular, USB-connected tools for electronics experiments. Today, we see one more addition to our Pico-based tool arsenal – a USB-I2C adapter firmware for RP2040 by [Renze Nicolai]. This is a reimplementation of the ATTiny-based I2C-Tiny-USB project and complies to the same protocol – thus, it’s compatible with the i2c-tiny-usb
driver that’s been in the Linux kernel for ages. Just drag&drop the .uf2
, run a script on your Linux system, and you will get a /dev/i2c-X
device you can work with from userspace code, or attach other kernel drivers to.
The software will work with any RP2040 devboard – just connect your I2C devices to the defined pins and you’ll have them show up in i2cdetect
output on your Linux workstation. As a demo, [Renze] has written a userspace Python driver for one of these SSD1306 128×64 OLEDs, and gives us a commandline that has the driver accept output of an ffmpeg
command capturing your main display’s contents, duplicating your screen on the OLED – in a similar fashion that we’ve seen with the “HDMI” I2C-driven display a few months back. Everything you might need is available on the GitHub page, including usage instructions and examples, and the few scripts you can use if you want to add an udev
rule or change the I2C clock frequency.
Just to name a few purposes, you can use a Pi Pico as a tool for SWD, JTAG, CAN, a logic analyser with both digital and analog channels, or even as a small EMP-driven chip glitching tool. The now-omnipresent $3 Pi Pico boards, it seems, are a serious contender to fondly remembered hacker tools of the past, such as the legendary BusPirate.
DirtyJTAG has now a Pico port, and an openocd port (testers are welcomed, contact me if you want to help):
https://github.com/jeanthom/DirtyJTAG
https://github.com/zoobab/openocd-dirtyjtag2
What‘s the advantage over the picoprobe firmware?
took me a little while to understand, the pico is everything that the knockoff stm32 bluepills ever wanted to be. actually makes me resent the small pile of stm32s i stocked
It depends on what you want. Three analogue inputs isn’t always enough (the stm has around 8, and they’re nicely usable as capacitive inputs with no extra hardware), and I don’t think the Pico has an rtc you can power with a coin cell (but on many of my stm32 clones the externally powered clock doesn’t work anyway). But most of my projects don’t need these extras.
I should consider porting my stm32f1 USB library to the Pico, and then it’ll work for most of my use cases.
A USB port: The consonant ‘y’ sound is used to say ‘u’. It’s about what you (not ‘an you’) hear, not what you see.
It’s pronounced “ooh ess bee”
definitely not ooh
By whom? The French? It’s ‘ooo, vee, double-ooo, then?
“ess oh bee”?
B^)
Make it wireless? At least now it is actually possible to buy the RPi Pico W (I have no affiliation):
* Raspberry Pi Pico W (without headers) Product ID: 5526 $6.00 In-Stock.
https://www.adafruit.com/product/5526
* RASPBERRY PI PICO W (without headers) Qty.-1 $6.00 17,033 In Stock.
https://www.digikey.com/en/products/detail/raspberry-pi/SC0918/16608263
how do you propose Bluetooth Low Energy to implement the USB Control Transfer layer?
now if only the author would’ve checked their github in ever, and noticed they got a) the protocol all wrong and b) it already fixed by someone else, they could’ve just clicked a single button and it would actually work as advertised.