This is just a proof of concept for replacing controller of HHKB, not a complete firmware.
My prototype firmware source tree is here:
- branch: hhkb(http://github.com/tmk/tmk_keyboard/tree/hhkb)
+ github(http://github.com/tmk/tmk_keyboard)
This firmware is a port of my previous project:
HHKB style Mod(http://geekhack.org/showwiki.php?title=Island:11930)
PJRC:
Angled USB mini B adapter is used to install Teensy++ laterally.
(teensy_install.jpg)
-Bread baord cables used for connect Teensy++.
+Bread baord wires are used to connect Teensy++.
(teensy_wiring.jpg)
(connector_contact.jpg)
HHKB internal
-------------
-HHKB pro has two PCBs and some chips.
+HHKB pro has some chips on separate two PCBs.
Controller PCB:
M38K07M4 Renesas MCU with USB function
(HHKB_TP1684.jpg)
-Two PCBs are connected by 15 lines. Vcc/GND uses 3 lines each, 9lines for keyboard signaling.
+Two PCBs are connected by 15 lines. Vcc and GND use 3 lines each, other 9 lines are for keyboard signaling.
Keyswitch PCB connector Teensy++ pins
-------------------------------------------------------------------------------
2 Vcc(5V)
3 Vcc(5V)
4 TP1684 KEY: Low(0) when key pressed PE6 input(with pullup)
- 5 TP1684 unknown:how to use PE7 input(with pullup)
+ 5 TP1684 KEY_PREV: assert previous key state??? PE7 output
6 HC4051 A(bit0) select 8 rows(0 to 7) PB0 output
7 HC4051 B(bit1) PB1 output
8 HC4051 C(bit2) PB2 output
Keyswitch matrix
----------------
-60 keyswitches in 8*8 matrix. ghost free. bounce free.
+60 keyswitches in 8*8 matrix. It is ghost-free and bounce-free.
COL 0 1 2 3 4 5 6 7
ROW ---------------------------------------------------------------
(HHKB_chart1.jpg)
- Space bar locate at ROW:3 COL:7. Key are selected by HC4051(C,B,A) and LS145(C,B,A).
+ Space bar locate at ROW:3 COL:7. A key is selected by HC4051(C,B,A) and LS145(C,B,A).
Key state can be read on TP1684(4/KEY) while asserting low on LS145(D).
- Usage of TP1684(5) is unknown. Key state can be read without using this signal.
+
+ Usage of TP1684(5) is not clear. Controller seemed to output previous key state on this line.
+ However key state can be read without using this signal.
(HHKB_chart2.jpg)
for (col: 0-7) {
SELECT_COL(col); // set LS145(A,B,C)
- _delay_us(50);
+ _delay_us(40);
+
+ if (prev_key_state(row, col)) {
+ KEY_PREV_ON;
+ }
+
+ _delay_us(7);
ENALBLE_COL(); // set LS145(D) to low
} else {
// not pressed
}
+
+ KEY_PREV_OFF;
+ UNALBLE_COL(); // set LS145(D) to high
+
+ _delay_us(150);
}
}
Keymap layers
-------------
-Followings are added layers with additional Fn keys. They are not final decision.
+Followings are added layers with additional Fn keys.
-see keymap_hhkb.c
+see keymap.c
EOF