Close To The Metal

Firmware is caught between hardware and software. What do I mean? Microcontroller designers compete on how many interesting and useful hardware peripherals they can add to the chips, and they are all different on purpose. Meanwhile, software designers want to abstract away from the intricacies and idiosyncrasies of the hardware peripherals, because code wants to be generic and portable. Software and hardware designers are Montagues and Capulets, and we’re caught in the crossfire.

I’m in the middle of a design that takes advantage of perhaps one of the most idiosyncratic microcontroller peripherals out there – the RP2040’s PIOs. Combining these with the chip’s direct memory access (DMA) controllers allows some fairly high-bandwidth processing, without bogging down the CPUs. But because I want this code to be usable and extensible by a wide audience, I’m also trying to write it in MicroPython. And configuring DMA controllers is just too idiosyncratic for MicroPython.

But there’s an escape hatch. In my case, it’s courtesy of the machine.mem32 function, which lets you read and write directly into the chip’s memory, including all of the memory-mapped configuration registers. Sure, it’s absurdly low-level, but it means that anything you read about in the chip’s datasheet, you can do right away, and from within the relative comfort of a Micropython program. Other languages have their PEEK and POKE equivalents as well, or allow inline assembler, or otherwise furnish you the tools to get closer to the metal without having to write all the rest of your code low level.

I’m honestly usually a straight-C or even Forth programmer, but this experience of using a higher-level language and simultaneously being able to dive down to the lowest levels of bit-twiddling at the same time has been a revelation. If you’re just using Micropython, open up your chip’s datasheet and see what it can offer you. Or if you’re programming at the configure-this-register level, check out the extra benefits you can get from a higher-level language. You can have your cake and eat it too!

A Mainframe Computer For The Modern Age

The era of mainframe computers and directly programming machines with switches is long past, but plenty of us look back on that era with a certain nostalgia. Getting that close to the hardware and knowing precisely what’s going on is becoming a little bit of a lost art. That’s why [Phil] took it upon himself to build this homage to the mainframe computer of the 70s, which all but disappeared when PCs and microcontrollers took over the scene decades ago.

The machine, known as PlasMa, is not a recreation of any specific computer but instead looks to recreate the feel of computers of this era in a more manageable size. [Phil] built the entire machine from scratch, and it can be programmed directly using toggle switches to input values into registers and memory. Programs can be run or single-stepped, and breakpoints can be set for debugging. The internal workings of the machine, including the program counter, instruction register, accumulator, and work registers, are visible in binary lights. Front panel switches let you control those same items.

The computer also hosts three different microcodes, each providing a unique instruction set. Two are based on computers from Princeton, Toy-A, and Toy-B, used as teaching tools. The third is a more advanced instruction set that allows using things like emulated peripherals, including storage devices. If you want to build one or just follow along as the machine is constructed, programmed, and used, [Phil] has a series of videos demonstrating its functionality, and he’s made everything open-source for those more curious. It’s a great way to get a grasp on the fundamentals of computing, and the only way we could think of to get even more into the inner workings of a machine like this is to build something like a relay computer.

Continue reading “A Mainframe Computer For The Modern Age”

MeArm 3.0: The Pocket-Sized Robot Arm

We all might dream of having an industrial robot arm at our disposal, complete with working controller that doesn’t need constant maintenance and replacement parts, and which is able to help us with other projects with only a minimum of coding or instruction. That’s a pipe dream for most of us, as without a large space, sufficient funding, or unlimited amounts of troubleshooting time we’ll almost always have to look for something smaller and simpler. Perhaps something even as small as this pocket-sized robotic arm.

This isn’t actually the first time we’ve seen the MeArm; the small robot has been around since 2014 and has undergone a number of revisions and upgrades. Even this revision has been out for a little while now but this latest in the series is now available with a number of improvements over the older models. The assembly time required has been reduced from two hours to about 30 minutes and the hardware has even been fully open-sourced as well which allows virtually anyone with the prerequisite tools to build this tiny robot for whatever they happen to need it for, due to its very permissive licensing.

The linked Instructable goes into every detail needed for building the robot as well as documenting all of the parts needed, although you will need access to some specialty tools to make a lot of them. We also featured a Friday Hack Chat about these robots back in 2018 that has some interesting details about these robots in it, and although this is a relatively small robot in the grand scheme of things it’s always possible to upgrade to something larger in the future.

Continue reading “MeArm 3.0: The Pocket-Sized Robot Arm”

Recreating An Analog TV Test Pattern

