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.
34 pro pro2 Description Teensy++ pins
35 --------------------------------------------------------------------------------------------
36 1 Vcc(5V) Not exist on Pro2 5V
39 4 3 TP1684 KEY: Low(0) when key pressed PE6 input(with pullup)
40 5 4 TP1684 KEY_PREV: make threshold PE7 output
41 6 5 HC4051 A(bit0)\ PB0 output
42 7 6 HC4051 B(bit1) > select row(0 to 7) PB1 output
43 8 7 HC4051 C(bit2)/ PB2 output
44 9 8 LS145 A(bit0)\ PB3 output
45 10 9 LS145 B(bit1) > select column(0 to 7) PB4 output
46 11 10 LS145 C(bit2)/ PB5 output
47 12 11 LS145 D(enable) Low(0) enables selected column PB6 output
50 15 GND Not exist on Pro2 GND
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.
60 60 keyswitches in 8*8 matrix. It is ghost-free and bounce-free.
63 ROW ---------------------------------------------------------------
66 2| 5 6 y t g h n _NONE_
67 3| 1 Esc Tab Control LShift LAlt LMeta Space
68 4| 7 8 u i k j m _NONE_
69 5| \ ` Delete Return Fn RShift RAlt RMeta
70 6| 9 0 o p ; l , _NONE_
71 7| - + ] [ ' / . _NONE_
76 +-------------------------+-+-+-+-+-+-+-+ Vcc
77 |bias control? - - - - - - - - ---
78 | 3.9K*8 R R R R R R R R |
79 +--------^+ +--------+ - - - - - - - - |
80 | 2| | HC4051 <0-------|-|-|-|-|-|-|-|--|R|-+
81 | |capa. | <1-------|-|-|-|-|-|-|-|--|R|-+
82 | TP1684 |sense | <2-------|-|-|-|-|-|-|-|--|R|-+
83 | 11<------| <3-------|-|-|-|-|-|-|-|--|R|-+
84 | | | <4-------|-|-|-|-|-|-|-|--|R|-+
85 | | | <5-------|-|-|-|-|-|-|-|--|R|-+
86 | <-+ | <6-------|-|-|-|-|-|-|-|--|R|-+
87 | 1 4 | | | <7-------|-|-|-|-|-|-|-|--|R|-+
88 +---V---^-+ | +-^-^-^--+ 0 1 2 3 4 5 6 7 33K*8
89 KEY PREV | A B C +-----------------+
90 | | +-^----+ | | | | LS145 |
91 Vcc | | |BU9831| | | | +-^--^--^--^------+
92 --- | | +------+ | | | A B C D +------+
93 | | | | | | | | | | | |
94 1-3 4 5 6 7 8 9 10 11 12 13-15 |
95 +--------------------------------------------------+ |
97 +--------------------------------------------------+ GND
103 While pressing space bar, watched HHKB original controller signals by logic analyzer.
104 Row and column is looping between 0-7 each for selecting a key.
105 A key is scaned every about 15ms, so scan rate is 66Hz.
109 Space bar locate at ROW:3 COL:7. A key is selected by HC4051(C,B,A) and LS145(C,B,A).
110 Key state can be read on TP1684(4/KEY) while asserting low on LS145(D).
112 Usage of TP1684(5) is not clear. Controller seemed to output previous key state on this line.
113 However key state can be read without using this signal.
118 Matrix scan pseudo code
119 -----------------------
121 SELECT_ROW(row); // set HC4051(A,B,C)
124 SELECT_COL(col); // set LS145(A,B,C)
128 if (prev_key_state(row, col)) {
134 ENALBLE_COL(); // set LS145(D) to low
138 if (KEY == 0) { // read TP1684(KEY)
145 UNALBLE_COL(); // set LS145(D) to high