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