While most countries have switched to digital broadcasting, and most broadcasts themselves have programming on 24/7 now, it’s hard to remember the ancient times of analog broadcasts that would eventually stop sometime late at night, displaying a test pattern instead of infomercials or reruns of an old sitcom. They were useful for various technical reasons including calibrating the analog signals. Some test patterns were simply camera feeds of physical cards, but if you wanted the most accurate and reliable test patterns you’d need a Philips pattern generator which created the pattern with hardware instead, and you can build your own now because the designs for these devices were recently open-sourced. Continue reading “Recreating An Analog TV Test Pattern”

Embed Hardware Into 3D Prints, But Not In The Way You’re Thinking

[Christopher Helmke] is doing fantastic work in DIY systems for handling small hardware like fasteners, and that includes robotic placement of hardware into 3D prints. Usually this means dropping nuts into parts in mid-print so that the hardware is captive, but that’s not really the story here.

The really inventive part we want to highlight is the concept of reducing packaging and labor. Instead of including a zip-lock bag of a few bolts, how about embedding the bolts into a void in the 3D print, covered with a little snip-out retainer? Skip ahead to 1:54 in the video to see exactly what we mean. It’s a pretty compelling concept that we hope sparks a few ideas in others.

As clever as that concept is, the rest of the video is also worth a watch because [Christopher] shows off a DIY system that sits on top of his 3D printer and takes care of robotically placing the hardware in mid-print. He talks all about the challenges of such a system. It’s not perfect (yet), but seeing it in action is very cool.

We’ve recently seen a lot of fascinating stuff when it comes to [Christopher Helmke]’s automated handling of fasteners and similar hardware. His system makes rapid and accurate dispensing of bolts look easy, and his work on using compressed air to zip pieces around seems effective.

Continue reading “Embed Hardware Into 3D Prints, But Not In The Way You’re Thinking”

PUF Away For Hardware Fingerprinting

Despite the rigorous process controls for factories, anyone who has worked on hardware can tell you that parts may look identical but are not the same. Everything from silicon defects to microscopic variations in materials can cause profoundly head-scratching effects. Perhaps one particular unit heats up faster or locks up when executing a specific sequence of instructions and we throw our hands up, saying it’s just a fact of life. But what if instead of rejecting differences that fall outside a narrow range, we could exploit those tiny differences?

This is where physically unclonable functions (PUF) come in. A PUF is a bit of hardware that returns a value given an input, but each bit of hardware has different results despite being the same design. This often relies on silicon microstructure imperfections. Even physically uncapping the device and inspecting it, it would be incredibly difficult to reproduce the same imperfections exactly. PUFs should be like the ideal version of a fingerprint: unique and unforgeable.

Because they depend on manufacturing artifacts, there is a certain unpredictability, and deciding just what features to look at is crucial. The PUF needs to be deterministic and produce the same value for a given specific input. This means that temperature, age, power supply fluctuations, and radiation all cause variations and need to be hardened against. Several techniques such as voting, error correction, or fuzzy extraction are used but each comes with trade-offs regarding power and space requirements. Many of the fluctuations such as aging and temperature are linear or well-understood and can be easily compensated for.

Broadly speaking, there are two types of PUFs: weak and strong. Weak offers only a few responses and are focused on key generation. The key is then fed into more traditional cryptography, which means it needs to produce exactly the same output every time. Strong PUFs have exponential Challenge-Response Pairs and are used for authenticating. While strong PUFs still have some error-correcting they might be queried fifty times and it has to pass at least 95% of the queries to be considered authenticated, allowing for some error. Continue reading “PUF Away For Hardware Fingerprinting”

Art of 3D printer in the middle of printing a Hackaday Jolly Wrencher logo

3D Printering: Can You Ever Have Enough Vitamins?

As a community we owe perhaps more than we realise to the RepRap project. From it we get not only a set of open-source printer designs, but that 3D printing at our level has never become dominated by proprietary manufacturers in the way that for example paper printing is. The idea of a printer that can reproduce itself has never quite been fully realised though, because of what the RepRap community refer to as “vitamins“.

These are the mass-produced parts such as nuts, bolts, screws, and other parts which a RepRap printer can’t (yet) create for itself. It’s become a convenience among some of my friends to use this term in general for small pieces of hardware, which leads me to last week. I had a freshly printed prototype of one of my projects, and my hackerspace lacked the tiny self-tapping screws necessary for me to assemble it. Where oh where, was my plaintive cry, are the vitamins!

So my hackerspace is long on woodscrews for some reason, and short on machine screws and self-tappers. And threaded inserts for that matter, but for some reason it’s got a kit of springs. I’m going to have to make an AliExpress order to fix this, so the maybe I need you lot to help me. Just what vitamins does a a lone hardware hacker or a hackerspace need? Continue reading “3D Printering: Can You Ever Have Enough Vitamins?”