Jump to content

Apple Desktop Bus

From RetroTechCollection
Revision as of 14:25, 6 September 2025 by Josh (talk | contribs)
Apple Desktop Bus
ADB connector (female socket)
Type Computer peripheral interface
Designer Steve Wozniak
Design date 1985-1986
Manufacturer Apple Computer
Production 1986-1999
Superseded USB
External Yes
Hot-pluggable Technically capable but not recommended
Cable 4-conductor shielded
Pins 4
Connector Mini-DIN 4 (same as S-Video)
Electrical Single data line, open collector
Maximum devices 16
Protocol Serial, self-clocking
Data signal Bidirectional serial
Data rate 10-125 kbit/s
Style Serial

Apple Desktop Bus (ADB) is a proprietary bit-serial peripheral bus connecting low-speed input devices to computers. Designed by Steve Wozniak and introduced on the Apple IIGS in September 1986, ADB was created to provide a simple, low-cost method for connecting keyboards, mice, and other input devices in a daisy-chain configuration without requiring hubs. The technology was quickly adopted for the Macintosh line beginning with the Macintosh SE and Macintosh II in March 1987, and remained Apple's standard peripheral interface until its replacement by USB in 1998-1999.

History and Development

Origins

During the early development of the Macintosh in the 1980s, Apple engineers had selected the sophisticated Zilog 8530 for serial communications. However, this solution was expensive and complex for simple input devices. Steve Wozniak, working on the Apple IIGS project in 1985-1986, developed ADB as a simpler, more cost-effective alternative that could support multiple devices on a single bus.

The design philosophy emphasized simplicity and low cost while maintaining reliability. Wozniak's solution used a single data line with self-clocking signals, eliminating the need for separate clock lines and reducing component count. The protocol was sophisticated enough to support device enumeration, collision detection, and service requests, yet simple enough to implement with minimal hardware.

Implementation Timeline

  • September 1986: First implementation in Apple IIGS
  • March 1987: Adopted by Macintosh SE and Macintosh II
  • 1987-1998: Standard on all desktop Macintosh computers
  • 1991-1998: Used in PowerBook line
  • 1989-1996: Implemented in some NeXT computer models
  • 1998: Phased out with introduction of iMac G3 (USB-based)
  • 1999: Last external ADB port on Power Macintosh G3 (Blue and White)
  • 2000-2005: Internal ADB protocol continued in some PowerBooks for built-in keyboards/trackpads

Technical Specifications

Physical Interface

ADB Connector Pinout (Mini-DIN 4)
Pin Signal Description Specifications
1 ADB Data Bidirectional serial data Open collector, 5V pull-up
2 PSW Power switch Direct connection to power supply
3 +5V Power supply 500mA total, 100mA per device max
4 GND Ground reference Common ground

The connector is physically identical to the 4-pin mini-DIN used for S-Video, leading to potential confusion. However, pins 1 and 2 are bridged in some S-Video cables, which can cause catastrophic damage if used with ADB devices.

Electrical Characteristics

  • Bus topology: Multi-drop, daisy-chain capable
  • Signal type: Open collector with 5V pull-up resistors
  • Logic levels: TTL compatible (0V = low, 5V = high)
  • Cable length: Maximum 5 meters total bus length
  • Power distribution: 500mA at 5V total available
  • Device power limit: 100mA per device maximum

Protocol Specifications

Bit Encoding

ADB uses self-clocking duty-cycle modulation where each bit period is 100μs:

  • Logic 0: 65μs low, 35μs high
  • Logic 1: 35μs low, 65μs high
  • Start bit: Always logic 1
  • Stop bit: Always logic 0

Transaction Structure

Each ADB transaction consists of:

  1. Attention signal: Host pulls bus low for 800μs
  2. Sync signal: Bus high for 70μs
  3. Command byte: 8 bits transmitted by host
  4. Stop bit: Logic 0
  5. Service Request window: 65-300μs (device can assert SRQ)
  6. Stop-to-start time (Tlt): 140-260μs bus high
  7. Data transfer: 2-8 bytes (if applicable)

Command Format

Commands are 8 bits structured as:

  • Bits 7-4: Device address (0-15)
  • Bits 3-2: Command type
  • Bits 1-0: Register number
ADB Command Types
Command Binary Description Action
SendReset 00 System reset All devices reset to default state
Flush 01 Flush device Clear device buffer for specified register
Reserved 10 Reserved Not used
Reserved 11 Reserved Not used
Listen 10 Write to device Host sends data to device register
Talk 11 Read from device Device sends register contents to host

Device Registers

Each ADB device implements four registers:

