Killed By A Machine: The Therac-25

The Therac-25 was not a device anyone was happy to see. It was a radiation therapy machine. In layman’s terms it was a “cancer zapper”; a linear accelerator with a human as its target. Using X-rays or a beam of electrons, radiation therapy machines kill cancerous tissue, even deep inside the body. These room-sized medical devices would always cause some collateral damage to healthy tissue around the tumors. As with chemotherapy, the hope is that the net effect heals the patient more than it harms them. For six unfortunate patients in 1986 and 1987, the Therac-25 did the unthinkable: it exposed them to massive overdoses of radiation, killing four and leaving two others with lifelong injuries. During the investigation, it was determined that the root cause of the problem was twofold. Firstly, the software controlling the machine contained bugs which proved to be fatal. Secondly, the design of the machine relied on the controlling computer alone for safety. There were no hardware interlocks or supervisory circuits to ensure that software bugs couldn’t result in catastrophic failures.

The case of the Therac-25 has become one of the most well-known killer software bugs in history. Several universities use the case as a cautionary tale of what can go wrong, and how investigations can be lead astray. Much of this is due to the work of [Nancy Leveson], a software safety expert who exhaustively researched the incidents and resulting lawsuits. Much of the information published about the Therac (including this article) is based upon her research and 1993 paper with [Clark Turner] entitled “An Investigation of the Therac-25 Accidents”. [Nancy] has since published updated information in a second paper which is also included in her book.

Continue reading “Killed By A Machine: The Therac-25”

Stuffing Macs Into FPGAs

A few years ago, [Steve] of Big Mess ‘O Wires fame stuffed one of the first Macintosh computers into an FPGA. While the project worked and was able to run System 6 on a virtual CPU, there were a few problems: it wasn’t exactly stable, and there was no support for a keyboard, sound, SCSI, or serial ports.

Now, there’s a new tiny FPGA board around, and this one is perfectly designed to fit the original Macintosh on it. It’s much more stable, and there is a floppy disk emulator on the horizon, just so you won’t have to deal with all those 400k 3.5″ disks anymore.

[Steve]’s brand new Mac Plus is based on the MiST board, an FPGA board that was originally designed to emulate the first Amigas and the Atari SE on an FPGA and a separate ARM CPU. There’s already been a lot of classic computers ported to the MiST, and the classic all-in-one Macs are the last project that’s left.

In the video below, you can see the MiST board running the classic System 6 at SVGA resolution. That means MacPaint and Shufflepuck in one compact board using modern hardware.

Continue reading “Stuffing Macs Into FPGAs”

Every PCB Has Its Place

Everyone has their favorite process for PCB fabrication, as long as you’re a happy hacker I don’t think it really matters. But in this post I thought it might be interesting to describe my personal process, and some of the options available.

Making your own at home

The Dirty Electronics Skull Etching Synth a great looking maskless board.

Etching is the classic PCB fabrication option for the home hacker. It’s been many, many years since I etched a PCBs but it can produce interesting results. Some people don’t like it, and I’d personally tend to avoid it as a messy and finicky process. But, if you only need 1 or 2 layer boards with large features (through-hole components are best of course) it can be a viable option. In some cases, I think etched boards look awesome and are a great fit. One example is the skull etching shown to the right. The oxidation and discoloration of the boards adds to the design aesthetic in this case.

Sample1
A simple design milled on an Accurate CNC

For those with a bigger budget a professional milling machine might be a viable choice. I’ve used an Accurate CNC in the past (LPKF and others make mills too), but this is an expensive option (no online pricing, but if $10,000 USD is a lot for you don’t bother). The accurate mill is pretty awesome, it can be fitted with a vacuum bed, automatic tool changer and vision system for alignment. The mill can produce high quality two layer boards with all the holes and vias drilled out. The final step of filling the vias is however manual, but compared to etched boards the results are pretty professional (the mill itself uses milled PCBs!). They claim a 0.1mm (4 mil) track size, I’ve never tried tracks this small but surface mount components were not a problem.

