]> git.gir.st - tmk_keyboard.git/blob - ADB.txt
ADB to USB keyboard converter
[tmk_keyboard.git] / ADB.txt
1 ADB Protocol
2 ============
3
4 Resources
5 ---------
6 Apple IIgs Hardware Reference Second Edition [p80(Chapter6 p121)]
7 ftp://ftp.apple.asimov.net/pub/apple_II/documentation/Apple%20IIgs%20Hardware%20Reference.pdf
8 ADB Keycode
9 http://72.0.193.250/Documentation/macppc/adbkeycodes/
10 http://m0115.web.fc2.com/m0115.jpg
11 ADB Signaling
12 http://kbdbabel.sourceforge.net/doc/kbd_signaling_pcxt_ps2_adb.pdf
13 ADB Overview & History
14 http://en.wikipedia.org/wiki/Apple_Desktop_Bus
15 Microchip Application Note: ADB device(with code for PIC16C)
16 http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011062
17 AVR ATtiny2131 ADB to PS/2 converter(Japanese)
18 http://hp.vector.co.jp/authors/VA000177/html/KeyBoardA5DEA5CBA5A2II.html
19
20
21 Pinouts
22 -------
23 Female socket from the front
24
25 4o o3
26 2o o1
27 ==
28
29 1: Data
30 2: Power SW(low when press Power key)
31 3: Vcc(5V)
32 4: GND
33
34
35 Commands
36 --------
37 ADB command is 1byte and consists of 4bit-address, 2bit-command
38 type and 2bit-register. The commands are always sent by Host.
39
40 Command format:
41 7 6 5 4 3 2 1 0
42 | | | |------------ address
43 | |-------- command type
44 | |---- register
45
46 bits commands
47 ------------------------------------------------------
48 - - - - 0 0 0 0 Send Request(reset all devices)
49 A A A A 0 0 0 1 Flush(reset a device)
50 - - - - 0 0 1 0 Reserved
51 - - - - 0 0 1 1 Reserved
52 - - - - 0 1 - - Reserved
53 A A A A 1 0 R R Listen(write to a device)
54 A A A A 1 1 R R Talk(read from a device)
55
56 The command to read keycodes from keyboard is 0x2C which
57 consist of keyboard address 2 and Talk against register 0.
58
59 Address:
60 2: keyboard
61 3: mice
62
63 Registers:
64 0: application(keyobard/mice use to store its data.)
65 1: application
66 2: application
67 3: status and command
68
69
70 Communication
71 -------------
72 This is a minimum information for keyboard communication.
73 See "Resources" for detail.
74
75 Signaling:
76
77 ~~~~____________~~||||||||||||__~~~~~_~~|||||||||||||||__~~~~
78
79 |800us | |7 Command 0| | | |15-64 Data 0|Stopbit(0)
80 +Attention | | | +Startbit(1)
81 +Startbit(1) | +Tlt(140-260us)
82 +stopbit(0)
83
84 Bit cells:
85
86 bit0: ______~~~
87 65 :35us
88
89 bit1: ___~~~~~~
90 35 :65us
91
92 bit0 low time: 60-70% of bit cell(42-91us)
93 bit1 low time: 30-40% of bit cell(21-52us)
94 bit cell time: 70-130us
95 [from Apple IIgs Hardware Reference Second Edition]
96
97 Criterion for bit0/1:
98 After 55us if line is low/high then bit is 0/1.
99
100 Attention & start bit:
101 Host asserts low in 560-1040us then places start bit(1).
102
103 Tlt(Stop to Start):
104 Bus stays high in 140-260us then device places start bit(1).
105
106 Global reset:
107 Host asserts low in 2.8-5.2ms. All devices are forced to reset.
108
109 Send request from device(Srq):
110 Device can request to send at commad(Global only?) stop bit.
111 keep low for 300us to request.
112
113
114 Keyboard data(register0)
115 This 16bit data can contains 2 keycodes and 2 released flags.
116 First keycode is palced in upper nibble. When one keyocode is sent,
117 lower nibble is 0xFF.
118 Release flag is 1 when key is released.
119
120 15 14 . . . . . 8 7 6 . . . . . 0
121 | |keycode1 | |keycode2
122 |released(1) |released(1)
123
124 Keycodes:
125 Scancode consists of 7bit keycode and 1bit release flag.
126 Device can send two keycodes at once. If just one keycode is sent
127 keycode1 contains it and keyocode2 is 0xFF.
128
129 Power switch:
130 You can read the state from PSW line(active low) however
131 the switch has a special scancode 0x7F7F, so you can
132 also read from Data line. It uses 0xFFFF for release scancode.
133
134 END_OF_ADB
Imprint / Impressum