]>
Commit | Line | Data |
---|---|---|
208f6d7f | 1 | Internal of HHKB pro |
2 | ===================== | |
3 | HHKB pro has MCU and some chips on separate two PCBs. | |
99bba8d9 | 4 | |
208f6d7f | 5 | Controller PCB |
6 | -------------- | |
99bba8d9 | 7 | M38K07M4 Renesas MCU with USB function |
8 | http://documentation.renesas.com/eng/products/mpumcu/rej03b0192_38k0ds.pdf | |
c8e1ad8c | 9 | |
99bba8d9 | 10 | (HHKB_controller.jpg) |
11 | ||
208f6d7f | 12 | Keyswitch PCB |
13 | ------------- | |
99bba8d9 | 14 | HC4051 Analog Multiplexer: select a row line. |
60134830 | 15 | http://www.ti.com/lit/ds/schs122j/schs122j.pdf |
99bba8d9 | 16 | LS145 BCD Decoder: select a column line. |
60134830 | 17 | http://www.ti.com/lit/ds/symlink/sn74ls145.pdf |
99bba8d9 | 18 | BU9831 Non-volatile electronic potentiometer: for calibration? |
60134830 | 19 | https://www.spezial.com/doc/rohm-a/bu9831.pdf |
13e4662b | 20 | TP1683/4 Capacitive Sensing controller: no datasheet available. |
c8e1ad8c | 21 | |
99bba8d9 | 22 | (HHKB_keyswitch.jpg) |
c8e1ad8c | 23 | |
99bba8d9 | 24 | Topre original chip? |
25 | (HHKB_TP1684.jpg) | |
26 | ||
27 | ||
208f6d7f | 28 | Connector Cable |
29 | --------------- | |
30 | Two PCBs are connected by 15 lines(13 in case of Pro2). | |
60134830 | 31 | Vcc and GND use 3(2) lines each, other lines are for keyboard signaling. |
99bba8d9 | 32 | |
60134830 | 33 | HHKB connector lines: |
8e7153d1 | 34 | JP Pro2 Pro Function Description TMK pin usage |
d2ea9e80 | 35 | -------------------------------------------------------------------------------------------- |
60134830 | 36 | 1 Vcc(5V) 5V |
37 | 1 1 2 Vcc(5V) 5V | |
38 | 2 2 3 Vcc(5V) 5V | |
8e7153d1 | 39 | 3 3 4 TP1684 ~KEY: Low(0) when key is pressed PD7 input(with pullup) |
40 | 4 4 5 TP1684 HYS: High(1) when key is pressed PB7 output | |
60134830 | 41 | 5 5 6 HC4051 A(bit0)\ PB0 output |
42 | 6 6 7 HC4051 B(bit1) > select row 0-7 PB1 output | |
43 | 7 7 8 HC4051 C(bit2)/ PB2 output | |
44 | 8 8 9 LS145 A(bit0)\ PB3 output | |
45 | 9 9 10 LS145 B(bit1) > select column 0-7 PB4 output | |
46 | 10 10 11 LS145 C(bit2)/ PB5 output | |
8e7153d1 | 47 | 11 11 12 LS145 ~D(enable) Low(0) enables selected column PB6 output |
60134830 | 48 | 12 12 13 GND GND |
49 | 13 13 14 GND GND | |
50 | 15 GND | |
8e7153d1 | 51 | 14 HC4051(Z2) ~Enable of Z2 row0-7 PC6 |
52 | 15 HC4051(Z3) ~Enable of Z3 row8-15 PC7 | |
208f6d7f | 53 | |
8e7153d1 | 54 | NOTE: Probably HYS changes threshold for upstroke and makes hysteresis in the result. |
55 | NOTE: HYS should be given High(1) when previous KEY state is Low(0). | |
d2ea9e80 | 56 | NOTE: 1KOhm didn't work as pullup resistor on KEY. AVR internal pullup or 10KOhm resistor was OK. |
60134830 | 57 | NOTE: JP has two HC4051(Z2,Z3) and line 5, 6 and 7 are connected to both of them. |
c8e1ad8c | 58 | |
99bba8d9 | 59 | (HHKB_connector.jpg) |
60 | ||
61 | ||
62 | Keyswitch matrix | |
63 | ---------------- | |
60134830 | 64 | HHKB switch matrix is ghost-free and bounce-free. |
99bba8d9 | 65 | |
60134830 | 66 | Pro/Pro2(8x8): |
208f6d7f | 67 | COL 0 1 2 3 4 5 6 7 |
68 | ROW --------------------------------------------------------------- | |
69 | 0| 2 q w s a z x c | |
70 | 1| 3 4 r e d f v b | |
71 | 2| 5 6 y t g h n _NONE_ | |
72 | 3| 1 Esc Tab Control LShift LAlt LMeta Space | |
73 | 4| 7 8 u i k j m _NONE_ | |
74 | 5| \ ` Delete Return Fn RShift RAlt RMeta | |
75 | 6| 9 0 o p ; l , _NONE_ | |
76 | 7| - + ] [ ' / . _NONE_ | |
99bba8d9 | 77 | |
78 | ||
60134830 | 79 | JP(16x8): |
80 | COL 0 1 2 3 4 5 6 7 | |
81 | ROW --------------------------------------------------------------- | |
82 | 0| ESC TAB LFn LShift LCtrl | |
83 | 1| 4 E MuHKN C D | |
84 | 2| 3 W LAlt X S | |
85 | 3| 1 HHK | |
86 | 4| | |
87 | 5| 5 R V F | |
88 | 6| 2 Q LGui Z A | |
89 | 7| 6 T Space B G | |
90 | 8| 9 I Kana , K | |
91 | 9| 8 U Henkan M J | |
92 | A| 7 Y N H | |
93 | B| 0 O RAlt . L | |
94 | C| BS Right RShift Enter | |
95 | D| \ [ Down Up ] | |
96 | E| - P RFn / ; | |
97 | F| ~ @ Left Ro : | |
98 | ||
99 | ||
99bba8d9 | 100 | Matrix diagram: |
208f6d7f | 101 | |
60134830 | 102 | Pro/Pro2: |
99bba8d9 | 103 | +-------------------------+-+-+-+-+-+-+-+ Vcc |
104 | |bias control? - - - - - - - - --- | |
105 | | 3.9K*8 R R R R R R R R | | |
106 | +--------^+ +--------+ - - - - - - - - | | |
e109b550 | 107 | | 3| | HC4051 <0-------|-|-|-|-|-|-|-|--|R|-+ |
108 | | DIL-20 |capa. | <1-------|-|-|-|-|-|-|-|--|R|-+ | |
13e4662b | 109 | | TP1684 |sense | <2-------|-|-|-|-|-|-|-|--|R|-+ |
e109b550 | 110 | | 20<------| <3-------|-|-|-|-|-|-|-|--|R|-+ |
99bba8d9 | 111 | | | | <4-------|-|-|-|-|-|-|-|--|R|-+ |
112 | | | | <5-------|-|-|-|-|-|-|-|--|R|-+ | |
e109b550 | 113 | >5~EN <-+ | <6-------|-|-|-|-|-|-|-|--|R|-+ |
114 | | 2 4 | | | <7-------|-|-|-|-|-|-|-|--|R|-+ | |
13e4662b | 115 | +---V---^-+ | +-^-^-^--+ 0 1 2 3 4 5 6 7 33K*8 |
8e7153d1 | 116 | KEY HYS | A B C +-----------------+ |
99bba8d9 | 117 | | | +-^----+ | | | | LS145 | |
118 | Vcc | | |BU9831| | | | +-^--^--^--^------+ | |
60134830 | 119 | --- | | +------+ | | | A B C D +-------+ |
120 | | | | | | | | | | | | | | |
121 | 1-3 4 5 6 7 8 9 10 11 12 13-15 Pro | | |
122 | 1-2 3 4 5 6 7 8 9 10 11 12-13 Pro2| | |
123 | +--------------------------------------------------+ | | |
124 | | connector | --- | |
125 | +--------------------------------------------------+ GND | |
126 | ||
127 | ||
128 | JP: | |
129 | +-----------------------------+-+-+-+-+ Vcc | |
130 | |bias control? - - - - - --- | |
131 | | 3.9K*5 R R R R R | | |
132 | +--------^+ +--------+ - - - - - | | |
e109b550 | 133 | | 3| | HC4051 <0-----------|-|-|-|-|----|R|-+ |
60134830 | 134 | | |capa. | Z2 <1-----------|-|-|-|-|----|R|-+ |
135 | | TP1684 |sense | <2-----------|-|-|-|-|----|R|-+ | |
e109b550 | 136 | | 20<---+--| <3-----------|-|-|-|-|----|R|-+ |
60134830 | 137 | | | | | <4-----------|-|-|-|-|----|R|-+ |
138 | | | ~En| <5-----------|-|-|-|-|----|R|-+ | |
e109b550 | 139 | >5~EN | +----> <6-----------|-|-|-|-|----|R|-+ |
140 | | 2 4 | | | | A B C <7-----------|-|-|-|-|----|R|-+ | |
60134830 | 141 | +---V---^-+ | | +-^-^-^--+ | | | | | | |
8e7153d1 | 142 | KEY HYS | | | | | | | | | | | |
60134830 | 143 | | | | | +--------+ | | | | | | |
144 | | | | | | HC4051 <8-----------|-|-|-|-|----|R|-+ | |
145 | | | | | | Z3 <9-----------|-|-|-|-|----|R|-+ | |
146 | | | | +--| <A-----------|-|-|-|-|----|R|-+ | |
147 | | | | | <B-----------|-|-|-|-|----|R|-+ | |
148 | | | | | <C-----------|-|-|-|-|----|R|-+ | |
149 | | | | ~En| <D-----------|-|-|-|-|----|R|-+ | |
150 | | | | +-> <E-----------|-|-|-|-|----|R|-+ | |
151 | | | | | | A B C <F-----------|-|-|-|-|----|R|-+ | |
152 | | | | | +-^-^-^--+ 0 1 2 3 4 5 6 7 33K*8 | |
153 | | | | | | | | +-----------------+ | |
154 | | | | | | | | | LS145 | | |
155 | Vcc | | | | | | | +-^--^--^--^------+ | |
156 | --- | | | | | | | A B C D +-------+ | |
157 | | | | | | | | | | | | | | | | |
158 | 1-2 3 4 14 15 5 6 7 8 9 10 11 12-13 | | |
159 | +--------------------------------------------------+ | | |
160 | | connector | --- | |
161 | +--------------------------------------------------+ GND | |
e109b550 | 162 | |
163 | TP1684-5(~EN) pin is connected with LS145-D/Connector-11. | |
99bba8d9 | 164 | |
165 | ||
208f6d7f | 166 | Signals charts |
167 | -------------- | |
92004d67 | 168 | While pressing space bar, watched HHKB Pro original controller signals by logic analyzer. |
99bba8d9 | 169 | Row and column is looping between 0-7 each for selecting a key. |
170 | A key is scaned every about 15ms, so scan rate is 66Hz. | |
c8e1ad8c | 171 | |
99bba8d9 | 172 | (HHKB_chart1.jpg) |
173 | ||
2ca3ab18 | 174 | Space bar locate at ROW:3 COL:7. A key is selected by HC4051(C,B,A) and LS145(C,B,A). |
e109b550 | 175 | Key state can be read on TP1684(4) while asserting low on LS145(D). |
2ca3ab18 | 176 | |
99bba8d9 | 177 | (HHKB_chart2.jpg) |
178 | ||
99bba8d9 | 179 | |
92004d67 | 180 | Signal of JP: |
99bba8d9 | 181 | |
92004d67 | 182 | 1) Select row |
183 | rowC ____~~~~____~~~~ 3.8/3.8ms(JP) 7.7/7.7ms(Pro) S2 of HC4051 | |
184 | rowB __~~__~~__~~__~~ 1.9/1.9ms(JP) 3.8/3.8ms(Pro) S1 of HC4051 | |
185 | rowA _~_~_~_~_~_~_~_~ 1.0/1.0ms(JP) 1.9/1.9ms(Pro) S0 of HC4051 | |
186 | 0123456701234567 selected row(Pro) | |
187 | 0123456789ABCDEF selected row(JP) | |
188 | rowEn0 ________~~~~~~~~ 7.7/7.7ms(JP only) ~Enable of Z2 HC4051(JP only) | |
189 | rowEn1 ~~~~~~~~________ 7.7/7.7ms(JP only) ~Enable of Z3 HC4051(JP only) | |
99bba8d9 | 190 | |
92004d67 | 191 | 2) Select column |
192 | colC ____~~~~____~~~~ 550/410us(JP) / us(Pro) | |
193 | colB __~~__~~__~~__~~ 200/210us(JP) 450/460us(Pro) | |
194 | colA _~_~_~_~_~_~_~_~ 100/110us(JP) 220/230us(Pro) | |
195 | 0123456701234567 selected column | |
6c3b9a2d | 196 | |
92004d67 | 197 | 3) Wait 5us after column select, then set prev, strobe colD to spit out key status and read it. |
8e7153d1 | 198 | hys _~~~~_____ 20us if previous key state is low |
92004d67 | 199 | colD ~~~__~~~~~ 10us strobe |
200 | key ~~~____~~~ 22us indicates current state of the key | |
6c3b9a2d | 201 | |
92004d67 | 202 | NOTE: JP scans twice fast as Pro/Pro2 does. So Pro/Pro2 scans 8x8 matrix in 15.4ms while JP scans 16x8 in that time. |
99bba8d9 | 203 | |
204 | ||
99bba8d9 | 205 | |
206 | EOF |