Building the hardware so I can build the software (so I can build the hardware)
Originally published on Patreon.
My day job, before taking this break to work on the book, was in mobile apps. Of all the things I took for granted in software engineering, the one assumption I could always make was that the hardware was, y’know, done. Now that I’m writing software for hardware that I’m building myself, it’s the exact opposite. In fact, I find these funny circular dependencies where I want to write some piece of functionality, only to realize that the thing I’ve built so far doesn’t support it.

Case in point (though not today’s point): a few months ago, I was working on Babel, a library for universal language support. I had figured out how to squeeze almost all the languages of the world into a two-megabyte Flash chip that comes with many of the Feather boards I had laying around. I wanted to write a CircuitPython module for Babel, but soon found a problem: CircuitPython needs that Flash chip, and Babel can’t share. So I needed to add a second Flash chip, which led to this rather silly FeatherWing, consisting of nothing but a SPI Flash chip and a decoupling capacitor (and I guess a microSD slot, but I never actually needed it).
Anyway, back to today: after a conversation with a colleague about manufacturing and costs and the margin needed to sustainably make a product, I realized that all my pinching of pennies on the BOM still hasn’t been enough to make this as universally accessible as I’ve been hoping. Basically, I’m going to need to find a way to make an even more cost-efficient version of this thing. And as I’m staring at the device, wondering what I could possibly cut out, it occurred to me: there are 11 buttons on this thing. What if I could get that number down?
The SAMD51 at the heart of the Open Book includes something called a “Peripheral Touch Controller”. Basically, you can connect some of its pins directly to a conductive object (like a flat copper pad on a circuit board), and it can detect when you touch it. You can even design a series of pads in a zigzag pattern, and detect an exact touch position along a continuous line.

In theory, this is great! I can imagine swiping from right to left on this slider to turn a page, or tapping on individual touch areas to tap soft buttons indicated on the screen. In practice, though, one thing makes it less great: the software to actually use the PTC is closed source, which goes against the ethos of the Open Book. Some folks have done great work developing open source libraries for the PTC on the SAMD11 and SAMD21, but the SAMD51 remains a black box. If I’m going to do this, I need to write some software for running the touch controller. Which means I need some hardware, even if it’s just a small circuit board with zigzagging copper pads and not much else.

It should get here next week.
Technically I ordered another board — two actually — to try something even more ambitious with touch control. I might share more about those in the new year.