]>
Commit | Line | Data |
---|---|---|
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 | |
57 | ||
58 | and program your Teensy with [PJRC Teensy loader](http://www.pjrc.com/teensy/loader.html). | |
59 | ||
60 | ||
61 | ||
62 | Keymap | |
63 | ------ | |
64 | You can change keymaps by editing *keymap.c*. | |
65 | ||
66 | ### M0110 & M0120 | |
67 | #### *Default* | |
68 | ,---------------------------------------------------------. ,---------------. | |
69 | | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Ctl| -|Lft|Rgt| | |
70 | |---------------------------------------------------------| |---------------| | |
71 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| Up| | |
72 | |---------------------------------------------------------| |---------------| | |
73 | |Fn0 | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| Dn| | |
74 | |---------------------------------------------------------| |---------------| | |
75 | |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | | |
76 | `---------------------------------------------------------' |-----------|Ent| | |
77 | |Alt|Gui | Space |Ctl |Alt| | 0| .| | | |
78 | `-----------------------------------------------' `---------------' | |
79 | #### *HHKB/WASD Layer(WASD/IJKL)* | |
80 | ,---------------------------------------------------------. ,---------------. | |
81 | |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| -|Lft|Rgt| | |
82 | |---------------------------------------------------------| |---------------| | |
83 | |Caps |Hom| Up|PgU| | | |PgU| Up|Hom|Psc|Slk|Pau|Ins| | 7| 8| 9| Up| | |
84 | |---------------------------------------------------------| |---------------| | |
85 | |Fn0 |Lef|Dow|Rig| | | |Lef|Dow|Rig| | |Return| | 4| 5| 6| Dn| | |
86 | |---------------------------------------------------------| |---------------| | |
87 | |Shift |End| |PgD| | | |PgD| |End| |Shift | | 1| 2| 3| | | |
88 | `---------------------------------------------------------' |-----------|Ent| | |
89 | |Alt|Gui | Space |Ctl |Alt| | 0| .| | | |
90 | `-----------------------------------------------' `---------------' | |
91 | ||
92 | ### M0110A | |
93 | #### *Default* | |
94 | ,---------------------------------------------------------. ,---------------. | |
95 | | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Ctl| =| /| *| | |
96 | |---------------------------------------------------------| |---------------| | |
97 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | |
98 | |-----------------------------------------------------' | |---------------| | |
99 | |Fn0 | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | |
100 | |---------------------------------------------------------| |---------------| | |
101 | |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft| Up| | 1| 2| 3| | | |
102 | |---------------------------------------------------------| |-----------|Ent| | |
103 | |Alt |Gui | Space | \|Lft|Rgt| Dn| | 0| .| | | |
104 | `---------------------------------------------------------' `---------------' | |
105 | #### *Cursor Layer(WASD/IJKL)* | |
106 | ,---------------------------------------------------------. ,---------------. | |
107 | |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| | |
108 | |---------------------------------------------------------| |---------------| | |
109 | |Caps |Hom| Up|PgU| | | |PgU| Up|Hom|Psc|Slk|Pau| | | 7| 8| 9| -| | |
110 | |-----------------------------------------------------' | |---------------| | |
111 | |Fn0 |Lef|Dow|Rig| | | |Lef|Dow|Rig| | |Return| | 4| 5| 6| +| | |
112 | |---------------------------------------------------------| |---------------| | |
113 | |Shift |End| |PgD| | | |PgD| |End| |Shif|PgU| | 1| 2| 3| | | |
114 | |---------------------------------------------------------| |-----------|Ent| | |
115 | |Alt |Gui | Space |Ins|Hom|End|PgD| | 0| .| | | |
116 | `---------------------------------------------------------' `---------------' | |
117 | ||
118 | ||
119 | ||
120 | Debug | |
121 | ----- | |
122 | You can use [PJRC HID listen](http://www.pjrc.com/teensy/hid_listen.html) to see debug output. | |
123 | ||
124 | The converter has some functions for debug, press `<magickey>+H` simultaneously to get help. | |
125 | These function is totally undocumented, tentative, inconsistent and buggy. | |
126 | ||
127 | magickey: Shift+Option+Command(Shift+Alt+Gui or Shift+Alt+Control) |