While a fun toy, it’s worth considering if you really need a PCB mill. The only case where they’re really valuable is if you want to be able to iterate over a design with less than a days turn around. This can be useful in RF or low noise designs where you might want to experiment with different layouts, but for other projects the price of a good mill can pay for quick turn around (1 or 2 days from order submission to delivery) on a lot of boards.

Commercial Fabrication

Years ago commercial fabrication used to be a very expensive and finicky process. For the most part you’d need to order a full panel putting the service outside of most hobbyists reach. Generating gerbers and drill files to the fabs specification could also be a process fraught with complication.

These days services that aggregate designs onto a single panel and break them out for distribution are common. For my work I mostly stick with OSHPark and SeeedStudio whose services complement each other well. I’ve also used Itead and found them compatible with Seeed (with the added benefit that they supply free boards for open projects).

Using OSHPark gives me the warm fuzzies. A child of the hacker community, born out of DorkbotPDX, all OSHPark’s boards are fabbed in the US (check out the great amphour interview for more details). Their services are limited to either 2 or 4 layer boards (always in purple, and always coated with gold (ENIG)), in 6×6 (6 mil traces with 6 mil spacing) or 5×5. I rarely attempt BGA boards so the 2 layer service works out great for me. OSHPark’s minimum order is 3 boards, which is perfect for prototyping. The gold plating also provides a nice finish, which both protects the board from oxidation and provides a nice surface to solder to. The main reason I use OSHPark however is that they’re cheap for small boards and have a relatively fast turn around (I recently purchased 3 tiny 20x15mm boards for $2.40 including shipping which was unbeatable). From OSHPark in the US to the UK my boards take about 2 weeks to arrive. They’ve also automatically upgrade boards to their super-swift service for free when there’s spare capacity. Their service is pretty slick, and provides a rendering of the gerbers prior to ordering as a final check which comes in very handy.

oshseeed2
Zigbee to esp8266 interface fabricated by Seeed (left) and OSHPark (right) (more complex boards here)

Seeed on the other hand are much cheaper for larger size boards and volume orders. They also provide more color and finishing options. The cheapest option at Seeed is green PCBs with HASL finish (hot air solder leveling). From Seeed, my boards usually take about a month to arrive (there are a few delivery options, but in my experience this is about as fast as it gets and faster shipping services often make using Seeed less attractive).

The image to the right shows a couple of very simple boards I had manufactured at both OSHPark and Seeed. I’ve never had a fabrication issues with boards from either service (though I prefer the ENIG finish).

Partly due to the limitations imposed by using commercial fabs I pipeline my projects. I send projects out to fab early in the design process and then switch to another design. When the board comes back I bring it up, bodge as required, and iterate over the layout. This works well with a two-week turn around, so I mostly use OSHPark while prototyping.

My boards also tend to be quite small (Arduino shield size or a little bigger). With small boards like this OSHPark is usually on-par or cheaper than ordering from Seeed (whose minimum quantity is 10 boards). With boards of about 100x100mm or larger I consider Seeed as they become significantly cheaper.

As a hobbyist I also rarely need huge numbers of boards, but for workshops when I need 10 or 20 boards I order from Seeed based on the final iteration of my prototypes. This is not only much cheaper than OSHPark, but I can get boards in a variety of colors to make workshops more interesting too.

This post has described some of the available options and my personal process. I hope it’s been interesting, but I’d love to hear about your favorite fabrication techniques, services and experiences both good and bad too. Please comment below!

Upgrade Your Computer The 1985 Way

Today when you want to upgrade your computer you slap in a card, back in the early 80’s things were not always as simple.  When [Carsten] was digging around the house he found his old, and heavily modified Rockwell AIM 65 single board computer, flipped the switch and the primitive 6502 machine popped to life.

Added to the computer was a pile of wires and PCB’s in order to expand the RAM, the I/O to form a “crate bus” and of course tons of LED blinkenlights! On that bus a few cards were installed, including a decoder board to handle all the slots, a monitor controller, a massive GPIO card, and even a universal EEPROM programmer.

