aboutsummaryrefslogtreecommitdiff
path: root/keyboard/hhkb
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-07-11 16:23:53 +0900
committertmk <nobody@nowhere>2013-07-11 16:23:53 +0900
commitd2ea9e80a07ced7c2b6a420ad2bd43a8c6220eac (patch)
treeaff266baca0431633a5da7c4d26ccb6b62ff0510 /keyboard/hhkb
parent9d7278682e674816d467aaf9020c478e333b1168 (diff)
downloadqmk_firmware-d2ea9e80a07ced7c2b6a420ad2bd43a8c6220eac.tar.gz
qmk_firmware-d2ea9e80a07ced7c2b6a420ad2bd43a8c6220eac.zip
Fix README and doc
Diffstat (limited to 'keyboard/hhkb')
-rw-r--r--keyboard/hhkb/README.md162
-rw-r--r--keyboard/hhkb/doc/HHKB.txt36
2 files changed, 111 insertions, 87 deletions
diff --git a/keyboard/hhkb/README.md b/keyboard/hhkb/README.md
index f7e96126b..b9e0b534a 100644
--- a/keyboard/hhkb/README.md
+++ b/keyboard/hhkb/README.md
@@ -2,128 +2,144 @@ Alternative Controller for HHKB Pro
2=================================== 2===================================
3I wanted to add some features like vi cursor and mouse keys to my [HHKB][HHKB] but its controller is not programmable and 3I wanted to add some features like vi cursor and mouse keys to my [HHKB][HHKB] but its controller is not programmable and
4firmware source code is not open, of course. This means customizing this keyboard needs to replace original 4firmware source code is not open, of course. This means customizing this keyboard needs to replace original
5controller with programmable one. For this purpose I used PJRC [Teensy++][Teensy] as alternative controller. 5controller with programmable one. This controller can work with HHKB Professional and Professional 2 model.
6
7See [this thread][AltController] in geekhack.org.
6 8
7[HHKB]: http://www.pfu.fujitsu.com/hhkeyboard/ 9[HHKB]: http://www.pfu.fujitsu.com/hhkeyboard/
10[AltController]: http://geekhack.org/index.php?topic=12047.0
8[Teensy]: http://www.pjrc.com/teensy/ 11[Teensy]: http://www.pjrc.com/teensy/
9 12
10 13
11My keyboard firmware source tree is here: http://github.com/tmk/tmk_keyboard
12See directory keyboard/hhkb to build firmware for HHKB.
13
14
15##Features 14##Features
16* Customizable keymap 15* Customizable keymap
17* More keymap layers(more Fn keys) 16* More keymap layers(more Fn keys)
18* Mouse keys 17* Mouse keys
19* USB NKRO 18* USB NKRO
20 19
20See README of [tmk_keyboard] for more.
21
22[tmk_keyboard]: http://github.com/tmk/tmk_keyboard
23
21###Pros 24###Pros
25* No risk: Everything is all reversible
22* Without PCB trace cutting, case mod or any destructives 26* Without PCB trace cutting, case mod or any destructives
23* Can keep original controller intact 27* Can keep original controller intact
24* Can change all HHKB behaviour as you like 28* Can change all HHKB behaviour as you like
25 29
26###Cons 30###Cons
27* Void your warranty 31* Void your warranty
28* Lose USB hub function in case of Pro2 32* Lose USB hub function of Pro2
29 33
30##DISCLAIMER 34##DISCLAIMER
31I'm not a professional of electronics or MCU programming. This may damage your HHKB. 35I'm not a professional of electronics nor MCU programming. This may damage your HHKB.
32And my English writing is poor, I'm not sure I can convey my notions accurately. 36And my English writing is poor, I'm not sure I can convey my notions accurately.
33 37
34 38
39##Documents
40See [doc/HHKB.txt](doc/HHKB.txt) and files under [doc/](doc/) for internal of HHKB and this controller.
35 41
36 42
43##Build Firmware & Program
44You can choose some combination of hardware and USB protocol stack([LUFA], [PJRC]).
37 45
46### Install Tools
47See [this document](../../doc/build.md).
38 48
39##Build Firmware 49### TMK Alt Controller Board
40You can choose some combination of MCU and USB protocol stack. 50 $ make -f Makefile.tmk
41
42### Teensy++(AVR USB family) with [LUFA]
430. Edit **matrix.c** to use your pin configuration. See doc/HHKB.txt for detail.
44
451. Edit **keymap.c** to use your favoirte keymap.
46
472. Edit **Makefile** if you want to use other `MCU` than Teensy++ 2.0.
48 51
493. Build firmware binary file: 52This programs the controller with [dfu-programmer] if the tool is intalled and configured properly.
50 `$ make -f Makefile.lufa`
51 53
524. Program MCU with PJRC [Teensy Loader] tool. If you install command line version of the loader just run: 54 $ make -f Makefile.tmk dfu
53 `$ make -f Makefile.lufa teensy`
54 55
55[LUFA]: http://www.fourwalledcubicle.com/LUFA.php 56Push reset button and program with [FLIP]. The tool should be intalled and configured properly.
56[Teensy Loader]: http://www.pjrc.com/teensy/loader.html
57 57
58 $ make -f Makefile.tmk flip
58 59
59###AVR Mega with [V-USB] 60Or you can also program with FLIP GUI.
60Follow below if you want to use AVR with V-USB as .
61 61
620. Edit **matrix.c** to use your pin configuration. See doc/HHKB.txt for detail. 62[dfu-programmer]: http://dfu-programmer.sourceforge.net/
63[FLIP]: http://www.atmel.com/tools/FLIP.aspx
63 64
641. Edit **keymap.c** to use your favoirte keymap.
65 65
662. Edit **usbconfig.h** to configure V-USB options. 66### PJRC Teensy++
67Build with [LUFA] USB stack:
67 68
683. Edit **Makefile.vusb** to define `MCU` and `F_CPU`. 69 $ make -f Makefile.lufa
69 70
704. Build firmware binary file: 71or with [PJRC] USB stack:
71 `$ make -f Makefile.vusb`
72 72
735. Program MCU with AVR programmer like AVRISPmkII. If you already have [USBaspLoader] on MCU just run: 73 $ make -f Makefile.pjrc
74 `$ make -f Makefile.vusb program`
75 74
76[V-USB]: http://www.obdev.at/products/vusb/index.html 75Push reset button and program with [Teensy Loader(command line)]. The tool should be intalled and configured properly.
77[USBaspLoader]: http://www.obdev.at/products/vusb/usbasploader.html
78 76
77 $ make -f Makefile.lufa teensy
78 $ make -f Makefile.pjrc teensy
79 79
80###How to Customize Keymap 80Or you can also program with [Teensy Loader(GUI)].
81Later...
82See **keymap.c**.
83 81
82[LUFA]: http://www.fourwalledcubicle.com/LUFA.php
83[PJRC]: http://www.pjrc.com/teensy/usb_keyboard.html
84[Teensy Loader(command line)]: http://www.pjrc.com/teensy/loader_cli.html
85[Teensy Loader(GUI)]: http://www.pjrc.com/teensy/loader.html
84 86
85##Hardware
86 87
87###Teensy++ installation 88###AVR Mega with [V-USB]
88Angled USB mini B adapter is used to install Teensy++ laterally. 89Build:
90 $ make -f Makefile.vusb
89 91
90![Image of Teensy install](hhkb/doc/HHKB_img/teensy_install.jpg) 92Program [USBaspLoader] on MCU with AVR programmer like [AVRISPmkII] and tool like [avrdude].
91 93
92Bread baord wires are used to connect Teensy++. 94You can programs with [avrdude] once you have programmed [USBaspLoader] on MCU.
95 $ make -f Makefile.vusb program
93 96
94![Image of Teensy wiring](hhkb/doc/HHKB_img/teensy_wiring.jpg) 97[AVRISPmkII]: http://www.atmel.com/tools/AVRISPMKII.aspx
98[avrdude]: http://www.nongnu.org/avrdude/
95 99
96![Image of Connector](hhkb/doc/HHKB_img/connector_contact.jpg)
97 100
101##How to Customize
102See [tmk_keyboard] documents.
98 103
99###PJRC Teensy++ 2.0 connection
100 +---------------+
101 | Teensy++ |
102 | |
103 | | HHKB
104 | | ~~~~
105 | PB0-2|------->ROW(6-8)
106 | PB3-5|------->COL(9-11)
107 | PB6|------->ENABLE(12)
108 | PE6|<-------KEY(4)
109 | PE7|------->PREV(5)
110 | |
111 | |
112 | |
113 +---------------+
114 104
105##Hardware
106You have some options for hardware. Development boards with USB AVR family(ATMega32U4, AT90USB1286) like Teensy will work while MegaAVR with V-USB library is also cheapear option for DIY.
107
108###1. TMK Alt Controller Board
109TMK designed [Keyboard Controller Board for HHKB Pro2(KiCad project)](https://github.com/tmk/HHKB_controller).
110See [this post](http://geekhack.org/index.php?topic=12047.msg948923#msg948923).
111
112
113###2. PJRC Teensy++ 2.0 connection
114 +---------------+
115 | Teensy++ |
116 | |
117 | | HHKB pro HHKB pro2
118 | | ~~~~~~~~ ~~~~~~~~~
119 | PB0-2|------->ROW (6-8) (5-7)
120 | PB3-5|------->COL (9-11) (8-10)
121 | PB6|------->ENABLE (12) (11)
122 | PE6|<-------KEY (4) (3)
123 | PE7|------->PREV (5) (4)
124 | |
125 | | 5V--- (1-3) (1-2)
126 | | GND--- (13-14) (12-13)
127 +---------------+
128
129- NOTE: PJRC [Teensy](http://www.pjrc.com/teensy/)
130[Teensy Loader]: http://www.pjrc.com/teensy/loader.html
115 131
116###V-USB circuit 132###3. V-USB connection
117 +---+ +---------------+ 133 +---+ +---------------+
118 USB GND | | ATmega168 | 134 USB GND | | ATmega328p |
119 ~~~ C3 | | 135 ~~~ C3 | |
120 5V <-------+--------+---|Vcc,AVCC | HHKB 136 5V <-------+--------+---|Vcc,AVCC | HHKB pro pro2
121 R1 | | ~~~~ 137 R1 | | ~~~~~~~~ ~~~~
122 D- <----+--+-----R2-----|INT1 PB2-4|------->ROW(6-8) 138 D- <----+--+-----R2-----|INT1 PB2-4|------->ROW (6-8) (5-7)
123 D+ <----|---+----R3-----|INT0 PC0-2|------->COL(9-11) 139 D+ <----|---+----R3-----|INT0 PC0-2|------->COL (9-11) (8-10)
124 Z1 Z2 | PC3|------->ENABLE(12) 140 Z1 Z2 | PC3|------->ENABLE (12) (11)
125 GND<----+---+-----------|GND PB0|<-------KEY(4) 141 GND<----+---+-----------|GND PB0|<-------KEY (4) (3)
126 | PB1|------->PREV(5) 142 | PB1|------->PREV (5) (4)
127 | | 143 | |
128 GND+-C2--+--|XTAL1 RXD|------->Debug Console 144 GND+-C2--+--|XTAL1 RXD|------->Debug Console
129 X1 | TXD|<-------Debug Console 145 X1 | TXD|<-------Debug Console
@@ -134,5 +150,11 @@ Bread baord wires are used to connect Teensy++.
134 Z1,Z2: Zener 3.6V 150 Z1,Z2: Zener 3.6V
135 C1,C2: 22pF 151 C1,C2: 22pF
136 C3: 0.1uF 152 C3: 0.1uF
137 X1: Crystal 20MHz(16MHz/12MHz) 153 X1: Crystal 12MHz
138 SW: Push Switch(Optional for bootloader) 154 SW: Push Switch(for bootloader)
155
156- NOTE: See [V-USB] documentation for more detail of hardware and the USB stack.
157- NOTE: [USBaspLoader] is very useful for firmware update.
158
159[V-USB]: http://www.obdev.at/products/vusb/index.html
160[USBaspLoader]: http://www.obdev.at/products/vusb/usbasploader.html
diff --git a/keyboard/hhkb/doc/HHKB.txt b/keyboard/hhkb/doc/HHKB.txt
index f99a07443..422c452c9 100644
--- a/keyboard/hhkb/doc/HHKB.txt
+++ b/keyboard/hhkb/doc/HHKB.txt
@@ -30,25 +30,27 @@ Connector Cable
30Two PCBs are connected by 15 lines(13 in case of Pro2). 30Two PCBs are connected by 15 lines(13 in case of Pro2).
31Vcc and GND use 3(2) lines each, other 9 lines are for keyboard signaling. 31Vcc and GND use 3(2) lines each, other 9 lines are for keyboard signaling.
32 32
33 Keyswitch PCB connector Teensy++ pins 33 Keyswitch connector
34 ------------------------------------------------------------------------------- 34 pro pro2 Description Teensy++ pins
35 1 Vcc(5V) Not exist on Pro2 5V 35 --------------------------------------------------------------------------------------------
36 2 Vcc(5V) 5V 36 1 Vcc(5V) Not exist on Pro2 5V
37 3 Vcc(5V) 5V 37 2 1 Vcc(5V) 5V
38 4 TP1684 KEY: Low(0) when key pressed PE6 input(with pullup) 38 3 2 Vcc(5V) 5V
39 5 TP1684 KEY_PREV: assert previous key state??? PE7 output 39 4 3 TP1684 KEY: Low(0) when key pressed PE6 input(with pullup)
40 6 HC4051 A(bit0) select 8 rows(0 to 7) PB0 output 40 5 4 TP1684 KEY_PREV: make threshold PE7 output
41 7 HC4051 B(bit1) PB1 output 41 6 5 HC4051 A(bit0)\ PB0 output
42 8 HC4051 C(bit2) PB2 output 42 7 6 HC4051 B(bit1) > select row(0 to 7) PB1 output
43 9 LS145 A(bit0) select 8 columns(0 to 7) PB3 output 43 8 7 HC4051 C(bit2)/ PB2 output
44 10 LS145 B(bit1) PB4 output 44 9 8 LS145 A(bit0)\ PB3 output
45 11 LS145 C(bit2) PB5 output 45 10 9 LS145 B(bit1) > select column(0 to 7) PB4 output
46 12 LS145 D(enable) Low(0) enable selected column PB6 output 46 11 10 LS145 C(bit2)/ PB5 output
47 13 GND GND 47 12 11 LS145 D(enable) Low(0) enables selected column PB6 output
48 14 GND GND 48 13 12 GND GND
49 15 GND Not exist on Pro2 GND 49 14 13 GND GND
50 15 GND Not exist on Pro2 GND
50 51
51 NOTE: guessing pin5(KEY_PREV) may work for hysteresis of capacitive sensing. 52 NOTE: guessing pin5(KEY_PREV) may work for hysteresis of capacitive sensing.
53 NOTE: 1KOhm didn't work as pullup resistor on KEY. AVR internal pullup or 10KOhm resistor was OK.
52 54
53 (HHKB_connector.jpg) 55 (HHKB_connector.jpg)
54 56