您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. M0110/M0110A to USB keyboard converter
  2. ======================================
  3. This firmware converts the protocol of Apple Macintosh keyboard M0110/M0110A into USB.
  4. Target board of this project is [PJRC Teensy](http://www.pjrc.com/teensy/), though,
  5. you can use other board with USB AVR like `ATmega32U4` and `AT90USB`.
  6. ![M0110](https://raw.github.com/tmk/tmk_keyboard/master/converter/m0110_usb/doc/m0110.jpg)
  7. - M0110A support was contributed by [skagon@github](https://github.com/skagon).
  8. - M0120 also is supported. keys(+ * / and ,) on M0120 are recognized as cursor keys.
  9. Connection
  10. ----------
  11. You need 4P4C plug and cable to connect Teensy or other AVR dev board into the keyboard.
  12. Teensy port `PF0` is assigned for `CLOCK` line and `PF1` for `DATA` by default,
  13. you can change pin configuration with editing *config.h*.
  14. You can find 4P4C plugs on telephone handset cable. Note that it is *crossover* connection
  15. while Macintosh keyboard cable is *straight*.
  16. [![Conection](https://raw.github.com/tmk/tmk_keyboard/master/converter/m0110_usb/doc/teensy.jpg)]
  17. In this pic:
  18. 1. `GND`(Black)
  19. 2. `CLOCK`(Red)
  20. 3. `DATA`(Green)
  21. 4. `+5V`(Yellow)
  22. Note that wire colors may vary in your cable.
  23. ### Pinout
  24. - <http://pinouts.ru/Inputs/MacKeyboard_pinout.shtml>
  25. - <http://en.wikipedia.org/wiki/Modular_connector#4P4C>
  26. ![Jack fig](http://www.kbdbabel.org/conn/kbd_connector_macplus.png)
  27. ### Pull-up Registor
  28. You may need pull-up registors on signal lines(`CLOCK`, `DATA`) in particular
  29. when you have long or coiled cable. 1k-10k Ohm will be OK for this purpose.
  30. In some cases MCU can't read signal from keyboard correctly without pull-up resistors.
  31. Building Frimware
  32. -----------------
  33. To compile firmware you need AVR GCC. You can use [WinAVR](http://winavr.sourceforge.net/) on Windows.
  34. You can edit *Makefile* and *config.h* to change compile options and pin configuration.
  35. $ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
  36. $ cd m0110_usb
  37. $ make
  38. and program your Teensy with [PJRC Teensy loader](http://www.pjrc.com/teensy/loader.html).
  39. Keymap
  40. ------
  41. You can change keymaps by editing *keymap.c*.
  42. ### M0110 & M0120
  43. #### *Default*
  44. ,---------------------------------------------------------. ,---------------.
  45. | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Ctl| -|Lft|Rgt|
  46. |---------------------------------------------------------| |---------------|
  47. |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| Up|
  48. |---------------------------------------------------------| |---------------|
  49. |Fn0 | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| Dn|
  50. |---------------------------------------------------------| |---------------|
  51. |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| |
  52. `---------------------------------------------------------' |-----------|Ent|
  53. |Alt|Gui | Space |Ctl |Alt| | 0| .| |
  54. `-----------------------------------------------' `---------------'
  55. #### *HHKB/WASD Layer(WASD/IJKL)*
  56. ,---------------------------------------------------------. ,---------------.
  57. |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| -|Lft|Rgt|
  58. |---------------------------------------------------------| |---------------|
  59. |Caps |Hom| Up|PgU| | | |PgU| Up|Hom|Psc|Slk|Pau|Ins| | 7| 8| 9| Up|
  60. |---------------------------------------------------------| |---------------|
  61. |Fn0 |Lef|Dow|Rig| | | |Lef|Dow|Rig| | |Return| | 4| 5| 6| Dn|
  62. |---------------------------------------------------------| |---------------|
  63. |Shift |End| |PgD| | | |PgD| |End| |Shift | | 1| 2| 3| |
  64. `---------------------------------------------------------' |-----------|Ent|
  65. |Alt|Gui | Space |Ctl |Alt| | 0| .| |
  66. `-----------------------------------------------' `---------------'
  67. ### M0110A
  68. #### *Default*
  69. ,---------------------------------------------------------. ,---------------.
  70. | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Ctl| =| /| *|
  71. |---------------------------------------------------------| |---------------|
  72. |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -|
  73. |-----------------------------------------------------' | |---------------|
  74. |Fn0 | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +|
  75. |---------------------------------------------------------| |---------------|
  76. |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft| Up| | 1| 2| 3| |
  77. |---------------------------------------------------------| |-----------|Ent|
  78. |Alt |Gui | Space | \|Lft|Rgt| Dn| | 0| .| |
  79. `---------------------------------------------------------' `---------------'
  80. #### *Cursor Layer(WASD/IJKL)*
  81. ,---------------------------------------------------------. ,---------------.
  82. |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *|
  83. |---------------------------------------------------------| |---------------|
  84. |Caps |Hom| Up|PgU| | | |PgU| Up|Hom|Psc|Slk|Pau| | | 7| 8| 9| -|
  85. |-----------------------------------------------------' | |---------------|
  86. |Fn0 |Lef|Dow|Rig| | | |Lef|Dow|Rig| | |Return| | 4| 5| 6| +|
  87. |---------------------------------------------------------| |---------------|
  88. |Shift |End| |PgD| | | |PgD| |End| |Shif|PgU| | 1| 2| 3| |
  89. |---------------------------------------------------------| |-----------|Ent|
  90. |Alt |Gui | Space |Ins|Hom|End|PgD| | 0| .| |
  91. `---------------------------------------------------------' `---------------'
  92. Debug
  93. -----
  94. You can use [PJRC HID listen](http://www.pjrc.com/teensy/hid_listen.html) to see debug output.
  95. The converter has some functions for debug, press `<magickey>+H` simultaneously to get help.
  96. These function is totally undocumented, tentative, inconsistent and buggy.
  97. magickey: Shift+Option+Command(Shift+Alt+Gui or Shift+Alt+Control)