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.alldatasheet.com/datasheet-pdf/pdf/203989/KODENSHI/KK74HC4051A.html
16 LS145 BCD Decoder: select a column line.
17 http://www.alldatasheet.com/datasheet-pdf/pdf/27373/TI/SN74LS145D.html
18 BU9831 Non-volatile electronic potentiometer: for calibration?
19 http://www.alldatasheet.com/datasheet-pdf/pdf/36387/ROHM/BU9831.html
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 9 lines are for keyboard signaling.
33 Keyswitch PCB connector Teensy++ pins
34 -------------------------------------------------------------------------------
35 1 Vcc(5V) Not exist on Pro2 5V
38 4 TP1684 KEY: Low(0) when key pressed PE6 input(with pullup)
39 5 TP1684 KEY_PREV: assert previous key state??? PE7 output
40 6 HC4051 A(bit0) select 8 rows(0 to 7) PB0 output
41 7 HC4051 B(bit1) PB1 output
42 8 HC4051 C(bit2) PB2 output
43 9 LS145 A(bit0) select 8 columns(0 to 7) PB3 output
44 10 LS145 B(bit1) PB4 output
45 11 LS145 C(bit2) PB5 output
46 12 LS145 D(enable) Low(0) enable selected column PB6 output
49 15 GND Not exist on Pro2 GND
51 NOTE: guessing pin5(KEY_PREV) may work for hysteresis of capacitive sensing.
58 60 keyswitches in 8*8 matrix. It is ghost-free and bounce-free.
61 ROW ---------------------------------------------------------------
64 2| 5 6 y t g h n _NONE_
65 3| 1 Esc Tab Control LShift LAlt LMeta Space
66 4| 7 8 u i k j m _NONE_
67 5| \ ` Delete Return Fn RShift RAlt RMeta
68 6| 9 0 o p ; l , _NONE_
69 7| - + ] [ ' / . _NONE_
74 +-------------------------+-+-+-+-+-+-+-+ Vcc
75 |bias control? - - - - - - - - ---
76 | 3.9K*8 R R R R R R R R |
77 +--------^+ +--------+ - - - - - - - - |
78 | 2| | HC4051 <0-------|-|-|-|-|-|-|-|--|R|-+
79 | |capa. | <1-------|-|-|-|-|-|-|-|--|R|-+
80 | TP1684 |sense | <2-------|-|-|-|-|-|-|-|--|R|-+
81 | 11<------| <3-------|-|-|-|-|-|-|-|--|R|-+
82 | | | <4-------|-|-|-|-|-|-|-|--|R|-+
83 | | | <5-------|-|-|-|-|-|-|-|--|R|-+
84 | <-+ | <6-------|-|-|-|-|-|-|-|--|R|-+
85 | 1 4 | | | <7-------|-|-|-|-|-|-|-|--|R|-+
86 +---V---^-+ | +-^-^-^--+ 0 1 2 3 4 5 6 7 33K*8
87 KEY PREV | A B C +-----------------+
88 | | +-^----+ | | | | LS145 |
89 Vcc | | |BU9831| | | | +-^--^--^--^------+
90 --- | | +------+ | | | A B C D +------+
91 | | | | | | | | | | | |
92 1-3 4 5 6 7 8 9 10 11 12 13-15 |
93 +--------------------------------------------------+ |
95 +--------------------------------------------------+ GND
101 While pressing space bar, watched HHKB original controller signals by logic analyzer.
102 Row and column is looping between 0-7 each for selecting a key.
103 A key is scaned every about 15ms, so scan rate is 66Hz.
107 Space bar locate at ROW:3 COL:7. A key is selected by HC4051(C,B,A) and LS145(C,B,A).
108 Key state can be read on TP1684(4/KEY) while asserting low on LS145(D).
110 Usage of TP1684(5) is not clear. Controller seemed to output previous key state on this line.
111 However key state can be read without using this signal.
116 Matrix scan pseudo code
117 -----------------------
119 SELECT_ROW(row); // set HC4051(A,B,C)
122 SELECT_COL(col); // set LS145(A,B,C)
126 if (prev_key_state(row, col)) {
132 ENALBLE_COL(); // set LS145(D) to low
136 if (KEY == 0) { // read TP1684(KEY)
143 UNALBLE_COL(); // set LS145(D) to high