On the Trail of the MCU

This story kind of bounces around a little, so you’ll have to bear with me.  It used to just be a handful of connected anecdotes on experience, but when it came up in a chat a while ago with a CS prof, he said there was probably a paper in it.  I dunno about that (at least, without a lot more research), but I think this much deserves a blog post.

It starts with my being an embedded system designer whose early work was with Motorola microprocessors:  6800, 6802, an assortment of 6805 variants, 6809, 68008, 68000/010, (and later) 68HC16, 68332, 68340, etc.  By the late 80s, though, I was working with the 68HC11 – a great part for its time with a buttload of onboard resources (e.g. A/D, EEPROM, SCI, SPI, GPIO, expandable bus, counters/timers, watchdog) that laid groundwork for excellent modern parts like the Atmel AVR series I work with now (yeah, I know, the HC11 was von Neumann and the AVR is modified Harvard, but let’s not start splitting hairs, okay?).  It had pretty much everything except for a FLASH code store.  I did a lot of HC11-based designs, including the controllers I built at Survival Research Laboratories (see other posts), and the last being the original ISA version of our PC Weasel, a board for low-level administration of PC-based servers (and another story all its own).

The PC Weasel started as a no-budget side project, so we were jamming econo (thanks, Minutemen).  After we got the first wire-wrapped proto running (I still use Slit-n-Wrap, bitches.  Dat shit da bomb.  Alright, I’m done with the fake ebonics now.)  I banged out a double-sided through-hole board and we fabbed something like a hundred as betas.  But on a visit to our then-local surplus dealer we bumped into a box of Conner Peripherals IDE disks (little things – 20 and 40 megabyte – my Compaq portables used them) that happened to use HC11s as their MCUs.  We got them for a fraction of what new HC11s cost at the time, so I didn’t have any problem with spending a minute or two using my hot air SMT tool to pop them off the drives, after which I dropped them into the Data I/O Unisite to check the setting of the configuration register.  That’s where you enable/disable onboard resources like the mask ROM, EEPROM, etc.

While I was in there, I took a look at the ROM, and was surprised to find a Chrysler copyright notice.  What was evidently happening was that Motorola was selling their factory seconds to Conner, parts that had been mask programmed for Chrysler, but had defects, or maybe were overruns.  Conner was using (as was I) an external ROM for their firmware, so they didn’t care, and probably got the parts from Motorola at a discount.  So I’d confirmed firsthand what I think I’d read in a trade some years before – that Chrysler was using a family I was familiar with in their ignition (and perhaps other) controllers.  And that their seconds wound up in hard disks made for an interesting anecdote.

A few years later, though, this became useful information.  I’d had a two-wheel-drive 1990 Dodge Dakota pickup for some years, and it was stolen one night in early 2005 from our office parking lot while I was working.  It turned up a few days later in another part of town, apparently the product of a joyride.  When the police called to let me know they’d found it they said it had been “trashed”, so I expected a real mess (broken windows, flat tires, etc.) when I went to the impound lot.  Didn’t look much different than before it was stolen, really… it’s not that it was in bad shape (it was actually in quite good condition), so someone must have made a snap judgement based on how many burger wrappers I’d left on the floor.  Whatever.  As far as the insurance company was concerned it was a writeoff, and I was happy to take the money and flip it into a “well-used” 1991 Dakota 4×4, much more appropriate for where we live in the country.  I’ve had more than my share of trouble from this truck, and at one point spent more than it was worth to replace a bad front differential, but sometimes circumstances (and a bit of a cash surplus) can make bad choices easy.  A few years later the ignition controller failed, and that’s where this story picks up again.

(Because they’re not relevant to this story, I won’t get into here the other failures I’ve endured with this thing, including overheating thanks to a clogged rad, the valves wearing badly enough to abruptly leave me stranded at a lake with the TriFoiler in tow and necessitating a head job, a bad ignition coil that dogged me for a long time in the weirdest way and the persistent vibration which produced some comic results.  I blame high miles, and not the motor – that 318 is a rock.)

1991 was a crossover year for this truck family in that the earlier years were carbureted and later years full fuel injection, but the ’91 was unique in using throttle body injection (TBI).  So, suddenly, I had to find that exact year and model – with the same engine (5.2/318 V8) – at the junkyard in order to hope to scavenge a working compatible engine controller module, because surely a new replacement (if available at all) would cost more than the truck was worth, and that was  no longer an option available to me.  As luck would have it, after weeks of searching… I didn’t.   But I did find a module that looked the same (i.e. same package, and more importantly, same connector) in a truck with a V6.  I got it, and as expected, it didn’t work when I connected it in place of mine.  Figuring that they were the same except for the firmware (different timing and number of plugs, right?), I unpotted the old/dead one, confirmed by inspecting the circuit that it was in all likelyhood the expected 68HC11 (couldn’t tell by the package markings, which were house numbers, but it’s just a 52-pin J-lead PLCC, so it was trivial to ID a few ground and Vcc pins), and desoldered the nearby DIP EPROM from the board.  Now that I knew where to look, I unpotted that corner of the new (V6) board, yanked its EPROM, laid down a socket, and plugged in my old firmware.  Voila – fired up first try.

All of which leaves me wondering:  How the hell does anyone without my ridiculously varied skill set keep stuff like this running without breaking the bank?