3 HHKB pro has MCU and some chips on separate two PCBs.
7 M38K07M4 Renesas MCU with USB function
8 http://documentation.renesas.com/eng/products/mpumcu/rej03b0192_38k0ds.pdf
14 HC4051 Analog Multiplexer: select a row line.
15 http://www.ti.com/lit/ds/schs122j/schs122j.pdf
16 LS145 BCD Decoder: select a column line.
17 http://www.ti.com/lit/ds/symlink/sn74ls145.pdf
18 BU9831 Non-volatile electronic potentiometer: for calibration?
19 https://www.spezial.com/doc/rohm-a/bu9831.pdf
20 TP1683/4 Capacitive Sensing controller: no datasheet available.
30 Two PCBs are connected by 15 lines(13 in case of Pro2).
31 Vcc and GND use 3(2) lines each, other lines are for keyboard signaling.
34 JP Pro2 Pro Function Description TMK pin usage
35 --------------------------------------------------------------------------------------------
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
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
47 11 11 12 LS145 ~D(enable) Low(0) enables selected column PB6 output
51 14 HC4051(Z2) ~Enable of Z2 row0-7 PC6
52 15 HC4051(Z3) ~Enable of Z3 row8-15 PC7
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).
56 NOTE: 1KOhm didn't work as pullup resistor on KEY. AVR internal pullup or 10KOhm resistor was OK.
57 NOTE: JP has two HC4051(Z2,Z3) and line 5, 6 and 7 are connected to both of them.
64 HHKB switch matrix is ghost-free and bounce-free.
68 ROW ---------------------------------------------------------------
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_
81 ROW ---------------------------------------------------------------
82 0| ESC TAB LFn LShift LCtrl
94 C| BS Right RShift Enter
103 +-------------------------+-+-+-+-+-+-+-+ Vcc
104 |bias control? - - - - - - - - ---
105 | 3.9K*8 R R R R R R R R |
106 +--------^+ +--------+ - - - - - - - - |
107 | 2| | HC4051 <0-------|-|-|-|-|-|-|-|--|R|-+
108 | |capa. | <1-------|-|-|-|-|-|-|-|--|R|-+
109 | TP1684 |sense | <2-------|-|-|-|-|-|-|-|--|R|-+
110 | 11<------| <3-------|-|-|-|-|-|-|-|--|R|-+
111 | | | <4-------|-|-|-|-|-|-|-|--|R|-+
112 | | | <5-------|-|-|-|-|-|-|-|--|R|-+
113 | <-+ | <6-------|-|-|-|-|-|-|-|--|R|-+
114 | 1 4 | | | <7-------|-|-|-|-|-|-|-|--|R|-+
115 +---V---^-+ | +-^-^-^--+ 0 1 2 3 4 5 6 7 33K*8
116 KEY HYS | A B C +-----------------+
117 | | +-^----+ | | | | LS145 |
118 Vcc | | |BU9831| | | | +-^--^--^--^------+
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 +--------------------------------------------------+ |
125 +--------------------------------------------------+ GND
129 +-----------------------------+-+-+-+-+ Vcc
130 |bias control? - - - - - ---
132 +--------^+ +--------+ - - - - - |
133 | | | HC4051 <0-----------|-|-|-|-|----|R|-+
134 | |capa. | Z2 <1-----------|-|-|-|-|----|R|-+
135 | TP1684 |sense | <2-----------|-|-|-|-|----|R|-+
136 | <---+--| <3-----------|-|-|-|-|----|R|-+
137 | | | | <4-----------|-|-|-|-|----|R|-+
138 | | ~En| <5-----------|-|-|-|-|----|R|-+
139 | | +----> <6-----------|-|-|-|-|----|R|-+
140 | | | | | A B C <7-----------|-|-|-|-|----|R|-+
141 +---V---^-+ | | +-^-^-^--+ | | | | | |
142 KEY HYS | | | | | | | | | | |
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 +--------------------------------------------------+ |
161 +--------------------------------------------------+ GND
166 While pressing space bar, watched HHKB Pro original controller signals by logic analyzer.
167 Row and column is looping between 0-7 each for selecting a key.
168 A key is scaned every about 15ms, so scan rate is 66Hz.
172 Space bar locate at ROW:3 COL:7. A key is selected by HC4051(C,B,A) and LS145(C,B,A).
173 Key state can be read on TP1684(4/KEY) while asserting low on LS145(D).
181 rowC ____~~~~____~~~~ 3.8/3.8ms(JP) 7.7/7.7ms(Pro) S2 of HC4051
182 rowB __~~__~~__~~__~~ 1.9/1.9ms(JP) 3.8/3.8ms(Pro) S1 of HC4051
183 rowA _~_~_~_~_~_~_~_~ 1.0/1.0ms(JP) 1.9/1.9ms(Pro) S0 of HC4051
184 0123456701234567 selected row(Pro)
185 0123456789ABCDEF selected row(JP)
186 rowEn0 ________~~~~~~~~ 7.7/7.7ms(JP only) ~Enable of Z2 HC4051(JP only)
187 rowEn1 ~~~~~~~~________ 7.7/7.7ms(JP only) ~Enable of Z3 HC4051(JP only)
190 colC ____~~~~____~~~~ 550/410us(JP) / us(Pro)
191 colB __~~__~~__~~__~~ 200/210us(JP) 450/460us(Pro)
192 colA _~_~_~_~_~_~_~_~ 100/110us(JP) 220/230us(Pro)
193 0123456701234567 selected column
195 3) Wait 5us after column select, then set prev, strobe colD to spit out key status and read it.
196 hys _~~~~_____ 20us if previous key state is low
197 colD ~~~__~~~~~ 10us strobe
198 key ~~~____~~~ 22us indicates current state of the key
200 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.