• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

TelePort ADB Modem Protocol?

tashtari

PIC Whisperer
I'm thinking about ADB again for some reason, and it was only a matter of time before this white whale resurfaced in my brain.

For the uninitiated, at some point Global Village made a 2400 baud TelePort modem (the first or one of the first bearing that name, I think) that really was an ADB peripheral in its own right; this was before the dime-a-dozen ones that just siphon power from the ADB port while plugging into a serial port for their actual data. This article describes it.

To the best of my recollection, it remains the only ADB device I've ever heard of that isn't a keyboard, mouse/trackball/tablet/pointing-device, or security dongle, and is thus uniquely interesting.

Does anyone know if there's ever been any effort to figure out the protocol that these things use? Hell, does anyone even have one? I would love to figure out its protocol and emulate it in one of my firmware projects, but I've never seen one up for sale.
 

tashtari

PIC Whisperer
Always wondered about this one. Isn't ADB extremely slow?
Sure is. But so is 2400 baud! Wikipedia says the practical maximum is about 10 kbps and even mentions the TelePort modem by name, saying ADB had no trouble keeping up with it. The point isn't sourced, of course, but you can't have everything...

(Apple's article "Space Aliens Ate My Mouse" puts the maximum rate at 100-200 bytes per second, which I think is off by an order of magnitude.)
 

mmu_man

Well-known member
200 bytes/s = 200*8 bits/s = 1600 bauds (well, bits/s don't always equals bauds, but in most cases that's it), so not that far.
 

tashtari

PIC Whisperer
On one of my machines, polling intervals seem to be spaced by about 10 ms. Back-of-the-envelope calculation is that a full packet of 8 bytes would take about 8 ms to send. Let's say that one of those bits is used for control purposes and each 8-byte packet only has 7 bytes of real data in it. That's 7 bytes per 18 ms, or 389 bytes per second. That's not exactly quick, but it'd carry 2400 baud with a decent margin for error.
 

Sunoo

Well-known member
To the best of my recollection, it remains the only ADB device I've ever heard of that isn't a keyboard, mouse/trackball/tablet/pointing-device, or security dongle, and is thus uniquely interesting.
Not fully on topic, but LaCie made an FM radio that connects via ADB. I have one around here somewhere.
 

tashtari

PIC Whisperer
LaCie made an FM radio that connects via ADB.
Oh? That's neat. I'm guessing the ADB part was so you could control it via the computer, not so you could transmit audio data over the bus, though... ADB definitely could not carry audio data at a reasonable frequency. The main reason the modem is interesting is because if reverse engineered, it means you could effectively graft a third serial port onto the mac... 2400 baud would be plenty for acting as a low-speed terminal or something like that.
 

paws

Well-known member
Isn't ADB completely documented? Would it be substantially less work to do that from nothing? I assume you want to reuse their drivers, but are they really that much work?
 

tashtari

PIC Whisperer
Isn't ADB completely documented? Would it be substantially less work to do that from nothing? I assume you want to reuse their drivers, but are they really that much work?
ADB is completely documented, yeah, but that only extends to the physical-layer protocol, certain conventions, and the protocols for well-known devices such as keyboards and mice.

It doesn't explain how Global Village decided to use ADB to communicate with their modem - it would be nice if they just used register 0 as a straight-up serial communications channel with no overhead, but we already know that can't be true because ADB data payloads can't be a single byte, they have to be between two and eight, so there's no defined way to send or receive a single-byte payload. I'm theorizing (but I do not know) that the first byte in the payload written to or read from register 0 always contains control information of some kind, and the 1 to 7 that follow are data bytes.

I could do some trial and error with observing their driver's behavior, but there are a lot of pitfalls there, given that I don't have a device to compare against and thus can't be sure how well I'm imitating it.
 

paws

Well-known member
It doesn't explain how Global Village decided to use ADB to communicate with their modem
I get that, but I'm wondering if it's more work to figure out how they did than to just make a new driver that acts as a serial port. Assuming that you'd be making new hardware anyway.
 

tashtari

PIC Whisperer
I'm wondering if it's more work to figure out how they did
I might be able to hack something together, but I find the prospect much more appealing of implementing a simple protocol in firmware and using an existing driver that's been professionally written and widely tested. Plus, it's fun!
 

sstaylor

Well-known member
I seem to recall Apple in the late 80s/early 90s touting ADB as capable of being more than just an interface for keyboards and mice, that it could be used for scanners and other devices. Apparently Global Village took them at their word.
 

tashtari

PIC Whisperer
Talk of ADB scanners seems awfully optimistic of Apple, unless they were talking about barcode scanners...

The LaCie ADB radio brings the count of interesting (not keyboards or pointing devices) ADB devices that I've heard of to two... surely there must be at least a few others.
 

tashtari

PIC Whisperer
Ooh, that's neat. That brings the count to three devices. =D I can't find any information about it, though. I'm guessing based on the time period that home automation means X10, this probably would have been a device that plugged into an outlet and came with software to let you send commands to control lights and such. I might be a little worried about plugging a device from 1990 both into an ADB port and the mains, though...
 

tashtari

PIC Whisperer
@Dandu kindly helped me out with some details from his teleport ADB modem and I managed to get some responses out of the driver, so I thought I'd chronicle my experience a bit for posterity...

First and foremost, the default address is 0x5 and the handler ID is 0x36. That seems to be enough for the driver to talk to it; I'd feared that it would require correct responses from various registers, but the driver seems curiously uninterested in querying them.

The driver does a talk register 2 on startup, to which my firmware currently gives no reply, and the driver doesn't seem to care. From Dandu's modem, talk register 2 gave eight bytes of what looks like random nonsense; given how interested the driver is in getting users to register with Global Village, it wouldn't surprise me to learn that that is a serial number.

Apart from that, register 0 seems to be where most of the action is. As I conjectured, the modem has a mechanism for communicating the length of a chunk of data (since ADB requires transactions to be minimum 2 bytes). Listen register 2 commands seem to always be 8 bytes in length, with the lower three bits of the final byte indicating how many of the preceding bytes were valid data. As for the other five bits, usually the MSB of the final byte is also set (0b10000), but the first data chunk on startup has 0b01010 instead for some reason.

The driver also writes sequences of two bytes to register 1 and sequences of four bytes to register 2, purpose as-yet unknown. I think that bit 1 of the second byte written to register 1 is set for off-hook and clear for hangup, but I'm not sure. I'm also not sure why this is necessary considering that data sent by the driver and registration application indicate that it takes AT commands ("ATL1M1&&W1" and "AT&FE0V1X3", if you want to know.)

It turns off the SRQ-enable bit in register 3 on startup, which is curious. I think it's because when off-hook, the driver polls the modem and the mouse in alternating succession, possibly taking over from the ADB driver or otherwise coercing it to act differently than it usually does (repeatedly polling the last device to send data.) Possibly this is because it would look bad to have a jerky mouse while your modem was working and/or because it would decrease the modem's throughput if you moved the mouse and the ADB controller had to cycle through the other devices to find out it was the modem requesting service. Of course, this is all guesswork.

Interestingly, it also seems to use the "exceptional event" bit in register 3, clearing it before taking the phone off hook and setting it before hanging up.

It's early days yet. I still, for example, need to get myself an actual terminal program and see if changing any of its settings changes the commands sent to the modem, as well as programming the firmware to actually respond in some way. And it'd be nice to get my hands on one of the real things to play with myself.

That said, what I've seen so far is promising...
 
Top