Standard ADB Register Definitions
Register Purpose Size Description
0 Device data 2-8 bytes Primary data (keyboard keys, mouse movement)
1 Device-specific Variable Extended features or configuration
2 Device-specific Variable Additional features (e.g., keyboard LEDs)
3 Status/Command 2 bytes Device ID, address, and handler ID

Register 3 Format

Register 3 contains device identification and configuration:

  • Bits 15-8: Exceptional event flags (device-specific)
  • Bits 7-0: Device handler ID
  • Bits 11-8: Device address (when read)
  • Service Request Enable: Bit 13

Device Addressing and Enumeration

Default Addresses

ADB Default Device Addresses
Address Device Type Notes
$0 Reserved SendReset command
$1 Security dongles Copy protection devices
$2 Keyboards All keyboards default to this
$3 Mice/Pointing devices Mice, trackballs, trackpads
$4 Graphics tablets Absolute positioning devices
$5 Reserved Vendor-specific
$6 Reserved Vendor-specific
$7 Reserved Vendor-specific
$8-$E Relocated devices Collision resolution addresses
$F Reserved Global polling address

Enumeration Process

The ADB Manager performs device enumeration at startup:

  1. Reset: SendReset command clears all devices
  2. Discovery: Poll each default address with Talk Register 3
  3. Collision Detection: If multiple devices respond:
    • Devices detecting collision stop transmitting
    • Non-colliding device completes transmission
  4. Address Resolution:
    • Send Listen Register 3 with new address ($8-$E) and handler ID $FE
    • Only non-colliding device moves to new address
    • Repeat until all devices have unique addresses
  5. Verification:: Poll new addresses to confirm relocation
  6. Handler Installation:: Install appropriate device drivers

Service Requests

Devices can request service by:

  1. Pulling bus low during stop bit of any transaction (65-300μs)
  2. Host detects extended stop bit as Service Request (SRQ)
  3. Host polls all devices' Register 0 sequentially
  4. Device with data becomes new active device
  5. Active device is polled continuously until another SRQ

Device Handler IDs

Device handlers define how the host interprets device data. Standard handler IDs include:

Common ADB Handler IDs
Handler ID Device Type Description
$00 Self-test fail Device failed internal diagnostics
$01 Standard mouse 100 CPI relative positioning
$02 Standard keyboard Original keyboard protocol
$03 Extended keyboard Supports extended key codes
$04 ISO keyboard International layout support
$05-$07 Reserved keyboards Vendor-specific
$08-$0F Reserved mice Vendor-specific
$10-$1F Graphics tablets Absolute positioning devices
$20-$2F Other devices Joysticks, special controllers
$30-$FD Vendor-specific Custom implementations
$FE Change address Special collision resolution
$FF Self-test pass Device diagnostics successful

Hardware Implementation

Host Controllers

Different Apple systems used various ADB controller implementations:

ADB Controller Implementations
System Controller Type Implementation Details
Apple IIGS Custom ASIC Integrated with Mega II chip
Macintosh SE PIC16CR54 Microchip microcontroller (Apple-branded)
Macintosh II/IIx VIA + transceiver 6522 VIA with discrete transceiver
Macintosh IIfx IOP processor Dedicated I/O processor
Macintosh Portable Power Manager Integrated with PMU chip
PowerBook series PMU Power Management Unit integration
Later Macs Cuda/Egret Combined ADB and power management

VIA Implementation

On most 68k Macintoshes, ADB was implemented using:

  • VIA (Versatile Interface Adapter): 6522 chip for CPU interface
  • Transceiver IC: Handles bus electrical interface
  • State lines (ST0, ST1): Define transaction states

Transaction states:

  • State 0: Even byte from application
  • State 1:: Odd byte from application
  • State 2:: Even byte to application
  • State 3:: Odd byte to application

Standard Devices

Keyboards

ADB keyboards implemented two protocols:

Standard Keyboard Protocol:

  • Register 0: Two key events (2 bytes)
  • Each byte: Key code (7 bits) + up/down flag (1 bit)
  • Rollover: 2-key guaranteed

Extended Keyboard Protocol:

  • Distinguishes left/right modifiers
  • Handler ID change from $02 to $03
  • Additional key codes for extended keys
  • Used by Apple Extended Keyboard and later models

Mice and Pointing Devices

Standard Mouse Protocol:

  • Register 0: Button state and movement deltas (2 bytes)
  • Byte 0: Button (bit 7) + X delta (bits 6-0)
  • Byte 1: Button (bit 7) + Y delta (bits 6-0)
  • Resolution: 100 counts per inch typical
  • Movement range: -64 to +63 per packet

Extended Mouse Protocol:

  • Supports multiple buttons
  • Higher precision movement data
  • Additional registers for extended features
  • Handler ID varies by capability

