Jump to content

Apple Desktop Bus

From RetroTechCollection
Revision as of 08:46, 27 September 2026 by Josh (talk | contribs) (Fix two red links: point the Macintosh Portable mention at the hosted service manual, and unlink the non-existent Universal Serial Bus page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Apple Desktop Bus
ADB connector (female socket)
Type Computer peripheral interface
Designer Apple Computer
Design date 1985-1986
Manufacturer Apple Computer
Production 1986-1999
Superseded USB
External Yes
Hot-pluggable No - Apple's documentation warns against it
Cable 4-conductor shielded, 5 m maximum
Pins 4
Connector Mini-DIN 4 (same shell as S-Video)
Electrical Single data line, open collector, 470 ohm pull-up
Maximum devices 16 addressable; more than 3 per port not recommended
Protocol Serial, self-clocking, single-master
Data signal Bidirectional serial
Data rate ~10 kbit/s (100 us bit cell)
Style Serial

The Apple Desktop Bus (ADB) is Apple's single-master, multislave bit-serial bus for low-speed input devices — keyboards, mice, graphics tablets and the like. Apple describes it as connecting "up to 16 low-speed input devices".[1] It was introduced on the Apple IIGS in September 1986 and carried across the Macintosh line from the Macintosh SE and Macintosh II in 1987 until USB replaced it at the end of the 1990s.

On most Macintosh models the bus hardware is three things: an ADB transceiver IC — which Apple describes as a 4-bit microcontroller — that drives the bus and reads device status; the VIA, which is how the CPU talks to the transceiver; and two 4-pin ADB connectors wired in parallel on the rear panel. The Macintosh Portable is the exception: there the Power Manager IC performs the transceiver function, and the Macintosh IIfx uses the IOP custom IC instead.[1]

Physical Interface

[edit | edit source]

Connector

[edit | edit source]
ADB connector signal assignments[1]
Pin Signal Description
1 ADB Bidirectional data bus, used for input and output. Open-collector, pulled up to +5 V through a 470 Ω resistor on the computer's main logic board
2 POWER.ON On the Macintosh II family, a key on the ADB keyboard momentarily grounds this pin to pin 4 to switch on the power supply. On other models this pin is not connected
3 +5 V +5 volts
4 GND Ground

Pin 2 is POWER.ON, not "PSW"; it is a momentary ground path to pin 4, not a "direct connection to the power supply".

The shell is the same 4-pin mini-DIN used for S-Video, which is why S-Video cables get pressed into service. Do not: some S-Video cables bridge or omit conductors, and the pin functions do not correspond.

Electrical characteristics

[edit | edit source]
ADB transceiver electrical characteristics[1]
Parameter Minimum Maximum
Low input signal voltage −0.2 V 0.8 V
High input signal voltage 2.4 V 5.0 V
Low output signal voltage — 0.45 V (at 12 mA)
High output signal voltage 2.4 V —
Device output current when off — −20 µA (at 0.4 V)
Device input capacitance — 150 pF

Apple gives no rise-time or fall-time figure, and no per-device current limit. What it does give is a bus total: "ADB devices may use the +5 volts supplied by the bus, but all the ADB devices combined must not draw more than a total of 500 mA."[1] A widely repeated "100 mA per device maximum" does not appear in Apple's documentation and is not reproduced here.

Cable and chain length

[edit | edit source]

Cables should be no longer than 5 metres, and cable capacitance should not exceed 100 picofarads per metre.[1] On device count Apple is blunt: "Although the ADB transceiver is capable of addressing up to 16 different peripheral devices, daisy-chaining more than 3 devices on one ADB port is not recommended because of connector resistance and signal degradation."[1] Long chains and cheap extension leads are a real cause of intermittent mice and keyboards.

Protocol

[edit | edit source]

Bit cells

[edit | edit source]

Each command or data bit is encoded as a bit cell: a low voltage on the bus, a rising edge, a high voltage, and a final falling edge. A 0 is distinguished from a 1 by the relative length of the low time. Every command and data packet ends with a stop bit — a 0 bit with the same low time as any other 0, but which does not necessarily have a second falling edge.[1]

ADB timing specifications (Apple Table 8-14)[1]
Parameter Nominal Host tolerance Device tolerance
Bit-cell time 100 µs ±3% ±30%
"0" low time 65 µs 65% of bit-cell time ±5% 65% of bit-cell time ±5%
"1" low time 35 µs 35% of bit-cell time ±5% 35% of bit-cell time ±5%
Attention low time 800 µs ±3% —
Sync high time 65 µs ±3% —
Stop bit low time 70 µs ±3% ±30%
Global Reset low time 3 ms 3 ms minimum 3 ms minimum
Service Request low time 300 µs — ±30%
Stop-bit-to-start-bit time 200 µs 140 µs min, 260 µs max 140 µs min, 260 µs max

Two things about this table are easy to get wrong. Sync is 65 µs high and the stop bit is 70 µs low — several online summaries transpose them. And the bit cell is 100 µs, so the bus runs at roughly 10 kbit/s. A figure of "125 kbit/s theoretical" circulates widely; it does not follow from Apple's own timing table and is not used here.

Transactions

[edit | edit source]

A transaction is a command sent by the computer followed by a data packet sent by either the computer or the device.[1]

  • A command consists of an Attention signal, a Sync signal, one command byte, and one stop bit.
  • A data packet consists of a start bit, two to eight 8-bit data bytes, and one stop bit.

Command byte

[edit | edit source]

Every command byte is a 4-bit device address, a 2-bit command code and a 2-bit register code. There are four commands, not six:[1]

ADB command byte syntax (Apple Table 8-13)
Bits 7–4 (address) Bits 3–2 (command) Bits 1–0 (register) Command
x x x x 0 0 0 0 SendReset
A3 A2 A1 A0 0 0 0 1 Flush
x x x x 0 0 1 0 Reserved
x x x x 0 0 1 1 Reserved
x x x x 0 1 x x Reserved
A3 A2 A1 A0 1 0 r1 r0 Listen
A3 A2 A1 A0 1 1 r1 r0 Talk
  • Talk reads a register. The device must respond with data within 260 µs or the computer takes the bus back. A device with nothing to say simply times out — except that it must respond to Talk Register 3.
  • Listen writes a register.
  • SendReset returns every device on the bus to its power-on state, clearing pending service requests.
  • Flush is defined per device; normally it clears internal registers, losing anything buffered such as type-ahead characters.

The commands with command code 01 are reserved by Apple for future expansion, and nothing should use them.[1]

Signals

[edit | edit source]

Four global signals are not addressed to any device. Attention, Sync and Global Reset are always generated by the computer; Service Request is always generated by a device.[1]

  • Attention — a long low that marks the start of every command, followed by a short high Sync pulse that establishes the timing of the bits that follow.
  • Global Reset — if the bus stays low for at least 3.0 ms, every device interprets it as a Global Reset, releases the bus and resets itself. A bus stuck low is therefore a permanent reset condition and nothing will enumerate.
  • Service Request — a device that is not the active device and has data to send waits until the end of a command and then holds the bus low for 140 to 260 µs, lengthening the stop bit.

The second defined error condition is a transaction that never finishes: if the bus stays high beyond the maximum bit-cell time, all devices ignore the command and wait for a new Attention signal.[1]

Transaction states

[edit | edit source]

Two lines from the VIA to the transceiver, ST0 and ST1, define the transaction state:[1]

ADB transaction states (Apple Table 8-12)
ST1 ST0 State
0 0 0: start a new command
0 1 1: transfer data byte (even)
1 0 2: transfer data byte (odd)
1 1 3: idle

State 3 is where the bus spends most of its life, and it is the key to understanding ADB latency: in the idle state the ADB transceiver automatically repeats the last Talk command every 11 ms. The default transaction state on startup or reset is 3.[1]

Device Registers

[edit | edit source]

An ADB device may have up to four registers, each 2 to 8 bytes.[1]

  • Register 0 — the data register. When the ADB Manager polls to find which device asserted a Service Request it sends Talk Register 0 to each device in turn, so a device must have data in register 0 when it requires service, even if the interesting data is elsewhere.
  • Register 1 — device-specific; the device may use it for anything.
  • Register 2 — device-specific. On Apple keyboards it carries modifier-key status (and, on the Extended Keyboard, the lock LEDs).
  • Register 3 — status and identification.
Bits in device register 3 (Apple Table 8-15)[1]
Bit Description
15 Reserved; must be 0
14 Exceptional event, device specific; always 1 if not used
13 Service Request enable; 1 = enabled
12 Reserved; must be 0
11–8 Device address
7–0 Device Handler ID

A device's ability to raise a Service Request can be switched off by clearing bit 13 with a Listen Register 3 command carrying Device Handler ID $00. Apple suggests this to improve service-request response time when several devices are on the bus and not all of them matter to the application in hand.[1]

Addressing and Enumeration

[edit | edit source]

Default addresses

[edit | edit source]
ADB device addresses (Apple Table 8-16)[1]
Address Device type Example
$00–$01 Reserved —
$02 Encoded devices Keyboard
$03 Relative devices Mouse
$04 Absolute devices Graphics tablet
$05–$07 Reserved —
$08–$0F Any other —

Eight addresses are predefined or reserved, leaving eight available for other device types. This is the whole published table — tables circulating elsewhere that assign $01 to "security dongles" or $0F to a "global polling address" are not Apple's.

Device Handler IDs

[edit | edit source]

The 8-bit Device Handler ID, together with the default address, is what the ADB Manager uses to decide which device driver to call.[2] A device with more than one functional mode changes mode when its driver writes a new Handler ID to register 3 — this is how a mouse is switched from 100 to 200 counts per inch, and how the Apple Extended Keyboard is made to distinguish left from right modifiers.

Apple reserves exactly four Handler ID values for special functions. Every other value must be assigned by Apple Computer, and unrecognised IDs are ignored:[1]

Device Handler IDs reserved for special functions (Apple Table 8-17)
ID Function
$FF As Listen Register 3 data, initiates a self-test in the device
$FE As Listen Register 3 data, instructs the device to change its address field to the new address sent by the computer if no collision has been detected
$FD As Listen Register 3 data, instructs the device to change its address field if the activator is pressed
$00 As Listen Register 3 data, instructs the device to change the address and enable fields to the new values sent by the computer
$00 As data returned to a Talk Register 3 command, indicates that the device failed a self-test

There is no published registry of handler IDs beyond this. Lists that assign ranges to keyboards, mice, tablets and joysticks are not Apple's and are not reproduced here.

Collision detection

[edit | edit source]

Every ADB device must be able to detect collisions. A device waits for a free bus — the bus staying high for the stop-bit-to-start-bit time. If it is trying to bring the bus high and another device forces the line low, or another device starts sending before it can assert its start bit, it has lost a collision. The loser stops transmitting immediately, preserves the data it was sending, and sets an internal collision flag, which is cleared the next time it transmits successfully.[1]

Because a device could fail to detect a collision with another device running on a nearly identical internal clock, Apple specifies that each device should attempt to assert its start bit at a random time within the stop-bit-to-start-bit window.[1]

Enumeration

[edit | edit source]

At startup the Start Manager sends Talk Register 3 to each address. Where more than one device answers, each device that loses the collision sets its flag and disables its movable-address function. The Start Manager then sends Listen Register 3 to that address with Handler ID $FE and a new address; only the device that did not detect a collision moves. This repeats until Talk Register 3 at that address times out, at which point one device is moved back to the default address and the Start Manager moves on.[1]

The activator

[edit | edit source]

An ADB device may have a key or button called an activator, intended for multi-user applications that need to identify and locate individual devices. An application can display a message asking the user to press it; the driver then relocates that device with a Listen Register 3 command carrying Handler ID $FD.[1]

Polling protocol

[edit | edit source]

Once addresses are resolved, the ADB Manager sends Talk Register 0 to address $03 — the default active device, usually the mouse — and the transceiver repeats that command every 11 ms. The last device to send data becomes the active device and is polled every 11 ms until another device asserts a Service Request.[1]

When a Service Request arrives, the transceiver raises an interrupt to the VIA, which sets bit 3 of VIA Data register B to 0. The operating system polls that bit, hands control to the ADB Manager, which sends Talk Register 0 to each device until it finds the one asking for service.[1]

Hot-plugging

[edit | edit source]

Apple's warning is explicit: "Do not unplug and reattach an ADB device while the computer is running" — if you do, the device reverts to its default address while the computer carries on trying to reach it at the address it was assigned at startup, so it simply stops working until the machine is restarted.[1]

Repair experience adds a second reason: on many machines the ADB +5 V feed is protected by a fuse on the logic board, and hot-plugging can open it. The fuse type and rating vary between models and Apple's ADB documentation does not describe it, so check the service documentation for the specific machine rather than assuming a value. Claims of a "1.1 A polyfuse" as a general figure are not supported by any Apple document seen here.

Apple's Own ADB Devices

[edit | edit source]

Apple Standard Mouse

[edit | edit source]

A rubber-coated steel ball turns two capstans, each driving a slotted interrupter wheel. Two beams of infrared light shine through the slots onto two detectors offset just enough to produce two square waves 90° out of phase — the interrupt signal and the quadrature signal. The quadrature signal precedes the interrupt signal by 90° when the wheel turns one way and trails it when it turns the other. A microprocessor in the mouse counts the edges and also acts as the mouse's ADB transceiver.[1]

ADB transceiver register 0 in the Apple Standard Mouse (Apple Table 8-4)[1]
Bit Meaning
15 Button status; 0 = down
14–8 Y move counts, two's complement. Negative = up, positive = down
7 Not used (always 1)
6–0 X move counts, two's complement. Negative = left, positive = right

The first byte carries Y, not X; the move fields are 7-bit two's complement, so the range per report is −64 to +63; and bit 7 is fixed at 1, not a second button. Resolution is 100 ±10 counts per inch at Device Handler ID $0001 and 200 ±10 at $0002; the mouse powers up and resets to $0001.[1] See Apple Desktop Bus Mouse for the device itself.

Apple Standard Keyboard

[edit | edit source]
Register 0 in the Apple Standard Keyboard (Apple Table 8-7)[1]
Bit Meaning
15 Key status for first key; 0 = down
14–8 Key code for first key; a 7-bit value
7 Key status for second key; 0 = down
6–0 Key code for second key; a 7-bit value

Two key events fit in one register-0 read — this is the origin of ADB keyboards' 2-key reporting, and it is a property of the register format, not of the switch matrix.

Register 2 in the Apple Standard Keyboard (Apple Table 8-8)[1]
Bit Key
15 None (reserved)
14 Delete
13 Caps Lock
12 Reset
11 Control
10 Shift
9 Option
8 Command
7–0 None (reserved)

A 0 indicates that the key is down. Note what register 2 is not: on the Apple Standard Keyboard it carries no LED bits at all. Descriptions giving register 2 a "Compose LED", a "Kana LED" or a "Power LED" are inventions.

Apple Extended Keyboard

[edit | edit source]

The Extended Keyboard uses the same register-0 format and an extended register 2:[1]

Register 2 in the Apple Extended Keyboard (Apple Table 8-11)
Bit Meaning
15 None (reserved)
14 Delete
13 Caps Lock
12 Reset
11 Control
10 Shift
9 Option
8 Command
7 Num Lock / Clear
6 Scroll Lock
5–3 None (reserved)
2 LED 3 (Scroll Lock)
1 LED 2 (Caps Lock)
0 LED 1 (Num Lock)

A zero indicates a key is down or that an LED is on. The three LED bits are the only writable ones, and they are set with a Listen Register 2 command.[1]

Changing the Extended Keyboard's Device Handler ID in register 3 from $0002 to $0003 makes it generate distinct transition codes for the right-hand Option and Control keys — those two keys only. This is done with a Listen Register 3 command.[1]

Macintosh Portable

[edit | edit source]

The Portable is a special case throughout. Its ADB transceiver function is in the Power Manager IC and keyswitch encoding is done by a separate keyboard processor. Its keyboard is a keyswitch matrix only, with no active electronics — 63 keyswitches on a steel plate. Its trackball is electrically ADB-compatible but uses a few pins of a large shared connector, with default Handler ID $0001 and the same address as a mouse.[1]

Apple's warning is worth repeating because it is still a live hazard: any input device connected to the Macintosh Portable ADB must be a low-power version. Keyboards and mice from other Macintosh models are not usable, and connecting them "could cause an unacceptable decrease in the +5 volt supply voltage and result in improper operation".[1]

Software

[edit | edit source]

The ADB Manager is the part of the Operating System that talks to the bus. Applications normally do not touch it — keyboard and mouse input arrives through the Event Manager.[2]

Its published routines are:[2]

  • CountADBs — counts entries in the ADB device table.
  • GetIndADB — returns information about a device by its index in the table.
  • GetADBInfo — the same information, by address.
  • SetADBInfo — used by a device handler's installation code to set its own entry.
  • ADBOp — transmits a command byte directly. Always executed asynchronously; if the bus is busy the command is queued.
  • ADBReInit — reinitialises the bus.

Device handlers live in 'ADBS' resources in the System file; at startup the Start Manager loads and executes them, reads register 3 in each device, and places each device's default address and Device Handler ID in the ADB device table.[2] Because GetIndADB and GetADBInfo return the device's original handler ID and default address, they remain a reliable way to identify what a device is even after enumeration has moved it.

Troubleshooting

[edit | edit source]

Nothing enumerates

[edit | edit source]
  • Measure +5 V at pin 3 against pin 4 at the port with nothing connected.
  • Pin 1 should idle high, held up by the 470 Ω pull-up on the logic board. A pin 1 sitting at 0 V with nothing plugged in is a fault on the computer, not the peripheral; and a bus held low for more than 3 ms is a permanent Global Reset condition.
  • Check the ADB fuse on the logic board for the specific machine. Blowing it by hot-plugging is the classic cause.

Intermittent device

[edit | edit source]
  • Check continuity of all four conductors end to end, flexing the cable at the strain relief as you go.
  • Shorten the chain. Apple recommends no more than three devices per port, and 5 m of cable total.
  • Total bus draw must stay under 500 mA; a chain of powered accessories can exceed it.

Device works alone but not in a chain

[edit | edit source]

This is usually an address collision that failed to resolve, or a device with a defective collision detector. Disconnect everything else, restart, and add devices back one at a time.

With an oscilloscope

[edit | edit source]
  • Look for the 800 µs Attention pulse followed by the 65 µs Sync high.
  • Look for the device answering within 260 µs of a Talk command.
  • In the idle state you should see the last Talk command repeat every 11 ms. If the host is transmitting and the device never answers, the fault is in the device; if the host is not transmitting at all, it is not.

Adapters and Modern Use

[edit | edit source]

ADB-to-USB conversion is the usual route to using these devices today. Commercial adapters of the period (notably Griffin's iMate) are long discontinued, and community-built converters come and go. This page does not endorse a particular one; check current sources before buying, and check that whatever you find implements the timing in the table above rather than approximating it.

Not to be confused with AppleTalk

[edit | edit source]

ADB and AppleTalk are different buses with different failure modes, and the wiki holds Apple's own material on the AppleTalk side. Apple's Macintosh Office (AppleTalk) Technical Procedures, bound into the binder described at Service Support Tranning Programs Laserwriter Technical Procedures Jan 1985, troubleshoots a LocalTalk network by flowchart — ONE NODE, TWO OR MORE BUT NOT ALL, ALL NODES, FIRST NODE and RARE CASE — and its appendix explains bus termination problems, why noisy nodes break the bus, cable impedance, dangling cables and circular networks. Apple notes there that the AppleTalk bus conforms to the EIA electrical interface specification.[3]

For the programming side of AppleTalk rather than the wiring, see Programming with AppleTalk 1991; it contains no electrical data.

See Also

[edit | edit source]

References

[edit | edit source]
  1. ↑ 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 Guide to the Macintosh Family Hardware, second edition, Apple Computer, Inc. / Addison-Wesley, 1990 — hosted on this wiki as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf. Chapter 8, "Apple Desktop Bus", pages 287–326: bus overview (single-master multislave, up to 16 devices, ADB transceiver IC described as a 4-bit microcontroller, two connectors wired in parallel, four-conductor shielded cable, the warning against unplugging a device while the computer is running, the 500 mA total bus limit, the 5 m cable length and 100 pF/m capacitance limits, and the note that daisy-chaining more than three devices on one port is not recommended); Table 8-1 connector signal assignments; Table 8-2 transceiver electrical characteristics; Table 8-4 register 0 in the Apple Standard Mouse and the accompanying note on 100 ±10 and 200 ±10 counts per inch; Tables 8-7 and 8-8 registers 0 and 2 in the Apple Standard Keyboard; Tables 8-10 and 8-11 registers 0 and 2 in the Apple Extended Keyboard; Table 8-12 transaction states; Table 8-13 command byte syntax; Table 8-14 the full timing specification; Table 8-15 device register 3; Table 8-16 device addresses; Table 8-17 reserved Device Handler IDs; the collision-detection, polling (11 ms) and error-condition sections. Chapter 9, "Floppy Disk Interfaces", is the source for the floppy-drive material.
  2. ↑ 2.0 2.1 2.2 2.3 Inside Macintosh: Devices, chapter 5, "ADB Manager", Apple Computer, Inc. — hosted on this wiki as File:Inside Macintosh Devices Chapter 5 ADB Manager.pdf. ADB overview; the ADB device table; CountADBs, GetIndADB, GetADBInfo, SetADBInfo, ADBOp and ADBReInit; device handlers installed from 'ADBS' resources; and the statement that the Apple Extended Keyboard has Device Handler ID $02 at default address $2.
  3. ↑ Apple Computer, Apple LaserWriter Printer Technical Procedures, preliminary version for internal use only, sections stamped rev. Jan 85 and rev. Feb 85. Held on this wiki inside the Service Support Training Programs binder scan, described at Service Support Tranning Programs Laserwriter Technical Procedures Jan 1985 (File:Service_Support_Tranning_Programs_Laserwriter_Technical_Procedures_Jan_1985.pdf).