Post AYALtkRlIPu2NnR7Kq by keelan@mastodon.sdf.org
(DIR) More posts by keelan@mastodon.sdf.org
(DIR) Post #AYALtNWwUzNfJCgQiW by keelan@mastodon.sdf.org
2023-07-28T16:08:35Z
1 likes, 0 repeats
Let’s take a closer look at the ThunderScan, the device that famously turned an Apple ImageWriter into a monochrome scanner. The hardware consists of three boxes connected by cables; the “cartridge”, an “adapter box” and a “power converter”. 🧵
(DIR) Post #AYALtP2Wt2F1zSTAae by keelan@mastodon.sdf.org
2023-07-28T16:26:12Z
0 likes, 0 repeats
First some history. The original Macintosh used a DE-9 connector for its serial port, but it was not a standard RS-232 port. Apple used RS-422, which employed differential signaling, so the TX and RX lines each used two wires. They included one handshake/clock pin, and also provided +5 and +12 volt outputs for powering peripherals. Quite handy.
(DIR) Post #AYALtRHqX3gKxXeQk4 by keelan@mastodon.sdf.org
2023-07-28T17:30:13Z
0 likes, 0 repeats
Then along came the Macintosh Plus. Maybe because the SCSI port robbed the rear panel of room for connectors, maybe because making something that wasn't an RS-232 port look like an RS-232 port was a bad idea, or maybe for other reasons, but regardless Apple change the serial ports to Mini DIN 8 connectors. They added a handshake output and a general purpose input, but removed both power pins. But what if your company had developed a piece of hardware that required power from the serial port?
(DIR) Post #AYALtTYE77yNyvKXYG by keelan@mastodon.sdf.org
2023-07-28T17:34:12Z
0 likes, 0 repeats
Well, that's where the "power converter" comes in. This box contained +12V and +5V regulators, and its output connector matched the pinout of the original 512/128 serial port. The input was also a DE-9, but an adapter cable could be used to connect the power converter to a Macintosh Plus or later. And for no good reason, the power input was centre negative.
(DIR) Post #AYALtXrs423zN0YHj6 by keelan@mastodon.sdf.org
2023-07-28T17:40:22Z
0 likes, 0 repeats
The next box in the electronic centipede was the "adapter box". This had a little pigtail connector that could either connect directly to a 512/128 mac's printer port, or to a later mac through the "power converter". It had a DE-9 connector for the ImageWriter II to plug in to, it included a switch to switch between print and scan modes, and it was attached to the ThunderScan "cartridge" through a long thin black cable.
(DIR) Post #AYALtZ03r4D0shOL8C by keelan@mastodon.sdf.org
2023-07-28T17:44:56Z
0 likes, 0 repeats
And this is where things get interesting. The "adapter box" contains no active electronics. And even weirder, the RS-422 transmit/receive pairs pass through the box untouched. The ThunderScan doesn't connect to them at all. And the cable to the ThunderScan? Only 3 of the 4 wires are used. Subtracting two for power, that leaves only one wire. Somehow the ThunderScan connects to the mac through a single wire. And what is that wire is connected to? The serial port's handshake/ext clock pin. Whaaat?
(DIR) Post #AYALtbetyC497wVz4C by keelan@mastodon.sdf.org
2023-07-28T17:47:28Z
0 likes, 0 repeats
Okay, so let's look at the "cartridge", that will answer all the mysteries. Maybe there is a microcontroller with some firmware we can dump to help decode the mystery. The front of the case near the sensor was glued shut, so after carefully prying it open, this is what I found:
(DIR) Post #AYALtfBGsIk03CgNRA by keelan@mastodon.sdf.org
2023-07-28T17:51:54Z
0 likes, 0 repeats
It would appear that there are no digital electronics in this thing at all. Unsurprisingly, the part numbers were scrubbed from two critical components. The optical sensor, and a 10 pin TO-97 or TO-100 can. I happened to stumble across the optical sensor on Digikey (discontinued, obsolete), it's an HP HEDS-1500. When the ThunderScan was new, It was probably worth more than all of the rest of the hardware combined.
(DIR) Post #AYALti6Q0ndr71R2n2 by keelan@mastodon.sdf.org
2023-07-28T17:57:19Z
0 likes, 0 repeats
That left the TO-100 package. Luckily it tuns out that very few products used that package. In fact I was only able to find one: an Analog Devices voltage to frequency converter. This is a handy device generates a square wave with a frequency that varies depending on a voltage input. And then it all started to make sense.
(DIR) Post #AYALtj3GU0iI3Wy2Vs by keelan@mastodon.sdf.org
2023-07-28T18:03:50Z
0 likes, 0 repeats
So here's what's going on: the signal from the optical sensor goes through an op-amp, then it is fed into the V-to-F converter. The output from that converter is then fed directly into the clock in pin on the serial port. I'm assuming the software switches the SCC to async mode, and sends commands to the printer to start the carriage moving. Then it reconfigures the port into sync mode, disables interrupts and polls the "Rx Character Available" flag on the SCC...
(DIR) Post #AYALtkRlIPu2NnR7Kq by keelan@mastodon.sdf.org
2023-07-28T18:29:39Z
0 likes, 0 repeats
It doesn't care about the data, it cares about timing. In my tests, the ThunderScan outputs a 2.6 KHz for black, 500 Hz for white. If the SCC were configured in sync mode with a synchronization character of all zeros, then that rate at which "characters" became available would vary depending on what the scanner was seeing. With 5 bit sync and data bits, black would generate a character every 3.8 ms, while white would produce a character every 20ms. Greys would be all the values in between.
(DIR) Post #AYALtlqc5VNMjA4Ti4 by keelan@mastodon.sdf.org
2023-07-28T18:35:10Z
0 likes, 0 repeats
What's crazy about the ThunderScan is that it is a purely analog device. It is completely dumb, the moment the switch is set to "scan", it starts sending a square wave. The rest of the magic is done in software, which I'm hoping to get to next.That's it for now!