Tuesday, December 30, 2014

Adventures in hardware

Just before the Christmas break, we had a "makers" day at work in which the team I am on built various gizmos, such as wiring up a set of traffic lights to a continuous build monitor. I hung out with a group that was working on getting an Arduino to drive a LCD display and some LEDs, again for build and test status. This for me was a little like going back to my roots. I started my career as a hardware designer, working on embedded microprocessor systems for custom displays. That was around 1983-4. I had been building small electronic circuits from about 1975 onwards. I recall the first thing I built was a two-tone oscillator based on a 7413 Schmidt trigger. It sounded a bit like a British police car siren, and caused general amusement when it was put into service in place of our door bell. It was building things like this that got me interested in computers, largely because the electronics magazines where starting to carry articles about them as they started to become cheap enough for hobbyists in the late 1970s. From hardware I went on to programming, and the rest is history. Just think, if it hadn't been for that 7413 perhaps I would not have abandoned my other possible careers as an astronaut or a rock star.

I was sufficiently inspired by the maker day at work to buy myself an Arduino, and I've spent the Christmas break playing with it. I'll write more about it later. I also bought a Raspberry Pi: a tiny, self-contained computer intended to inspire people to program in the same way that the BBC Micro did in the 1980s. By default it runs a version of Linux. I noticed that you can also run RISCOS on it. RISCOS was the second version of the operating system for the Acorn Archimedes, after the hack-and-slash Arthur in the initial release, and I wrote some of the bundles applications for it when I was working for Acorn. Acorn is sadly long since gone, but RISCOS has continued as open source. Out of curiosity, I downloaded the source, and found some of my original code from 1988-89 still there. It's less nasty than I thought it would be, and I am glad to see that my ability to proof read comments was always as bad as it is now.

I got the Arduino and the Pi from adafruit.com. This site has a good collection of hardware, from ready assembled boards down to individual components. Many of the things they sell (sensors and so on) have accompanying articles showing how to hook up the hardware and write software to use it. Although it's good that they provide this support, I was a little disappointed in how they do it. Most of the articles treat the items like Lego: they tell you to connect wires here and call this library there, with no explanation of what is going on at either the hardware or software level. Thinking back to those first circuits that I built, the hobbyist magazines always have a deeper level of explanation than just how to solder it together. I may not have understood the descriptions of how the circuits worked, but I gradually learned a lot about electronics both in theory and practice from them.

One last note. I was looking at making at transceiver using an IR LED and phototransistor for use with the Arduino, and found some good articles on the subject. I noticed several of them were by Ken Shirriff in his blog at righto.com. Ken is someone I've worked with a Google: a good engineer and an all round nice guy. This is not the first time I've stumbled across things by him. Earlier this year I was reading an article about how someone had reverse engineered the code in the Sinclair Scientific calculator by looking at a scan of the chip. Who would do something so bizarre? Ken, of course. Then a few months later, I was reading about someone who tried to run the bitcoin mining algorithm by hand, an insane proposition. Need I say who did it? I think not.