You are viewing c0re_dump

c0re_dump's Journal
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 20 most recent journal entries recorded in c0re_dump's LiveJournal:

    [ << Previous 20 ]
    Monday, November 12th, 2012
    1:10 pm
    Quirky Calculator
    Way back when I was at school in the 1970s, one of my classmates had a calculator of unusual design. Remember that this was the early days of pocket calculators, not long after the introduction of such classics as the Sinclair Cambridge and the HP 35. Calculators were expensive then! This particular one met an early demise when it was thrown out of an upstairs window at the school. There wasn't much left, but I did manage to rescue the keypad section, to make a control panel for a TV game kit that I built into an old black-and-white valve TV.

    Many years later, I found another one on eBay:

    Casio Personal Mini Calculator

    Snazzy, isn't it? Not only is it a very early example of "landscape" control-panel design, it also has a peculiar display. The seven-segment vacuum fluorescent display is six-digit, but the calculator works with 12-digit numbers internally. The arrow key (bottom left of the keypad) shifts the display to show the other six digits of the answer. Not only that, but it also has a seven-segment font that has a half-height zero, with only four segments lit instead of the usual six.

    So there we have it: the Casio Personal Mini, a quirky calculator.
    Saturday, June 4th, 2011
    1:04 pm
    Fixing the Old Bench Amp
    Many years ago, I built a bench amplifier from a design published in the popular magazine Electronics Today International. It was in the February 1977 issue, and I built it fairly soon after the mag came out, so that gives you some idea how old the amplifier is now! I used it quite a bit when working on audio circuits, just so that I could listen to the signals and hear what was going on. It's just an amplifier in a box, but remember that in 1977, you couldn't get, say, a pair of amplified PC speakers from FreeCycle. In fact, it wasn't until late 1978 when I saw my first 8-bit computer (a Commodore PET) at school, and the IBM PC wasn't launched until 1981. Sound cards for IBM-compatible PCs came along much later.

    Anyway, I've used this little bench amp on and off for over 30 years, most recently with circuits connected to an Arduino. I used it to listen to the output of a SID chip that I wired to an Arduino, for instance. But recently, I've begun to notice problems with it. For one, it's in a wooden box and picks up DECT and GSM phone interference rather badly. Another snag is its use of PP9 batteries, a now-obsolete 9V type (it needs two of them to run on 18V). The most recent circuit I wired it up to, an MCP4822 dual 12-bit DAC chip, revealed another limitation: it has very poor low-frequency response.

    Time to make some measurements! There's no point acquiring all this fine HP test gear from eBay unless I'm going to wire it all up to a circuit now and then. So, we have the HP 3310A Function Generator to supply an input signal and the HP 427A Voltmeter to measure the AC voltage at the loudspeaker. The 427A runs on another obsolete battery, a 22.5V type. The previous owner has installed two 4mm sockets on the back of the instrument for an external power supply, so I hooked that up to a DC bench PSU that I made in the mid-1970s. The bench amp that I'm testing is running off my more recent (1990s) Farnell TOPS 4D power supply. There's an HP 3456A, a 3466A and a 3476B nearby, as well as a 1980B scope and a 1630G logic analyser. If I'm in any doubt about frequencies, there's an HP 5326A Timer-Counter with Nixie tubes, no less.


    Bench Amplifier Circuit


    Looking at the circuit, I was suspicious of the 10nF coupling capacitor between the 741 op-amp input stage and the 100kOhm volume control. Seems way too small. So, I worked out the RC time constant, and that was 1ms, which led me to expect a fall-off in response below about 1kHz. Wait a minute -- below 1kHz? Surely not! Middle 'C' is 262Hz, and the 'A' above that is 440Hz; an amplifier should have a level frequency response well below that. Something's wrong with that 10nF capacitor! And that was confirmed by the testing: frequency response falls off dramatically below about 1kHz.

    To fix the problem, I increased all the coupling capacitors in the amplifier. The main problem was with the 10nF (C3), which I increased to 4.7uF. The first capacitor that came to hand in the little drawer of recycled caps was a 2200uF, so that went in place of the LM380 output capacitor (previously 470uF). A 47uF axail electrolytic went in place of the original 4.7uF input coupling capacitor. With the HP 3310A as an input again, the output signal retained a constant ampltude down to about 25Hz. The small speaker had no chance of reproducing such a low frequency, but at least the signal was there.


    Bench Amp


    To fix the other problems, I glued aluminium foil to the inside of the wooden case, and earthed it. I used a small spring to make contact with the foil on the inside of the lid of the box. As for the PP9 batteries, I simply wired up an 18V mains adaptor "brick" -- another item that would have been hard to find in 1977. There's room in the box for a stack of 12 AA cells if I really need to use the amplifier on batteries one day.
    Saturday, February 19th, 2011
    8:26 pm
    Things You Find In Scanners
    I sometimes pick up odd scanners and printers on FreeCycle, especially broken ones to take apart for the motors, sensors, mirrors and so on. On Friday I got an HP DeskJet F2180, which was only made in 2007 but had been dropped down the stairs! In taking apart, I found the paper feed motor's optical sensor had been jolted out of alignment in the fall, and the optical grating had become scratched next time the printer was switched on.

    So I carried on taking apart intil I had a pile of parts: three DC motors, some opto-slot sensors, and the scanner head. The latter looked like a sealed unit, with no mirrors, cold-cathode lamps or anything re-useable. But closer inspection revealed a 220mm long RGB LED lighting unit, easily desolderable. So that's now ready to be hooked up to the Arduino! I already have a simple sketch that takes polar co-ordinate input from a resistive touch-screen and generates colours with PWM on an RGB LED.

    Right next to the RGB LED gadget, there's an amazing array of tiny lenses (or light-guides, or something) and beneath that, there's a PCB with a long strip of silicon photo-sensors on it. Just bare silicon, about 0.5mm wide and 220mm long, although it looks like there are joins where it's been made up from several smaller chips. All the bond wires are exposed, and there's another (tiny) chip on the PCB, also with bare bond-wires connecting it to the sensor array. This is definitely something to get under the stereo microscope and examine closely!

    Apart from the scanner-head stuff, there are a total of three DC motors in the device, and the usual paper-path sensors and a power supply.
    Saturday, January 22nd, 2011
    12:41 am
    Wondering about LiveJournal
    I've not done an update here for quite some time. I seem to be forced to watch an advert when navigating the site, at least when I'm not logged in. And I'm getting a lot more comment spam all of a sudden. Wonder what's going on? Maybe I'll carry on with the journal, but then again maybe not.
    Wednesday, September 29th, 2010
    10:59 pm
    More Success, But Not Surface-Mount
    This evening, I changed the two BU406 power transistors in the ultrasonic cleaner. They're TO220 parts on quite large heatsinks, and both of them were shorted collector-emitter. I just put in new ones, and replaced the fuse, hoping that they wouldn't simply blow again. Well, they didn't, and the circuit worked, and the fuse was OK. So now I have an ultrasonic cleaner that not only gives the cleaning bath a good shake, but also illuminates it with blue LED light while doing so. Makes it work better, of course.

    So, now I'm looking out for small dirty things in my house.
    12:39 am
    Surface-Mount Success
    The other day, I was asked to have a look at a Nintendo DS portable game machine. It wouldn't power up, and it wouldn't charge the lithium-ion battery. At first, I suspected the battery itself, but that checked out OK. Having had a look at some web-sites with tear-downs and fix-it information, I realised that there was a good chance that one of the surface-mount fuses had blown. Why it had blown was another matter. The web-sites seemed to indicate an 0603 size fuse, i.e. 60 thou by 30 thou (0.06-inch by 0.03-inch, or 1.5mm by 0.75mm). But I found that the markings on the actual fuse looked more like an 0402 size. They're way too small to write current ratings on, so it's all done with symbols: dots, squares, lines and so on. Farnell has a good selection of spares, so I ordered some.

    The new fuses arrived today and my first reaction was "Ooh, they're teeny small!", but I have a stereo microscope with 20x magnification. So, off with the old fuse and on with the new one. The original was 0603 after all, but the 0402 fitted OK. And the DS started up just fine! It goes straight into a set-up dialog, so it may have forgotten some config, but it runs and charges OK.

    Suitably encouraged by my success, I remembered that incident with the dead iRiver MP3 player. Time to get down to it and replace that Philips UDA1380TT I2C DAC chip. The chip implements most of the audio part of the MP3 player, including DAC, line out, headphone out and the ADC for line in. And I'd blown up one channel of it by connecting it to a suspect audio amplifier.


    PCB Cleaned Up The Chip, Replaced


    A few weeks back, I got a new chip from RS Components, but I hadn't fitted it yet. Back to the stereo microscope with a sharp knife to cut the old chip out, then solder the new one in. It's a package with 0.65mm pitch leads. Then, reassemble the device -- I took it apart back in November last year. Success! The battery needs to be charged, but the headphone output works again! So I now have a 40Gb MP3 player, from FreeCycle, that can record audio as well as play back. It'll also run the alternative firmware, RockBox.

    I got two UDA1380 chips, so I have another one to solder to a break-out board and wire up to the Arduino for fun. Next thing to fix will be the ultrasonic cleaning tank that I was given by someone at Dorkbot. I have already acquired two BU406 power transistors for that.
    Wednesday, September 15th, 2010
    10:17 pm
    FreeCycle Sewing Plot Open Door Engineering
    Oh dear, it's been a while since I did an update here! Well, FreeCycle came up with another great item, a zig-zag sewing machine (Toyota 888) with a selection of accessories. So that was an upgrade from the Jones straight-line machine, and enables me to sew buttons on and to sew zips in. Some of the stitch patterns can be used on stretch fabrics and to make butt joins. I now have a few pairs of jeans with repaired pockets (no more loose change running down my trouser leg) and one pair of trousers with a re-attached button. I've done a few test stitches that attach thin wire to a piece of fabric, but I haven't got any conductive thread yet. Nor have I got any Kevlar thread or fabric yet.

    I made a bit of progress with the line-scan camera, mainly by adding automatic exposure control. I also need to speed up the data acquisition so that it'll work in bright daylight. I have a plan to use some laser line generators to make a sort of laser harp or hand-tracking device.

    128-Pixel Camera and Arduino LineViewer Sketch in Processing (2)

    We had a merry Dorkbot outing to see the Bristol Model Engineers show in Thornbury. Lots of steam engines, the usual home-made jet engines, and a few CNC machine this year. Outside, the weather was not great but the jet engine builders did get a chance to start one up, and a petrol-engined radio-controlled tank was driving about:

    BSMEE: CNC Gantry Mill BSMEE: I.C. R/C Tank

    After the trip, we headed into Bristol to visit the ScrapStore, where we acquired a small shopping trolley full of silicone rubber tubing, various out-of-date medical tubes, some nylon hot-air balloon fabric offcuts, some rubber sheet and a lot of spools that I think must've been used for the thread at the balloon factory.

    FreeCycle once again came up with a superb bit of kit, this time a Roland DXY-990 eight-pen plotter. None of the pens worked, and the rails were filthy with a thick layer of grime that made the X-axis motion quite rough, but it's A3 size, has electrostatic paper hold-down and has both serial and parallel interfaces. I've cleaned it up and fixed the rough spots in the movement, and I have found a way to drill out old, dry pens to make pen-holders for new rollerball pens:

    X Axis Track and Wheels The Finished Adaptor

    I took the plotter (and some demo software on a laptop) to Dorkbot last week, which was a big success. One of the Dorkbotters was kind enough to make a couple of short video clips: http://yfrog.com/0p50ktz http://yfrog.com/jpzufz

    Last weekend was Bristol Doors Open Day, so I went along to Underfall Yard as usual:

    Line Shaft, Operating Pillar Drill Handwheels

    My parts from Deal Extreme have arrived, namely some UV LEDs, some spudgers, four red line laser modules, a tri-wing screwdriver and a vacuum pickup tool for SMD. The Readers Digest Guide To Sewing is at the Post Office, pending collection, which I'll do tomorrow, on the way to the Cappuccino's MOT.
    Monday, August 2nd, 2010
    12:05 am
    Working Line-Scan Sensor Chip and Software
    After a successful day's hacking on the Arduino line-scan image sensor at the Dorkbot Bristol Hack Day, I can now claim FIRST LIGHT! I had the sensor working earlier in the week, but I now have a way to actually see what it can "see" (all 128 pixels of it). I thought about installing and learning a C++ graphical framework like Qt or GTK+, but settled for installing Processing. Processing is a Java-based IDE and language system that's designed for rapid software prototyping, so it was just what I needed. The Arduino sends pixel data at 115200 baud to the host, where the Processing program (they call it a "sketch", just like on the Arduino) reads it in and displays it in a scrolling graphical window. One or two quirks to deal with, like the non-blocking serial.read() function and the slightly unexpected idea of setting a frame rate. But it all works in about a screenful of code, and I can get on with experiments on the optical end of things, i.e. the lens.

    I think I'd like to get a cylindrical lens working, but for now I have a 35mm disposable camera with a hole in the back. It's a lens and an opaque box, with the shutter glued open. I have a couple of snippets of Pyrex glass rod, to try out as lenses, but they focus very close to the rod. They also have no opaque box to mount them on, yet. I want to try to find one of those book or newspaper magnifiers that have a wide, plastic cylindrical lens in them. They'll have a flat rear side and hopefully a better focal length.

    In other news, I can highly recommend taking a look at the sensor chip from a flat-bed scanner under the 40X stereo microscope. Some types have three stripes of intense colour all along the chip, the RGB filters.

    But, after all that, still absolutely no progress on the UK101.
    Thursday, July 29th, 2010
    8:38 pm
    Update on Optical Sensors
    I have now received the chips from RS Components, and the mix-up with the ADC/DAC parts has been resolved. The TSL1401 is connected to the Arduino and sending pixel data to the host. I have a Boots disposable 35mm camera to hack into a lens and housing for the sensor. I expect I'll take the whole lot to the next Dorkbot hack day on Sunday.

    I've also dug down to the stratum in the lab that exposes enough of the workbench and the UK101 to get on with stuff. Still lacking energy and/or motivation to actually get on with it.
    Friday, July 23rd, 2010
    10:29 pm
    Sewing and Optical Sensing
    I've switched back to part-time working for a few weeks now, so I've had a bit more spare time. Not that I've done very much productive with it, you understand. Well, I did make a photographic trip round the harbour:


    Harbourside Panorama


    One idea that came up after the Bletchley Park trip was to do with transporting the UK101s to future shows and faires. I'm thinking about something to protect the UK101s, and also to make them easier to stack in the back of a car or van. And something to keep dust off when in storage and during off-hours at shows. To that end, I acquired a Jones electric sewing machine from FreeCycle. I have now also acquired sewing machine oil, bobbins, needles and thread. My search for a copy of the Reader's Digest Guide To Sewing has so far been fruitless. But with a bit of cleaning up and lubrication the sewing machine has now been threaded up and achieved FIRST STITCH.


    Fairbairn Steam Crane


    At the Dorkbot hack day, we had a very nice demo of a 128-pixel line-scan optical sensor connected to an Arduino. Now, the Arduino only has 2k of RAM, so a 128-byte pixel array is large but manageable. The chip maker's applications information suggest the use of a prism or diffraction grating to make a simple spectrometer, which sounds interesting. Another idea is to make a bar-code reader, or to add a small laser and set up a laser harp -- or at least the hand position sensor part of such an instrument.


    Cumberland Basin Swing Bridge: Deck


    I've opened an account with RS Components, and purchased two linear image sensor chips: an MLX90255 and a TSL1401. All done via the new-fangled interwebs -- gone are the days when RS would only open an account with a business! I've also bought a replacement UDA1380TT stereo audio chip to replace the one that I blew up in the MP3 player (some time ago).
    Monday, July 5th, 2010
    10:58 pm
    Vintage Computers and Bubble Cars
    The two big events recently were the Vintage Computer Festival at Bletchley Park and the annual bubble car rally at Keynsham.


    VCF UK: Compukit UK101


    Over the weekend of 19th/20th June, I took the three Compukit UK101 machines to Bletchley Park for the Vintage Computer Festival. It's the first such festival to be held in the UK, and what better place than Bletchley Park, the home of British code-breaking during World War II. I had a table in the marquee outside H Block, where the main collection of The National Museum Of Computing is held. Tours ran all day through those exhibits, as well as around the huts and the mansion. I was between an exhibit featuring a 1940s uniselector digital clock and a gentleman who had implemented an IBM 360 Model 30 in an FPGA. Other tables in the marquee showed the Dragon 32, a Sinclair Spectrum ULA on breadboard and a Spectrum with an ethernet interface, sending messages to Twitter.


    VCF UK: ZX80 and 1970s TV


    All in all, a brilliant weekend, with lots to see and many people who remembered the Compukit UK101 -- either as owners or as users of similar machines. I hope we can do it all again next year! I've been making plans already for improvements to the UK101 display, such as a gadget that'll load programs from Flash memory. I've have some success with recovering the old UK101 cassettes using a modern PC, including the special "boot" tape that installs drivers for the fast digital cassette and the parallel printer.


    Bubble Car Show


    Last weekend was the annual rally of the Bristol Microcar Club, known as the Bath Rally but actually held in Keynsham. A good selection of BMW Isetta, Heinkel, Trojan, Messerschmitt and Bond Bug cars, plus a few interesting small cars that weren't bubble-shaped at all, such as the Fiat 500, BMW 700 and Trabant. There's another, national bubble car rally near Malvern in September this year, so I will go to that as well.


    Bubble Car Show


    Latest car boot sale acquisition is a cash register thermal printer with USB interface. FreeCycle has been going through a classic computer phase, with a BBC Model B, a ZX81 and a box of tractor-feed listing paper -- I managed to resist all of them, but only just. As for secondhand books, I have a series of three books on blacksmithing and toolmaking by Alexander Weygers, which has inspired me to do more with metalworking. The books are presented in a style that combines hand-drawn illustrations and diagrams with typeset text, slightly reminiscent of the Illustrating BASIC style. Inspiration has been lacking in the area of AVR programming, although I shall no doubt use one to make that program loader for the UK101. I've upgraded the Linux machine with a recycled 18.4Gb UltraSCSI disk from the office, and a copy of Slackware 13.1 (the latest).
    Monday, May 17th, 2010
    12:09 am
    BBC BASIC Programming
    Last week, I received a copy of Donald Alcock's Illustrating BBC BASIC, another in his series of hand-drawn programming books. According to the dedication, the manuscript for this one was saved from a house fire by the Fire Brigade. It seems to go much deeper into implementation details then the generic Illustrating BASIC. I suppose that's to be expected, but the details must be confusing for novices to programming. It also leaves out several examples of the higher level stuff, like the Roman numerals program, linked lists, and the critical path program, as well as the entire chapter on MAT statements, which BBC BASIC doesn't have. The book goes into details like hex numbers, binary representation and screen modes. It tells us all about the Beeb's esoteric "@%" pseudo-variable, which affects the formatting of numbers printed by PRINT and can (optionally) affect STR$(), too.

    I've also been reading BASIC Programming by the inventors of the language, Kemeny and Kurtz. I was struck by the large amount of mathematics in that text, although it perhaps shouldn't be all that surprising, since the authors were maths professors at Dartmouth College. I also noticed that many of the examples in that book are just the same as the example programs in Illustrating BASIC, and indeed, in many other beginning programming books and courses. We have a Noughts and Crosses program, the Game of Nim, compound interest calculations, trigonometry programs, prime number generators, a critical path example, queuing simulations and sports simulations. I've just started the chapter on files in BASIC, and the example is a sports league table. This is very similar to the coursework we did in Algol-68 in my first year of Computer Science at Westfield College, where we wrote a program to update a football league table. The Westfield course was perhaps unusual in that the very first programs we wrote (in simplified Algol-68) were turtle graphics programs modelled on those in LOGO. We had no graphical output devices, and no physical turtles, so all the output was in the form of line-printer graphics -- and the programs were run by means of a batch job queue on a CDC 7600, so we could never interact with them and results usually took an hour or more to come back.

    In the AVR programming world, I have installed a new version of WINAVR, which is a complete GCC toolchain running on Windows. I don't have much code in C for the AVR chips (apart from the Arduino stuff), but the one program that I found had to be updated a little to work with the new AVR C library. I'll be writing some stuff to run on the ATmega1284, but as yet I can't decide whether to plug the 1284 in place of the 324 or to build a new board to take the 1284 and maybe a MAX232A.

    As usual after a General Election, I've been trying not to find out who won. Four and a half days later and I still didn't know who is the Prime Minister. But then I glimpsed it on the Yahoo home page and my ignorance was over -- until next time.
    Saturday, May 8th, 2010
    3:09 pm
    Classic Cars
    Last weekend was the Bristol Classic Car Show at the Bath and West Showground near Shepton Mallet. I went along in the Cappuccino and ended up in the overflow section of the classic parking area, next to a Rover 3500.


    Jaguar E-Type
    (that's not the Cappuccino, it's a E-Type)


    The trouble with going to a show like this is that I just end up wanting one of just about every car I see there! This year was no exception, and I now want a Hillman Husky (a version of the rear-engined Imp with an estate-car body) and a Volvo Amazon pick-up.


    Volvo Amazon Pick-up


    I quite liked the look of the hearses, too. In the end I limited myself to buying a some orange festoon-bulb lamps, some offcuts of leather and a couple of quarter-inch hex electric drill/driver gadgets. One is a countersink bit, and the other is an adaptor to drive half-inch sockets.


    Messerschmitt Bubble Car


    The Bristol Microcar Club stand featured a BMW Isetta, a Messerschmitt, and one I'd never seen before, a Mink microcar. I'll go along to the next monthly meeting, and try to get the City-El to the next bubblecar show in Keynsham.
    Monday, May 3rd, 2010
    11:55 pm
    BASIC Programming
    On FreeCycle, I have acquired a very fine Kodak Carousel slide projector. It's much nicer than my dad's old Gnome projector, which is of the type that literally slides the slides into place behind the lens. The Kodak has an infra-red remote control, auto-focus, a zoom lens and an 80-slide magazine.

    Made a trip to the Watershed during the week to pick up some servers for the office. In the same junk-room were the remains of about four 35mm movie projectors in various states of disassembly. We also saw the main 415V three-phase power switch for the entire Watershed.

    With all the dry weather, I've been able to do a bit of gardening. The flower borders are now less clogged with weeds, but as yet not filled with flowers. The lawn's a mess and the bushes in the front garden seem to have suffered from the harsh winter.

    As for programming, I've been making some progress on the 6809 BASIC interpreter. I've been working on this, on and off, for a while now and have at last got to the stage where I can type in lines of BASIC source code and have the program store them. I can add and delete lines, list the BASIC program and count the number of bytes it occupies. All seems to work OK, although it doesn't yet trap out-of-memory errors. Once it does that, I'll burn a copy onto EPROM and try it on a real 6809 chip -- I've been using a simulator so far.

    Along with writing the BASIC, I've been re-reading a book that was inspirational when I first got it, back in the 1980s. It is Writing Interactive Compilers and Interpreters, by Peter J. Brown. Unusually for an academic textbook, the example language is BASIC and the text is eminently practical. The author was involved in writing a BASIC for the ICL 2900, which I must find out more about. Meanwhile, I've searched the second-hand booksellers on-line and found a copy of BASIC Programming, by the original developers of the language, Kemeny and Kurtz. From the same seller, I got Software Tools in Pascal, by Kernighan and Plauger, and Illustrating Pascal by Donald Alcock.

    Donald Alcock's hand-written book on BASIC was another inspirational one for me in the 1980s. His others, on FORTRAN, BBC BASIC and ANSI C were also hand-written in a style that freely mixes text, diagrams and little drawings of bugs. Also hand-drawn is my all-time best computer book ever written, by Roger Kaufman of MIT, The FORTRAN Coloring Book.
    Saturday, April 24th, 2010
    12:55 pm
    Assembly Language FTW!
    Someone at Dorkbot Bristol found an interesting project that's going on at the University of California at Irvine. It's called Digital Voices, and it's all about making mobile computers communicate using sound. Now, using sound for communication is not new; modems have been using the technique since the 1960s. The new idea is to make the sounds pleasing to the human ear, maybe to the extent that we hardly notice them. Some of the examples that have been tried so far sound like bird song or crickets chirping. Other, more obvious examples sound like R2-D2 or encode digital data into music.

    The communications theory is all very technical, and we have a weighty tome by Sklar that goes into all the mathematics of it. With that book, one could design a 56kbps modem pretty much from scratch (given enough time to understand the maths). Being more of a code-hacking type, I had a look at the Java programs that the Digital Voices project had published. Imagine my horror when I discovered that they'd called both sin() and cos() in the innermost loop! In a piece of code that must work in real time to detect audio tones in a digitised sample! That would never do...

    So, suitably charged with righteous indignation at the wasted processor cycles in such a program, not to mention the use of a high level language, I set about making it go faster. I won't rant about the use of a language that compiles into P-code, because some Java compilers don't do that, and they really are quite good nowadays -- and anyway, we're talking about calling a trigonometric function in the run-time library here, from a tight loop. No, I'm going to rant about pre-computing the trig stuff in advance and coding the tight innermost loop in assembler. Oh, I just did. OK.

    The innermost loop in the tone detection program performs a convolution. That is, it multiplies the samples in the incoming audio with samples of a reference sine wave and cosine wave, then the adds them up. Hence, the process is often called multiply-accumulate. DSP (Digital Signal Processing) chips have special, very fast instructions to do multiply-accumulate, and even the ARM chip has one. But I want to use an Atmel AVR, the ATmega8 (or an ATmega168 or ATmega328, as found in the Arduino). Now, the AVR has an eight-bit multiply instruction that executes in two cycles, so maybe we have a chance of getting this to work.

    AVR microcontroller board: LEDs plugged in

    But first, I must acquire 8-bit audio data at something like an 8kHz sample rate. To grab 256 samples, it'll take 32ms, and that will occupy 256 bytes in RAM, or one quarter of the ATmega8's RAM. OK so far, the chip's analog-to-digital convertor can do that and I can double-buffer the data with a timer interrupt to keep the audio flowing through the program. So now I have 32ms to do all those multiplications and additions, 256 of them for the sine and 256 more for the cosine, for each frequency that I want to detect. Then, I have to square the results (two 32-bit multiplications) and add them together. If the result is bigger than some pre-determined threshold, I've detected a tone.

    Scope Photo of Overlapped I/O

    Well, I needn't have worried about the speed of the code, because my convolution program takes 550μs to process each tone. That's enough time to detect over 50 separate tone frequencies at once. I only need eight to begin with, for DTMF tone-dialling detection. It all worked well enough to take it to Dorkbot last week and demonstrate it with a signal generator, amplifier, microphone and preamp.
    Sunday, April 18th, 2010
    1:20 am
    Maker Faire
    Oh no, it's been two months since my last update here! Lots been going on, but also lots not getting done.

    The big event was, of course, the Maker Faire in Newcastle on March 13-14th. I nearly didn't get there, though, due to illness just a day or two before. What with that, the office move, and the extra days I worked to prepare time-lapse cameras for a deployment, I didn't get any of the circuits built that I'd wanted to. In fact, on the morning of the Friday, when I should have been on my way, I was still soldering up an RGB cable for the UK101 to connect to the Philips CM8833 colour monitor. So I arrived late, tired and in a rush to get everything ready.

    The Maker Faire was a brilliant weekend, as expected. A few people who saw the UK101 told me that they'd either had one, or wanted one, or known someone who had one. The machines behaved well for both days, but the Philips monitor failed on me. I was helped out by the man from the BBC, who found me a portable TV to use for the Sunday. All around were weird and wonderful devices, such as the singing Tesla coils, the Friispray video graffiti machine, robots of all kinds, and a BBC Micro with an ethernet interface. I got a few opportunities to demonstrate the Pisan-O-Matic musical bicycle wheels from Dorkbot Bristol, and see a bit more of the rest of the Faire.

    Maker Faire 2010: Compukit UK101

    One thing I learnt from last year was not to drive home on the Sunday evening, but to allow some time to see (and photograph) Newcastle. So on the Monday I made the trip to find George Stephenson's locomotive works, close to the station. Then I saw Moseley Street, the first to be illuminated by electric light by the inventor Joseph Swan. Going via the city centre, I made my way to the Discovery Museum to see the steam turbine ship Turbinia. Now, if you look at the museum web-site, it's clear that Turbinia is the main attraction. What is not clear is how much other stuff the museum has, from Joseph Swan's light bulbs to steam engines and turbines, models of ships, cranes and bridges, and the ordinary artefacts of Newcastle life through the years. All in all, I spent the majority of the day in the museum, and was late (again) starting my journey home -- via the Angel of the North. The journey itself went a bit awry near Tamworth when I got tangled up in a diversion off the motorway and onto the ring road, that just took me round in circles.

    Having got home, late, tired, etc., I set about finding the fault in the CM8833. It's a PAL and RGB monitor, with stereo sound, and is too nice to just scrap without at least knowing what's gone wrong. The monitor's power supply was shutting down (and whining) due to a short, but where? A little fault-finding with the circuit diagram led (predictably) to the line output stage. I was hoping for a shorted transistor, but the culprit was the line output transformer, an altogether more tricky component to replace. For now, I've just reassembled it, but maybe I should look at it again before the trip to Bletchley Park -- and definitely take a spare monitor this time!

    On the FreeCycle front, I've acquired a spare portable TV for use with the UK101 (and made up an RGB-to-SCART cable for it), and I have some laptop bags for the various laptops that I seem to have gained from various sources. I've got some IDE hard disks to upgrade the Apple Mac G4,as well as a keyboard for it. Also got a couple of cordless drill/screwdrivers (but only one with a charger) that may end up as DC motors in some application. I picked up some genealogy CD-ROMs, and was also offered some old Psion hand-helds, which I accepted. One of them is a Revo, which has an ARM CPU and will run Linux. As for getting rid of stuff, well, not so much -- although I did clear out the tree branches from the back garden for use as firewood.

    I did get the 10x7 pixel green LED display working for Dorkbot Bristol, but I didn't write a game on it. At the moment, it's scrolling a text message across the LEDs, with no other animation. The refresh for the display is handled by a timer interrupt, though, so as far as the ATmega8 code is concerned, there's a region of RAM that shows up on the display as pixels. I now have the ten 8x8 pixel red square LED matrix displays from Futurlec, but I'll need some more 74HC595 chips to get them working.

    Also from Futurlec, I have some prototyping boards and an ARM development board, as yet unused. From Farnell, I have an Atmel ATmega1284 chip, which is a 40-pin DIL version of the AVR microcontroller, but with 16k bytes of RAM. 16k! Nearly as much as a BBC Micro! And it's on-chip, so no RAM-pack wobble!
    Sunday, February 14th, 2010
    5:18 pm
    Making Things With LEDs
    I'm starting to look forward now to the Maker Faire in Newcastle in mid-March. I need to get a few things fixed up, like the Compukit UK101, to take along. I also need to make a couple of things pretty much from scratch, to take along and see if they generate enough interest that I could make them into products.

    I made a few purchases that lead into those potential products, and some of the parts have now arrived. From Deal Extreme, I acquired a couple of CA-42 USB phone cables. One of them is now hacked off and soldered into some Veroboard, with an LE33CZ 3.3V voltage regulator, to make a TTL-level serial-to-USB cable. That cable now connects my various ATmega chips to the serial terminal emulators on my various host computers. It's a Prolific PL2303 USB chip, not the FTDI chip found in the Arduino, but I have drivers for Windows, MacOS and Linux (MacOS and Linux appear to have them pre-installed). From Rapid, I have acquired a number of handy 9mm square LED modules (I also got the LE33CZs there, and a Hall-effect magnetic field sensor). Each LED module has four LED chips in it, which can be wired in series-parallel to work off 5V. They stack nicely end-to-end, so my plan is to make another long row of them with 74HC595 chips to drive them from the Arduino. Finally, from Futurlec, I've ordered some 8x8 LED dot-matrix displays, in which the individual LEDs are square (the commonly-found types are round). Also from Futurlec is an LPC2119 ARM development board.

    Lab Panorama

    Make magazine liked my panoramic photo of the lab!

    In the lab, as seen above, I've been upgrading from a 16MHz Atmel ATmega32 to a 20MHz ATmega324. It has more memory, a second serial UART and a few detailed changes in the register-level programming interface. The assembler-coded software for the ATmega32 is now converted to work on the ATmega324. Also, the assembler code computes the baud rate divisor and 100Hz clock divisor directly from the CPU clock frequency, which makes it easier to change things in future. I'll transfer that code back into the ATmega8 programs as I get round to updating them.

    Spent Friday afternoon at the Pervasive Media Studio and came away with a number of interesting ideas for the Arduino, ATmega32 and 6809. Will be there again for Dorkbot next week.

    And as for the ATmega8 (which looks a bit old-hat now that we have the ATmega328 in the Arduino), I need to get something to show at Dorkbot on Tuesday. So as a prelude to receiving those 8x8 pixel square LED arrays, I will be re-activating the dual 5x7 dot-matrix display. When I last had it running, I used an 8MHz ATmega8 module and a pair of 74LS374 8-bit latches. Since then, I've made a 16MHz ATmega8 PCB with two 74HC595 8-bit shift registers, originally as a persistence-of-vision wand. So now I must update the code to drive the shift registers, and to run at 16MHz. While I'm doing that, I might as well add a timer interrupt to make the scanning of the 10x7 display into a background task, and write some sort of simple game as a foreground task.
    Sunday, January 10th, 2010
    12:28 am
    Succesful Day
    Today has been a successful day. This morning, I found my MMJ serial console cable and ran the DEC 3000 Alpha 64-bit RISC machine. The MMJ plug looks just like an RJ-11 6-pin modular phone plug, except that the latch is offset to one side, making it incompatible. It was DEC's way to make serial connections to RS-232 terminals a bit simpler (all the cables are crossover) and at the same time, proprietary. Fortunately, I bought a number of MMJ cables at a car boot sale a few years ago. The DEC 3000 is a TurboChannel based Alpha machine, which means that it won't run Linux but will run NetBSD. It started up just fine after a couple of years of not being powered up.

    I didn't get as far as running the Sun Ultra 1 64-bit UltraSparc machine, but I did find the 13W3 video cable for it, and find the fault in the cable. One of the moulded-on BNC plugs (composite sync) was open-circuit. This turned out to be a bad connection under the moulded-on plastic, where the BNC plug was crimped onto the coaxail cable. That's fixable with a new BNC plug.

    While looking for the MMJ cable, I found a 20GB IDE hard disk that I'd forgotten about. I've been looking for a bigger drive for the Mac G4 Sawtooth Linux machine, which currently has only 8GB. Now that I've tested it, the 20GB drive can go back into service.

    By coincidence, aminorjourney went on a FreeCycle pickup to the same person who'd promised me a hulk of a laptop (Fujitsu Amilo). So, she collected the parcel with my name on it and brought it over. I now have some miscellaneous parts as well as the bit I wanted, the PS/2 trackpad. At least, I think it's PS/2; it might be USB on a modern laptop.

    The real success of the day, though, was the Acorn Archimedes A310. I got it last week from a FreeCycle user in Fishponds, along with some assorted electronic junk and a PC power supply. We knew it wasn't working properly but we didn't know whether the bad video display was due to the machine or the monitor (Philips CM8833). The screen didn't sync, and the text was all in magenta. I tested the monitor on a composite video signal, and it was fine. That left something amiss in the A310's video and/or sync outputs.

    After all the usual stuff with re-seating chips and checking connections, I read the manual (came with the machine) and spotted something. I'd had to replace the two AA batteries, which had burst (use-by date was 1994), and I'd cleaned up the corrosion. There's a note in the manual that tells you to switch the machine on with the DEL key held down, to re-initialise the non-volatile RAM. It also tells you to change the fan filter every year or so, but I'd just washed it out -- there was so much caked-on dust that no air flowed through it at all. Anyway, after the DEL key trick, the video display was fine and I got to a RISCOS desktop. From there, I could run games from the floppy disk. Naturally, I put the Elite disk in, but it turned out to have a bad sector. Not to be beaten at this stage, I ran the Lemmings disk instead and marvelled at what could be done with an 8MHz ARM chip and 1MB of RAM.

    Current Mood: accomplished
    Friday, January 8th, 2010
    10:35 pm
    "GO" again for Maker Faire in Newcastle
    I have just received word from O'Reilly that I have been accepted to exhibit at the Maker Faire in Newcastle, March 13-14th 2010.

    http://makerfaire.com/newcastle/2010/

    (that's my UK101 exhibit, in the middle right-hand panel of the photos)

    Last year, I took three Compukit UK101 machines for the 30th anniversary of the magazine articles that introduced the UK101 to the world. My own UK101 will be 30 years old on February 20th, 2010. This year, I propose to take UK101s to Newcastle again, but will also take along 21st Century 8-bit computers, namely the Arduino boards. So, I have two months to prepare...

    Current Mood: pleased
    Wednesday, December 30th, 2009
    1:10 am
    Working on a Workbench
    Things have been a bit up and down over Christmas. The last couple of days were definitely down, but things are looking up now that I've got started on making something again. This one's a very straightforward physical construction project: I'm making a workbench.

    I have a little more space in the garage now that I don't have the huge DEC TU77 tape drive in there any more. That space is currently under-utilised and poorly organised, so I was on the lookout for an offcut of kitchen worktop to make into a bench. I have just over a metre of room between the end wall and my father's old metalworking bench. Now, I recently visited an old friend, Fran, and he had a piece of worktop that's made of a material called SpeedStone. It's sold by B&Q for installation as part of their kitchens, and can be joined to the sink almost invisibly using an epoxy resin. It's actually made by DuPont, according to the manufacturing markings underneath.

    I know that I can't get a 600mm wide chunk of worktop in the Cappuccino. Fortunately, Fran brought the offcut round to my house just before Christmas (he also brought my birthday/Christmas present: an Adafruit Ice Tube Clock kit). Today, I ventured out to buy the wood I'd need to make the legs and frame of the bench. It comes in 2.4m lengths, so I had to remove one side of the Cappuccino's roof to get it in (by some coincidence, the B&Q car-park held a number of two-seater sports cars today):

    Cappuccino with Planks

    I'm loosely following the design here:

    http://woodgears.ca/workbench/build.html

    Although, my version is quite a bit smaller, 1170x600mm.

    So far, I have most of the pieces cut from the 2.4m lengths. I have drilled the holes and installed the dowels for some of the joints, but I have not yet begun to cut the mortices in the sides of the frame. I've used the bench hook that I made earlier, but I also had to use the little square table as a platform to saw on. It wobbles. A lot. It's a sort of bootstrap problem: I could really use a good workbench to make this workbench on...
[ << Previous 20 ]
My Website   About LiveJournal.com