Reverse engineering is working up documentation for some piece of equipment for which documentation is unavailable. At least that is what it is for me. It is also a great way to learn about electronics and software. It has a bad name among some people who view it as a means to rip off intellectual property, and may in some cases be illegal.
In the case of the MacLab, this product is no longer supported, and although the manufacturer (AD Instruments) is still in business and provides online manuals for their modern products. This particular item (the MacLab) has been replaced by their "PowerLab" series, a note in their online FAQ says:
The original MacLab units were developed in the late 1980's to run only on Macintosh computers. Since then, ADInstruments software applications (LabChart and Scope) have been developed for Windows and MacOS. The recording units were renamed 'PowerLab' to reflect the cross-platform (MAC & WIN) nature of the system.In addition they say:
ADInstruments no longer supports SCSI due to unavailability of neccessary hardware. Modern operating systems no longer reliably support SCSI.The last sentence is a bit of a stretch, but alright, this is a dead end.
My take on this is that we have 4 analog input and 1 analog output, oddly presented as differential pairs with each member of the pair on a shielded cable.
The back of the box has an AC cord inlet with switch and the following connectors:
Made in Australia by: ADInstruments Pty. Ltd.
There are two big circuit boards inside.
The bottom board is an analog input/output board. Each of the four analog inputs is handled by an Analog Devices AD6211 chip (an instrumentation amplifier), followed by a Burr Brown PGA202. The analog output connector on the rear is routed to an Analog Devices ADG526AKN chip (a 16 channel analog multiplexer).
These days most manufacturers have online datasheets, which is fine for products still in production. Chips become obsolete faster than I would ever have expected though, and this means that you may or may not find online data for chips in use. And there is now the plague of online datasheet pandering companies. My advice is that you will be well served by a decent collection of databooks if you can afford the shelf space.
Datecodes on the chips are almost uniformly 1992.
In other words, this thing is 20 years old (and getting ever older)!
The upper board has a power supply section and the logic section. The power supply is driven by a toroidal transformer (nice in a piece of equipment with low noise analog circuits), and the upper and lower boards are separated by a metal partition (more nice low noise design). The logic section has the following parts:
The AD6677J chip is a 12 bit microprocessor compatible D/A converter with 3 microsecond settling time.
The ADS7800 is a 12 bit analog to digital converter with a 3 microsecond conversion time (capable of 333,000 samples per second).
And of course there are lots of standard TTL chips, as well as 3 programmable logic chips (GAL devices from lattice semiconductor).
So the heart of this thing is an 8 bit 6502 microprocessor, running at 4 megahertz.
Given a 4Mhz 8 bit processor with 40K of ram, I don't expect amazing data acquisition performance from the MacLab. The ADS7800 is quite capable, it will be curious to find out how much of that ability can be realized.
Whatever the case, for many things I am thinking of doing with it, I am sure it will be just fine.
The SCSI interface for this, is at best awkward. In this day and age I would hope for USB, or even a network interface. Of course USB did not even exist back in 1989, and designers were not yet adventurous enough to put network devices in what were viewed as "peripherals". For what I have in mind though, I'll wager that we can put it to use as is. Back in the late 1980's when this thing was designed, Mac computers were all about SCSI, and it was a point of pride with Mac owners, as were many other things.
The I2C interface might actually be more easily useful (maybe), and there is no telling what could be done with the serial port (never mind the screwy connector they chose for it).
Studying this shows me that the PROM has almost the exact same contents repeated twice. This seems mysterious, and a bit of further study shows there are actually two not quite identical code images in one ROM, and either one or the other needs to be placed at the end of the address space (0xc000 through 0xffff) to run. I expected to find a switch or jumper on the circuit board to select one or the other, but there does not seem to be such a thing. A little poking around with a meter demonstrates that pin 27 (A14) on the 27C256 EPROM is connected to ground, pulling this address line low, and permanently selecting the first of the two images. I wonder why there are two?
There are only two recognizable strings in the PROM:
At address 0x29F0 there is:
ADI MacLab/4 3.2
At address 0x2E5A there is:
MacLab/4 III ROM by MCM & MJAH Sept 91There is a big block of unused bytes (read as 0xff) from 0x30c0 to 0x3ff0, so one PROM image really only contains about 12K of unique information.
There are 9 interesting bytes right at the end as follows:
0000Fff0 ffff ffff ffff fffe ab3e 6aed b1eb f100
Details on the R65C02 processor here.
There is also a piece of software called dis6502, written by Robert Bond to analyze Atari files. It was posted to net.sources in October of 1986 and then to comp.unix.sources June of 1988. It was modified by Udi Finkelstein to support Commodore 64 object files and posted again to comp.sources.amiga in November of 1988.
Apparently this version (0.12) is GPL and available online.
Another program (but not open source) written by Eric Bacher is available online by the same name. There are links that offer the source code, but in fact are fraudulent and only provide the windows binaries. This is of no interest whatsoever.
I obtained the source files for dis6502-0.12 and built the disassembler (after making a few necessary modifications) and I find the code clean and the disassembler clever and nice. I then tidied up a couple of things and added the R65C02 instructions to the disassembler, which took me most of an evening. It now does a very nice job of disassembling the ROM.
To do this requires (along with a cross assembler) either a way to burn roms, or some kind of rom emulator. I have blank rom chips, and a UV eraser, and an EPROM programmer, but would much prefer to use a rom emulator, which I also have. See my notes on using the promice rom emulator.
It may also be helpful to read out the GAL devices (if their security fuse is not blown) and figure out how address decoding was done for this device. This may not be necessary if IO port address use can just be sorted out by studying the firmware and doing some experiments.
Stay tuned.
Tom's Computer Info / tom@mmto.org