Jump to content

Apple Desktop Bus: Difference between revisions

From RetroTechCollection
P4 verification: cite Apple's own AppleTalk bus-termination material from the hosted Technical Procedures binder, and distinguish it from ADB
Split the single catch-all Family Hardware ref into page-cited refs (pp. 285-322) and check each claim; remove 'circulating figures' narration, uncited S-Video, ADB fuse and chain-collision claims, and the off-topic AppleTalk section citing the LaserWriter binder; right-Shift note per Table 8-9; sentence-case headings; empty table cells instead of dashes
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
| type        = Computer peripheral interface
| type        = Computer peripheral interface
| designer    = Apple Computer
| designer    = Apple Computer
| design_date  = 1985-1986
| manufacturer = Apple Computer
| manufacturer = Apple Computer
| production  = 1986-1999
| production  = 1986-1999
| superseded  = [[Universal Serial Bus|USB]]
| superseded  = USB
| external    = Yes
| external    = Yes
| hotplug      = No - Apple's documentation warns against it
| hotplug      = No; Apple warns against it
| cable        = 4-conductor shielded, 5 m maximum
| cable        = 4-conductor shielded, 5 m maximum
| pins        = 4
| pins        = 4
| connector    = Mini-DIN 4 (same shell as S-Video)
| connector    = 4-pin mini-DIN
| electrical  = Single data line, open collector, 470 ohm pull-up
| electrical  = Single data line, open collector, 470 Ω pull-up
| maximum_devices = 16 addressable; more than 3 per port not recommended
| maximum_devices = 16 addressable; more than 3 per port not recommended
| protocol    = Serial, self-clocking, single-master
| protocol    = Serial, self-clocking, single-master
| data_signal  = Bidirectional serial
| data_signal  = Bidirectional serial
| data_rate    = ~10 kbit/s (100 us bit cell)
| data_rate    = about 10 kbit/s (100 µs bit cell)
| style        = Serial
| style        = Serial
| pinout_caption = ADB connector (female socket)
| pinout_caption = ADB connector (female socket)
|pinout=[[File:Apple Desktop Bus Connector Pinout.png|150px]]}}
|pinout=[[File:Apple Desktop Bus Connector Pinout.png|150px]]}}
<templatestyles src="Template:StyledTable/styles.css" />
<templatestyles src="Template:StyledTable/styles.css" />
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".<ref name="gmfh">''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.</ref> 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.
The '''Apple Desktop Bus''' ('''ADB''') is Apple's single-master, multislave serial bus for up to 16 low-speed input devices such as keyboards, mice and graphics tablets.<ref name="g285">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", Overview, pp. 285-286. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> It was introduced on the [[Apple IIGS]] in 1986, whose keyboard had a second ADB port for daisy-chaining the mouse,<ref name="dtkb">Deskthority wiki, [https://deskthority.net/wiki/Apple_Desktop_Bus_Keyboard "Apple Desktop Bus Keyboard"]. Retrieved 2026-09-30.</ref> and it was used on every Macintosh from the [[Macintosh SE]] and [[Macintosh II]] onwards; the Macintosh Plus and earlier models do not have it.<ref name="g289">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", ADB interface circuits, p. 289. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>


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.<ref name="gmfh" />
On most Macintosh models the bus hardware is an ADB transceiver IC, a 4-bit microcontroller that drives the bus and reads the status of the devices; the VIA, through which the CPU talks to the transceiver; and two 4-pin ADB connectors on the rear panel, connected in parallel. In the [[Macintosh Portable Service Source|Macintosh Portable]] the Power Manager IC acts as the ADB transceiver, and in the Macintosh IIfx the transceiver functions are in the IOP custom IC.<ref name="g285" /> When the bus is idle, the transceiver automatically polls the device that last sent data.<ref name="g285" />
 
== Physical Interface ==


