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.
Continue reading “USB Host On RP2040 – With PIO” →
Making a programming jig becomes exponentially more difficult after two pins and who would even consider building one if they were not setting up more than twenty boards? If it were easy for novices to construct jigs, we might all have a quiver of them on the shelf next to our microprocessors. Honestly, a tackle box full of homemade programming fixtures sounds pretty chic. The next advantage to ditching the demo boards is that bare processors take up less room and don’t draw power for unnecessary components like unused voltage regulators and LEDs. [Albert David] improves the return-on-time-investment factor by showing us how to repurpose a WeMos board to program a bare ESP8266 module.
[Albert]’s concept can apply to many other surface-mount chips and modules. The first step is to buy a demo board which hosts a programmable part and remove that part. Since you’ve exposed some solder pads in the process, put pogo pins in their place. Pogo pins are small spring-loaded probes that can be surface mounted or through-hole. We’ve used them for programming gorgeous badges and places where the ESP8266 has already been installed. When you are ready to install your software, clamp your Franken-porcupine to the controller and upload like normal. Rinse, wash, repeat. We even get a view of the clamp [Albert] uses.
If you have a microcontroller to program, it can be an easy enough process to hook up a serial lead and perform the task. If however you have hundreds of microcontrollers on PCBs to program, connecting that lead multiple times becomes an impossibility. In manufacturing environments they have pogo pin jigs, an array of spring-loaded pins carrying the programming signals that line up perfectly with the appropriate pads on a PCB places on top of it.
[Conor Patrick] is working on an upgrade to the U2F Zero 2-factor authentication token, and he faces exactly this problem of needing to program a lot of boards. His pogo pin jig is very nicely executed, and he’s taken us through his design and manufacture process for it.
Starting with his PCB design in Eagle, he exported it to Fusion 360 in which he was able to create a jig to fit it. Into the jig model he placed the holes for his chosen pogo pins in the appropriate places, before printing it with an SLA 3D printer. He is particularly complementary about the pins themselves, a solder bucket design that comes from mill-Max, and was sourced via DigiKey.
The proof of the pudding is in the eating, and happily when his completed jig received its first board, everything worked as planned and the programming proceeded flawlessly. We’ve shown you other pogo pin jigs, but this one is particularly nicely executed.