If that was not enough there was even a OS upgrade from the standard issue BASIC, to a dual-boot BASIC and FORTH. Though again unlike today where upgrading your OS requires a button click and a reboot, making all these upgrades are planned out on paper, which were scanned for any retro computer buff to pour through.

[Carsten] posted a video of this computer loading the CRT initilization program from a cassette. You can watch, but shouldn’t listen to that video here.

Nomograms: Complex Analog Calculators Simple For Everyone

In the late 1800s, a railway engineer named Philbert Maurice d’Ocagne was part of a group of men faced with the task of expanding the French rail system. Before a single rail could be laid, the intended path had to be laid out and the terrain made level. This type of engineering involves a lot of cut and fill calculations, which determine where dirt must be added or removed. The goal of earthwork is to create a gentle grade and to minimize the work needed to create embankments.

In the course of the project, d’Ocagne came up with an elegant, reusable solution to quickly  solve these critical calculations. Most impressively, he did it with little more than a pen, some paper, and a straightedge. By developing and using a method which he called nomography, d’Ocagne was able to perform all the necessary calculations that made the gentle curves and slopes of the French railway possible.

Continue reading “Nomograms: Complex Analog Calculators Simple For Everyone”

Mostly Non-Volatile Memory With Supercapacitors

Back in the days of old, computers used EPROMs to store their most vital data – usually character maps and a BASIC interpreter. The nature of these EPROMs meant you could write to them easily enough, but erasing them meant putting them under an ultraviolet light. Times have changed and now we have EEPROMs, which can be erased electronically, and Flash, the latest and greatest technology that would by any other name be called an EEPROM. [Nicholas] wanted an alternative to these 27xx-series EPROMs, and found his answer in supercapacitors.

[Nick]’s creation is a mostly non-volatile memory built around an old 62256 32k SRAM. SRAM is completely unlike EPROMs or Flash, in that it requires power to keep all its bits in memory. Capacitor technology has improved dramatically since the 1980s, and by using a supercap and one of these RAM chips, [Nick] has created a substitute for a 27-series EPROM that keeps all its memory alive for days at a time.

The circuit requires a small bit of electronics tucked between the EPROM socket and the SRAM chip; just enough to turn the 12 Volts coming from the EPROM programming pin to the 5 Volts expected from the SRAM’s Write Enable pin. This is accomplished by a few LEDs in series, and a 0.1F 5.5V supercap which keeps the SRAM alive when the power is off.

As for why anyone would want to do this when modern technologies like Flash can be found, we can think of two reasons. For strange EPROM sizes, old SRAMs abound, but a suitable Flash chip in the right package (and the right voltage) might be very hard to find. Also, EEPROMs have a write lifetime; SRAMs can be written to an infinite number of times. It’s not the best solution in every case, but it is certainly interesting, and could be useful for more than a few vintage computing enthusiasts.

This project makes us think of another where an LED may have been supplying keep-alive power to some volatile memory.

TEMPEST: A Tin Foil Hat For Your Electronics And Their Secrets

Electronics leak waves and if you know what you’re doing you can steal people’s data using this phenomenon. How thick is your tinfoil hat? And you sure it’s thick enough? Well, it turns out that there’s a (secret) government standard for all of this: TEMPEST. Yes, all-caps. No, it’s not an acronym. It’s a secret codename, and codenames are more fun WHEN SHOUTED OUT LOUD!

The TEMPEST idea in a nutshell is that electronic devices leak electromagnetic waves when they do things like switch bits from ones to zeros or move electron beams around to make images on CRT screens. If an adversary can remotely listen in to these unintentional broadcasts, they can potentially figure out what’s going on inside your computer. Read on and find out about the history of TEMPEST, modern research, and finally how you can try it out yourself at home!

Continue reading “TEMPEST: A Tin Foil Hat For Your Electronics And Their Secrets”