You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

ibm4704.txt 7.3KB

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