Graphics Tablets

Graphics tablets could operate in two modes:

  • Relative mode:: Emulates standard mouse
  • Absolute mode:: Reports absolute position
  • Required vendor-specific drivers
  • No standard protocol defined by Apple

Limitations and Issues

Hot-Swapping

While ADB protocol supports hot-swapping, most implementations were unsafe:

  • Problem:: No current limiting on ADB ports
  • Risk:: Hot-swapping could blow motherboard fuse (typically 1.1A polyfuse)
  • Exceptions:: PowerBook G3 "Wall Street" had protected ports
  • Repair:: Required fuse replacement or expensive motherboard swap

Collision Issues

  • Multiple identical devices caused address collisions
  • Resolution process could fail with >3 identical devices
  • Some devices had non-random address generation

Performance Limitations

  • Bandwidth:: Limited to 125 kbit/s theoretical (10-50 kbit/s typical)
  • Latency:: Polling-based system introduced input lag
  • Device limit:: 16 devices maximum, practically fewer
  • Cable length:: 5 meters total maximum

Power Limitations

  • Total power:: 500mA at 5V for entire bus
  • Per device:: 100mA maximum
  • PowerBooks:: Reduced to 200mA total on battery

Software Support

ADB Manager

The ADB Manager in Mac OS handled:

  • Device enumeration and address assignment
  • Polling active devices
  • Service request handling
  • Device handler installation and management
  • Register read/write operations

Key ADB Manager routines:

  • ADBOp: Perform ADB transaction
  • ADBReset:: Reset bus and enumerate devices
  • SetADBInfo:: Install device handler
  • GetADBInfo:: Query device information
  • CountADBs:: Return number of devices

System Software Compatibility

  • Apple IIGS:: GS/OS with built-in ADB support
  • Mac OS:: System 3.2 through Mac OS 9.2.2
  • A/UX:: Full ADB support in Unix environment
  • NeXT:: Limited support on some models
  • BeOS:: Third-party drivers available
  • Linux:: Kernel support for PowerPC Macs

Modern Usage and Adapters

ADB to USB Adapters

  • Griffin iMate:: Original commercial adapter (discontinued)
  • Wombat:: Modern bidirectional ADB-USB converter
  • Belkin F5U118:: Simple ADB to USB adapter

USB to ADB Adapters

  • Wombat:: Allows USB devices on ADB Macs
  • DIY solutions:: Arduino-based converters

Replacement Controllers

  • PIC16F87/88:: Drop-in replacement for failed SE controllers
  • Custom ASICs:: Modern reproductions for restoration

Legacy and Impact

ADB represented several important innovations:

  • First successful hot-pluggable peripheral bus (though implementation issues limited this)
  • Automatic device enumeration and configuration predating USB
  • Low-cost implementation enabling affordable peripherals
  • Power distribution through the peripheral bus
  • Collision detection and resolution without user intervention

The protocol influenced later designs:

  • USB adopted similar enumeration concepts
  • NeXT used ADB on some models
  • Protocol concepts influenced FireWire development
  • Demonstrated viability of serial peripheral buses

Technical Documentation

Patents

Key Apple patents related to ADB:

  • 4,875,158 - Method for requesting service by a device
  • 4,910,655 - Apparatus for transferring signals and data
  • 4,912,627 - Method for storing information
  • 4,918,598 - Method for selectively activating and deactivating devices

Developer Resources

  • Inside Macintosh: Devices - Complete ADB programming guide
  • Technical Note HW01 - "ADB - The Untold Story: Space Aliens Ate My Mouse"
  • Guide to Macintosh Family Hardware - Hardware specifications

Common ADB Devices

Apple Devices

Third-Party Devices

  • Kensington TurboMouse trackballs
  • Gravis GamePad and MouseStick
  • Wacom ArtZ graphics tablets
  • CalComp DrawingBoard tablets
  • CoStar LabelWriter printers
  • Hardware copy-protection dongles
  • Modems and telecommunications devices

Troubleshooting

Common Problems

ADB Troubleshooting Guide
Problem Possible Cause Solution
No devices recognized Blown ADB fuse Replace fuse or motherboard repair
Intermittent device Damaged cable Check continuity, replace if needed
Device not found Address collision Disconnect other devices, restart
Erratic behavior Bus termination issue Check cable length (<5m total)
Power issues Overloaded bus Remove devices, check power draw
Random disconnects Failing transceiver Replace ADB controller

Diagnostic Tools

  • ADB Parser:: Classic Mac OS tool for bus analysis
  • TechTool:: Hardware diagnostic suite
  • MacsBug:: Low-level debugging access to ADB