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