Keyboard firmwares for Atmel AVR and Cortex-M
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.

4704.txt 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. 4704 Keyboard
  2. =============
  3. Keyboard Models:
  4. Model 100 6019273 50-key (grid layout)
  5. Model 200 6019284 62-key Alpha(60% layout)
  6. Model 300 6019303 77-key Expanded Alpha
  7. Model 400 6020218 107-key Full key
  8. Resourse
  9. --------
  10. The IBM 4704: lots of pictures and info
  11. http://kishy.dyndns.org/?p=648#more-648
  12. Brochure:
  13. http://ed-thelen.org/comp-hist/IBM-ProdAnn/4700.pdf
  14. 4704 Keyboard Protocol
  15. ======================
  16. On powering up the keyboard sends keyboard id; A3h for 6019284(62-key), for example.
  17. After that firmware enters FC command mode and waits for parameter data from host
  18. so that it doesn't send any scancode until you send 'FF'(End of FC command).
  19. Keyboard to Host
  20. ----------------
  21. Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part.
  22. ____ __ __ __ __ __ __ __ __ __ ________
  23. Clock \____/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
  24. ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
  25. Data ____/ X____X____X____X____X____X____X____X____X____X________
  26. Start 0 1 2 3 4 5 6 7 P Stop
  27. Start bit: can be long as 300-350us.
  28. Inhibit: Pull Data line down to inhibit keyboard to send.
  29. Timing: Host reads bit while Clock is hi.
  30. Stop bit: Keyboard pulls down Data line to lo after 9th clock.
  31. Host to Keyboard
  32. ----------------
  33. Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part.
  34. ____ __ __ __ __ __ __ __ __ __ ________
  35. Clock \______/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
  36. ^ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ___
  37. Data ____|__/ X____X____X____X____X____X____X____X____X____X \___
  38. | Start 0 1 2 3 4 5 6 7 P Stop
  39. Request by host
  40. Start bit: can be long as 300-350us.
  41. Request: Host pulls Clock line down to request to send a command.
  42. Timing: After Request keyboard pull up Data and down Clock line to low for start bit.
  43. After request host release Clock line once Data line becomes hi.
  44. Host wirtes a bit while Clock is hi and Keyboard reads while low.
  45. Stop bit: Host releases or pulls up Data line to hi after 9th clock and waits for keybaord pull down the line to lo.
  46. Scancodes
  47. ---------
  48. Keyboard doesn't send Break code for all keys except for Alt by default.
  49. 6019284 62-key:
  50. ,-----------------------------------------------------------.
  51. | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|???|BS |
  52. |-----------------------------------------------------------|
  53. |Tab | Q| W| E| R| T| Y| U| I| O| P| ¢| \| PD2|
  54. |-----------------------------------------------------------|
  55. |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| {}| PD3|
  56. |-----------------------------------------------------------|
  57. |Shif| <>| Z| X| C| V| B| N| M| ,| ,| /|???|Shift |
  58. |-----------------------------------------------------------|
  59. |Reset|blk|Alt | Space |Alt |blk|Enter|
  60. `-----------------------------------------------------------'
  61. +----------+---------------------+----------+----------+
  62. |` 00|PD1 04|Caps 20|LShift 30|Reset 31|
  63. |1 18|q 05|a 21|<> 3E|Rblank 41|
  64. |2 19|w 06|s 22|z 32|Alt 3F|
  65. |3 1A|e 13|d 23|x 33|Space 40|
  66. |4 10|r 14|f 24|c 34|Alt 3F|
  67. |5 11|t 15|g 25|v 35|Lblank 42|
  68. |6 12|y 16|h 26|b 36|Enter 2F|
  69. |7 08|u 17|j 27|n 37| |
  70. |8 09|i 01|k 28|m 38| |
  71. |9 0A|o 02|l 29|, 39| |
  72. |0 0F|p 03|; 2A|. 3A| |
  73. |- 1F|¢ 1B|' 2B|/ 3B| |
  74. |= 0D|\ 1C|{} 2C|??? 3C| |
  75. |??? 0C|PD2 1D|PD3 2D|RShift 3D| |
  76. |BS 0E| | | | |
  77. +----------+---------------------+----------+----------+
  78. Bit7 is 'press flag' which set 1 on press and 0 on release when break code is enabled.
  79. NOTE: When break code is enabled the key sends scancode with setting 7th bit on press
  80. and without it on release. That is, '`' sends 80h on press and 00h on release.
  81. keyboard command
  82. ----------------
  83. FF Soft Reset(0008h)
  84. FE Resend(00e8h)
  85. FD Buzzer stop?(00edh)
  86. FC Set Key flag(00f6h)
  87. FB Soft Reset(0008h)
  88. FA Reset(0000h)
  89. Keyboard response
  90. -----------------
  91. FF Not exist. [Outgoing buffer cannot have FFh(00h in fact)]
  92. FE Overflow(key event/receive data) at 00c5h, 0346h
  93. FE Memory test error at 0224h
  94. FD Command out of bound at 00d8h
  95. Key out of bound
  96. 7E Read/Parity error in receive from host at 00bch
  97. Set Key flag command(FC)
  98. ------------------------
  99. After 'Power on Reset' firmware enters this command mode and waits for data from host,
  100. so that you don't need to send 'FC' and it doesn't send any scancode until you send 'FF'.
  101. Data sent from host:
  102. bit: 7 6 ... 0
  103. en | |
  104. | `-----`--- scan code
  105. `------------- enable bit(0: enable repeat, 1: enable break)
  106. 00-77 Enable repeat(78-7F: invalid scancode)
  107. 80-F7 Enable break(F8-FF: invalid scancode)
  108. FE Resend(011ah) no need to use
  109. FF End(0114h) exits FC command mode.
  110. Response from keyboard:
  111. FD Out of bound - Invalid scancode
  112. Examples:
  113. To enable break code of all keys.
  114. FC 80 81 ... F7 FF