Folks from [Adafruit] are showing off a neat hack – USB host on RP2040, using the now-famous PIO peripheral. [Adafruit] builds a lot of RP2040 boards, and naturally, you gotta test them before you ship them to customers. They’ve been using very specific Teensies for that, and at some point, those became unobtainium. Based on the work of [sekigon-gonnoc] and with help of [Thach], they’ve made their TinyUSB library support bitbanging of USB over PIO, and successfully ported their test jig firmware to it!
The base Pico-PIO-USB repo by [sekigon-gonnoc] shows a pretty impressive state of affairs – with low-speed and full-speed USB host and full-speed USB device modes supported, and quite a few examples to get you started. [Adafruit]’s work integrates this code into their TinyUSB stack, specifically focusing on MST (mass storage) features – as this is what you need to program a RP2040. Of course, they also provide a mass storage example to boot!
Test jigs are pretty important to have when making multiple pieces of a board, and with RP2040 supporting more and more interfaces thanks to PIO, it sounds like the perfect chip for your next production testing-intended PCB. With the jig brains taken care of, you’ll want to look into building no less important mechanical part, and we’ve covered quite a few ways to sort that out – here’s an OpenSCAD script that generates lasercutting files out of KiCad boards, or a jig built out of scrap copperclad FR4, and a pretty extensive tutorial on making your own lasercuttable jigs, to boot.
https://github.com/jfedor2/hid-remapper This is a similar project that has found a lot of interest among users of older trackballs and mlt04 based mice. it allows cross platform button remapping, dpi scaling, and usb polling rate overclocking.
Killer application. How to make oddball input devices into standart HID ones, at the hardware level :)
Honestly, anything MCU with basic USB HID capabilities do that (e.g. ATTiny85 can bitbang to be a USB keyboard). The real points of interest is that this doesn’t consume the (primary) CPU bitbanging USB, doesn’t use proprietary silicon, and still is low cost.
Apparently the attiny85 trick doesn’t work as well anymore on modern computers. (At least, it fails enough that Adafruit is discontinuing all their products that used it and have a big warning on the product pages for remaining stock, iirc).
I mean, I built the USB i2c thingie a few years ago and I think it mostly works fine, but I’m never the first to upgrade computers.
No. There are a lot of esoteric USB2 peripherals for which “anything MCU” and “bitbanging USB” would be not fit.
Although a neat project, it uses two pico’s. With what adafruit has developed you could now do the same on one pico.
That’s not quite correct. The original version used one pico, but when some users complained about their peripherals not being supported, it was decided to create a twin mcu design to take advantage of the hardware usb libraries on both the client and host side.
Did you mean two PIOs?
That project sounds very similar to a project I’ve been working on. Mine is for converting USB devices into up to 4 HID Gamepad
https://github.com/drflamemontgomery/Rosetta
That’s pretty cool. Though definitely a bit more specific in scope (and presumably easier to use).
So, I love the idea of a hybrid KVM+software solution.
Do all the actual switching physically so that it works flawlessly and works with any OS, but use a little software on supported platforms for automatically triggering the change and hopping my cursor to the correct spot. Give me a button for manually toggling and a switch to enable/disable automatic screen edge jumping. If it bugs out, I can just hit the manual button.