- Apple Desktop Bus
name=Apple Desktop Bus (ADB)
type=Human input device interface
caption=An early ADB keyboard and the ADB Icon
Steve Wozniak/Apple Computer
manufacturer=Apple Computer Inc.
production_date=1986 to 1998
RS-422/6522 keyboard and mouse
data_signal=Bi-directional serial command stream
data_bandwidth=125 kbit/s maximum
(~10 kbit/s actual)
(~5 actual, 3 supported)
pinout_caption=Female socket from the front.
pin3=+5 volts power
pinout_notes=Same connector as
Apple Desktop Bus (or ADB) is an obsolete bit-serial
computer busconnecting low-speed devices to computers. Used primarily on the Apple Macintoshplatform, ADB equipment is still available but not supported by most Apple hardware manufactured since 1999.
ADB was created by
Steve Wozniak, who had been looking for a project to work on in the mid-1980s. Someone suggested that he should create a new connection system for devices like mice and keyboards, one that would require only a single daisy-chained cable, and be inexpensive to implement. As the story goes, he went away for a month and came back with ADB.
The first system to use ADB was the Apple IIGS in 1986. It was subsequently used on all Apple Macintosh machines starting with the
Macintosh IIand Macintosh SE, before it was replaced by USB, starting on the iMacin 1998. ADB was also used on a number of other 680x0-based microcomputers made by Sun, HP, NeXT and such.
No machines being built today use ADB for device interconnection, but up to February 2005, PowerBooks and iBooks still used the simple ADB protocol in the internal interface with the built-in keyboard and
touchpad. The internal connection for the trackpads has now been changed to USB.
In keeping with Apple's general philosophy of industrial design, ADB was intended to be as simple to use as possible, while still being inexpensive to implement. A suitable connector was found in the form of the 4 pin
mini-DINconnector, which is also used for S-Video. The connectors were small, widely available, and can only be inserted the "correct way". They do not "lock" into position, but even with a friction fit they are firm enough for light duties like those intended for ADB. ADB can be implemented for less than a pennyfact|date=July 2008; the connector always costs more than the controller hardware.
ADB's protocol required only a single pin for data, labeled ADB. Two of the other pins were used for +5 V power supply and ground. The +5 V pin guaranteed at least 500 mA, and required devices to use only 100 mA each. ADB also included the PSW pin which was attached directly to the power supply of the host computer. This was included to allow a key on the keyboard to start up the machine without needing the ADB software to interpret the signal. In more modern designs an auxiliary microcontroller is always kept running, so it is economical to use a power-up command over the standard USB channel.
Most serial digital interfaces use a separate "clock" pin to signal the arrival of individual bits of data. As ADB was designed to be low-cost, Wozniak recognized that a single wire had enough bandwidth to carry both signals at the required data rate. Moreover it was economical to decode the clock and data and use cheaper cables. The decoding
transceiverASIC was available only by request, as Apple preferred to work more closely with vendors. Apple possibly sold this hardware below cost to encourage peripheral development and their own economy of scale.
The ADB system is based around the devices having the ability to decode a single number (the "address") and being able to hold several small bits of data (their "registers"). All traffic on the bus is driven by the host computer, which sends out commands to read or write data: devices are not allowed to use the bus unless the computer first requests it. These requests took the form of single-
bytestrings. The upper four bits contained the address, the id of one device on the chain, allowing for up to 16 devices on a single bus. The next two bits specified one of four commands, and the final two bits indicated one of four registers. The commands were:
talk- send the contents of a register to the computer
listen- set the register to the following number
flush- clear the contents of the register
reset- tell everyone on the bus to reset
For instance, if the mouse was known to be at address $D, the computer would periodically send out a message on the bus that looked something like...
1101 11 00
This says that device $D (1101) should talk (11) and return the contents of register zero (00). To a mouse this means "tell me the latest position changes". Registers could contain between two and eight bytes. Register zero was generally the primary communications channel. Registers one and two were undefined, and were generally intended to allow 3rd party developers to store configuration information. Register three always contained device identification information.
The addresses and enumeration of the devices were set to default values when reset. For instance, all keyboards were set to $2, and all mice to $3. When the machine was first powered on the ADB device driver would send out talk commands asking each of these known default address, in turn, for the contents of register three. If no response came from a particular address, the computer marked it dead and didn't bother polling it later.
If a device did respond, it did so by saying it was moving to a new randomly selected "higher" address. The computer then responded by sending another command to that new address, asking the device to move to yet another new address. Once this completed that device was marked "live", and the system continued polling it in the future. Once all of the devices were enumerated in this fashion the bus was ready to be used.
Although it was not common, it was possible for the ADB bus to have more than one device of the same sort plugged in — two graphics tablets or software protection dongles for instance. In this case when it asked for devices on that default address, both would respond and a collision could occur. The devices included a small bit of timing that allowed them to avoid this problem. After receiving a message from the host, the devices waited a short random time before responding, and then only did so after "snooping" the bus to make sure it was not busy.
With two dongles plugged in, for instance, when the bus was first setting up one of them would be the first to respond due to the random wait timer. The other would notice the bus was busy and not respond. The host would then send out another message to that original address, but since one device had moved to a new address, only the other would then respond. This process continued until no one responded to the request on the original address, meaning there were no more devices of that type to enumerate.
Data rates on the bus were theoretically as high as 125 kbit/s. However the actual speed was at best half that due to there being only one pin being shared between the computer and devices. In actual use the speed was much less than that, as the entire system was driven by how fast the computer polled the bus. The
Mac OSwas not particularly well suited to this task, and the bus often got bogged down at about 10 kbit/s.
One peculiarity of ADB was that it in spite of being electrically unsafe for
hot-swappingon all but a few machines, it had all of the basic capabilities needed for hot-swapping implemented in its software and support hardware.
It is important to stress that on practically all original ADB systems it is not safe to plug in or unplug a device once the system is powered on (unlike modern day busses designed with hot-swap in mind). This could cause the opening of a soldered-in fuse on the motherboard. If brought to an authorised dealer this could result in a motherboard swap at a significant expense. A simple alternative was to obtain a fuse at a nominal cost and wire it in parallel across the open motherboard fuse (not even requiring soldering if done appropriately).
The mini-DIN connector was only rated for 400 insertions and it was easy to bend a pin if not inserted with caution; in addition, the socket could become loose, resulting in intermittent function.
Presaging the disappearance of the second port on newer
FireWiredevices, some ADB devices lacked a pass-through connector, making it impossible to daisy-chain more than one such device at a time without obscure splitter units. Keyboards, software dongles, graphics tablets, game pads and joysticks typically had pass-through connectors, while few mice or trackballs had them.
While Mini-DIN connectors can not be plugged in the "wrong way", it is possible to have trouble finding the right way without looking inside the circular connector's shroud. Apple attempted to help by using U-shaped grips around the connectors to key both plugs and sockets so the flat side is up, but this feature was ignored by some 3rd-party manufacturers.
List of device bandwidths
* [http://developer.apple.com/documentation/mac/Devices/Devices-205.html About the ADB Manager]
* [http://developer.apple.com/technotes/hw/hw_01.html Apple Documentation on the ADB Protocol]
* [http://developer.apple.com/documentation/Hardware/Developer_Notes/Macintosh_CPUs-G3/PowerMacintosh_G3/PowerMacG3.2b.html Apple doc on the ADB port]
Wikimedia Foundation. 2010.