]> git.gir.st - tmk_keyboard.git/blob - converter/ibm4704_usb/ibm4704.txt
core: Swap position of PEQL and PENT in unimap
[tmk_keyboard.git] / converter / ibm4704_usb / ibm4704.txt
1 IBM 4704 Keyboard
2 =================
3 IBM capacitive switch models:
4 6019273 Model 100 50-key (grid layout) http://kishy.ca/?p=894
5 6019284 Model 200 62-key Alpha(60% layout) http://kishy.ca/?p=894
6 6019303 Model 300 77-key Expanded Alpha http://deskthority.net/photos-f62/ibm-6019303-t8502.html
7 6020218 Model 400 107-key Full key http://kishy.ca/?p=894
8
9 Alps switch(vintage Green) models:
10 5954339 Japanese 102-key http://deskthority.net/post87127.html#p87127
11 6112883 Japanese 102-key http://geekhack.org/index.php?topic=52888.msg1194489#msg1194489
12 6112884 Japanese 102-key http://geekhack.org/index.php?topic=50437.msg1193047#msg1193047
13 6341739 Chinese 102-key http://geekhack.org/index.php?topic=52888.msg1176566#msg1176566
14
15 Resourse
16 --------
17 The IBM 4704: lots of pictures and info
18 http://kishy.dyndns.org/?p=648#more-648
19
20 Brochure:
21 http://ed-thelen.org/comp-hist/IBM-ProdAnn/4700.pdf
22
23
24
25 IBM 4704 Keyboard Protocol
26 ==========================
27 On powering up keyboard sends keyboard ID; A3h for 6019284(62-key), for example.
28 After that the keyboard enters FC command mode and waits for parameter data from host
29 so that it doesn't send any scancode until you send 'FF'(End of FC command mode).
30
31 Keyboard ID
32 -------------------------------
33 Model 100 50-key A2h
34 Model 200 62-key A3h
35 Model 300 77-key A4h
36 Model 400 107-key A5h
37 Japanese/Chinese 102-key A6h
38
39
40 Connector
41 ---------
42 Keyboard Plug from front
43
44 DSUB-9
45 -------------
46 \ N 2 3 4 5 /
47 \ N N N N /
48 ---------
49 2 GND
50 3 VCC 5V
51 4 DATA
52 5 CLOCK
53 N No connection/No pin.
54
55
56 Keyboard to Host
57 ----------------
58 Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part.
59
60 ____ __ __ __ __ __ __ __ __ __ _______
61 Clock \_____/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
62 ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
63 Data ____/ X____X____X____X____X____X____X____X____X____X________
64 Start 0 1 2 3 4 5 6 7 P Stop
65
66 Start bit: can be long as 300-350us.
67 Inhibit: Pull Data line down to inhibit keyboard to send.
68 Timing: Host reads bit while Clock is hi.(rising edge)
69 Stop bit: Keyboard pulls down Data line to lo after 9th clock.
70
71
72 Host to Keyboard
73 ----------------
74 Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part.
75
76 ____ __ __ __ __ __ __ __ __ __ ________
77 Clock \______/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
78 ^ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ___
79 Data ____|__/ X____X____X____X____X____X____X____X____X____X \___
80 | Start 0 1 2 3 4 5 6 7 P Stop
81 Request by host
82
83 Start bit: can be long as 300-350us.
84 Request: Host pulls Clock line down to request to send a command.
85 Timing: After Request keyboard pull up Data and down Clock line to low for start bit.
86 After request host release Clock line once Data line becomes hi.
87 Host wirtes a bit while Clock is hi and Keyboard reads while low.
88 Stop bit: Host releases or pulls up Data line to hi after 9th clock and waits for keybaord pull down the line to lo.
89
90
91 Scancodes
92 ---------
93 Keyboard doesn't send Break code for all keys except for Alt by default.
94
95 6019284 62-key:
96 ,-----------------------------------------------------------.
97 | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|???|BS |
98 |-----------------------------------------------------------|
99 |Tab | Q| W| E| R| T| Y| U| I| O| P| ¢| \| PD2|
100 |-----------------------------------------------------------|
101 |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| {}| PD3|
102 |-----------------------------------------------------------|
103 |Shif| <>| Z| X| C| V| B| N| M| ,| ,| /|???|Shift |
104 |-----------------------------------------------------------|
105 |Reset|blk|Alt | Space |Alt |blk|Enter|
106 `-----------------------------------------------------------'
107 +----------+---------------------+----------+----------+
108 |` 00|PD1 04|Caps 20|LShift 30|Reset 31|
109 |1 18|q 05|a 21|<> 3E|Rblank 41|
110 |2 19|w 06|s 22|z 32|Alt 3F|
111 |3 1A|e 13|d 23|x 33|Space 40|
112 |4 10|r 14|f 24|c 34|Alt 3F|
113 |5 11|t 15|g 25|v 35|Lblank 42|
114 |6 12|y 16|h 26|b 36|Enter 2F|
115 |7 08|u 17|j 27|n 37| |
116 |8 09|i 01|k 28|m 38| |
117 |9 0A|o 02|l 29|, 39| |
118 |0 0F|p 03|; 2A|. 3A| |
119 |- 1F|¢ 1B|' 2B|/ 3B| |
120 |= 0D|\ 1C|{} 2C|??? 3C| |
121 |??? 0C|PD2 1D|PD3 2D|RShift 3D| |
122 |BS 0E| | | | |
123 +----------+---------------------+----------+----------+
124 Bit7 is 'press flag' which set 1 on press and 0 on release when break code is enabled.
125
126 NOTE: When break code is enabled the key sends scancode with setting 7th bit on press
127 and without it on release. That is, '`' sends 80h on press and 00h on release.
128
129
130 Keyboard command
131 ----------------
132 Keyboard accepts these commands from host.
133
134 Description Entry point
135 -----------------------------------------------------------
136 FF Soft Reset 0008h
137 FE Resend 00e8h
138 FD Buzzer(emits a short beep) 00edh
139 FC Set Key Flag 00f6h
140 FB Soft Reset 0008h
141 FA Reset 0000h
142
143
144 Keyboard response
145 -----------------
146 Keyobard sends these bytes to host.
147
148 Description Entry point
149 -----------------------------------------------------------
150 FE Overflow(key event/receive data) 00c5h, 0346h
151 Memory test error 0224h
152 FD Command out of bound 00d8h
153 Key out of bound
154 7E Read/Parity error in receive from host 00bch
155 80-FB? scan code(make)
156 00-7B? scan code(break)
157 note: Alps model spits scan code 7B(FB) at least.
158
159
160 Set Key Flag command(FC)
161 ------------------------
162 After 'Power on Reset' firmware enters this command mode and waits for data from host,
163 so that you don't need to send 'FC' and it doesn't send any scancode until you send 'FF'.
164 With Alps models you need to send 'FC' command to enter this mode.
165
166 Data sent from host:
167
168 bit: 7 6 ... 0
169 en | |
170 | `-----`--- scan code
171 `------------- enable bit(0: enable repeat, 1: enable break)
172
173 00-7B? Enable repeat
174 80-FB? Enable break
175 FE Resend(011ah) no need to use
176 FF End(0114h) exits FC command mode.
177
178 Response from keyboard:
179 FD Out of bound - Invalid scancode
180 -- OK - No response means that command is accepted.
181
182 Examples:
183 To enable break code of all keys.
184
185 FC 80 81 ... FB FF
186
Imprint / Impressum