== Physical interface ==
=== Connector ===
=== Connector ===
{| class="wikitable styled-table" style="width:75%;"
{| class="wikitable styled-table" style="width:75%;"
|+'''ADB connector signal assignments'''<ref name="gmfh" />
|+'''ADB connector signal assignments'''<ref name="g288">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", Table 8-1, p. 288. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
! Pin !! Signal !! Description
! 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
| 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'''
| 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
| 3 || +5 V || +5 volts
Line 42: Line 40:
|}
|}


Pin 2 is '''POWER.ON''', not "PSW"; it is a momentary ground path to pin 4, not a "direct connection to the power supply".
Pin 2 is POWER.ON: a momentary ground to pin 4 from a key on the ADB keyboard, used only on the Macintosh II family.<ref name="g288" />
 
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 ===
=== Electrical characteristics ===
{| class="wikitable styled-table" style="width:75%;"
{| class="wikitable styled-table" style="width:75%;"
|+'''ADB transceiver electrical characteristics'''<ref name="gmfh" />
|+'''ADB transceiver electrical characteristics'''<ref name="g289" />
! Parameter !! Minimum !! Maximum
! Parameter !! Minimum !! Maximum
|-
|-
Line 55: Line 51:
| High input signal voltage || 2.4 V || 5.0 V
| High input signal voltage || 2.4 V || 5.0 V
|-
|-
| Low output signal voltage || — || 0.45 V (at 12 mA)
| Low output signal voltage || || 0.45 V (at 12 mA)
|-
|-
| High output signal voltage || 2.4 V || —
| High output signal voltage || 2.4 V ||
|-
|-
| Device output current when off || — || −20 µA (at 0.4 V)
| Device output current when off || || −20 µA (at 0.4 V)
|-
|-
| Device input capacitance || — || 150 pF
| 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'''."<ref name="gmfh" /> A widely repeated "100 mA per device maximum" does not appear in Apple's documentation and is not reproduced here.
Apple gives the power budget for the bus as a whole: ADB devices may use the +5 V supplied by the bus, but all the ADB devices together must not draw more than 500 mA.<ref name="g292">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", p. 292. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>


=== Cable and chain length ===
=== Cable and chain length ===
Cables should be '''no longer than 5 metres''', and cable capacitance should not exceed '''100 picofarads per metre'''.<ref name="gmfh" /> 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."<ref name="gmfh" /> Long chains and cheap extension leads are a real cause of intermittent mice and keyboards.
Cables should be no longer than 5 m, and cable capacitance should not exceed 100 pF per metre. Although the transceiver can address up to 16 devices, Apple does not recommend daisy-chaining more than three devices on one ADB port, because of connector resistance and signal degradation.<ref name="g292" />


== Protocol ==
== Protocol ==
=== Bit cells ===
=== Bit cells ===
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.<ref name="gmfh" />
Each command or data bit is sent 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 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 need not have a second falling edge. The time from the stop bit to the next start bit is critical, because the computer needs that turnaround time for internal overhead.<ref name="g315">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB timing" and Table 8-14, pp. 315-316. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>


{| class="wikitable styled-table" style="width:90%;"
{| class="wikitable styled-table" style="width:90%;"
|+'''ADB timing specifications''' (Apple Table 8-14)<ref name="gmfh" />
|+'''ADB timing specifications''' (Apple Table 8-14)<ref name="g315" />
! Parameter !! Nominal !! Host tolerance !! Device tolerance
! Parameter !! Nominal !! Host tolerance !! Device tolerance
|-
|-
Line 84: Line 79:
| "1" low time || 35 µs || 35% of bit-cell time ±5% || 35% 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% || —
| Attention low time || 800 µs || ±3% ||
|-
|-
| Sync high time || 65 µs || ±3% || —
| Sync high time || 65 µs || ±3% ||
|-
|-
| Stop bit low time || 70 µs || ±3% || ±30%
| Stop bit low time || 70 µs || ±3% || ±30%
Line 92: Line 87:
| Global Reset low time || 3 ms || 3 ms minimum || 3 ms minimum
| Global Reset low time || 3 ms || 3 ms minimum || 3 ms minimum
|-
|-
| Service Request low time || 300 µs || — || ±30%
| 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
| 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.
The 100 µs bit cell gives a raw rate of about 10 kbit/s.


=== Transactions ===
=== Transactions ===
A transaction is a command sent by the computer followed by a data packet sent by either the computer or the device.<ref name="gmfh" />
A transaction is a command sent by the computer followed by a data packet sent by the computer or the device. A command is an Attention signal, a Sync signal, one command byte and one stop bit; a data packet is a start bit, two to eight 8-bit data bytes and a stop bit.<ref name="g309">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB communications", p. 309. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
 
* 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 ===
=== Command byte ===
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:<ref name="gmfh" />
Every command byte is a 4-bit device address, a 2-bit command code and a 2-bit register code. There are four commands: Talk, Listen, SendReset and Flush.<ref name="g311">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB commands" and Table 8-13, pp. 311-312. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>


{| class="wikitable styled-table" style="width:85%;"
{| class="wikitable styled-table" style="width:85%;"
|+'''ADB command byte syntax''' (Apple Table 8-13)
|+'''ADB command byte syntax''' (Apple Table 8-13)<ref name="g311" />
! Bits 7–4 (address) !! Bits 3–2 (command) !! Bits 1–0 (register) !! Command
! Bits 7–4 (address) !! Bits 3–2 (command) !! Bits 1–0 (register) !! Command
|-
|-
Line 127: Line 119:
|}
|}


* '''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.
* Talk reads a register. The addressed device must respond with data within 260 µs; a device must always answer Talk Register 3.<ref name="g311" />
* '''Listen''' writes a register.
* Listen writes a register.
* '''SendReset''' returns every device on the bus to its power-on state, clearing pending service requests.
* SendReset returns every device on the bus to its power-on state; each device clears its pending service requests.<ref name="g311" />
* '''Flush''' is defined per device; normally it clears internal registers, losing anything buffered such as type-ahead characters.
* Flush is defined for each device; normally it clears the device's internal registers, and any buffered user input, such as keyboard type-ahead, is lost.<ref name="g311" />
 
The commands with command code <code>01</code> are reserved by Apple for future expansion, and nothing should use them.<ref name="gmfh" />


=== Signals ===
=== Signals ===
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.<ref name="gmfh" />
Four signals are not addressed to any device. Attention, Sync and Global Reset always come from the computer; Service Request always comes from a device.<ref name="g313">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB signals", pp. 313-314. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
* Attention is a long low that starts every command. It is followed by a short high Sync pulse that sets the timing of the bits that follow.
* Global Reset: the computer resets every device by holding the bus low for at least 3.0 ms. If the bus stays low for 3.0 ms for any reason, all devices treat it as a Global Reset, release the bus and reset themselves.<ref name="g315" />
* Service Request: a device with data to send holds the bus low during the low part of the stop bit of a command or data transaction, lengthening the stop bit by at least 140 µs.<ref name="g313" />


* '''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.
If a command or data transaction is left incomplete and the bus stays high beyond the maximum bit-cell time, all devices ignore the command and wait for an Attention signal.<ref name="g315" />
* '''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.<ref name="gmfh" />


=== Transaction states ===
=== Transaction states ===
Two lines from the VIA to the transceiver, ST0 and ST1, define the transaction state:<ref name="gmfh" />
Two lines from the VIA, ST0 and ST1, set the transceiver's transaction state.<ref name="g310">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", Table 8-12, p. 310. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>


{| class="wikitable styled-table" style="width:65%;"
{| class="wikitable styled-table" style="width:65%;"
|+'''ADB transaction states''' (Apple Table 8-12)
|+'''ADB transaction states''' (Apple Table 8-12)<ref name="g310" />
! ST1 !! ST0 !! State
! ST1 !! ST0 !! State
|-
|-
Line 159: Line 148:
|}
|}


'''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.<ref name="gmfh" />
To send a command, the ADB Manager loads the command byte into the VIA's shift register and sets state 0, then alternates between states 1 and 2 to move each data byte. When the transfer is complete it sets state 0 for another command or state 3, idle. In state 3 the transceiver repeats the last Talk command every 11 ms, and state 3 is the default after startup or reset.<ref name="g310" />
 
== Device Registers ==
 
An ADB device may have up to four registers, each 2 to 8 bytes.<ref name="gmfh" />


* '''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.
== Device registers ==
* '''Register 1''' — device-specific; the device may use it for anything.
An ADB device may have up to four registers, numbered 0 to 3, each holding 2 to 8 bytes. Registers 0 and 3 are defined by Apple; registers 1 and 2 are device-dependent.<ref name="imd">Apple Computer, ''Inside Macintosh: Devices'', chapter 5, "ADB Manager", pp. 5-3 to 5-13. Hosted as [[:File:Inside Macintosh Devices Chapter 5 ADB Manager.pdf]].</ref><ref name="g317">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB device registers" and Table 8-15, pp. 316-318. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
* '''Register 2''' — device-specific. On Apple keyboards it carries modifier-key status (and, on the Extended Keyboard, the lock LEDs).
* Register 0 is the data register. When the ADB Manager looks for the device that sent 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.<ref name="g317" />
* '''Register 3''' — status and identification.
* Register 2 is device-specific; the Apple keyboards use it for modifier-key status, and the Apple Extended Keyboard also for its lock LEDs.<ref name="g317" />
* Register 3 holds status and identification.


{| class="wikitable styled-table" style="width:70%;"
{| class="wikitable styled-table" style="width:70%;"
|+'''Bits in device register 3''' (Apple Table 8-15)<ref name="gmfh" />
|+'''Bits in device register 3''' (Apple Table 8-15)<ref name="g317" />
! Bit !! Description
! Bit !! Description
|-
|-
Line 187: Line 173:
|}
|}


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.<ref name="gmfh" />
To stop a device sending Service Requests, clear 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 are needed by the application.<ref name="g321">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB collision detection", activator and "ADB polling protocol", pp. 321-322. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
 
== Addressing and Enumeration ==


== Addressing and enumeration ==
=== Default addresses ===
=== Default addresses ===
{| class="wikitable styled-table" style="width:70%;"
{| class="wikitable styled-table" style="width:70%;"
|+'''ADB device addresses''' (Apple Table 8-16)<ref name="gmfh" />
|+'''ADB device addresses''' (Apple Table 8-16)<ref name="g318">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", Table 8-16, p. 318. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
! Address !! Device type !! Example
! Address !! Device type !! Example
|-
|-
| $00–$01 || Reserved || —
| $00–$01 || Reserved ||
|-
|-
| $02 || Encoded devices || Keyboard
| $02 || Encoded devices || Keyboard
Line 204: Line 189:
| $04 || Absolute devices || Graphics tablet
| $04 || Absolute devices || Graphics tablet
|-
|-
| $05–$07 || Reserved || —
| $05–$07 || Reserved ||
|-
|-
| $08–$0F || Any other || —
| $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.
Eight addresses are predefined or reserved, leaving eight default addresses for other device types.<ref name="g318" />


=== Device Handler IDs ===
=== Device Handler IDs ===
The 8-bit Device Handler ID, together with the default address, is what the ADB Manager uses to decide which device driver to call.<ref name="adbmgr">''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; <code>CountADBs</code>, <code>GetIndADB</code>, <code>GetADBInfo</code>, <code>SetADBInfo</code>, <code>ADBOp</code> and <code>ADBReInit</code>; device handlers installed from <code>'ADBS'</code> resources; and the statement that the Apple Extended Keyboard has Device Handler ID $02 at default address $2.</ref> 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.
The ADB Manager uses the 8-bit Device Handler ID, together with the default address, to decide which device driver to call. A device with more than one functional mode changes mode when its driver writes a new Handler ID to register 3.<ref name="g319">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB Device Handler ID" and Table 8-17, pp. 319-320. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> This is how an Apple mouse is switched from 100 to 200 counts per inch,<ref name="g297">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Apple Standard Mouse", pp. 297-299. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> and how the Apple Extended Keyboard is made to send separate codes for its right-hand modifier keys.<ref name="g305">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Apple Extended Keyboard", pp. 305-306. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> The Apple Standard Keyboard has Device Handler ID 1 and the Apple Extended Keyboard ID 2.<ref name="imd" />


Apple reserves exactly '''four''' Handler ID values for special functions. Every other value must be assigned by Apple Computer, and unrecognised IDs are ignored:<ref name="gmfh" />
Apple reserves four values for special functions. A device acts on a reserved ID at once and does not store it in register 3, and unrecognised IDs are ignored.<ref name="g319" />


{| class="wikitable styled-table" style="width:90%;"
{| class="wikitable styled-table" style="width:90%;"
|+'''Device Handler IDs reserved for special functions''' (Apple Table 8-17)
|+'''Device Handler IDs reserved for special functions''' (Apple Table 8-17)<ref name="g319" />
! ID !! Function
! ID !! Function
|-
|-
| $FF || As Listen Register 3 data, initiates a self-test in the device
| $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'''
| $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'''
| $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 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'''
| $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 ===
=== Collision detection ===
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.<ref name="gmfh" />
Every ADB device must be able to detect collisions. A device that is trying to bring the bus high while another device holds it low, or that sees another device start sending before it asserts its start bit, has lost a collision: it stops transmitting, keeps the data it was sending and sets an internal collision flag. Because two devices on nearly identical clocks might not detect a collision, each device should assert its start bit at a random time within the stop-bit-to-start-bit window.<ref name="g320">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB collision detection", pp. 320-321. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
 
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.<ref name="gmfh" />


=== Enumeration ===
=== Enumeration ===
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.<ref name="gmfh" />
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 collision 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, and the device that did not detect a collision moves. This repeats until Talk Register 3 at that address times out; one device is then moved back to the default address and the Start Manager goes on to the next address.<ref name="g321" />


=== The activator ===
=== The activator ===
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'''.<ref name="gmfh" />
A device may have a key or button called an activator, for multi-user applications that need to identify individual devices. An application asks the user to press it, and the driver moves that device with a Listen Register 3 command carrying Handler ID $FD.<ref name="g321" />


=== Polling protocol ===
=== Polling ===
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.<ref name="gmfh" />
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 it every 11 ms. When another device sends a Service Request, the transceiver interrupts the VIA, which sets bit 3 of VIA Data register B to 0; the operating system hands control to the ADB Manager, which sends Talk Register 0 to each device until it finds the one requiring service. The last device to send data becomes the active device.<ref name="g321" />
 
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.<ref name="gmfh" />


== Hot-plugging ==
== Hot-plugging ==
Apple warns: 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 keeps trying to reach it at the address assigned at startup.<ref name="g287">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", p. 287. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> Apple's troubleshooting articles repeat the warning.<ref name="til18560">Apple Computer, Tech Info Library article 18560, "ADB Mouse: Sticking In The Down Position (9/95)". Hosted in [[:File:Apple Tech Info Library ADB keyboard and mouse articles.pdf]], PDF pp. 18-19.</ref>


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.<ref name="gmfh" />
== Apple's own ADB devices ==
 
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 ==
 
=== Apple Standard Mouse ===
=== Apple Standard Mouse ===
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.<ref name="gmfh" />
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 so that they produce two square waves 90° out of phase, the interrupt and quadrature signals; the quadrature signal leads the interrupt signal when the wheel turns one way and trails it when it turns the other. A microprocessor in the mouse counts the pulses and also acts as its ADB transceiver.<ref name="g297" />


{| class="wikitable styled-table" style="width:70%;"
{| class="wikitable styled-table" style="width:70%;"
|+'''ADB transceiver register 0 in the Apple Standard Mouse''' (Apple Table 8-4)<ref name="gmfh" />
|+'''ADB transceiver register 0 in the Apple Standard Mouse''' (Apple Table 8-4)<ref name="g297" />
! Bit !! Meaning
! Bit !! Meaning
|-
|-
| 15 || Button status; '''0 = down'''
| 15 || Button status; 0 = down
|-
|-
| 14–8 || '''Y''' move counts, two's complement. Negative = up, positive = down
| 14–8 || Y move counts, two's complement. Negative = up, positive = down
|-
|-
| 7 || '''Not used (always 1)'''
| 7 || Not used (always 1)
|-
|-
| 6–0 || '''X''' move counts, two's complement. Negative = left, positive = right
| 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.<ref name="gmfh" /> See [[Apple Desktop Bus Mouse]] for the device itself.
The Y count comes first; each count is 7-bit two's complement, so one report covers −64 to +63. At Device Handler ID $0001, the start-up setting, the mouse counts 100 ± 10 per inch; at $0002, 200 ± 10.<ref name="g297" /> See [[Apple Desktop Bus Mouse]] and [[Apple Desktop Bus Mouse II]].


=== Apple Standard Keyboard ===
=== Apple Standard Keyboard ===
{| class="wikitable styled-table" style="width:70%;"
{| class="wikitable styled-table" style="width:70%;"
|+'''Register 0 in the Apple Standard Keyboard''' (Apple Table 8-7)<ref name="gmfh" />
|+'''Register 0 in the Apple Standard Keyboard''' (Apple Table 8-7)<ref name="g303">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", Tables 8-7 and 8-8, p. 303. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
! Bit !! Meaning
! Bit !! Meaning
|-
|-
Line 289: Line 264:
|}
|}


'''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 0 holds the status of two keys at once.<ref name="g303" />


{| class="wikitable styled-table" style="width:60%;"
{| class="wikitable styled-table" style="width:60%;"
|+'''Register 2 in the Apple Standard Keyboard''' (Apple Table 8-8)<ref name="gmfh" />
|+'''Register 2 in the Apple Standard Keyboard''' (Apple Table 8-8)<ref name="g303" />
! Bit !! Key
! Bit !! Key
|-
|-
Line 314: Line 289:
|}
|}


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.
A 0 means the key is down. Register 2 on the Apple Standard Keyboard has no LED bits.<ref name="g303" />


=== Apple Extended Keyboard ===
=== Apple Extended Keyboard ===
The Extended Keyboard uses the same register-0 format and an extended register 2:<ref name="gmfh" />
The Extended Keyboard uses the same register 0 format and an extended register 2.<ref name="g305" />


{| class="wikitable styled-table" style="width:60%;"
{| class="wikitable styled-table" style="width:60%;"
|+'''Register 2 in the Apple Extended Keyboard''' (Apple Table 8-11)
|+'''Register 2 in the Apple Extended Keyboard''' (Apple Table 8-11)<ref name="g305" />
! Bit !! Meaning
! Bit !! Meaning
|-
|-
Line 352: Line 327:
|}
|}


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.<ref name="gmfh" />
A zero means a key is down or an LED is on. The LED bits are written with a Listen Register 2 command. Changing the Device Handler ID in register 3 from $0002 to $0003 makes the keyboard send separate codes for the right-hand Option and Control keys; Apple's key-code table also lists a separate right Shift code under the same setting.<ref name="g305" /> See [[Apple Extended Keyboard II]].
 
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.<ref name="gmfh" />


=== Macintosh Portable ===
=== Macintosh Portable ===
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.<ref name="gmfh" />
In the Portable the Power Manager IC acts as the ADB controller and a separate keyboard processor encodes the keyswitches.<ref name="g293">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Macintosh Portable ADB", p. 293. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> The keyboard is a matrix of 63 full-travel keyswitches with no active electronics.<ref name="g306">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Macintosh Portable low-power keyboard", p. 306. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref> Apple warns that any input device connected to the Portable's ADB must be a low-power version: keyboards and mice from other Macintosh models are not usable, and connecting them could cause an unacceptable drop in the +5 V supply and improper operation.<ref name="g301">Apple Computer, ''Guide to the Macintosh Family Hardware'', 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Macintosh Portable low-power trackball", p. 301. Hosted as [[:File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf]].</ref>
 
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".<ref name="gmfh" />


== Software ==
== Software ==
 
The ADB Manager is the part of the Operating System that talks to the bus; applications normally get keyboard and mouse input through the Event Manager.<ref name="imd" /> Its routines include CountADBs, which counts the entries in the ADB device table; GetIndADB and GetADBInfo, which return a device's entry by index or by address, including its original default address and handler ID; SetADBInfo, used by a device handler's installation code; ADBOp, which sends a command directly; and ADBReInit, which reinitialises the bus.<ref name="imd2">''Inside Macintosh: Devices'', chapter 5, "ADB Manager Reference". Hosted as [[:File:Inside Macintosh Devices Chapter 5 ADB Manager.pdf]].</ref> Device handlers are kept in 'ADBS' resources in the System file; at startup the Start Manager loads and runs them, reads register 3 in each device, and records each device's default address and Device Handler ID in the ADB device table.<ref name="g319" />
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.<ref name="adbmgr" />
 
Its published routines are:<ref name="adbmgr" />
* '''<code>CountADBs</code>''' — counts entries in the ADB device table.
* '''<code>GetIndADB</code>''' — returns information about a device by its index in the table.
* '''<code>GetADBInfo</code>''' — the same information, by address.
* '''<code>SetADBInfo</code>''' — used by a device handler's installation code to set its own entry.
* '''<code>ADBOp</code>''' — transmits a command byte directly. Always executed asynchronously; if the bus is busy the command is queued.
* '''<code>ADBReInit</code>''' — reinitialises the bus.
 
Device handlers live in <code>'ADBS'</code> 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.<ref name="adbmgr" /> Because <code>GetIndADB</code> and <code>GetADBInfo</code> 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 ==
== Troubleshooting ==
 
=== Nothing responds ===
=== Nothing enumerates ===
* Measure +5 V between pin 3 and pin 4 of the port with nothing connected.<ref name="g288" />
* '''Measure +5 V at pin 3 against pin 4''' at the port with nothing connected.
* Pin 1 should idle high through the 470 Ω pull-up on the logic board. If it sits at 0 V with nothing connected, the fault is on the computer; a bus held low for 3 ms or more resets every device.<ref name="g315" />
* '''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.
* Try each device on its own, directly on the computer.
* Check the ADB fuse on the logic board for the specific machine. Blowing it by hot-plugging is the classic cause.


=== Intermittent device ===
=== Intermittent device ===
* Check continuity of all four conductors end to end, flexing the cable at the strain relief as you go.
* Check all four conductors for continuity while flexing the cable at the strain relief.
* Shorten the chain. Apple recommends no more than three devices per port, and 5 m of cable total.
* Shorten the chain: no more than three devices per port and 5 m of cable, and a total draw under 500 mA.<ref name="g292" />
* Total bus draw must stay under 500 mA; a chain of powered accessories can exceed it.
* Do not reconnect devices with the computer running; restart after changing the chain.<ref name="g287" />
 
=== Device works alone but not in a chain ===
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 ===
=== With an oscilloscope ===
* Look for the '''800 µs Attention''' pulse followed by the '''65 µs Sync''' high.
* Look for the 800 µs Attention pulse followed by the 65 µs Sync pulse.<ref name="g315" />
* Look for the device answering within '''260 µs''' of a Talk command.
* Look for the device answering within 260 µs of a Talk command.<ref name="g311" />
* 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.
* When idle, the last Talk command repeats every 11 ms.<ref name="g310" /> If the host transmits and the device never answers, the fault is in the device.
 
== Adapters and Modern Use ==
 
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 ==


ADB and AppleTalk are different buses with different failure modes, and the wiki holds Apple's own
== Modern use ==
material on the AppleTalk side. Apple's '''Macintosh Office (AppleTalk) Technical Procedures''',
Converters from ADB to USB are the usual way to use these devices today. See the pages for each device for the details that matter to a converter, such as the extra devices on the [[Apple Adjustable Keyboard]].
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.<ref name="lwtp85">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]]).</ref>


For the programming side of AppleTalk rather than the wiring, see
== See also ==
[[Programming With AppleTalk 1991]]; it contains no electrical data.
 
== See Also ==
* [[Apple Desktop Bus Keyboard]]
* [[Apple Desktop Bus Keyboard]]
* [[Apple Desktop Bus Mouse]]
* [[Apple Desktop Bus Mouse]]
* [[Apple Desktop Bus Mouse II]]
* [[Apple Desktop Bus Mouse II]]
* [[Apple Extended Keyboard II]]
* [[Apple Extended Keyboard II]]
* [[Apple Design Keyboard]]
* [[Apple Adjustable Keyboard]]
* [[Apple IIGS]]
* [[Apple IIGS]]


== References ==
== References ==
<references />
<references />



Latest revision as of 13:33, 30 September 2026

Apple Desktop Bus
ADB connector (female socket)
Type Computer peripheral interface
Designer Apple Computer
Manufacturer Apple Computer
Production 1986-1999
Superseded USB
External Yes
Hot-pluggable No; Apple warns against it
Cable 4-conductor shielded, 5 m maximum
Pins 4
Connector 4-pin mini-DIN
Electrical Single data line, open collector, 470 Ω 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 about 10 kbit/s (100 µs bit cell)
Style Serial

The Apple Desktop Bus (ADB) is Apple's single-master, multislave serial bus for up to 16 low-speed input devices such as keyboards, mice and graphics tablets.[1] It was introduced on the Apple IIGS in 1986, whose keyboard had a second ADB port for daisy-chaining the mouse,[2] and it was used on every Macintosh from the Macintosh SE and Macintosh II onwards; the Macintosh Plus and earlier models do not have it.[3]

On most Macintosh models the bus hardware is an ADB transceiver IC, a 4-bit microcontroller that drives the bus and reads the status of the devices; the VIA, through which the CPU talks to the transceiver; and two 4-pin ADB connectors on the rear panel, connected in parallel. In the Macintosh Portable the Power Manager IC acts as the ADB transceiver, and in the Macintosh IIfx the transceiver functions are in the IOP custom IC.[1] When the bus is idle, the transceiver automatically polls the device that last sent data.[1]

Physical interface

[edit | edit source]

Connector

[edit | edit source]
ADB connector signal assignments[4]
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: a momentary ground to pin 4 from a key on the ADB keyboard, used only on the Macintosh II family.[4]

Electrical characteristics

[edit | edit source]
ADB transceiver electrical characteristics[3]
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 the power budget for the bus as a whole: ADB devices may use the +5 V supplied by the bus, but all the ADB devices together must not draw more than 500 mA.[5]

Cable and chain length

[edit | edit source]

Cables should be no longer than 5 m, and cable capacitance should not exceed 100 pF per metre. Although the transceiver can address up to 16 devices, Apple does not recommend daisy-chaining more than three devices on one ADB port, because of connector resistance and signal degradation.[5]

Protocol

[edit | edit source]

Bit cells

[edit | edit source]

Each command or data bit is sent 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 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 need not have a second falling edge. The time from the stop bit to the next start bit is critical, because the computer needs that turnaround time for internal overhead.[6]

ADB timing specifications (Apple Table 8-14)[6]
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

The 100 µs bit cell gives a raw rate of about 10 kbit/s.

Transactions

[edit | edit source]

A transaction is a command sent by the computer followed by a data packet sent by the computer or the device. A command is an Attention signal, a Sync signal, one command byte and one stop bit; a data packet is a start bit, two to eight 8-bit data bytes and a stop bit.[7]

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: Talk, Listen, SendReset and Flush.[8]

ADB command byte syntax (Apple Table 8-13)[8]
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 addressed device must respond with data within 260 µs; a device must always answer Talk Register 3.[8]
  • Listen writes a register.
  • SendReset returns every device on the bus to its power-on state; each device clears its pending service requests.[8]
  • Flush is defined for each device; normally it clears the device's internal registers, and any buffered user input, such as keyboard type-ahead, is lost.[8]

Signals

[edit | edit source]

Four signals are not addressed to any device. Attention, Sync and Global Reset always come from the computer; Service Request always comes from a device.[9]

  • Attention is a long low that starts every command. It is followed by a short high Sync pulse that sets the timing of the bits that follow.
  • Global Reset: the computer resets every device by holding the bus low for at least 3.0 ms. If the bus stays low for 3.0 ms for any reason, all devices treat it as a Global Reset, release the bus and reset themselves.[6]
  • Service Request: a device with data to send holds the bus low during the low part of the stop bit of a command or data transaction, lengthening the stop bit by at least 140 µs.[9]

If a command or data transaction is left incomplete and the bus stays high beyond the maximum bit-cell time, all devices ignore the command and wait for an Attention signal.[6]

Transaction states

[edit | edit source]

Two lines from the VIA, ST0 and ST1, set the transceiver's transaction state.[10]

ADB transaction states (Apple Table 8-12)[10]
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

To send a command, the ADB Manager loads the command byte into the VIA's shift register and sets state 0, then alternates between states 1 and 2 to move each data byte. When the transfer is complete it sets state 0 for another command or state 3, idle. In state 3 the transceiver repeats the last Talk command every 11 ms, and state 3 is the default after startup or reset.[10]

Device registers

[edit | edit source]

An ADB device may have up to four registers, numbered 0 to 3, each holding 2 to 8 bytes. Registers 0 and 3 are defined by Apple; registers 1 and 2 are device-dependent.[11][12]

  • Register 0 is the data register. When the ADB Manager looks for the device that sent 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.[12]
  • Register 2 is device-specific; the Apple keyboards use it for modifier-key status, and the Apple Extended Keyboard also for its lock LEDs.[12]
  • Register 3 holds status and identification.
Bits in device register 3 (Apple Table 8-15)[12]
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

To stop a device sending Service Requests, clear 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 are needed by the application.[13]

Addressing and enumeration

[edit | edit source]

Default addresses

[edit | edit source]
ADB device addresses (Apple Table 8-16)[14]
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 default addresses for other device types.[14]

Device Handler IDs

[edit | edit source]

The ADB Manager uses the 8-bit Device Handler ID, together with the default address, to decide which device driver to call. A device with more than one functional mode changes mode when its driver writes a new Handler ID to register 3.[15] This is how an Apple mouse is switched from 100 to 200 counts per inch,[16] and how the Apple Extended Keyboard is made to send separate codes for its right-hand modifier keys.[17] The Apple Standard Keyboard has Device Handler ID 1 and the Apple Extended Keyboard ID 2.[11]

Apple reserves four values for special functions. A device acts on a reserved ID at once and does not store it in register 3, and unrecognised IDs are ignored.[15]

Device Handler IDs reserved for special functions (Apple Table 8-17)[15]
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

Collision detection

[edit | edit source]

Every ADB device must be able to detect collisions. A device that is trying to bring the bus high while another device holds it low, or that sees another device start sending before it asserts its start bit, has lost a collision: it stops transmitting, keeps the data it was sending and sets an internal collision flag. Because two devices on nearly identical clocks might not detect a collision, each device should assert its start bit at a random time within the stop-bit-to-start-bit window.[18]

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 collision 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, and the device that did not detect a collision moves. This repeats until Talk Register 3 at that address times out; one device is then moved back to the default address and the Start Manager goes on to the next address.[13]

The activator

[edit | edit source]

A device may have a key or button called an activator, for multi-user applications that need to identify individual devices. An application asks the user to press it, and the driver moves that device with a Listen Register 3 command carrying Handler ID $FD.[13]

Polling

[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 it every 11 ms. When another device sends a Service Request, the transceiver interrupts the VIA, which sets bit 3 of VIA Data register B to 0; the operating system hands control to the ADB Manager, which sends Talk Register 0 to each device until it finds the one requiring service. The last device to send data becomes the active device.[13]

Hot-plugging

[edit | edit source]

Apple warns: 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 keeps trying to reach it at the address assigned at startup.[19] Apple's troubleshooting articles repeat the warning.[20]

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 so that they produce two square waves 90° out of phase, the interrupt and quadrature signals; the quadrature signal leads the interrupt signal when the wheel turns one way and trails it when it turns the other. A microprocessor in the mouse counts the pulses and also acts as its ADB transceiver.[16]

ADB transceiver register 0 in the Apple Standard Mouse (Apple Table 8-4)[16]
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 Y count comes first; each count is 7-bit two's complement, so one report covers −64 to +63. At Device Handler ID $0001, the start-up setting, the mouse counts 100 ± 10 per inch; at $0002, 200 ± 10.[16] See Apple Desktop Bus Mouse and Apple Desktop Bus Mouse II.

Apple Standard Keyboard

[edit | edit source]
Register 0 in the Apple Standard Keyboard (Apple Table 8-7)[21]
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

Register 0 holds the status of two keys at once.[21]

Register 2 in the Apple Standard Keyboard (Apple Table 8-8)[21]
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 means the key is down. Register 2 on the Apple Standard Keyboard has no LED bits.[21]

Apple Extended Keyboard

[edit | edit source]

The Extended Keyboard uses the same register 0 format and an extended register 2.[17]

Register 2 in the Apple Extended Keyboard (Apple Table 8-11)[17]
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 means a key is down or an LED is on. The LED bits are written with a Listen Register 2 command. Changing the Device Handler ID in register 3 from $0002 to $0003 makes the keyboard send separate codes for the right-hand Option and Control keys; Apple's key-code table also lists a separate right Shift code under the same setting.[17] See Apple Extended Keyboard II.

Macintosh Portable

[edit | edit source]

In the Portable the Power Manager IC acts as the ADB controller and a separate keyboard processor encodes the keyswitches.[22] The keyboard is a matrix of 63 full-travel keyswitches with no active electronics.[23] Apple warns that any input device connected to the Portable's ADB must be a low-power version: keyboards and mice from other Macintosh models are not usable, and connecting them could cause an unacceptable drop in the +5 V supply and improper operation.[24]

Software

[edit | edit source]

The ADB Manager is the part of the Operating System that talks to the bus; applications normally get keyboard and mouse input through the Event Manager.[11] Its routines include CountADBs, which counts the entries in the ADB device table; GetIndADB and GetADBInfo, which return a device's entry by index or by address, including its original default address and handler ID; SetADBInfo, used by a device handler's installation code; ADBOp, which sends a command directly; and ADBReInit, which reinitialises the bus.[25] Device handlers are kept in 'ADBS' resources in the System file; at startup the Start Manager loads and runs them, reads register 3 in each device, and records each device's default address and Device Handler ID in the ADB device table.[15]

Troubleshooting

[edit | edit source]

Nothing responds

[edit | edit source]
  • Measure +5 V between pin 3 and pin 4 of the port with nothing connected.[4]
  • Pin 1 should idle high through the 470 Ω pull-up on the logic board. If it sits at 0 V with nothing connected, the fault is on the computer; a bus held low for 3 ms or more resets every device.[6]
  • Try each device on its own, directly on the computer.

Intermittent device

[edit | edit source]
  • Check all four conductors for continuity while flexing the cable at the strain relief.
  • Shorten the chain: no more than three devices per port and 5 m of cable, and a total draw under 500 mA.[5]
  • Do not reconnect devices with the computer running; restart after changing the chain.[19]

With an oscilloscope

[edit | edit source]
  • Look for the 800 µs Attention pulse followed by the 65 µs Sync pulse.[6]
  • Look for the device answering within 260 µs of a Talk command.[8]
  • When idle, the last Talk command repeats every 11 ms.[10] If the host transmits and the device never answers, the fault is in the device.

Modern use

[edit | edit source]

Converters from ADB to USB are the usual way to use these devices today. See the pages for each device for the details that matter to a converter, such as the extra devices on the Apple Adjustable Keyboard.

See also

[edit | edit source]

References

[edit | edit source]
  1. ↑ 1.0 1.1 1.2 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", Overview, pp. 285-286. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  2. ↑ Deskthority wiki, "Apple Desktop Bus Keyboard". Retrieved 2026-09-30.
  3. ↑ 3.0 3.1 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", ADB interface circuits, p. 289. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  4. ↑ 4.0 4.1 4.2 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", Table 8-1, p. 288. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  5. ↑ 5.0 5.1 5.2 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", p. 292. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  6. ↑ 6.0 6.1 6.2 6.3 6.4 6.5 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB timing" and Table 8-14, pp. 315-316. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  7. ↑ Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB communications", p. 309. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  8. ↑ 8.0 8.1 8.2 8.3 8.4 8.5 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB commands" and Table 8-13, pp. 311-312. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  9. ↑ 9.0 9.1 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB signals", pp. 313-314. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  10. ↑ 10.0 10.1 10.2 10.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", Table 8-12, p. 310. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  11. ↑ 11.0 11.1 11.2 Apple Computer, Inside Macintosh: Devices, chapter 5, "ADB Manager", pp. 5-3 to 5-13. Hosted as File:Inside Macintosh Devices Chapter 5 ADB Manager.pdf.
  12. ↑ 12.0 12.1 12.2 12.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB device registers" and Table 8-15, pp. 316-318. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  13. ↑ 13.0 13.1 13.2 13.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB collision detection", activator and "ADB polling protocol", pp. 321-322. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  14. ↑ 14.0 14.1 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", Table 8-16, p. 318. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  15. ↑ 15.0 15.1 15.2 15.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB Device Handler ID" and Table 8-17, pp. 319-320. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  16. ↑ 16.0 16.1 16.2 16.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Apple Standard Mouse", pp. 297-299. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  17. ↑ 17.0 17.1 17.2 17.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Apple Extended Keyboard", pp. 305-306. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  18. ↑ Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "ADB collision detection", pp. 320-321. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  19. ↑ 19.0 19.1 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", p. 287. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  20. ↑ Apple Computer, Tech Info Library article 18560, "ADB Mouse: Sticking In The Down Position (9/95)". Hosted in File:Apple Tech Info Library ADB keyboard and mouse articles.pdf, PDF pp. 18-19.
  21. ↑ 21.0 21.1 21.2 21.3 Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", Tables 8-7 and 8-8, p. 303. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  22. ↑ Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Macintosh Portable ADB", p. 293. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  23. ↑ Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Macintosh Portable low-power keyboard", p. 306. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  24. ↑ Apple Computer, Guide to the Macintosh Family Hardware, 2nd edition (1990), chapter 8, "Apple Desktop Bus", "Macintosh Portable low-power trackball", p. 301. Hosted as File:Apple Guide to the Macintosh Family Hardware 2nd Edition 1990.pdf.
  25. ↑ Inside Macintosh: Devices, chapter 5, "ADB Manager Reference". Hosted as File:Inside Macintosh Devices Chapter 5 ADB Manager.pdf.