geekhack

geekhack Projects => Making Stuff Together! => Topic started by: hasu on Sun, 10 October 2010, 07:45:01

Title: [TMK] Alternative Controller for HHKB
Post by: hasu on Sun, 10 October 2010, 07:45:01
Synopsis
This controller replaces PFU/Topre stock controller board and makes your HHKB(Pro, Pro2, JP and Type-S) full programmable, so you can do everything you want with the keyboard in theory. This controller works with AVR USB familly such like ATMega32U4 or AT90USB1286, also on ATMega328P with V-USB. It will need 32KB flash at least.

This controller doesn't support Professional BT(PD-KB600/620) and Professional Class/HYBRID series(PD-KB401/PD-KB800/PD-KB820).

My Story
I wanted to add vi cursor keys and mouse keys to HHKB. Stock HHKB controller is not programmable and firmware source code is not open. So customizing HHKB needed to replace original controller with programmable one. My controller and firmware are now mature enough for my daily job. I'm happy to use my HHKB with this controller every day, in particular I can't live without mouse keys!

Any suggestions or ideas are welcome.


Preassembled TMK Alt Controller Board is avialable here:
Type-C connector version is available as well as Mini-B now.(2020-01-15)
https://geekhack.org/index.php?topic=71517.0



DISCLAIMER
I'm not a professional for electronics and MCU programming. This may damage your HHKB.
And my English writing is poor, I'm not sure I can convey my notions accurately.




Update



Features
See README (https://github.com/tmk/tmk_keyboard/#features) of firmware for more info.



TMK keyboard firmware for Alt Contrller
https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb (https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb)



HHKB Internals
See this document and pics.
https://raw.github.com/tmk/tmk_keyboard/master/keyboard/hhkb/doc/HHKB.txt (https://raw.github.com/tmk/tmk_keyboard/master/keyboard/hhkb/doc/HHKB.txt)
https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb/doc/HHKB_img (https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb/doc/HHKB_img)
More
Pro1, Pro2, JP Controller Board
(http://i.imgur.com/ZGpIuDX.jpg)

Pro2 Board Dimension
(http://i.imgur.com/wX66LG4.png)

Pro2 connector: JST ZH(13pin) http://www.jst-mfg.com/product/pdf/eng/eZH.pdf (http://www.jst-mfg.com/product/pdf/eng/eZH.pdf)
Pro1 connector: JST PH(15pin) http://www.jst-mfg.com/product/pdf/eng/ePH.pdf (http://www.jst-mfg.com/product/pdf/eng/ePH.pdf)
JP connector: Hirose DF14(15pin) http://www.hirose.co.jp/cataloge_hp/en_DF14_20130411.pdf (http://www.hirose.co.jp/cataloge_hp/en_DF14_20130411.pdf)

Digipot BU9831 for actuation point tweaking:
https://geekhack.org/index.php?topic=12047.msg2940666#msg2940666


Keymap Editor
You can edit your keymap on line with web browser.

Keymap Editor for TMK Alt Controller Board
http://www.tmk-kbd.com/tmk_keyboard/editor/
More
(http://i.imgur.com/EMUwuYz.png?1)




Hardware Implementation

(1) DIY Alt Controller
You can use PJRC Teensy, Pro Micro or other AVR boards to make your own Alt Controller hardware. See HHKB Internals section for more information to hack.

You can make you own!

(http://i.imgur.com/1Y5fpl.jpg)
Teensy2.0 in Pro2 This photo is from Deskthority thread.

More
Wiring
Quote

    HHKB connector lines:
    JP   Pro2   Pro     Function    Description                               ATMega32U4
    --------------------------------------------------------------------------------------------
                 1      Vcc(5V)                                               5V
     1    1      2      Vcc(5V)                                               5V
     2    2      3      Vcc(5V)                                               5V
     3    3      4      TP1684      ~KEY: Low(0) when key is pressed          PD7 input(with pullup)
     4    4      5      TP1684      HYS: High(1) when key is pressed          PB7 output
     5    5      6      HC4051      A(bit0)\                                  PB0 output
     6    6      7      HC4051      B(bit1) > select row 0-7                  PB1 output
     7    7      8      HC4051      C(bit2)/                                  PB2 output
     8    8      9      LS145       A(bit0)\                                  PB3 output
     9    9     10      LS145       B(bit1) > select column 0-7               PB4 output
    10   10     11      LS145       C(bit2)/                                  PB5 output
    11   11     12      LS145       ~D(enable) Low(0) enables selected column PB6 output
    12   12     13      GND                                                   GND
    13   13     14      GND                                                   GND
                15      GND
    14                  HC4051(Z2)  ~Enable of Z2   row0-7                    PC6
    15                  HC4051(Z3)  ~Enable of Z3   row8-15                   PC7


Also see these nice writeups to make Alt Controller.
https://geekhack.org/index.php?topic=57008.msg1292217#msg1292217 (https://geekhack.org/index.php?topic=57008.msg1292217#msg1292217)
http://deskthority.net/workshop-f7/hardware-dvorak-hhkb-t3415.html (http://deskthority.net/workshop-f7/hardware-dvorak-hhkb-t3415.html)





(2) TMK Alt Controller
TMK Alt Controller Board is a hardware designed and assembled by hands of me(hasu). This board is fully assembled so you can install it just with screw driver.

Schematic and PCB design files are also available.
https://github.com/tmk/HHKB_controller/ [PCB]
https://github.com/tmk/HHKB_controller/tree/master/schematic [Schematic]

USB Controller:
(http://i.imgur.com/xKHNxV3.jpg)

Bluetooth Controller
(http://i.imgur.com/NCy8qLrh.jpg?1)

You can buy this here!
[TMK] Alt Controller Board for HHKB Artisan Service Thread:
https://geekhack.org/index.php?topic=71517.0
https://geekhack.org/index.php?topic=56494.0 (https://geekhack.org/index.php?topic=56494.0)








Goodies from community

- Cover for USB Hub hole by alienman82
https://geekhack.org/index.php?topic=12047.msg1752328#msg1752328
https://geekhack.org/index.php?topic=12047.msg1754098#msg1754098

- Cover for USB Hub hole and Qi charger by manisteinn
https://geekhack.org/index.php?topic=12047.msg1558708#msg1558708

- You need hub? See these. :D
https://geekhack.org/index.php?topic=12047.msg1699177#msg1699177
https://geekhack.org/index.php?topic=57008.msg1491318#msg1491318

- Cover by RavenIl
https://geekhack.org/index.php?topic=12047.msg2165570#msg2165570






Old DIY HHKB BT(Bluegiga WT12)
https://geekhack.org/index.php?topic=20851.0 (Archived)
More
Some thoughts(2014/05/23):
Battery life: IIRC, finally it is around 18hours with 310mAh Lipo when my usual usage, this is, almost idle. Yes I think you can get run-time longer with big battery. My implementation was not completely tuned and remains room to tweak, though, I don't think you can get long battery life as weeks or months like consumer products. I'm sure you can have Sparkfun 850mA(or 1000mA?) in HHKB case but not sure about larger battery.

USB/BT: It is possible and not difficult to switch protocol between USB and Bluetooth. This is useful especially with short battery life keyboard like HHKB. You can used it as normal wired keyboard when you are on your desk without concerning about battery. When it is connected with USB it is charged its battery and can be used as normal USB keyboard.


My HHKB BT code is old and not used now, but you can still see them in my repository.
https://github.com/tmk/tmk_keyboard/tree/f4760c822a34c338250dc47ff6d195935986bdae/keyboard/hhkb
https://github.com/tmk/tmk_keyboard/tree/f4760c822a34c338250dc47ff6d195935986bdae/protocol/iwrap

You may be interested in code around here, it switches protocols:
https://github.com/tmk/tmk_keyboard/blob/f4760c822a34c338250dc47ff6d195935986bdae/protocol/iwrap/main.c#L289

Schematics of HHKB BT:
https://raw.githubusercontent.com/tmk/tmk_keyboard/f4760c822a34c338250dc47ff6d195935986bdae/keyboard/hhkb/doc/Bluetooth_img/BT_circuit.jpg

Pic of HHKB BT:
http://i.imgur.com/4YXc8SF.jpg

New controller schematics(WIP):
https://github.com/tmk/HHKB_controller
https://github.com/tmk/HHKB_controller/blob/master/HHKB_controller_B140314.pdf

In this moment no code for new controller.

Pic of new controller:
http://i.imgur.com/ivekyC6.jpg
Title: Alternative Controller for HHKB
Post by: Rajagra on Sun, 10 October 2010, 11:14:16
Wow. I would have assumed everything in the HHKB Pro would be integrated, and inaccessible to tinkerers. I'm impressed they were methodical enough to separate functional tasks into multiple chips. That is pro. Even more impressed that someone has found a way to hack into it. Good job! :thumb:
Title: Alternative Controller for HHKB
Post by: lowpoly on Mon, 11 October 2010, 03:17:23
Awesome.
Title: Alternative Controller for HHKB
Post by: didjamatic on Mon, 11 October 2010, 05:00:49
Oh my!!!  Fantastic mod!  That is seriously impressive.
Title: Alternative Controller for HHKB
Post by: itlnstln on Mon, 11 October 2010, 06:24:57
That's money.  Great job.

-Sent from my muhf*ckin' HHKB Pro 2
Title: Alternative Controller for HHKB
Post by: Daniel Beaver on Mon, 11 October 2010, 11:38:35
Excellent. I would love to have a fully-reprogrammable HHKB.
Title: Alternative Controller for HHKB
Post by: itlnstln on Mon, 11 October 2010, 11:59:49
The one thing I would do is create a virtual numpad on mine.  That's the only thing I miss on the HHKB, but the size more than makes up for it.
Title: Alternative Controller for HHKB
Post by: lowpoly on Mon, 11 October 2010, 15:08:21
Quote
unavailability of Teensy++/Teensy(because of PS3 cracking boom?)

Please explain.
Title: Alternative Controller for HHKB
Post by: RickyJ on Mon, 11 October 2010, 18:55:43
^ Sony's PS3 finally got cracked, group that did it released USB dongles that jailbreak the PS3.  After Sony threatened legal action against any online store selling the dongles, the group released the source code.  Now anyone can do it using a Teensy, or certain other Atmel based devices.

I've been thinking of resurrecting my other Nan-Tan board that has a fried controller, using an Arduino that I have on my work bench.  Thanks for the added motivation! :)
Title: Alternative Controller for HHKB
Post by: hasu on Mon, 11 October 2010, 18:57:07
lowpoly:
Open source PS3 jailbreak - PSGroove has been public last month. PSGroove uses AT90USB to crack PS3.
So, the demand of AT90USBs rose sharply. AT90USB boards(Teensy, USBKEY and etc)  has disappeared on the planet.
Title: Alternative Controller for HHKB
Post by: kishy on Mon, 11 October 2010, 19:26:57
Makes me glad I grabbed my Teensy++ when I did.

Interesting point is, AFAIK, the Teensy-based PS3 hacks are still unusable, broken by a PS3 update during the hack's rise to popularity.
Title: Alternative Controller for HHKB
Post by: kishy on Mon, 11 October 2010, 20:19:51
Yes, well, as it was explained to me...a good number of people did the update while waiting for their Teensies to arrive.
Title: Alternative Controller for HHKB
Post by: JBert on Sat, 16 October 2010, 16:11:55
@the OP: you say you're no professional but you still got some logic analyser around. Which hardware/software combo is it?
Title: Alternative Controller for HHKB
Post by: hasu on Sat, 16 October 2010, 20:13:18
It is a sample application for CPLD dev board which was available in Japan several years ago. It is no longer available and supported. All information is Japanese only.
http://translate.google.co.jp/translate?u=http%3A%2F%2Foptimize.ath.cx%2Fcusb%2Flogiana.html&hl=en&langpair=auto|en&tbb=1
(http://geekhack.org/attachment.php?attachmentid=12826&d=1286712368)

I would like a open source logic analyzer or the Saleae Logic if I buy now.

http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer (http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer)
http://www.saleae.com/logic/ (http://www.saleae.com/logic/)
Title: Alternative Controller for HHKB
Post by: hasu on Mon, 15 November 2010, 01:20:32
I added this video on article page.
This video show some keymap layers and case mod for USB receptacle.



Left side USB jack is very nice when I use HHKB on ThinkPad.

(http://img6.imageshack.us/img6/4002/201011011683.jpg)
Title: Alternative Controller for HHKB
Post by: Laser Freud on Wed, 17 November 2010, 02:12:57
Thanks for posting, this is very helpful information. I have the HHKB pro 2 and I want to keep the USB hub intact, so instead of replacing the controller completely I'm going to program an AVR to just translate the address bits on 6-11 to the remapped keys.
Title: USB 12KRO support
Post by: hasu on Wed, 24 November 2010, 07:40:51
I added USB 12KRO support and some features to my firmware.
I know 6KRO is enough for most people include me, though it's just possible and fun.
Auido control and sleep/wakeup feature is more essential for me.

12KRO:


audio control/power down & wakeup:
Not a valid youtube URL
Title: Alternative Controller for HHKB
Post by: nanu on Wed, 24 November 2010, 14:52:10
Too pro.
Title: Alternative Controller for HHKB
Post by: woody on Wed, 24 November 2010, 15:59:40
Quote from: ripster;251729
How did you add 12KRO support to a USB keyboard.  Are you using a custom driver or the standard Microsoft HID keyboard driver?

I'd guess more reports in the firmware. There is nothing about 6 in the USB specs, so the HID driver should handle any KRO.
Title: Alternative Controller for HHKB
Post by: hasu on Wed, 24 November 2010, 17:00:39
It uses two standard HID endpoints for 12KRO and standard driver is used.
Windows sees this as two another keyboards on Device Manager.
AVR(AT90USB) has 6 endpoints, 6*6KRO should be possible. :)

Some source says M$ driver can recognizes 10Keys a each endpoint, and if so,
6*10KRO will be possible on Windows without custom driver.

Quote from: ripster;251729
How did you add 12KRO support to a USB keyboard.  Are you using a custom driver or the standard Microsoft HID keyboard driver?
Title: Alternative Controller for HHKB
Post by: woody on Thu, 25 November 2010, 03:35:59
Quote from: hasu;252015
It uses two standard HID endpoints for 12KRO and standard driver is used.
Windows sees this as two another keyboards on Device Manager.

You have to be careful with that - if a report moves between "keyboards", it will be like releasing the key on one and pressing it on the other virtual keyboard.

BTW, why don't you just try increasing the number of reports with a single keyboard, along with a proper descriptor?
Title: Alternative Controller for HHKB
Post by: hasu on Thu, 25 November 2010, 05:41:34
Quote from: woody;252226
You have to be careful with that - if a report moves between "keyboards", it will be like releasing the key on one and pressing it on the other virtual keyboard.

BTW, why don't you just try increasing the number of reports with a single keyboard, along with a proper descriptor?


Your point-out is right. To avoid this problem, it uses some extra memory and cycles.

I am not sure that increasing over 6 keys on single report is recognized by OS keyboard driver. The keyboard which needs a custom driver is cumbersome.
Title: Alternative Controller for HHKB
Post by: woody on Thu, 25 November 2010, 06:53:59
Quote from: hasu;252237
I am not sure that increasing over 6 keys on single report is recognized by OS keyboard driver. The keyboard which needs a custom driver is cumbersome.

The HID doesn't specify anything about limit, so I don't see why HID drivers should have any limit, let alone at 6. That's the whole purpose of the cumbersome HID and the descriptors after all! I can speculate that the keyboards are 6KRO because the firmware developer just copied some example descriptors, or was lazy and chose easier compatibility with the boot mode.

On the other hand, if some OS' driver is hardcoded to a limit, that'll be useful information. Can you verify that?

I'll get to it someday soon, but you have all the tools at your disposal. Be the hero to uncover the mystery. ;-)
Title: Alternative Controller for HHKB
Post by: hasu on Thu, 25 November 2010, 09:42:30
Quote from: woody;252249
The HID doesn't specify anything about limit, so I don't see why HID drivers should have any limit, let alone at 6. That's the whole purpose of the cumbersome HID and the descriptors after all! I can speculate that the keyboards are 6KRO because the firmware developer just copied some example descriptors, or was lazy and chose easier compatibility with the boot mode.


I agree.
But the problem exist  in not only keyboard firmware but also OS driver side.
I can't believe driver/kernel can understand such complex HID report descriptors, I guess it doesn't even read :)

Using 8bytes(6keys)+ report may cause a compatibility problem on some circumstance(which expect a 8bytes report only). This is reason why I use two reports for 12KRO.



Quote

On the other hand, if some OS' driver is hardcoded to a limit, that'll be useful information. Can you verify that?

I'll get to it someday soon, but you have all the tools at your disposal. Be the hero to uncover the mystery. ;-)



I guess the driver is hardcoded on almost OS.
If I get spare time, I'll try to verify the limit on Windows/Linux. (I have no working Mac now :)

I'm not familiar with Linux internal, but this seems to be hardcoded.
http://lxr.linux.no/#linux+v2.6.36/drivers/hid/usbhid/usbkbd.c#L101 (http://lxr.linux.no/#linux+v2.6.36/drivers/hid/usbhid/usbkbd.c#L101)
Code: [Select]
101        for (i = 2; i < 8; i++) {
 102
 103                if (kbd->old[i] > 3 && memscan(kbd->new + 2, kbd->old[i], 6) == kbd->new + 8) {
 104                        if (usb_kbd_keycode[kbd->old[i]])
 105                                input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0);
 106                        else
 107                                dev_info(&urb->dev->dev,
 108                                                &quot;Unknown key (scancode %#x) released.\n&quot;, kbd->old[i]);
 109                }
 110
 111                if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) {
 112                        if (usb_kbd_keycode[kbd->new[i]])
 113                                input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1);
 114                        else
 115                                dev_info(&urb->dev->dev,
 116                                                &quot;Unknown key (scancode %#x) released.\n&quot;, kbd->new[i]);
 117                }
 118        }
 119
 120        input_sync(kbd->dev);
 121
 122        memcpy(kbd->old, kbd->new, 8);
Title: Alternative Controller for HHKB
Post by: kps on Thu, 25 November 2010, 10:07:01
Quote from: hasu;252288
If I get spare time, I'll try to verify the limit on Windows/Linux. (I have no working Mac now :)


I don't know whether the Mac driver has the same limit, but it has one other notable difference: keyboard state is separate for each keyboard, so a modifier key only applies to the keyboard it is on. For example, if you have two keyboards, and press the shift key on one keyboard and the ";:" key on another, Linux & Windows will process this as ":" but OS X will treat it as ";".
Title: Alternative Controller for HHKB
Post by: Soarer on Thu, 25 November 2010, 10:42:52
Thanks to the OP for the idea, this (ed: the multiple virtual keyboards bit) has now become a 'to-do' for my Teensy based PS2 to USB adapter.

I vaguely remember the problem with using larger reports being related to the bios... and that switching to larger reports once Windows boots should be possible, but isn't for some reason.

I wonder if it would work if the first virtual keyboard used 6-key reports and the second used larger reports?

It's rather academic because 12-key really is enough!

Quote from: kps;252296
I don't know whether the Mac driver has the same limit, but it has one other notable difference: keyboard state is separate for each keyboard, so a modifier key only applies to the keyboard it is on. For example, if you have two keyboards, and press the shift key on one keyboard and the ";:" key on another, Linux & Windows will process this as ":" but OS X will treat it as ";".

In this case, the solution is simple - just send the same modifiers for all the virtual keyboards. :-)
Title: Alternative Controller for HHKB
Post by: hasu on Thu, 25 November 2010, 10:45:58
Thanks for an interesting info.
Hmm. I have to try my keyboard on Mac.

Quote from: kps;252296
I don't know whether the Mac driver has the same limit, but it has one other notable difference: keyboard state is separate for each keyboard, so a modifier key only applies to the keyboard it is on. For example, if you have two keyboards, and press the shift key on one keyboard and the ";:" key on another, Linux & Windows will process this as ":" but OS X will treat it as ";".
Title: Alternative Controller for HHKB
Post by: kishy on Thu, 25 November 2010, 13:49:05
Quote from: ripster;252304
Like I've said earlier I've seen lots of people saying you can simply change a HID descriptor but I'm pretty sure the OS will not  recognize it.

If it was that easy some keyboard manufacturer would have done it by now other than Microsoft's Sidewinder X4.


If I am to understand it correctly, it isn't an OS support issue. It's the boot mode which doesn't work.

dfj knows more than I, I just spew whatever little I retain from our lengthy conversations.
Title: Alternative Controller for HHKB
Post by: ricercar on Thu, 25 November 2010, 17:56:20
Quote from: woody;252249
The HID doesn't specify anything about limit, so I don't see why HID drivers should have any limit,


Packet size. I don't have the numbers handy, but there can be only so much data in a USB packet. In the USB Keyboard HID this comes out to 6 keys and some overhead.
Title: Alternative Controller for HHKB
Post by: kishy on Thu, 25 November 2010, 23:06:06
Whatever the reason is, far more than 6kro is possible using standard HID drivers. I have seen this on my own computers and I have a device that does it cable-tied to the back of my desk...

There can be low-level BIOS incompatibilities, however, which is one conceivable reason why we don't see this as the standard.
Title: Alternative Controller for HHKB
Post by: kishy on Thu, 25 November 2010, 23:06:59
Whatever the reason is, far more than 6kro is possible using standard HID drivers.

There can be low-level BIOS incompatibilities, however, which is one conceivable reason why we don't see this as the standard.
Title: NKRO(62KRO) on USB
Post by: hasu on Fri, 26 November 2010, 06:57:00
woody, kishy, You guys win!

I verified that 62KRO by big HID report and standard driver(kbdhid.sys) is possible at least on Windows 7. (Behaviour on other platform and boot protocol is not verified.)
This is not my expectation at all about OS driver implementation. I'm very impressed:)

This is easy to implement, even easier than 12KRO by virtual 2 keyboards method.
Why don't  keyboard  manufactures do this?
62KRO may not be actual merit, but must be hype for some buyers :)

BTW, HHKB has only 52 normal keys, so my HHKB can be called NKRO. right ?
Title: Alternative Controller for HHKB
Post by: sixty on Fri, 26 November 2010, 07:05:47
Wow, outstanding results hasu!
Probably one of the best mods on the site, now that the miniguru project has died.

Great work.
Title: Alternative Controller for HHKB
Post by: Soarer on Fri, 26 November 2010, 07:21:45
As I understand it...
HID keyboards must support 'boot mode', to be used by the BIOS.
Boot mode is predefined (8 bytes) so that the BIOS doesn't have to read descriptors.
Low speed USB HID packets are a maximum of 8 bytes.
Full speed USB HID packets are a maximum of 64 bytes.
But... a 'report' may use multiple packets.
When an OS starts it should read descriptors from all HID devices.
So a HID keyboard could (in theory) then switch to using larger reports.

In practice though...
Most keyboard manufacturers have little motivation to support more than 6KRO.
OS developers have even less motivation (to support keyboards that don't exist).
Keyboard makers need to aim for maximum compatibility.
If there are bugs in any OS's HID implementation, it reduces the lowest common denominator.
And those bugs won't be classed as high priority.

hasu, I still think the idea of using two endpoints is very good.
If the first is configured for 6 keys and the second for 62 keys, it should be very compatible with most BIOS and OS (all of them, if you don't press more than 6 keys!).
Title: Alternative Controller for HHKB
Post by: hasu on Fri, 26 November 2010, 08:07:29
Thanks for your insightful comment, Soarer.

I also think a compatibility is a first target for a keyboard.
A keyboard which doesn't work  in some platform is lame.
64bytes report should be an option not a default, of course.
It is a excess and resource waste for normal use.


Quote from: Soarer;252512

hasu, I still think the idea of using two endpoints is very good.
If the first is configured for 6 keys and the second for 62 keys, it should be very compatible with most BIOS and OS (all of them, if you don't press more than 6 keys!).
Title: Alternative Controller for HHKB
Post by: woody on Fri, 26 November 2010, 09:03:06
Quote from: hasu;252509
I verified that 62KRO by big HID report and standard driver(kbdhid.sys) is possible at least on Windows 7. (Behaviour on other platform and boot protocol is not verified.)


Hasu, you receive the title "The Great GeekHack Un-Mystifier". Nice job!

So, W7 is ok. Linux is probably not - it seems hardcoded as far as I can see by quick glance from the snippet you posted, but there could be other code eventually in another file. So that needs further check. As the other older OSes.

The sad point will be if one of those legacy OSes had hardcoded 2+6 keyboard data, effectively restricting the keyboard manufacturers even today. Which probably happened. Meh.

BTW, Linux HID is easy to fix if it's really lacking.
Title: Alternative Controller for HHKB
Post by: woody on Fri, 26 November 2010, 09:07:00
Quote from: Soarer;252512
When an OS starts it should read descriptors from all HID devices.
So a HID keyboard could (in theory) then switch to using larger reports.

Descriptors are read on every USB device enumeration, i.e. each time they connect/re-connect. Host can force re-connect, too.
Title: Alternative Controller for HHKB
Post by: Soarer on Fri, 26 November 2010, 09:22:19
Quote from: woody;252528
Descriptors are read on every USB device enumeration, i.e. each time they connect/re-connect. Host can force re-connect, too.


True, I was making a distinction between BIOS and OS there - the BIOS doesn't enumerate fully and makes lots of assumptions, and it's possible that an OS could do the same (or have bugs in its implementation) with keyboards - hence the (legally cautious) 'should' and 'could' terms in my description. :-)
Title: Alternative Controller for HHKB
Post by: Soarer on Fri, 26 November 2010, 09:29:20
Quote from: hasu;252519
Thanks for your insightful comment, Soarer.

I also think a compatibility is a first target for a keyboard.
A keyboard which doesn't work  in some platform is lame.
64bytes report should be an option not a default, of course.
It is a excess and resource waste for normal use.


Well, you have a space for some DIP switches ;-)

But I don't think you'd need to use a switch - in normal use the second (64 byte) endpoint would just be idle, with the first (8 byte) endpoint doing all the work.
Title: Alternative Controller for HHKB
Post by: Soarer on Tue, 30 November 2010, 08:30:26
Large reports seem to work on Windows XP also :-)
Title: Alternative Controller for HHKB
Post by: Soarer on Tue, 30 November 2010, 20:27:24
It also works to send a 32 byte report, with a bit for each possible USB key-code.

240KRO :-D

Code: [Select]
#if 0
        0x95, USB_NUM_KEYS,          //   Report Count (6),
        0x75, 0x08,          //   Report Size (8),
        0x15, 0x00,          //   Logical Minimum (0),
        0x25, 0xFF,          //   Logical Maximum(255), // was 0x68,          //   Logical Maximum(104),
        0x05, 0x07,          //   Usage Page (Key Codes),
        0x19, 0x00,          //   Usage Minimum (0),
        0x29, 0xFF,          //   Usage Maximum (255), // was 0x68,          //   Usage Maximum (104),
        0x81, 0x00,          //   Input (Data, Array),
#else
0x75, 0x01,          //   Report Size (1),
0x95, 0xF0,          //   Report Count (240), // 30 bytes
0x05, 0x07,          //   Usage Page (Key Codes),
0x19, 0x04,          //   Usage Minimum (4), // start at 'A'
0x29, 0xF3,          //   Usage Maximum (243), // 30 bytes worth
0x15, 0x00,          //   Logical Minimum (0),
0x25, 0x01,          //   Logical Maximum (1),
0x81, 0x02,          //   Input (Data, Variable, Absolute), ;keys bit array
#endif
Title: Alternative Controller for HHKB
Post by: hasu on Tue, 30 November 2010, 20:39:18
Wow, 240KRO by only 32bytes, nice!
I needed some time to understand this :)
It uses 1bit each a key... genius.

It works with Windows standard driver?
Title: Alternative Controller for HHKB
Post by: Soarer on Tue, 30 November 2010, 20:56:47
Yes, standard driver on XP!
It works the same way as the modifier keys, so I used that section of the definition as a guide. :)
Title: Alternative Controller for HHKB
Post by: woody on Wed, 01 December 2010, 04:53:21
Soarer, you da man, too. I haven't thought about this approach, but apparently it's the best one for a 32 byte packet. Can you verify Linux and other OSes?
Title: Alternative Controller for HHKB
Post by: Soarer on Wed, 01 December 2010, 06:08:33
Probably safe to assume that Vista and 7 will be the same as XP. I'll try to find time to grab a live CD and test on Linux later.

The descriptor change I posted still needs some work, but it looks very promising.
I think the neatest would be to simply have the whole 32 bytes of the report as bits, representing codes from 0 to 255, but I haven't tried it yet.
Title: Alternative Controller for HHKB
Post by: woody on Wed, 01 December 2010, 06:29:39
Yep, that might do, too. How about for a 16-byte report, if you don't need codes above 128?

BTW, are you using this on a different endpoint/interface?
Title: Alternative Controller for HHKB
Post by: hasu on Wed, 01 December 2010, 06:39:48
Quote from: woody;254823
Yep, that might do, too. How about for a 16-byte report, if you don't need codes above 128?


I am thinking same thing.
I think 16byte report is enough for almost keyboard.
Japanese keyboard is one of exception, it used usage ID 135-140.
Title: Alternative Controller for HHKB
Post by: Soarer on Wed, 01 December 2010, 07:05:17
A 16-byte report would almost certainly work, and could handle most common keyboards. The codes don't have to all be consecutive, you can have multiple definition sections so for example you could use the 128 bits for codes 4 to 100 (general), 133 (keypad comma), 135 to 140 (int'l), 144 to 148 (lang), 240 to 247 (modifiers), and then add padding to make it up 128.

Apart from the patch above, I think the only change to the config was to adjust the size of the keyboard report twice - in the endpoint config table, and in the endpoint descriptor in the config descriptor. In the AVR code I'm using (from PJRC (http://www.pjrc.com/teensy/usb_keyboard.html)), there's already a #define for it called KEYBOARD_SIZE.
Title: Alternative Controller for HHKB
Post by: woody on Wed, 01 December 2010, 19:45:28
Splitting into regions would be ok. I can't really predict what's theoretically better - shortening the packet size will free few negligible bytes off USB, but splitting into regions might eat host CPU cycles due to more complex processing in the high-level HID code.
Title: Alternative Controller for HHKB
Post by: Soarer on Wed, 01 December 2010, 20:33:45
Quote from: woody;255269
Splitting into regions would be ok. I can't really predict what's theoretically better - shortening the packet size will free few negligible bytes off USB, but splitting into regions might eat host CPU cycles due to more complex processing in the high-level HID code.


It wouldn't bother the PC side, but on the Teensy it would be more effort, and probably not worth it. But it's certainly possible.

...

Speaking of possible, I have just managed to get my adapter to switch from NKRO mode to boot mode and back... at the right times!!!

This is my modified version of the PJRC keyboard code:

It isn't finished, but it proves the concept.

The BIOS scans USB devices, reading their descriptors, and if it finds a keyboard it issues a SetProtocol command to put it in boot mode. That's the easy switch.

Windows scans devices but does NOT issue a SetProtocol command. IIRC this has been given before as an answer to why more than 6KRO is not possible under Windows (without tricks). But, I thought, what if Windows expects the device to initialize to the correct protocol? I'm still not sure exactly when that initialization should happen, so I reset the protocol to NKRO when the host is starting to read the descriptors.

The BIOS ignores the descriptors it reads, and simply expects to get standard boot mode reports (modifiers + 6 keys). So in the code, there is no descriptor defined that matches boot mode (it sends the NKRO one).

Along the way, I discovered that my BIOS doesn't seem to mind if it gets a larger report, as long as it begins with the standard 8 bytes. I don't know if that could be relied on across all machines.
Title: Alternative Controller for HHKB
Post by: woody on Thu, 02 December 2010, 06:02:28
Quote from: Soarer;255306
It wouldn't bother the PC side, but on the Teensy it would be more effort, and probably not worth it. But it's certainly possible.

AVR is more than fast enough, just some level of indirection through tables.
The unknown hell of high-level abstraction in the PC HID drivers is what would bother me, so I'd keep the report in a single array.

Quote
Windows scans devices but does NOT issue a SetProtocol command. IIRC this has been given before as an answer to why more than 6KRO is not possible under Windows (without tricks). But, I thought, what if Windows expects the device to initialize to the correct protocol? I'm still not sure exactly when that initialization should happen, so I reset the protocol to NKRO when the host is starting to read the descriptors.

You are supposed to enter boot mode only when SetProtocol is issued. After reset/re-enumeration, you must be back to default (long-report) mode. It doesn't matter if the BIOS set boot mode, once OS loads up it will power cycle the USB ports and re-enumerate devices.

Quote
The BIOS ignores the descriptors it reads, and simply expects to get standard boot mode reports (modifiers + 6 keys). So in the code, there is no descriptor defined that matches boot mode (it sends the NKRO one).

Correct. Boot mode is just a kludge.

Quote
Along the way, I discovered that my BIOS doesn't seem to mind if it gets a larger report, as long as it begins with the standard 8 bytes. I don't know if that could be relied on across all machines.

No, keep it 8 bytes.
Title: Alternative Controller for HHKB
Post by: Soarer on Thu, 02 December 2010, 07:08:30
Quote from: woody;255476
AVR is more than fast enough, just some level of indirection through tables.
The unknown hell of high-level abstraction in the PC HID drivers is what would bother me, so I'd keep the report in a single array.
I meant effort to code, and I'm lazy ;-)
I don't think a shorter 16 byte report would really give any advantage, apart from the satisfaction of being slightly more efficient. For my purpose (a PS/2 to USB adapter) it would also mean I'd have to decide which codes to leave out.

Quote from: woody;255476
You are supposed to enter boot mode only when SetProtocol is issued. After reset/re-enumeration, you must be back to default (long-report) mode. It doesn't matter if the BIOS set boot mode, once OS loads up it will power cycle the USB ports and re-enumerate devices.
Yeah, that's what I found out. I think I should move the 'reset' to where it handles SetConfiguration. The Microsoft tests (http://msdn.microsoft.com/en-us/library/ff568610%28VS.85%29.aspx) demand being able to handle SetProtocol to go into full report mode (TD-9.27.3.3), but I've never seen it happen.

Quote from: woody;255476
No, keep it 8 bytes.
Oh, I will. No point in doing otherwise. But I found it curious, because it would mean that a device using the standard report layout, but extended with more keys, would work ok in the bios. Just another reason to ask 'why hasn't someone done this before'?

So why haven't they? Is there a nasty 'gotcha' lurking somewhere that we haven't spotted yet?
Title: Alternative Controller for HHKB
Post by: woody on Thu, 02 December 2010, 07:55:13
On the last question - don't really know. Nevermind, though. I think that the original HID intent of having flexible descriptors and the boot mode is enough. How they ended up with most implementations being 6KRO is beyond me.

You and hasu provided great deal of useful information and beat the lazy me. Cheers.
Title: Alternative Controller for HHKB
Post by: hasu on Thu, 02 December 2010, 09:23:43
I did quick test soarer's method on Ubuntu 10.04, and have no problem !!
But I used 16byte report  rather than 32byte.

My HHKB is USB NKRO on Windows and Linux now :)

This is the descriptor.
Code: [Select]

        0x95, 0x70,          //   Report Count (112),
        0x75, 0x01,          //   Report Size (1),
        0x15, 0x00,          //   Logical Minimum (0),
        0x25, 0x01,          //   Logical Maximum(1),
        0x05, 0x07,          //   Usage Page (Key Codes),
        0x19, 0x00,          //   Usage Minimum (0),
        0x29, 0x73,          //   Usage Maximum (111),
        0x81, 0x02,          //   Input (Data, Variable, Absolute),
Title: Alternative Controller for HHKB
Post by: Soarer on Thu, 02 December 2010, 09:28:23
What is the constraint on report lengths?
I thought it was powers of two, and that's all that seems to work (32=ok, 30=ng, 24=ng, 16=ok). But I just saw a reference in the docs to a 10 byte HID report... confusing!
Title: Alternative Controller for HHKB
Post by: woody on Thu, 02 December 2010, 10:00:51
Just from what I've read - none. Padding problems?
Title: Alternative Controller for HHKB
Post by: Soarer on Thu, 02 December 2010, 10:11:40
I don't think it's that - I wrote some macros to work out how much padding to add to make it up to whole bytes, and they seem to work fine. And I just tried a more hard-coded test of 24 bytes, which also failed.
It's not really important, but as you say, from the docs you'd think there was no restriction other than being whole bytes.
Title: Alternative Controller for HHKB
Post by: woody on Thu, 02 December 2010, 14:13:09
Could it be endpoint buffer size and packet signalling?
Title: Alternative Controller for HHKB
Post by: JBert on Thu, 02 December 2010, 15:04:10
Quote from: Soarer;255494
Oh, I will. No point in doing otherwise. But I found it curious, because it would mean that a device using the standard report layout, but extended with more keys, would work ok in the bios. Just another reason to ask 'why hasn't someone done this before'?

So why haven't they? Is there a nasty 'gotcha' lurking somewhere that we haven't spotted yet?
The answer is easier than it sounds: it takes too much code to run an entire USB HID stack.

So what they do is send a SetProtocol command and then read the raw keyboard data: (written in pseudo-C++ for convenience)
Code: [Select]
unsigned char kbdData[12];
cin >> kbdData;
char key1 = kbdData[4];
char key2 = kbdData[5];
etc...
char key6 = kbdData[11]
Because the boot mode is very strict, they can make assumptions of where the scancodes are and ignore everything else.
Title: Alternative Controller for HHKB
Post by: Soarer on Thu, 02 December 2010, 15:14:44
Quote from: woody;255795
Could it be endpoint buffer size and packet signalling?


Ah-ha, that's it, thanks! The PJRC code used the same #define for both configuration of the endpoint in the USB hardware and the max packet size in the endpoint descriptor. The hardware expects a power of two as the endpoint size, but the max packet size can be less than that.

So... we could transmit all valid USB HID key codes in 23 bytes :-)
Title: Alternative Controller for HHKB
Post by: Soarer on Thu, 02 December 2010, 15:29:16
Quote from: JBert;255847
The answer is easier than it sounds: it takes too much code to run an entire USB HID stack.

So what they do is send a SetProtocol command and then read the raw keyboard data: (written in pseudo-C++ for convenience)
Code: [Select]
unsigned char kbdData[12];
cin >> kbdData;
char key1 = kbdData[4];
char key2 = kbdData[5];
etc...
char key6 = kbdData[11]
Because the boot mode is very strict, they can make assumptions of where the scancodes are and ignore everything else.

Oh, I understand boot mode :) Sorry, what I said before wasn't clear... when I said 'why hasn't someone done this before'?, the 'this' meant switching to a better mode when an OS starts, since it has a full HID stack.

edit: The quirk that my BIOS doesn't mind longer reports, as long as the first 8 bytes match a boot mode report, if universal, would've made it easy for keyboards to support more than 6KRO - they wouldn't even need to switch.

So far, all I know is that switching works on my PC, the 'gotcha' could be that it doesn't work on other PCs.
Title: Alternative Controller for HHKB
Post by: woody on Fri, 03 December 2010, 06:23:25
Good news, Soarer. So W7 and XP work. I saw that hasu verified Linux, too. We can safely expect that OSX is on par.

USB NKRO proved to be as expected.
Title: Alternative Controller for HHKB
Post by: hasu on Fri, 03 December 2010, 08:08:25
I have a bad news.
Windows 2000 failed to handle my 16byte report. :<
Title: Alternative Controller for HHKB
Post by: hasu on Fri, 03 December 2010, 09:53:47
It seem that my code was insufficient.

Windows 2000 could handle the report in second try.


Quote from: hasu;256242
I have a bad news.
Windows 2000 failed to handle my 16byte report. :<
Title: Alternative Controller for HHKB
Post by: woody on Fri, 03 December 2010, 09:54:56
Was it bit array like Soarer did?
Title: Alternative Controller for HHKB
Post by: hasu on Fri, 03 December 2010, 09:58:15
yes, it was.
Title: Alternative Controller for HHKB
Post by: v193r on Thu, 13 January 2011, 20:19:45
Quote from: Laser Freud;247946
Thanks for posting, this is very helpful information. I have the HHKB pro 2 and I want to keep the USB hub intact, so instead of replacing the controller completely I'm going to program an AVR to just translate the address bits on 6-11 to the remapped keys.


anyone know how this is possible to do? or a tutorial prehaps? id like change my layout from qwerty to colemak natively thru the kb(hhkb2) without replacing the controller.
Title: Alternative Controller for HHKB
Post by: hasu on Thu, 13 January 2011, 23:12:31
Quote from: v193r;278250
anyone know how this is possible to do? or a tutorial prehaps? id like change my layout from qwerty to colemak natively thru the kb(hhkb2) without replacing the controller.


What he said is technically possible with additional hardware, but I think replacing the controller is easier way.



Quote from: ripster;278269
My Realforce 87U has DIP Switch setting 4 for firmware upgrade.  Don't think the HHKB has that.


You're right. HHKB's controller is not programmable.
Unfortunately 87U's MCU Fujitsu MB90F377 is not taste of geeks/hackers :)
I think GCC has no support for this MCU.
Title: Alternative Controller for HHKB
Post by: raeb on Thu, 20 January 2011, 14:38:31
Awesome work.

I've been toying with the idea of a teensy controller, but I'm quite unexperienced with this stuff.  Any good documentation recommendations on where I could start?
Title: Alternative Controller for HHKB
Post by: hasu on Thu, 20 January 2011, 23:14:50
Quote from: raeb;281822
Awesome work.

I've been toying with the idea of a teensy controller, but I'm quite unexperienced with this stuff.  Any good documentation recommendations on where I could start?


I think PJRC's USB keyboard example code is a good start point.
It was a start point of my firmware too.

Then you can consult existent keyboard firmware projects.
You can use google to get a documentation on each topic,
but I think no comprehensive documentation exist.


Following is list of keyboard firmware projects for AVR:
PJRC USB Keyboard/Mouse Example
    http://www.pjrc.com/teensy/usb_keyboard.html
    http://www.pjrc.com/teensy/usb_mouse.html
kbupgrade
    http://github.com/rhomann/kbupgrade
    http://geekhack.org/showwiki.php?title=Island:8406
c64key
    http://symlink.dk/projects/c64key/
rump
    http://mg8.org/rump/
    http://github.com/clee/rump
dulcimer
    http://www.schatenseite.de/dulcimer.html
humblehacker-keyboard
    http://github.com/humblehacker
    http://www.humblehacker.com/keyboard/
    http://geekhack.org/showwiki.php?title=Island:6292
ps2avr
    http://sourceforge.net/projects/ps2avr/
Title: Alternative Controller for HHKB
Post by: v193r on Tue, 01 February 2011, 01:51:30
any word on when this will work on the hhkbp2? i want native colemak and maybe usb nkro.
Title: Alternative Controller for HHKB
Post by: hasu on Tue, 01 February 2011, 02:58:41
This picture from rdjack21 (http://geekhack.org/member.php?u=1589)'s post (http://geekhack.org/attachment.php?attachmentid=3997&stc=1&d=1251079883) will be very helpful for you.

Pro2 uses 2 lines each for 5V and GND, 9 lines for signals. It seems to be almost same as Pro.
I think you can use same method for Pro2 though you should trace PCB patterns for accuracy.

(http://geekhack.org/attachment.php?attachmentid=3997&stc=1&d=1251079883)
Title: Alternative Controller for HHKB
Post by: Mazora on Tue, 12 July 2011, 10:19:35
hasu: what are mouse keys and what are they used for ? I guess you don't always have access to a mouse in your work environment?
Title: Alternative Controller for HHKB
Post by: hasu on Tue, 12 July 2011, 11:07:49
Mouse keys is a virtual pointing device implemented on my keyboard firmware, OS see it as a real mouse device so any special settings are not needed.
Mouse keys is enough for most my daily work, but complicated GUI job like CAD, Photoshop and Eclipse need a real mouse.

FYI: Xorg, OS X and Windows also have a mouse key function.
http://en.wikipedia.org/wiki/Mouse_keys
Title: Alternative Controller for HHKB
Post by: jackerran on Mon, 19 September 2011, 07:32:01
I followed the advice given by hasu and traced the pcb for the pro2  I could verify that the LS145 pin positions were correct and the HC4051's C pin was in the correct position. HC4051's A and B appeared to be right but I could not verify. And I could the 2 tracers going to the TP1684, but could not tell their position. It looked good enough for me so I compiled the software and hooked up the teesnie++. The keys seemed to work fine and so did the various modes. I used the following diagram to hook up my HHKB pro2 to the teensie++.
Code: [Select]


Keyswitch PCB connector                                 Teensy++ pins
    -------------------------------------------------------------------------------
     1  Vcc(5V)                                             5V
     2  Vcc(5V)
     3  TP1684    KEY: Low(0) when key pressed              PE6 input(pulluped)
     4  TP1684    KEY_PREV: assert previous key state???    PE7 output
     5  HC4051    A(bit0) select 8 rows(0 to 7)             PB0 output
     6  HC4051    B(bit1)                                   PB1 output
     7  HC4051    C(bit2)                                   PB2 output
     8  LS145     A(bit0) select 8 columns(0 to 7)          PB3 output
     9  LS145     B(bit1)                                   PB4 output
    10  LS145     C(bit2)                                   PB5 output
    11  LS145     D(enable) Low(0) enable selected column   PB6 output
    12  GND
    13  GND                                                 GND


I have not mounted and installed the chip yet, but as soon as I get all the parts needed to mount and install it, I will.
Title: Alternative Controller for HHKB
Post by: hasu on Mon, 19 September 2011, 08:17:15
Nice work! Thank you, jackerran.

This must be helpful to pro2 owners who want to mod.
I will added it on the article some time soon.
Title: Alternative Controller for HHKB
Post by: Dox on Mon, 19 September 2011, 16:20:11
Thanks to jackerran and hasu! looks like  it's time to order a teensy++ for my pro2!
Title: Alternative Controller for HHKB
Post by: hemflit on Sat, 05 November 2011, 01:22:23
Woooo it's working it's working I'm typing this from my PROGRAMMABLE HHKB :)
Muahaha, the sky is the limit now. Now I can take a year off to come up with my own fn-layers. :)

Hasu, you're a genius! Thank you so much for this!

Hey Dox, thanks for nudging me in some other thread to finally do this.

BTW I'm running it on Teensy 2.0 (tweaked a line or two) and it seems it will fit almost perfectly in the space around the mini-USB hole in the case. (That's plain HH Pro, not Pro 2.) I'll just need to sand down like 0.1mm of plastic and it's snug.
[ATTACH=CONFIG]30899[/ATTACH]
Title: Alternative Controller for HHKB
Post by: hasu on Wed, 09 November 2011, 03:49:37
Good to hear that!
And mmm, nice setup of Teensy.
Thanks, hemflit.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 18 June 2013, 19:47:35
I got warning  that this topc is old from system when I posted this :)  No post for 2 years!

This has been heart of my daily driver keyboard and worked well for me in two years. My TMK firmware has developed and evolved mainly on this contoller, this mod is still my main project,  NOT DEAD.

I desigend prototype of controller PCB for Pro2 which is in prouction somewhere in China.
(http://i.imgur.com/bXgj6Qx.png)
Title: Re: Alternative Controller for HHKB
Post by: alaricljs on Tue, 18 June 2013, 19:58:41
The topic was certainly growing dust bunnies... the project certainly not :)

Don't know too many people willing to crack open their HHKB and go at it with an iron though.
Title: Re: Alternative Controller for HHKB
Post by: Aranair on Tue, 18 June 2013, 20:01:38
If its confirmed to be free of any problems.. I might lol:0
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 02 July 2013, 13:56:32
Got it today. Now my spare pro2 got new controller.
(http://i.imgur.com/ryhgHzb.jpg)
Title: Re: Alternative Controller for HHKB
Post by: WhiteFireDragon on Tue, 02 July 2013, 14:12:52
AND? Does it work ok?
Title: Re: Alternative Controller for HHKB
Post by: Wraul on Tue, 02 July 2013, 14:34:07
Got it today. Now my spare pro2 got new controller.
Show Image
(http://i.imgur.com/ryhgHzb.jpg)


Wow, nice.
Will I be able to get my hands on one of those?
There are a few things keeping me from buying a HHKB. Having a programmable controller would change that.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 02 July 2013, 18:30:58
It works well after tweaking code a bit. It is full functional as USB keyboard now, all parts needed for this  are installeed in picture. Right part of PCB is optional for wireless option which is in development.

Yes, I have a plan to part with some of spare PCBs and parts. After some short testing I'll be able to offer some completed controllers or DIY kits. At this time wireless option will not be available.
And PCB and schematic data will also be available some after.
Title: Re: Alternative Controller for HHKB
Post by: esoomenona on Tue, 02 July 2013, 20:22:21
Do you think it might be possible to make one that allows the two USB ports to work with things like flash drives? Possibly wirelessly, if you ever get that going?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 02 July 2013, 21:29:48
It is possible with wired USB connection of course. If USB hub function is installed no firmware support is needed.

But in case of wireless it is impossible realistically with my firmware, i think. You may need more powerful and resource rich platform like Raspberry Pi.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 08 July 2013, 23:22:48
Seems like it has worked well so far.

- With this controller HHKB get programable while losing its USB Hub function as you can see.
- You can install the controller PCB very easily with just screw drivers.
- Components on right half part of PCB are not implemented it is for protyping purpose only and I don't know whether this part works or not atm.

Wraul, if you are still interested in getting this PM me.
Title: Re: Alternative Controller for HHKB
Post by: Wraul on Tue, 09 July 2013, 01:18:12
Seems like it has worked well so far.

- With this controller HHKB get programable while losing its USB Hub function as you can see.
- You can install the controller PCB very easily with just screw drivers.
- Components on right half part of PCB are not implemented it is for protyping purpose only and I don't know whether this part works or not atm.

Wraul, if you are still interested in getting this PM me.

Great to hear that it is working.
Very inspiring work.

Yes I'm still interested in getting one.
I'll send you a PM.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 11 July 2013, 06:38:30
My KiCad project of the controller PCB has repository on github now. I'm happy to share this with the community.
https://github.com/tmk/HHKB_controller

DISCLOSURE: This is my second PCB project, far from professional job. However, it still works!

Title: Re: Alternative Controller for HHKB
Post by: esoomenona on Sat, 20 July 2013, 13:58:51
Great work though! I look forward to the day when we can possibly make a HHKB controller with wireless/BT capability and a USB hub that does something. And I'm sure it will all stem from the great job you've put out so far here.
Title: Re: Alternative Controller for HHKB
Post by: nathankot on Sun, 08 September 2013, 04:10:17
I ordered one of hasu's tmk board replacements for the hhkb pro 2 and it is amazing! Fast response + delivery, everything just fits together perfectly, highly recommended if you don't want to risk damaging your board like me.

Being able to mod your own keyboard is like programming heaven, check out my blog post about this:  http://nathankot.com/blog/2013/09/05/modding-the-happy-hacking-keyboard/

Still tweaking my keymap but I couldn't be happier!!! Thanks hasu :)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 09 September 2013, 07:11:41
nathankot, Great writeup!

Fn key on 'F' in you Vim layer is a great example of use of Dual-role key.
Fn key on home row key is extreme! :D haha
Title: Keymap Editor
Post by: hasu on Mon, 09 September 2013, 11:24:33
I was working on this web based keymap editor recently. Now it can do the job somewhat.
(http://i.imgur.com/A5U8s1Mm.png)

This editor is a fully client side javascript web applicaton without using web app server, it works enven without network connection.  You can download hex file after editing your keymap, just need to program it without compile process.

You can try this at: http://tmk.github.io/tmk_keyboard/editor/hhkb/


This is greatly inspired by Yuri Khan's great work of TECK layout configurator and stole its ideas about share URL and hex download.
https://github.com/yurivkhan/teck/
http://yurivkhan.github.io/teck/
Title: Re: Alternative Controller for HHKB
Post by: MarioRicalde on Mon, 09 September 2013, 14:05:54
That's so nice Hasu! I'm going to be testing it soon.

Any kind of UI will help many users of this mod.

Thanks for the hard work.
Title: Re: Keymap Editor
Post by: mikelanding on Tue, 10 September 2013, 05:06:26
I was working on this web based keymap editor recently. Now it can do the job somewhat.
Show Image
(http://i.imgur.com/A5U8s1Mm.png)


This editor is a fully client side javascript web applicaton without using web app server, it works enven without network connection.  You can download hex file after editing your keymap, just need to program it without compile process.

You can try this at: http://tmk.github.io/tmk_keyboard/editor/hhkb/


This is greatly inspired by Yuri Khan's great work of TECK layout configurator and stole its ideas about share URL and hex download.
https://github.com/yurivkhan/teck/
http://yurivkhan.github.io/teck/
Wow. This is awesome stuff. Are you able to do it for Ergodox user base on cub-uanic's tmk firmware for Ergodox?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 16 September 2013, 21:22:48
I posted this 'cause some people asked me by PM if spare controller boards remain on my hand for last weeks. Thanks for your interest!

All spare boards already had gone now. But I have a plan of next production of PCB. It will cost $20-30 for the completed board excluding shipping. (Shipping to US are estimated about $12 for EMS or $6 for Registered Air Mail.)

Plz watch this thread if you are interested. And your ideas or suggestions on next revision of PCB are welcomed.


FYI, Revision A looks like this.
http://geekhack.org/index.php?topic=12047.msg948923#msg948923
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 16 September 2013, 21:30:25
Wow. This is awesome stuff. Are you able to do it for Ergodox user base on cub-uanic's tmk firmware for Ergodox?

Yes, it is completely possible to port this to any tmk projects including Ergodox.

I described some on how the keymap editor works in this post. I can help someone with interest in job for this port.
http://geekhack.org/index.php?topic=48106.msg1044581#msg1044581
Title: Rev.B PCB
Post by: hasu on Mon, 02 December 2013, 22:03:51
I'll start to design Rev.B PCB before long. Before start the work I'd try to ask some.

1) Rev.A users, do you have any flaw or thought on the board?
If you have requeset, complain, suggestion or anything, post it here(or PM me if it needs). Feedback from real users is very important and helps me a lot.

2) Other suggestion or idea on this?
Are there missing or wanting features?
(But... Don't say about USB hub and DIP switch :) I don't need them!)
Or recommended compornent supplier PCB manufacturer or other production service?

3) Any advices on circuit or PCB work?
I'm not an expert of electronics at all. No doubt I did and will make many mistakes. I need advices.


Why Rev.B?
Rev.A works well with HHKB pro2 and Type-S as a wired USB controller. The reason why I set to Rev.B is to add wireless option with Bluetooth. Rev.B still works as USB controller and also can  connect with wireless if you install BT module and other parts on it. In my plan you can switch between USB and Buletooth, and Li-po battery are charged with USB.

Wired controller part of Rev.A has no apparent flaws so I wont change its design except for some parts are removed or replaced, while its wireless portion has some flaws to be fixed. In Rev.B I'll use new module Roving RN-42 and add FET switching circuit for power control between USB and battery.


Rev.A
KiCAD project:
https://github.com/tmk/HHKB_controller/tree/revA
PCB image:
http://i.imgur.com/NHAavrm.jpg
Schematic:
[attachurl=1]
Title: Re: Alternative Controller for HHKB
Post by: SpAmRaY on Mon, 02 December 2013, 22:06:26
I just want one of the Rev. B controllers, especially to make use of wireless!!!
Title: Re: Alternative Controller for HHKB
Post by: jdcarpe on Mon, 02 December 2013, 22:25:23
I so need one of these! I can't wait for Rev B

hasu, you should talk to komar007 about the PCB manufacturing. He had the GH60 Rev B assembled with all components at the fab, and they turned out great. I believe he was also interested in integrating Bluetooth into the GH60 in the future.
Title: Re: Alternative Controller for HHKB
Post by: AKIMbO on Mon, 02 December 2013, 22:33:42
I so need one of these! I can't wait for Rev B

hash, you should talk to komar007 about the PCB manufacturing. He had the GH60 Rev B assembled with all components at the fab, and they turned out great. I believe he was also interested in integrating Bluetooth into the GH60 in the future.

Hell yeah man...who doesn't need a programmable HHKB (damn forward delete key...so unnatural).
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 03 December 2013, 07:02:07
jdcarpe,
I'll ask komar when my design is finally fixed if demand of the controller is enough. Thanks.
I'd need production service or better equipments like reflow oven and stencil. I'll be tired with soldering SMT components by hand if I have to do tens of PCB.
Title: Re: Alternative Controller for HHKB
Post by: phatdood9 on Tue, 03 December 2013, 19:58:20
I can't wait for the next batch!!

Meanwhile, I've been using keyremap4macbook, but it would be great to have it in hardware too :D

One thing that would be amazing is if I could get either the return key or one of the keys around hjkl to map to the fn key, then remap the arrows to the vi movement keys. I think the only straightforward way would be through firmware ....
Title: Re: Alternative Controller for HHKB
Post by: gnubag on Tue, 03 December 2013, 23:07:22
I will definetly get a HHKB if the bluetooth contoller is done.

put me on the list.

also does it also work for the HHKB JP?
Title: Re: Alternative Controller for HHKB
Post by: MarioRicalde on Wed, 04 December 2013, 13:32:46
Great news!

I'm definitely interested, I actually would like to get 5, put me on the list!

Cheers.
Title: Re: Alternative Controller for HHKB
Post by: Wraul on Wed, 04 December 2013, 13:50:21
As a owner of the current version I must say that hasu has done an amazing job with the controller.
The installation was very painless, and everything appears to be working this far.
Though I have not had time to do much programming of the controller.

Not sure if I really need the wireless functionality. But I guess it there were a wireless version I would be interested to play with it.
Title: Re: Rev.B PCB
Post by: Matt3o on Wed, 04 December 2013, 13:54:50
I'll start to design Rev.B PCB before long. Before start the work I'd try to ask some.

1) Rev.A users, do you have any flaw or thought on the board?
If you have requeset, complain, suggestion or anything, post it here(or PM me if it needs). Feedback from real users is very important and helps me a lot.

2) Other suggestion or idea on this?
Are there missing or wanting features?
(But... Don't say about USB hub and DIP switch :) I don't need them!)
Or recommended compornent supplier PCB manufacturer or other production service?

3) Any advices on circuit or PCB work?
I'm not an expert of electronics at all. No doubt I did and will make many mistakes. I need advices.


Why Rev.B?
Rev.A works well with HHKB pro2 and Type-S as a wired USB controller. The reason why I set to Rev.B is to add wireless option with Bluetooth. Rev.B still works as USB controller and also can  connect with wireless if you install BT module and other parts on it. In my plan you can switch between USB and Buletooth, and Li-po battery are charged with USB.

Wired controller part of Rev.A has no apparent flaws so I wont change its design except for some parts are removed or replaced, while its wireless portion has some flaws to be fixed. In Rev.B I'll use new module Roving RN-42 and add FET switching circuit for power control between USB and battery.


Rev.A
KiCAD project:
https://github.com/tmk/HHKB_controller/tree/revA
PCB image:
http://i.imgur.com/NHAavrm.jpg
Schematic:
(Attachment Link)

Hasu you are a rockstar! Count me in for a rev.B controller especially if it comes with bluetooth!

Please let me know if there's anything I could do to help you with (even if you need funds for the development!)
Title: Re: Alternative Controller for HHKB
Post by: esoomenona on Wed, 04 December 2013, 14:04:55
I didn't see where he asked for interest, so much as advice, so I'm not sure if I'm supposed to throw my name in now, but here it is.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 06 December 2013, 22:01:59
@Wraul, great. Thanks for your feedback!

@MarioRicalde, 5? too much HHKBs :) and you are already on the list.

@esoomenona, I certainly received PM long ago, you are on 2nd place of my list.

@Matt3o, if you want wireless you must wait for later revision. Wireless option is still very beta phase of development. And thanks for you kind word!

My post might be a bit confusing.
If you want to connect your HHKB with USB Rev.B is good for you. But Bluetooh is not mature enough on Rev.B yet, it will need to be revised several times like Rev.C,D,... to finish this wireless project. So you should wait for long time if you need wireless.

Thank you for your interest, guys!


Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Sat, 07 December 2013, 01:37:14
My post might be a bit confusing.
If you want to connect your HHKB with USB Rev.B is good for you. But Bluetooh is not mature enough on Rev.B yet, it will need to be revised several times like Rev.C,D,... to finish this wireless project. So you should wait for long time if you need wireless.

I'm interested anyway! :) With or without wireless :)
Title: Re: Alternative Controller for HHKB
Post by: tjcaustin on Sat, 07 December 2013, 02:18:40
/i'm assuming we're at the wait for rev b phase now?  Cause I want two of these thangs
Title: Re: Alternative Controller for HHKB
Post by: equuelus on Sun, 08 December 2013, 04:31:10
I'd like to reserve one too please. I don't really care if it has wireless or not. Thanks!
Title: Re: Alternative Controller for HHKB
Post by: bpiphany on Sun, 08 December 2013, 06:39:42
I want one of these. The PCB and all the components. I'll solder it myself of course =)
Title: Re: Alternative Controller for HHKB
Post by: snoopy on Sun, 08 December 2013, 06:43:29
I'm also interested in one of those :)
Title: Re: Alternative Controller for HHKB
Post by: Jrwestcoast on Sun, 08 December 2013, 09:09:27


I'm also interested in one. 
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 09 December 2013, 06:56:08
Wrote down on my waiting list, thanks all.

Now it sums up 20+ boards, I'll split them into some runs to minimize risk of my silly failure. Maybe I'll order 10(or 5) PCBs each run.
Title: Re: Alternative Controller for HHKB
Post by: phatdood9 on Mon, 09 December 2013, 19:42:33
I pmed you about the pcb, not sure if you put me down.

Either way, count me in for 1! :)
Title: Re: Alternative Controller for HHKB
Post by: kennardsmith on Wed, 11 December 2013, 20:57:38
I pm'd! I hope it's not too late :)
Title: Re: Alternative Controller for HHKB
Post by: TacticalCoder on Wed, 11 December 2013, 23:22:31
I'm in for two !

I don't need wireless and I don't need the USB hub so: I don't care if the next batch as wireless or not and I don't care if it has the USB hub or not.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 12 December 2013, 00:32:03
phatdood9, you're already on list, sure.

kennardsmith, TacticalCoder, welcome! wrote down.
Title: Re: Alternative Controller for HHKB
Post by: TacticalCoder on Thu, 12 December 2013, 08:52:07
btw... All that is needed to install this is a screwdriver?
Title: Re: Alternative Controller for HHKB
Post by: bueller on Thu, 12 December 2013, 09:00:56
I'm in. Been wanting a hhkb for a while and this is just the nudge I needed.
Title: Re: Alternative Controller for HHKB
Post by: agodinhost on Thu, 12 December 2013, 09:29:46
I so need one of these! I can't wait for Rev B

hasu, you should talk to komar007 about the PCB manufacturing. He had the GH60 Rev B assembled with all components at the fab, and they turned out great. I believe he was also interested in integrating Bluetooth into the GH60 in the future.
I'm still trying to work into that BT project of ours.
Right now my major problem is to find some spare time to work on it.
I didn't quit ...
Title: Re: Alternative Controller for HHKB
Post by: argcargv on Sun, 15 December 2013, 09:48:34
count me in!
Title: Re: Alternative Controller for HHKB
Post by: avtar on Sun, 12 January 2014, 01:28:50
I'm interested in this as well.
Title: Re: Alternative Controller for HHKB
Post by: atlas3686 on Sun, 12 January 2014, 03:43:47
I'm interested for sure, would love to make it programmable. Has anyone tried plugging it into the camera connector kit on iPad? Apparently it wouldn't work as an iPad keyboard std because it draws too much power for the USB hub, so I was wondering if it worked with this mod.
Title: Re: Alternative Controller for HHKB
Post by: mr.bean on Sun, 12 January 2014, 05:56:25
100% in
Title: Re: Alternative Controller for HHKB
Post by: MJ45 on Sun, 12 January 2014, 08:42:42
I would be very much interested in obtaining one for my HHKB. Most awesome work your doing hasu, I hope you can include me on the list.
Title: Re: Alternative Controller for HHKB
Post by: bazh on Sun, 12 January 2014, 09:31:46
BT means I could use my HHKB with iPad ? If so then yes yes, I'm in for sure.
Title: Re: Alternative Controller for HHKB
Post by: tuxsavvy on Sun, 12 January 2014, 19:43:45
I am in for one as well, am not picky about bluetooth feature. Should it have bluetooth feature I hope one can still use the keyboard via wired as well (also disabling bluetooth would be nice when using wired). I haven't caught up much of the topic let alone have read what are the official specifications on rev. B.

頑張ってください、ボクが君を応援します! (English translation: Please do your best, I will be cheering you on!)
Title: Re: Alternative Controller for HHKB
Post by: avtar on Sun, 12 January 2014, 20:40:18
Yeah wireless would be great but it's not a showstopper for me. Having more flexibility with the board itself is what I really, really want.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 13 January 2014, 21:07:25
Thanks for your interests, guys.

I'm working on Bluetooth(2.1+EDR) controller but it is still very personal project without good power control and pairing feature. You will need to wait for very long if you want wireless function. At least, with next several revisions I won't/can't offer assembled wireless controller.
I don't expect wireless HHKB can work long with bettery and to me Bluetooth is just supplementary feature. My Buletooth controller will have USB connection for main feature.

tuxsavvy, ありがとう、がんばるよ。(´∀`)
Title: Re: Alternative Controller for HHKB
Post by: AKIMbO on Mon, 13 January 2014, 21:33:40
phatdood9, you're already on list, sure.

kennardsmith, TacticalCoder, welcome! wrote down.

Put me down on your list too hasu.  I'd love to be able to reprogram my HHKB!
Title: Re: Alternative Controller for HHKB
Post by: tjcaustin on Mon, 13 January 2014, 21:36:15
BT means I could use my HHKB with iPad ? If so then yes yes, I'm in for sure.

You shouldn't need bt for that.  Use the camera connection thing.
Title: Re: Alternative Controller for HHKB
Post by: bazh on Mon, 13 January 2014, 21:55:14
BT means I could use my HHKB with iPad ? If so then yes yes, I'm in for sure.

You shouldn't need bt for that.  Use the camera connection thing.

I know but camera conection kit just for the additional keyboard doesnt sound good to me, I mean I never get in the wire-mess just for a tablet and a better keyboard. In fact I'm impressed with the Minila Air and the convinient it brings but the layout and the sw are nothing compared to HHKB so I just want a HHKB "Air"  :p
Title: Re: Alternative Controller for HHKB
Post by: WyldKard on Thu, 16 January 2014, 16:45:42
Would love to get in on this if still possible! My hack to use the HHKB with an iPad is not exactly convenient. I'd be in for one, maybe even two of these for now.
Title: Re: Alternative Controller for HHKB
Post by: Wildcard on Thu, 16 January 2014, 17:17:15
Would love to get in on this if still possible! My hack to use the HHKB with an iPad is not exactly convenient. I'd be in for one, maybe even two of these for now.

Now that's just silly :)
Title: Re: Alternative Controller for HHKB
Post by: ekw808 on Thu, 16 January 2014, 17:30:39
Hope I'm still on that waiting list.
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Fri, 17 January 2014, 05:49:29
Hi Hasu,

Just received a HHKB Pro 2 as a gift recently and after reading nathankot's blog post "Modding the HHKB," wanted to put my name on the list for one of these mod boards in addition to one of the upcoming ones (Rev. B) if I could.

Thanks!
Title: Re: Alternative Controller for HHKB
Post by: atlas3686 on Fri, 17 January 2014, 07:07:13
BT means I could use my HHKB with iPad ? If so then yes yes, I'm in for sure.

You shouldn't need bt for that.  Use the camera connection thing.

As far as I know it doesn't work because of the extra power draw for the USB hub, might work with this mod but not sure, can anyone confirm?
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Fri, 17 January 2014, 09:14:19
BT means I could use my HHKB with iPad ? If so then yes yes, I'm in for sure.

You shouldn't need bt for that.  Use the camera connection thing.

As far as I know it doesn't work because of the extra power draw for the USB hub, might work with this mod but not sure, can anyone confirm?

See http://geekhack.org/index.php?topic=29626.msg566856#msg566856 for power requirements. I believe the iPad (with the Camera Connection Kit) is capable of powering certain flash drives so it should be sufficient.
Title: Re: Alternative Controller for HHKB
Post by: avtar on Fri, 17 January 2014, 18:59:58
I might have missed this but any idea what the timeline looks like for this controller?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 17 January 2014, 20:50:16
This is current waiting list, let me know via PM if you are listed or not listed wrongly.
I'll PM you from top of the list when controllers get to be available. After that you can decide whether you accept it or not. No risk of you being on the list, in other words.

Design of new revision PCB is currently stuck a bit and I'm working on other small project. And another project will be comming. So this will progress very slow for a while, you need big patience. Sorry for this.

Thanks for your interesting.

Code: [Select]
HolidaySHRIMP       09/10
ekw808              09/15
esoomenona          09/17
MarioRicalde        09/20
argcargv            10/30
Felis Catus         11/01
SpAmRaY             11/01
equuelus            11/04
jdcarpe             11/16
phatdood9           12/03
nogah               12/04
gnubag              12/04
MarioRicalde        12/05
Matt3o              12/05
tjcaustin           12/07
equuelus            12/08
bpiphany            12/08
snoopy              12/08
Jrwestcoast         12/08
phatdood9           12/10
kennardsmith        12/12
TacticalCoder       12/12
BB__                12/13
Resonance           12/14
argcargv            12/15
Katana              12/21
Hzza                01/04
avtar               01/12
atlas3686           01/12
mr.bean             01/12
MJ45                01/12
bazh                01/12
tuxsavvy            01/13
AKIMbO              01/14
rdev5               01/17
margo baggins       01/18
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Fri, 17 January 2014, 22:53:36
This is current waiting list, let me know via PM if you are listed or not listed wrongly.
I'll PM you from top of the list when controllers get to be available. After that you can decide whether you accept it or not. No risk of you being on the list, in other words.

Design of new revision PCB is currently stuck a bit and I'm working on other small project. And another project will be comming. So this will progress very slow for a while, you need big patience. Sorry for this.

Thanks for your interesting.

Code: [Select]
HolidaySHRIMP       09/10
ekw808              09/15
esoomenona          09/17
MarioRicalde        09/20
argcargv            10/30
Felis Catus         11/01
SpAmRaY             11/01
equuelus            11/04
jdcarpe             11/16
phatdood9           12/03
nogah               12/04
gnubag              12/04
MarioRicalde        12/05
Matt3o              12/05
tjcaustin           12/07
equuelus            12/08
bpiphany            12/08
snoopy              12/08
Jrwestcoast         12/08
phatdood9           12/10
kennardsmith        12/12
TacticalCoder       12/12
BB__                12/13
Resonance           12/14
argcargv            12/15
Katana              12/21
Hzza                01/04
avtar               01/12
atlas3686           01/12
mr.bean             01/12
MJ45                01/12
bazh                01/12
tuxsavvy            01/13
AKIMbO              01/14
rdev5               01/17
margo baggins       01/18

Thanks Hasu!

In the mean time, I'm going to look into trying out my hand at building a prototype board based on the previous blog posts from which this project is derived. Got into Arduino a bit at the beginning of 2013 but didn't really have a use for it after a while so I lost interest. Might just pick it up again for this project.
Title: Re: Alternative Controller for HHKB
Post by: jorgenslee on Fri, 17 January 2014, 22:55:10
Hi hasu, please add me on the list. Thanks
Title: Re: Alternative Controller for HHKB
Post by: simkev on Thu, 30 January 2014, 03:57:03
This is current waiting list, let me know via PM if you are listed or not listed wrongly.
I'll PM you from top of the list when controllers get to be available. After that you can decide whether you accept it or not. No risk of you being on the list, in other words.

Design of new revision PCB is currently stuck a bit and I'm working on other small project. And another project will be comming. So this will progress very slow for a while, you need big patience. Sorry for this.

Thanks for your interesting.

Code: [Select]
Please add me to the list.
HolidaySHRIMP       09/10
ekw808              09/15
esoomenona          09/17
MarioRicalde        09/20
argcargv            10/30
Felis Catus         11/01
SpAmRaY             11/01
equuelus            11/04
jdcarpe             11/16
phatdood9           12/03
nogah               12/04
gnubag              12/04
MarioRicalde        12/05
Matt3o              12/05
tjcaustin           12/07
equuelus            12/08
bpiphany            12/08
snoopy              12/08
Jrwestcoast         12/08
phatdood9           12/10
kennardsmith        12/12
TacticalCoder       12/12
BB__                12/13
Resonance           12/14
argcargv            12/15
Katana              12/21
Hzza                01/04
avtar               01/12
atlas3686           01/12
mr.bean             01/12
MJ45                01/12
bazh                01/12
tuxsavvy            01/13
AKIMbO              01/14
rdev5               01/17
margo baggins       01/18
Title: Re: Alternative Controller for HHKB
Post by: steve.v on Sun, 09 February 2014, 21:43:10
Hello,

I am thinking of making a purchase of a HHKB (haven't decided on on a pro 2 or the type-S). It seems your work is one of the missing pieces that will make this keyboard almost perfect. I am right that you are working to create a hardware component that will enable a HHKB to be fully programmable? If interested, will there need to be any installation steps such as soldering? Before I commit, I would like to know what kinds of installation it will require; I am not too confident yet to do any soldering on a HHKB yet as I am afraid of breaking something due to my lack of soldering skills. Thank you.

Steve
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 10 February 2014, 01:03:27
Yes, wIth this controller it is fully programmable in my terminology. Even if my firmware doesn't fulfill your requirement you can still program it fully youself with GNU tools like compiler, assembler and etc. You can do almost everything with this keyboard if you are a C or AVR assembly programmer.

To install the controller board you need only a screw driver and a bit courage enough to void your warranty :)
You don't need soldering skills.

Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Mon, 10 February 2014, 01:32:48
hasu, would it possible to alter the actuation point? or even better, to get the actual resonance number from the capacitive switch?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 10 February 2014, 01:56:54
Matt3o,
no it is not possible to tweak actuation point with this controller. You will need to change digital potentiometer value but HHKB doesn't has signal lines of digipot on its connector.
I'm not sure what is "resonance number" but I think the answer is also no probably.
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Mon, 10 February 2014, 02:02:12
Matt3o,
no it is not possible to tweak actuation point with this controller. You will need to change digital potentiometer value but HHKB doesn't has signal lines of digipot on its connector.
I'm not sure what is "resonance number" but I think the answer is also no probably.

thanks. Am I right in saying that on the Leopold that seems actually possible?
Title: Re: Alternative Controller for HHKB
Post by: joneslee85 on Mon, 10 February 2014, 03:55:09
Hey hasu

Is the power input enough to build a USB 3 hub board for this controller?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 10 February 2014, 06:28:41
Matt3o, I guess so.

joneslee85, hmm, I think how much you can get power depends on capacity of your USB host power supply.
But I don't know about USB3 at all and not sure what you are asking honestly.
Title: Re: Alternative Controller for HHKB
Post by: naasfu on Wed, 26 February 2014, 01:31:15
Hey hasu, can you please add me to your wait list for your HHKB controller?  I would very much love to have one of these.  I'd like to program other Fn layouts, and especially try SpaceFN using a hardware implementation, since the software approach hasn't been working out too well for me so far.

Thanks!   :thumb:
Title: Re: Alternative Controller for HHKB
Post by: grantr on Wed, 05 March 2014, 16:55:52
I've been watching this project with great interest for years, and planned to design a board myself until I saw hasu was making one of his own! Please add me to the list for one controller.
Title: Re: Alternative Controller for HHKB
Post by: esoomenona on Wed, 05 March 2014, 20:02:30
Can't wait until I get one of these things. I've just been contemplating all the possibilities in my mind!
Title: Re: Alternative Controller for HHKB
Post by: argcargv on Tue, 11 March 2014, 21:50:19
Hi Hasu,

I know you've been very busy, any updates on the project?
Thanks!

 :thumb:
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 12 March 2014, 21:59:22
I was working on power selector circuit and PCB design these days. After several checks it will be sent to PCB manufacturer in a few weeks. Five(or ten at most) PCBs will be ordered for this batch.
(http://i.imgur.com/BXE0tK6.png)
[attachurl=1]
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Thu, 13 March 2014, 03:47:02
hasu, do you have any idea what's the second header/connector for in each and every topre PCB?
Title: Re: Alternative Controller for HHKB
Post by: RESPRiT on Thu, 13 March 2014, 04:25:20
Any estimate on the costs? I'm very interested in one of these :D
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Wed, 26 March 2014, 18:44:55
I am loving the HHKB Type-S I bought. After reading a blog post I have found and read over this wonderful thread.

I really want to try this mod so I can make my board programmable but I don't want to wait a long time (many months). Bluetooth would be nice but it is not necessary. What would you suggest I do?

1) Try to wait (Not sure on the ETA which could be a long time)

2) Order my own PCB - I found Revision A on your github. (I'm not sure how much SMD soldering this involves)

3) Use a teensy. (Not properly mounted)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 26 March 2014, 19:50:50
Nice, I'd encourage 2) or 3), of course :D

3) will be cheapest and quickest way and in my case strong double sideded tape worked well to stay board on. You may need a receptacle for HHKB like this, I have some extra PM me if you want.
http://deskthority.net/workshop-f7/hardware-dvorak-hhkb-t3415.html#p66362

2) is also an option if you want cleaner and good looking controller. Now Rev.B design is available, but not be confirmed yet. You had better wait for the confirmation of the design. I got Rev.B PCB and components yesterday and can let you know whether the design is good or not in next couple days.
https://github.com/tmk/HHKB_controller/tree/preB

I use elecrow.com for manufacturering the PCB and it is one of Fusion PCB service providers. I can recommend them. Around $35US per 5 PCBs.
HHKB connector is available at Digikey. But problem of this route is shortage of ATMega32U4, it will not be available until May or June. You can still try Ebay sellers or Chinese market, though.
http://www.digikey.jp/product-detail/ja/S13B-ZR-SM4A-TF(LF)(SN)(P)/455-1703-1-ND/926830
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Wed, 26 March 2014, 20:05:23
Thanks for the quick reply Hasu.

$35 for 5 PCB's insn't bad and I am sure I could give away the extras. Looking on octopart there appear to be a few left on newark.com but I'm sure they will run out in their next batch. The scarcity of the ATMega32U4 and SMD soldering (I haven't worked with anything that small yet) are what scare me.

I think I will probably end up purchasing a teensy because as you said it is the "cheapest and quickest" way. I will pm you about it.

Feel free to add me to the list if you want. I would be happy to try out revision C or whatever is available when I am next on the list. Thanks.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 26 March 2014, 21:23:36
I have nine extra header connectors. I can send it at only shipping cost from Japan, maybe around $2US? PM me.
http://www.digikey.com/product-detail/en/B13B-ZR(LF)(SN)/455-1668-ND/926575

Cable is not included, you still need to solder 13 wires on its 1.5mbm pitch pins. With this you can make a harness for Teensy like this.
http://deskthority.net/workshop-f7/hardware-dvorak-hhkb-t3415.html#p66362

EDIT: you can calculate shipping here, I'm in Tokyo, Japan. This page is Japanese, use Google translate. Weight is around 20g maybe.
http://translate.google.co.jp/translate?hl=ja&sl=ja&tl=en&u=https%3A%2F%2Fwww.post.japanpost.jp%2Fcgi-charge%2F&sandbox=1
EDIT2: ah, sorry this page doesn't work with Google translate.
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Wed, 26 March 2014, 21:33:51
$2 is great. I was expecting international shipping to be much, much more expensive. Just domestic shipping from EliteKeyboards is $14.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 29 March 2014, 11:28:39
USB part of Rev.B PCB works well now.
(http://i.imgur.com/7p9aKFCl.jpg)
Title: Re: Alternative Controller for HHKB
Post by: RESPRiT on Sat, 29 March 2014, 11:41:04
USB part of Rev.B PCB works well now.
Show Image
(http://i.imgur.com/7p9aKFC.jpg)


Wow, very cool hasu! Do you know if you'll be able to send out copies with the PCB and the stuff pre-soldered? If not, I might just order the stuff separately and try building it myself, but something put together already would be ideal :P
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Sat, 29 March 2014, 11:41:57
really impressive. Hasu, not that I was expecting anything less from you of course :)
Title: Re: Alternative Controller for HHKB
Post by: Sifo on Sat, 29 March 2014, 18:59:36
:( If I can get my hands on one of these I'd get an HHKB already. Love your work as usual hasu.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 29 March 2014, 19:42:23
Now this controller distribution has a GB thead, I'll keep infomation and waiting list updated there.
http://geekhack.org/index.php?topic=56494.0

Four or five controllers will be available from this revision. I'll PM top four of the list soon.

RESPRiT, you can get assembled PCB from me but it'll take very long time. I added you to the waiting list. But you can send PCB data to FusionPCB, get componets from Digikey and assembled it yourself.
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Fri, 11 April 2014, 14:14:08
I wonder how hard it would be to port the schematic to use with freescale arm k20 chip. I am going to try to build something similar based on mchck (https://mchck.org) and its toolchain.
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Fri, 11 April 2014, 17:45:01
Hey Hasu, I just want to let you know that I got my teensy all soldered up and it works fine (I'm typing on it right now).

I have one issue. I want the bottom row to have the small key as alt and the big key as Super (LGUI).

I edited keymap_hhkb.c to this:
Code: [Select]
    KEYMAP(ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV,   \
           TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC,       \
           LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT,             \
           LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,FN0,             \
                LALT,LGUI,          SPC,                RGUI,RALT),

then ran
Code: [Select]
make clean
make KEYMAP=hhkb
make teensy

I then used the magic command to reboot into bootloader and flashed the teensy. When the controller booted back up it still had the old layout. I have no idea what is wrong, any help would be greatly appreciated.

Here is the output - http://ix.io/bDA



EDIT: Pressing the button on the teensy then running "make teensy" programmed the new layout. Maybe the magic reboot is acting up for some strange reason. I'm not sure.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 11 April 2014, 18:01:17
egdmitry,
I think not so hard if you are familiar with that chip. Alt Controller schematic is very simple and straight.
See this, you need only circuit on first page unless you want wireless option. Also 'Matrix Power Control' is not needed.
Note that HHKB works with 5V level I/O. If your chip don't have 5V tolerant port you'll need voltage translator.
http://geekhack.org/index.php?action=dlattach;topic=12047.0;attach=60715
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 11 April 2014, 18:15:13
Smasher816,
Great! Post pic of your controller, it'll help others interested in.

Hmm, it seems to fail to start Teensy bootloader becuase firmware configuration is for TMK controller board(Atmel DFU) in default.
You need to change it for Teensy(halfKay), see Bootloader size in Makefile. Use 512 instead of 4096.
Code: [Select]
# Boot Section Size in *bytes*
#   Teensy halfKay   512
#   Teensy++ halfKay 1024
#   Atmel DFU loader 4096       (TMK Alt Controller)
#   LUFA bootloader  4096
#   USBaspLoader     2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Fri, 11 April 2014, 19:09:19
egdmitry,
I think not so hard if you are familiar with that chip. Alt Controller schematic is very simple and straight.
See this, you need only circuit on first page unless you want wireless option. Also 'Matrix Power Control' is not needed.
Note that HHKB works with 5V level I/O. If your chip don't have 5V tolerant port you'll need voltage translator.
http://geekhack.org/index.php?action=dlattach;topic=12047.0;attach=60715

Hasu, thanks a lot for the information. Why is 5v strictly required? I thought HHKB used a pretty simple matrix interface when I would scan the keyboard by applying voltage to rows and getting signals from cols. Is this different for HHKB?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 11 April 2014, 19:45:50
No so simple as most keyboards, HHKB(Topre version) has multiplexer, decoder and capacitive sensor in its PCB. These chips require 5V.
See this memo.
https://raw.github.com/tmk/tmk_keyboard/master/keyboard/hhkb/doc/HHKB.txt
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Fri, 11 April 2014, 21:13:47
Thanks Hasu,

Changing the bootloader size appears to have fixed my problem. I just flashed a new firmware without opening the case :)

I didn't take much/any pictures during the soldering process (and my camera is a potato). I would however be happy to write up my process and some tips that I think could be helpful.
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Fri, 11 April 2014, 23:33:41
I ended up spending a long time (over an hour) writing stuff. Anyone interested in using a Teensy as a HHKB controller should check this out :)

http://geekhack.org/index.php?topic=57008.0
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Sun, 13 April 2014, 01:22:21
Nice, I'd encourage 2) or 3), of course :D

3) will be cheapest and quickest way and in my case strong double sideded tape worked well to stay board on. You may need a receptacle for HHKB like this, I have some extra PM me if you want.
http://deskthority.net/workshop-f7/hardware-dvorak-hhkb-t3415.html#p66362

2) is also an option if you want cleaner and good looking controller. Now Rev.B design is available, but not be confirmed yet. You had better wait for the confirmation of the design. I got Rev.B PCB and components yesterday and can let you know whether the design is good or not in next couple days.
https://github.com/tmk/HHKB_controller/tree/preB

I use elecrow.com for manufacturering the PCB and it is one of Fusion PCB service providers. I can recommend them. Around $35US per 5 PCBs.
HHKB connector is available at Digikey. But problem of this route is shortage of ATMega32U4, it will not be available until May or June. You can still try Ebay sellers or Chinese market, though.
http://www.digikey.jp/product-detail/ja/S13B-ZR-SM4A-TF(LF)(SN)(P)/455-1703-1-ND/926830


Hi hasu,

Your work is awesome! And now I'm considering order my own pcb board with your GitHub KiCAD project!

I have't decided to use Rev.A or Rev.B yet. Is the Bluetooth mod confirmed to work now?

And how can I find the list of elements used by the project?(like one ATMega32U4, one RN42..)  I provide the plot files in the GitHub repo to the manufactor, but they said they can only produce the raw board unless I give them the list of elements.

Thanks!
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Sun, 13 April 2014, 02:06:45
I just found the BOM(Bill of Matrials) file. So the only problem is Bluetooth status. Hope there is good news! Can't wait for the new controller!
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Sun, 13 April 2014, 03:14:28
I just found the BOM(Bill of Matrials) file. So the only problem is Bluetooth status. Hope there is good news! Can't wait for the new controller!

Hi hasu,

It looks like the BOM.txt file lacks slot number for each material, I try to generate BOM sheet in KiCAD, but still lacks of some information. could you provide the BOM sheet you sent to http://elecrow.com?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 13 April 2014, 04:06:00
Smasher816, nice write up! Thanks.

Xe0n0, elecrow.com(or other fusion PCB serivces like seeedstudio will also work) don't need BOM file to manufacture PCB, just send gerber files; plot/HHKB_controller_fusion_B140314.zip.

And order components at digikey(or mouser?) according to BOM.txt.

Use Japanese products to help our sinking economy if possible :) like Panasonic or KOA for resistors, Murata or Taiyo Yuden for capacitor, Alps for switch and Hirose/JST for connector. They are reliable enough, I think.

EDIT: Bluetooth option of Rev.B is not confirmed at all yet, I have no time to do that.(And Rev.A has apparently a problem on power control.) If you want wireless connection you have to wait, but  both Rev.A and Rev.B are confirmed for USB.
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Sun, 13 April 2014, 08:53:48
Smasher816, nice write up! Thanks.

Xe0n0, elecrow.com(or other fusion PCB serivces like seeedstudio will also work) don't need BOM file to manufacture PCB, just send gerber files; plot/HHKB_controller_fusion_B140314.zip.

And order components at digikey(or mouser?) according to BOM.txt.

Use Japanese products to help our sinking economy if possible :) like Panasonic or KOA for resistors, Murata or Taiyo Yuden for capacitor, Alps for switch and Hirose/JST for connector. They are reliable enough, I think.

EDIT: Bluetooth option of Rev.B is not confirmed at all yet, I have no time to do that.(And Rev.A has apparently a problem on power control.) If you want wireless connection you have to wait, but  both Rev.A and Rev.B are confirmed for USB.

Hi hasu,

Thanks for your information!

Just checked for fusion PCB service. It seems it will only produce the PCB board, and I have to soldering components by myself.

I try to figure out the all the material I have to buy and how to install them, so I combined the BOM.txt with material list generated by KiCAD. I post it here, just need some help to clarify some details.

Code: [Select]
USB-mini connector  1   Hirose UX60SC-MB-5ST                                J1 
Chip                1   ATMega32U4-AU           TQFP                        1   
Xtal                1   HC49 16MHz  SMT                                     X1 
Capacity            2   22p                     1608                        C5 C6   
Capacity            6   0.1u                    1608                        C3 C7 C8 C9 C10 C13
Capacity            3   1u                      1608 +-10%                  C4 C11 C18 
Capacity            3   10u                     3216                        C1 C2 C14   
Capacity            1   22u                     3225 or 3528 or 3216        C12
Capacity            1   47u                     3225 or 3528 or 3216        C15
Resistor            2   ?R                      ?                           R17 R18
Resistor            2   15k                     ?                           R9 R24 
Resistor            10  10K                     1608                        R1 R6 R7 R8 R11 R12 R15 R16 R22 R23
Resistor            5   1K                      1608                        R4 R5 R10 R21 R25   
Resistor            2   ? R470                                              R13 R14
Resistor            2   22                      1608                        R2 R3   
Resistor            1   0                                                   R19
PPTC500mA           1   TYCO nano                                           PPTC1   
FET-PMOS            2                                                       Q4 Q5   
FET-NMOS            3   SOT23                                               Q1 Q2 Q3   
15pin connector     1   DF14A-15P-1.25H                                     CN1
13pin connector     1   S13B-ZR-SM4A-TF                                     CN2
LED                 9   2012                                                D1 D3 D4 D5 D6 D7 D8 D9 D10
Diode Schottky      1   SOD123                                              D2 
Bluetooth           1   RN42                                                U5 
Lipo Charger        1   LTC4054                                             U4 
Lipo connector      1   JST PH2                                             P100   
3.3V Regulator      1   TAR5SB33                                            U2 
Inductor?           1   L100u                                               L1 
SW-PUSH             1   Alps SKHH or SKHL                                   SW1
SW-SLIDE            1   DPDT                                                SW2
5V Boost converter  1   HT7750A                                             U3 

Is resistor valued R and 15k also the type 1608? (Resistor valued R is not included in BOM.txt, so it will be embed in PCB board?)
Value of resistor on R19 is 0...And it's marked with "Resistor is not implemented", so I just ignored the slot?
What's the proper type of the inductor "L100u" on L1?
I try to check your photo on http://geekhack.org/index.php?topic=56494.0 for detail, but this picture is not clear enough...Do you have an updated an closer photo of the Rev.B board? It would be easier soldering with that.

PS: I contact a manufactor and they told me they can help do the SMD things if I provide BOM sheet with detail slot number.

Again thanks!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 13 April 2014, 12:03:23
All resistors are 1608 metric size. R19 should not be implemented, it is for factory reset of RN42 and will be short with tweezer when reset is needed.
As for L1 around 6mm inductors will fit, I use TOKO.
http://www.toko.co.jp/cgi-bin/database_en/database.cgi?cmd=dp&Tfile=Data&num=716

You can see full resolution photo at imgur: http://i.imgur.com/SaHVCL7.jpg?1

This board uses land patterns for hand soldering(a bit large than reflow one) you may want to check foot print of your component with datasheets and change them if you want manufacturer to reflow production.

EDIT: And note that reset switch should be "side push type" and short stem length, that is,
SKHHLMA010, SKHHLNA010 and SKHHLPA010 will fit. SKHLwill not fit for current PCB foot print.
http://www.alps.com/products/WebObjects/catalog.woa/E/HTML/Tact/SnapIn/SKHH/SKHH_list.html
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Sun, 13 April 2014, 19:43:59
No so simple as most keyboards, HHKB(Topre version) has multiplexer, decoder and capacitive sensor in its PCB. These chips require 5V.
See this memo.
https://raw.github.com/tmk/tmk_keyboard/master/keyboard/hhkb/doc/HHKB.txt

Thanks for the information! Is there some well-defined hardware layer API tmk_keyboard depends on to port it to other hardware? For example, sending hid reports APIs and getting HHKB states. Sorry, haven't looked at tmk_keyboard in details yet, was playing with hid keyboard implementation for my board which seems to be working now so now I am going to move on with experimenting with HHKB part. In theory this will make tmk_keyboard work with teensy 3.0/3.1 as well.
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Sun, 13 April 2014, 20:09:27
All resistors are 1608 metric size. R19 should not be implemented, it is for factory reset of RN42 and will be short with tweezer when reset is needed.
As for L1 around 6mm inductors will fit, I use TOKO.
http://www.toko.co.jp/cgi-bin/database_en/database.cgi?cmd=dp&Tfile=Data&num=716

You can see full resolution photo at imgur: http://i.imgur.com/SaHVCL7.jpg?1

This board uses land patterns for hand soldering(a bit large than reflow one) you may want to check foot print of your component with datasheets and change them if you want manufacturer to reflow production.

EDIT: And note that reset switch should be "side push type" and short stem length, that is,
SKHHLMA010, SKHHLNA010 and SKHHLPA010 will fit. SKHLwill not fit for current PCB foot print.
http://www.alps.com/products/WebObjects/catalog.woa/E/HTML/Tact/SnapIn/SKHH/SKHH_list.html

Thanks hasu!

I guess R17, R18 is just for measure the voltage, some R17 = R18 should be ok. But what exactly value would you use? I not sure about that...

reset switch is the switch at SW1?

Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 13 April 2014, 23:32:28
egdmitry,
unfortunately no documentation and its API is result of ad hoc extensions. You can fork and redesign better API yourself. And you may want to see HaaTa's kiibohd controller which supports Teensy3.
https://gitorious.org/kiibohd-controller


Xe0n0,
I don't decide its value yet. I have no experince with ADC, I have to learn it and read datasheet. I f you want wireless option you also have to learn and debug it.
Yes, I mean SW1 with reset switch.
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Tue, 15 April 2014, 12:23:49
egdmitry,
I think not so hard if you are familiar with that chip. Alt Controller schematic is very simple and straight.
See this, you need only circuit on first page unless you want wireless option. Also 'Matrix Power Control' is not needed.
Note that HHKB works with 5V level I/O. If your chip don't have 5V tolerant port you'll need voltage translator.
http://geekhack.org/index.php?action=dlattach;topic=12047.0;attach=60715

Hasu, do I understand right that this is only for input/power and row/col select could be done by using 3.3v?

Thanks.
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Tue, 15 April 2014, 13:53:36
I have taken a look at data sheets. Multiplexer's minimum high control input is said to be 3.15v for 4.5v vcc and 4.2 for 6v. Not sure what it would be for 5v, hopefully, below 3.3v.  Decoder's high-level control input is 2-7v, low-level 0-0.7v (requires 5v vcc to operate) which is good for me. Not sure what's the decoder output, I guess, it just pulls to vcc on high state, right? TP1684(1) - "Key" probably uses 5v for high state, so I might be able to just use a voltage divider for that one.

So I guess the bottleneck is the multiplexer here. I might have to use 3 transistors to control it with proper 5v voltage.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 15 April 2014, 18:09:57
You have read datasheets and know problem to be solved now.
I think it is time to try it. Let us know your result.
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Wed, 16 April 2014, 08:44:52
Hi hasu,

I've also ordered a teensy++ for test use. What type of wire did your use to connect teensy++ with the 13pin connector? I can not find the right wire on digitkey...not familiar with those electronic components

Thanks!
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Wed, 16 April 2014, 09:06:37
Hi hasu,

I've also ordered a teensy++ for test use. What type of wire did your use to connect teensy++ with the 13pin connector? I can not find the right wire on digitkey...not familiar with those electronic components

Thanks!

I used a teensy 2.0 and did a big write up on it, so feel free to ask me if you need some help.

With the 2.0 you have holes that you can solder wires to. If you get one with pins you use a wire with male heads (https://www.google.com/search?q=male+wire). You can find them at almost any local electronics store, or online website (ex: amazon).
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Sat, 26 April 2014, 02:57:52
I have tried reading the "KEY" voltage with a voltmeter while asserting LOW on all other signal lines and then pressed "2" (actually I tried a bunch of keys) — voltage always stays at 5 volts. I am confused, what am I doing incorrectly?
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Sat, 26 April 2014, 04:53:28
I have checked the decoder, it seems selecting the column correctly (and selecting nothing when the enable is high). The multiplexer is harder to verify, since all the inputs are 5v independent of the column choice (not sure how it works exactly).
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 26 April 2014, 05:12:13
Hmm, output of KEY may not be held so long. If so you can't see the voltage change with voltmeter.

See this chart, it looks like LS145-D is a strobe rather than enable. I mean, KEY doesn't continue to output signal long even if you keep D line low.

(https://raw.githubusercontent.com/tmk/tmk_keyboard/master/keyboard/hhkb/doc/HHKB_img/HHKB_chart2.jpg)
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Sat, 26 April 2014, 15:06:56
Hmm, output of KEY may not be held so long. If so you can't see the voltage change with voltmeter.

See this chart, it looks like LS145-D is a strobe rather than enable. I mean, KEY doesn't continue to output signal long even if you keep D line low.

Hm, interesting. But the graph shows that enable goes high before KEY goes high, so it may be just responding to enable. What would happen if you held an enable low for a longer period of time? Would key output duration be still the same as in the graph?

I also wonder what method of capacitive sensing the chip uses. It looks like a decoder sets a column low to discharge all the capacitors in that column and then the chip looks at a row and measures recharge speed or something. I am just guessing. Although looking at the graph it is able to identify the key state immediately as enable goes low...
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Mon, 28 April 2014, 13:43:04
I have verified, it only holds the line for 22.5us independent of how long the enable pulse is.

[attach=1]
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Wed, 30 April 2014, 20:51:57
An update if you are interested: I got it all working and I am typing now on it (no tmk_keyboard code at the moment unfortunately). I am going to try to fork and generalize tmk framework so that it could run on any architecture, even on x86 (for testing purposes or as a part of something similar to keyremap4macbook). In general, the framework should be able to get a list of currently pressed keys, be able to output pressed keys as well and also have some generalized way to access timeouts/timers/delays. Does this sound reasonable?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 30 April 2014, 22:00:32
egdmitry, nice work! and thanks for nice scope capture :D

And yes, test framework on PC host will be very useful. At this time I have to test code on real keyboard with sadly primitive method :) and I can't test all test cases to be performed. Especially common/action* codes can be tested on host effectively and we can write many test cases for actions. This is really helpful for refactoring and bug fix.
Title: Re: Alternative Controller for HHKB
Post by: egdmitry on Sun, 04 May 2014, 23:37:26
And yes, test framework on PC host will be very useful. At this time I have to test code on real keyboard with sadly primitive method :) and I can't test all test cases to be performed. Especially common/action* codes can be tested on host effectively and we can write many test cases for actions. This is really helpful for refactoring and bug fix.

What's your main OS on the PC, hasu?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 05 May 2014, 01:16:31
Linux, ubuntu 12.04 at this time mainly and Cygwin on Windows 7 sometimes.
Title: Re: Alternative Controller for HHKB
Post by: HannibalChew on Mon, 05 May 2014, 15:29:18
I wish i had the balls to open up my expensive HHKB like that!
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Mon, 05 May 2014, 16:49:45
I wish i had the balls to open up my expensive HHKB like that!

It's actually surprisingly easy. http://geekhack.org/index.php?topic=57008.msg1293238#msg1293238
Title: Re: Alternative Controller for HHKB
Post by: jmolino on Sat, 21 June 2014, 00:26:52
Hi,

I'm having a little problem... I ordered the Teensy 2.0 controller, but for some unknown reason they sent me the Teensy ++ 2.0 controller!  (the one with the angled chip and additional pin outs).  I was trying to follow Smasher's great guide here:  http://geekhack.org/index.php?topic=57008.0  but now the pins dont match the ++ controller.... can anybody help me figure out which pins I need to solder?

Thanks alot for any help or guidance.....
Title: Re: Alternative Controller for HHKB
Post by: jmolino on Sat, 21 June 2014, 01:25:19
Think I found it....https://www.pjrc.com/teensy/pinout.html (https://www.pjrc.com/teensy/pinout.html) .... the pin names are a bit different, but still can be determined.....
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 21 June 2014, 03:48:12
Only concern is how Teensy++ can be installed in Pro2.
Teensy++ is perfectly fit for Pro1 but not for Pro2. See these photos. In Pro2 a standoff prevents Teensy from being installed.

(http://i.imgur.com/YJv70ODl.jpg)
(http://i.imgur.com/mExryaEl.jpg)
Title: Re: Alternative Controller for HHKB
Post by: jmolino on Sat, 21 June 2014, 22:57:07
Perhaps one could just bring in the cable through the 2nd USB Hub port since it is no longer being used.  It wouldn't be "pretty" but it would work.  The only thing I'm wondering is how to secure it to the case - that would seem most important.. I'll have to look around this thread and others for ideas.

Only concern is how Teensy++ can be installed in Pro2.
Teensy++ is perfectly fit for Pro1 but not for Pro2. See these photos. In Pro2 a standoff prevents Teensy from being installed.

Show Image
(http://i.imgur.com/YJv70ODl.jpg)

Show Image
(http://i.imgur.com/mExryaEl.jpg)


Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Sun, 22 June 2014, 19:25:55
Sticky foam tape works wellfor mounting and doesn't leave much residue. Something like this http://www.radioshack.com/product/index.jsp?productId=2103341.

Maybe you can talk to PJRC and see if you can get your teensy switched out. It should go ok, especially if it was their fault.
Title: Re: Alternative Controller for HHKB
Post by: jmolino on Mon, 23 June 2014, 08:51:38
Yep - actually they did send me the correct model.. I should have it today....pretty good customer service to fix up an error like that so fast!

Sticky foam tape works wellfor mounting and doesn't leave much residue. Something like this http://www.radioshack.com/product/index.jsp?productId=2103341.

Maybe you can talk to PJRC and see if you can get your teensy switched out. It should go ok, especially if it was their fault.

Title: Re: Alternative Controller for HHKB
Post by: jdcarpe on Mon, 23 June 2014, 09:23:55
Yep - actually they did send me the correct model.. I should have it today....pretty good customer service to fix up an error like that so fast!

Sticky foam tape works wellfor mounting and doesn't leave much residue. Something like this http://www.radioshack.com/product/index.jsp?productId=2103341.

Maybe you can talk to PJRC and see if you can get your teensy switched out. It should go ok, especially if it was their fault.



This is a bit OT here, but Paul and Robin at PJRC are good people. That's another reason I support using the Teensy myself, and I want to encourage everyone to use Teensys over those Pro Micro or other Arduino (clone) boards.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 10 July 2014, 03:18:11
HHKB JP is supported now!

(http://i.imgur.com/fYc7XJol.jpg)
Title: Re: Alternative Controller for HHKB
Post by: BB__ on Thu, 10 July 2014, 04:38:03
Oh nice.
Thank you hasu for your work. :thumb:

I have JP and Pro2.
When will you start selling it?
I'm in waiting list.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 10 July 2014, 13:09:44
These days I'am working on Bluetooth part of my controller and got it worked somewhat and found some defects on the PCB. I will order new PCB in a month or two to fix the fefects after some more firmware work. Next batch of PCB order will be 10.

In next revision and up of "TMK Alt Controller" PCB will support HHKB Pro2, JP and Type-S.
Title: Re: Alternative Controller for HHKB
Post by: Vitaly on Wed, 23 July 2014, 06:23:11
Yep - actually they did send me the correct model.. I should have it today....pretty good customer service to fix up an error like that so fast!

Sticky foam tape works wellfor mounting and doesn't leave much residue. Something like this http://www.radioshack.com/product/index.jsp?productId=2103341.

Maybe you can talk to PJRC and see if you can get your teensy switched out. It should go ok, especially if it was their fault.



This is a bit OT here, but Paul and Robin at PJRC are good people. That's another reason I support using the Teensy myself, and I want to encourage everyone to use Teensys over those Pro Micro or other Arduino (clone) boards.
Is any difference between teensy and arduino micro clone for usage in keyboard (or joystick)? Micro I can get for $5 with free shipping and teensy about 26 (16 + 10 shipping), 5 times higher.
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Wed, 23 July 2014, 09:07:32
Afaik, they both have the same chip controlling it, and the should have plenty of pins. The big differences are the slightly different layout, and the bootloader. You should be able to compile TMK for it fine (though don't quote me on that).
Title: Re: Alternative Controller for HHKB
Post by: argcargv on Sat, 02 August 2014, 21:54:39
I finally have time to use put Hasu's controller inside the hhkb.

Now the problem is I don't know how to use it. I see the repo here https://github.com/tmk/tmk_keyboard

But how do I install all the software on a Mac? I don't have a windows computer.

Any help would be greatly appreciated! Thanks in advance!

Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Sat, 02 August 2014, 22:08:51
You will need to install crosspack. Then download the code from github, go to the correct keyboard/protocol folder and run make to compile everything, then use dfu-programmer to flash the generated hex to the microcontroller. It might be confusing so someone can help, or maybe they could just compile it for you.

See here: https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md
Title: Re: Alternative Controller for HHKB
Post by: argcargv on Sat, 02 August 2014, 23:27:02
You will need to install crosspack. Then download the code from github, go to the correct keyboard/protocol folder and run make to compile everything, then use dfu-programmer to flash the generated hex to the microcontroller. It might be confusing so someone can help, or maybe they could just compile it for you.

See here: https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md

Thanks! Got it figured out.

For people having trouble installing dfu-programmer (I was on a new mac and missing some needed library files), use this link http://www.uriahbaalke.com/?p=106

One important thing that took me a few minutes to figure out was: when you are ready to build to the TMK alt controller with dfu. do this:

make KEYMAP=[keymap_name] dfu

DO NOT do this:
make KEYMAP=[keymap_name]
make dfu

this second make dfu overwrites the previous keymap you made with the default hhkb one. I was just dumb : P, I think I misunderstood the readme on git hub.
Title: Re: Alternative Controller for HHKB
Post by: dustinhxc on Sat, 20 September 2014, 02:16:02
HHKB JP is supported now!

Show Image
(http://i.imgur.com/fYc7XJol.jpg)


Yay.. I gotta get one someday.. Good job man.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 03 October 2014, 17:43:16
For someone who is interested in HHKB Bluetooth,

You can access files under development here.
https://github.com/tmk/HHKB_controller/ [PCB]
https://github.com/tmk/tmk_keyboard/tree/rn42/keyboard/hhkb_rn42 [Firmware]

(http://i.imgur.com/OXDsvKU.jpg)
Title: .
Post by: esoomenona on Fri, 03 October 2014, 20:52:43
.
Title: Re: Alternative Controller for HHKB
Post by: Latin00032 on Fri, 03 October 2014, 21:02:26
For someone who is interested in HHKB Bluetooth,

You can access files under development here.
https://github.com/tmk/HHKB_controller/ [PCB]
https://github.com/tmk/tmk_keyboard/tree/rn42/keyboard/hhkb_rn42 [Firmware]

Show Image
(http://i.imgur.com/OXDsvKU.jpg)

This makes me want to get a hhkb.

I wish there was an alternate controller that was compatible with the fc660c.
Title: Re: Alternative Controller for HHKB
Post by: epicepee on Mon, 06 October 2014, 22:56:12
Would this work with an atmega2560 via v-usb?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 07 October 2014, 00:21:51
Does VUSB support that MCU?
If yes it'll work probably.
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Tue, 07 October 2014, 00:23:48
For someone who is interested in HHKB Bluetooth,

You can access files under development here.
https://github.com/tmk/HHKB_controller/ [PCB]
https://github.com/tmk/tmk_keyboard/tree/rn42/keyboard/hhkb_rn42 [Firmware]

Show Image
(http://i.imgur.com/OXDsvKU.jpg)


Does this mean you finally got the bluetooth part working and are now looking for other people to test it?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 07 October 2014, 01:07:29
Yes, I hope selftaught DIY people will be able to use my those files and give me feedbacks and suggestions.
The project is not finished and will be revised in next few months but I think it not much far from my goal, 80% maybe?
I'm doing rest of the works like fixing PCB design, power saving and LED indicators now. Hopefully I'll finish them in this year.
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Tue, 07 October 2014, 02:58:35
Yes, I hope selftaught DIY people will be able to use my those files and give me feedbacks and suggestions.
The project is not finished and will be revised in next few months but I think it not much far from my goal, 80% maybe?
I'm doing rest of the works like fixing PCB design, power saving and LED indicators now. Hopefully I'll finish them in this year.

You are unstoppable, hasu! :) you know I'm in line for a BT version as soon as you get it! If you need advance funding just let me know, I'm more than happy to contribute.

PS: what BT module are you using again?
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Tue, 07 October 2014, 11:51:21
He is using the RN-42 HID (smd) from sparkfun.
Title: Re: Alternative Controller for HHKB
Post by: Latin00032 on Tue, 07 October 2014, 20:14:14
Does it support bt 4.0 or higher?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 07 October 2014, 20:38:57
Matt3o, thank you for the encouragement :D Yes, you are on the third of my list!

As Smasher816 said my controller uses Roving Network RN-42(ver6.15) which supports only legacy BT.
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Sun, 12 October 2014, 02:05:55
I wish i had the balls to open up my expensive HHKB like that!

just simply opening and closing hhkb pro 2
is really straightforward


i would like to make the mod with the teensy 3.1 and bluetooth module
https://www.sparkfun.com/products/12646
https://www.sparkfun.com/products/12819
i was thinking if i need also the 5V step breakout for changing the 3.3V teensy 3.1 output to 5V
https://www.sparkfun.com/products/10968
and the lipo battery maybe...
https://www.sparkfun.com/products/8483
Title: Re: Alternative Controller for HHKB
Post by: admiralvorian on Mon, 13 October 2014, 13:32:39
Yes, I hope selftaught DIY people will be able to use my those files and give me feedbacks and suggestions.
The project is not finished and will be revised in next few months but I think it not much far from my goal, 80% maybe?
I'm doing rest of the works like fixing PCB design, power saving and LED indicators now. Hopefully I'll finish them in this year.

keep up the great work hasu! I can't wait to replace my teensy with a BT controller!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 13 October 2014, 19:26:03
I wish i had the balls to open up my expensive HHKB like that!

just simply opening and closing hhkb pro 2
is really straightforward

Nice video.
Yes, the case is no problem, I needed more balls when pull out its connector and lines. You will be scared of damaging them unless you know correct method.

Read these instruction. And you better unscrew PCB before remove the connector.
http://www.hirose.co.jp/cataloge_hp/en_DF14_20130411.pdf
http://www.jst-mfg.com/product/pdf/eng/handling_e.pdf
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Mon, 13 October 2014, 23:48:22
I wish i had the balls to open up my expensive HHKB like that!

just simply opening and closing hhkb pro 2
is really straightforward

Nice video.
Yes, the case is no problem, I needed more balls when pull out its connector and lines. You will be scared of damaging them unless you know correct method.

Read these instruction. And you better unscrew PCB before remove the connector.
http://www.hirose.co.jp/cataloge_hp/en_DF14_20130411.pdf
http://www.jst-mfg.com/product/pdf/eng/handling_e.pdf

Don't pull on the cables because you don't want any of the wires getting yanked out. I just grabbed the plastic "nibs" on the sides and alternated between wiggling the left and right side while pulling. It took a little bit of force to come out but worked fine.
Title: Re: Alternative Controller for HHKB
Post by: BB__ on Thu, 16 October 2014, 15:10:06
Thank you. Hasu.
Received the package. JP controller working properly.  ;D

I'm using muhenkan key as fn layer. When fn activated, I want to use 'm' and ',' keys as parentheses.
Currently I assigned 'm'=9 and ','=0, with shift key it can send parentheses.
FN+Shift+m = (
FN+Shift+, = )
But how can I send without pressing shift key?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 17 October 2014, 02:02:57
Very quick delivery :)

I think you can use this action like,
ACTION_MODS_KEY(MOD_LSFT, KC_9)

https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#212-modified-key
Title: Re: Alternative Controller for HHKB
Post by: Xe0n0 on Mon, 20 October 2014, 08:43:26
For someone who is interested in HHKB Bluetooth,

You can access files under development here.
https://github.com/tmk/HHKB_controller/ [PCB]
https://github.com/tmk/tmk_keyboard/tree/rn42/keyboard/hhkb_rn42 [Firmware]

Show Image
(http://i.imgur.com/OXDsvKU.jpg)


Oh god! That's fascinating! I can't wait to order mine!

By the way hasu, how about the battery life in bluetooth battery mode? And does this design work with iOS devices?
Title: Re: Alternative Controller for HHKB
Post by: Sygaldry on Tue, 28 October 2014, 21:41:10
I will be placing an order for a Type-S soon.
Looking forward to ordering the controller with BT as well!
 :thumb: :thumb: :thumb:
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Wed, 29 October 2014, 15:00:07
Hasu (or anyone else),

How can I MACRO( T(N), ...) each (int) element in digits array in reverse order?

See https://gist.github.com/anonymous/cb0bc4419f83d66ae890
Title: Re: Alternative Controller for HHKB
Post by: bazh on Wed, 29 October 2014, 16:25:36
got mine today, definitely will have a fun time figure it out for my Pro 2 :p


and save me a spot when the final BT controller is ready also! :D
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 29 October 2014, 19:32:45
Not sure what you want to do with this. Can you describe more?

What does that C code and what is contents of digits[] array in the end?


Hasu (or anyone else),

How can I MACRO( T(N), ...) each (int) element in digits array in reverse order?

See https://gist.github.com/anonymous/cb0bc4419f83d66ae890

Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Thu, 30 October 2014, 10:15:53
Hi hasu,

Ultimately what I'd like to do is be able to programatically send keys using a MACRO based on a string of characters I provide, vs. hard coding it statically.

In the case of the gist I linked to, the use case would be to 1) generate a random number and then 2) send each digit in that string or array of digits.

So if my number was 1234, currently I would have to statically bind an Fn key as: MACRO( I(0), T(1), T(2), T(3), T(4), END )

In psuedo-code, what I'm asking is if there is a way to do the following:

Code: [Select]
int digits[] = {1, 2, 3, 4}; // Or random number regnerator

MACRO( I(0) );
for (int i = 0; i < sizeof(digits); i++) {
  MACRO( T( digits[i] ) );
}
MACRO( END );

Integer constants of course are easy since you have definitions for those. However, I'm also looking to do something like the following:

Code: [Select]
char seq[] = {'a', 'b', 'c', '1', '2', '3'}; // Or random number regnerator

MACRO( I(0) );
for (int i = 0; i < sizeof(seq); i++) {
  MACRO( T( seq[i] ) );
}
MACRO( END );

Thanks!

Not sure what you want to do with this. Can you describe more?

What does that C code and what is contents of digits[] array in the end?


Hasu (or anyone else),

How can I MACRO( T(N), ...) each (int) element in digits array in reverse order?

See https://gist.github.com/anonymous/cb0bc4419f83d66ae890
Title: Re: Alternative Controller for HHKB
Post by: byker on Thu, 30 October 2014, 13:16:11
Anyone else see this? Pretty interesting! http://www.kbdmania.net/xe/review/8598580
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 30 October 2014, 13:57:47
MACRO is basically static, all keys used in it should be fixed when compiled. You cannot calculate anything presented in MACRO dynamically at runtime.

You can define 'function action' in keymap instead, in this action you can write most of things freely in C. This is not well documented yet, but you can find some examples in keymap files under keyboard/ or converter/ directories.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#24-function-action

This is an example. To send keycodes to host use functions like register_code() and unregister_code() instead of T().
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L244




Hi hasu,

Ultimately what I'd like to do is be able to programatically send keys using a MACRO based on a string of characters I provide, vs. hard coding it statically.

In the case of the gist I linked to, the use case would be to 1) generate a random number and then 2) send each digit in that string or array of digits.

So if my number was 1234, currently I would have to statically bind an Fn key as: MACRO( I(0), T(1), T(2), T(3), T(4), END )
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Thu, 30 October 2014, 14:55:30
Getting this now (after previous failed attempt to flash with error about bootloader overlap):

Code: [Select]
Creating load file for Flash: hhkb_lufa.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature hhkb_lufa.elf hhkb_lufa.hex
dfu-programmer atmega32u4 erase
Checking memory from 0x0 to 0x6FFF...  Empty.
Chip already blank, to force erase use --force.
dfu-programmer atmega32u4 flash hhkb_lufa.hex
Checking memory from 0x0 to 0x6CFF...  Empty.
0%                            100%  Programming 0x6D00 bytes...
[ X  ERROR
Memory write error, use debug for more info.
make: *** [dfu] Error 1
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Thu, 30 October 2014, 14:57:25
Nevermind, did a force erase, and manually ran
Code: [Select]
dfu-programmer atmega32u4 flash hhkb_lufa.hex and it came back. Now to find a way to compress my code:

Code: [Select]
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  switch (id) {
    case MY_FUNC:
      if (!record->event.pressed && record->tap.count > 0 && !(record->tap.interrupted)) {

        int seed_size = 1000000;
        int seed_array[seed_size];

        // Seed rand from memory+time and generate random number
        int seed = 0; for (int i = 0 ; i < seed_size; i++) seed ^= abs(seed_array[i]);
        seed = abs(seed);

        srand(seed);
        int number = rand();

        // Print
        // printf("Seed: %d\n", seed);
        // printf("Number: %d\n", number);

        // Count digits
        int c = 0, n = number;
        while (n != 0) {n /= 10; c++; }

        // Extract each digit
        int numberArray[c]; c = 0; n = number;
        while (n != 0) {numberArray[c] = n % 10; n /= 10; c++; }

        // Print
        // printf("Verify: ");
        for (int i = c - 1 ; i >= 0; i--) {
          // // printf("%d", numberArray[i]);

          uint8_t k;
          switch(numberArray[i]) {
            case 0: k = 0x27; break;
            case 1: k = 0x18; break;
            case 2: k = 0x19; break;
            case 3: k = 0x20; break;
            case 4: k = 0x21; break;
            case 5: k = 0x22; break;
            case 6: k = 0x23; break;
            case 7: k = 0x24; break;
            case 8: k = 0x25; break;
            case 9: k = 0x26; break;
          }

          register_code(k);
          unregister_code(k);

          // printf("%d(%x) ", numberArray[i], k);
        }

        send_keyboard_report();
        record->tap.count = 0;  // ad hoc: cancel tap
      }
      break;
  }
}
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 30 October 2014, 15:22:02
My smaple code use a bit complex 'if' statement to handle delicate 'dual role key' things. I think you can use just this simple clause to execut your function when the key is released.
Code: [Select]
if (!record->event.pressed) {

And these codes are not needed.
Code: [Select]
        send_keyboard_report();
        record->tap.count = 0;  // ad hoc: cancel tap


Size of int is 16 bit, and ATMega32u4 has only 2.5KB memory(SRAM). This code won't work on the MCU. And you better use uint8_t, uint16_t, int8_t or int16_t in MCU programing instead of int.
Code: [Select]
        int seed_size = 1000000;
        int seed_array[seed_size];
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Thu, 30 October 2014, 15:53:28
Is there a way I can seed rand() or random() from this board (analog signal perhaps)?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 30 October 2014, 16:36:33
I don't know about that kind of things. You can ask experts at AVRFREAKS unless Google can help you.
http://www.avrfreaks.net/
Title: Re: Alternative Controller for HHKB
Post by: rdev5 on Thu, 30 October 2014, 17:28:03
How about just seeding rand() to get a random number between 0 and 128?

Also my updated code (entropy was generated using crypto#randomBytes in node.js):

Code: [Select]
uint8_t asc2key(uint8_t l)
{
    switch (l) {
        case 'A': return KC_A;
        case 'B': return KC_B;
        case 'C': return KC_C;
        case 'D': return KC_D;
        case 'E': return KC_E;
        case 'F': return KC_F;
        case 'G': return KC_G;
        case 'H': return KC_H;
        case 'I': return KC_I;
        case 'J': return KC_J;
        case 'K': return KC_K;
        case 'L': return KC_L;
        case 'M': return KC_M;
        case 'N': return KC_N;
        case 'O': return KC_O;
        case 'P': return KC_P;
        case 'Q': return KC_Q;
        case 'R': return KC_R;
        case 'S': return KC_S;
        case 'T': return KC_T;
        case 'U': return KC_U;
        case 'V': return KC_V;
        case 'W': return KC_W;
        case 'X': return KC_X;
        case 'Y': return KC_Y;
        case 'Z': return KC_Z;
        case '1': return KC_1;
        case '2': return KC_2;
        case '3': return KC_3;
        case '4': return KC_4;
        case '5': return KC_5;
        case '6': return KC_6;
        case '7': return KC_7;
        case '8': return KC_8;
        case '9': return KC_9;
        case '0': return KC_0;
        case '\n': return KC_ENTER;
        case 0x1B: return KC_ESCAPE;
        case '\b': return KC_BSPACE;
        case '\t': return KC_TAB;
        case ' ': return KC_SPACE;
        case '-': return KC_MINUS;
        case '=': return KC_EQUAL;
        case '[': return KC_LBRACKET;
        case ']': return KC_RBRACKET;
        case '\\': return KC_BSLASH;
        case ';': return KC_SCOLON;
        case '\'': return KC_QUOTE;
        case '`': return KC_GRAVE;
        case ',': return KC_COMMA;
        case '.': return KC_DOT;
        case '/': return KC_SLASH;
        default: return KC_NO;
    }
}

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  switch (id) {
    case ENTROPY:
      if (!record->event.pressed && record->tap.count > 0 && !(record->tap.interrupted)) {

        // Select chars in entropy[] seed starting at pos(i)
        char MAP_HEX[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
        uint8_t MAP_CODE[] = { 0x27, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
        char entropy[] = {
          '6','5','D','A','1','9','9','8','6','B','E','7','1','0','7','A','6','1','D','4','B','D','4','3','6','B','D','1','5','9','5','C','A','3','4','C','0','7','9','3','7','F','9','F','D','D','A','4','1','0','1','3','1','F','9','C','9','0','4','6','F','1','D','0','2','5','7','C','4','2','1','C','A','B','3','1','F','F','1','8','5','0','D','1','5','B','E','8','7','5','2','3','E','7','A','2','B','2','9','3','6','5','A','E','B','E','A','3','6','B','9','7','B','C','9','4','A','A','8','0','5','8','3','D','2','E','E','F',
          '7','F','9','7','3','2','0','D','9','5','B','F','5','D','0','1','7','D','6','D','B','A','1','4','5','E','2','F','C','0','9','7','A','6','E','1','F','9','1','4','A','2','3','C','8','6','5','0','4','D','2','8','1','5','1','F','F','9','8','C','1','5','2','B','7','6','B','C','B','3','C','B','B','C','A','C','B','9','A','1','D','5','0','F','5','F','E','0','A','9','1','5','5','0','2','8','9','4','F','6','7','C','8','4','2','8','C','4','E','8','6','7','3','1','3','5','2','4','0','6','C','7','5','9','1','B','8','9',
          '2','1','0','6','3','7','F','6','F','2','1','C','4','3','3','6','E','6','1','0','A','E','6','7','5','A','E','E','C','D','2','3','1','D','1','6','5','D','B','7','1','6','3','3','3','9','7','A','B','5','6','C','2','1','E','1','C','F','6','B','5','C','2','D','B','8','2','0','2','E','F','E','B','1','8','5','0','7','C','D','E','0','9','D','E','4','4','C','0','A','0','D','6','1','8','1','2','4','1','2','6','7','B','F','F','5','C','D','F','E','1','6','8','F','A','6','0','6','2','7','E','2','4','C','B','2','6','7',
        };
        int max = sizeof(entropy) / sizeof(entropy[0]);

        for (int i = 0; i < 64 * 2; i += 2) {

          /** Begin loop code on i**/

              // Sanitize range
              i = (i <= 0) ? 0 : i;
              i = (i >= max) ? max - 1 : i;

              // Get char at pos(i)
              int pos = (i % 2) ? i - 1 : i;
              char c1 = entropy[pos];
              char c2 = entropy[pos + 1];

              // printf("%d: char(%c, %c) -> send(0x%x, 0x%x)\n", i, c1, c2, k1, k2);
              register_code(asc2key(c1)); unregister_code(asc2key(c1));
              register_code(asc2key(c2)); unregister_code(asc2key(c2));

          /** End loop code on i**/

        }

        send_keyboard_report();
        record->tap.count = 0;  // ad hoc: cancel tap
      }
      break;
  }
}
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Sun, 23 November 2014, 09:40:27
Following the video of opening the hhkb, I'm showing how much is simple to change the hhkb pcb (how i did).
I'm completely not a professional and in anyway means that what I did is the right way.
Actually I think there is many better way to remove the connector.
what i did was making force on the little opening under the connector using the pcb surface under it (of course taking care of not making any scratch or similar, and actually from my point of view was simple and fast).
But I made a mistake in re connecting the connector I didn't apply too much force :/ so after testing it, was not getting power. but I didn't close yet so I just put more force in the connector and the second time was working as supposed.
I changed my 2 hhkb  :D both working amazing  :D with perfect response and fidelity :eek:
I didn't program yet anyway because i'm under school exam... but i will do as soon as i can.

Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 23 November 2014, 19:14:47
Pro2 JST connector is fairly tight and needs some force to mate/unmate it while JP Hirose connector is easy compared to JST.

I'd say this again, I recommend you follow method proposed by manufacturers and this works certainly for me.
You don't need any tool to remove/unmate the connector use just your fingers. Plier and screwdriver likely slip off and make scratch and give cables damage.

To remove/unmate hold many cables as possible with thumb and index finger and wiggle the connector laterally each side within 15deg range.

To insert/mate just push both side edge of the connector parallel with fingers or nails.

JST instruction:
(http://i.imgur.com/s0g2ztW.png)

Hirose instruction:
(http://i.imgur.com/lSJ5Klm.png)

Quote
Read these instruction. And you better unscrew PCB before remove the connector.
http://www.hirose.co.jp/cataloge_hp/en_DF14_20130411.pdf
http://www.jst-mfg.com/product/pdf/eng/handling_e.pdf
https://geekhack.org/index.php?topic=12047.msg1499922#msg1499922
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Sun, 23 November 2014, 20:54:44
Yes i tried at first to do like that but it was completely not moving... :(
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Thu, 27 November 2014, 04:54:35
hasu which keyboard layout is preinstalled on the tmk alternative controller for HHBK ?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 27 November 2014, 05:33:05
Your one has this keymap.
https://github.com/tmk/tmk_keyboard/blob/fd7833388cdf8b15728d951b63e78571ba2edbc9/keyboard/hhkb/keymap_hhkb.c


After shipped yours I changed keymap_hhkb.c a bit.
https://github.com/tmk/tmk_keyboard/commit/4192bce16b6cf4c5acc10ea6b26fb714fc132e01
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Thu, 27 November 2014, 20:51:39
ooh that's why my alt and SUPER_L was inverted :)

i will also change the backspace working with FN and remove the FN + ESC combination
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Fri, 28 November 2014, 04:08:20
just finished to write the new version with some personal change :)
it work so well :D!
Title: Re: Alternative Controller for HHKB
Post by: x1a0 on Mon, 08 December 2014, 16:15:58
You will need to install crosspack. Then download the code from github, go to the correct keyboard/protocol folder and run make to compile everything, then use dfu-programmer to flash the generated hex to the microcontroller. It might be confusing so someone can help, or maybe they could just compile it for you.

See here: https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md

Thanks! Got it figured out.

For people having trouble installing dfu-programmer (I was on a new mac and missing some needed library files), use this link http://www.uriahbaalke.com/?p=106

One important thing that took me a few minutes to figure out was: when you are ready to build to the TMK alt controller with dfu. do this:

make KEYMAP=[keymap_name] dfu

DO NOT do this:
make KEYMAP=[keymap_name]
make dfu

this second make dfu overwrites the previous keymap you made with the default hhkb one. I was just dumb : P, I think I misunderstood the readme on git hub.

Thanks! This helped me!
Title: Re: Alternative Controller for HHKB
Post by: manisteinn on Wed, 10 December 2014, 15:11:10
I thought I'd share some HHKB stuff I've made since august:

I made and ordered a switch cap 3d-model and attached to plastic covers:
https://imgur.com/a/kdox9
http://www.shapeways.com/model/2602069/hhkb-bt-switch-cap-v2.html

The covers aren't hard to make, but a little time consuming to get right:
- Find a piece of plastic with a color and finish that matches the case (I used a d-link dir-100 router cover)
- Cut roughly to the right size (slightly larger).
- Drill 3mm holes for the light-pipes in one of them and cut a groove for the switch cap in the other.
- Sand on a flat surface to the right size/thickness, make them the same height as the outer case edge so the topre PCB supports them from the inside with the case closed.
The cap has a tiny lip on the bottom, insert with the PCB unscrewed

Completed covers: https://i.imgur.com/MS4pfR2.jpg

For USB only you could just glue a single piece of plastic to the PCB, or solder something to holes close to the edge for support.



I also added wireless qi charging with automatic power source switching: https://imgur.com/a/9yds3
I haven't used it much yet, I'm waiting for the release of the longer range qi v1.2 resontant transmitters to place one under my tabletop: http://www.wirelesspowerconsortium.com/blog/86/major-milestones-for-v12-resonant-specification
I still haven't fixed the reset issue and won't be able to until february, otherwise it works fine and a completely wireless keyboard is nice :)



The battery I used is AFAIK the largest one that'll fit without case modifications: 3.7v 2000mah 804550 (you'd need to add longer cables and connectors)
http://www.aliexpress.com/item/804550-854550-084550-3-7vmp5-battery-flat-gps-mobile-power-remote-control/978812465.html

They shipped me a pair of slightly smaller lower capacity (1800mah) batteries the second time, so you might want to confirm the exact dimensions and capacity in case you want to order a pair.
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Thu, 11 December 2014, 05:27:19
how long does the battery last?
Title: Re: Alternative Controller for HHKB
Post by: manisteinn on Thu, 11 December 2014, 05:51:29
how long does the battery last?

It lasted 24h27min with BT connected, idle, no power saving.
(https://i.imgur.com/W62JAxQ.png)
(https://i.imgur.com/NnqhJvn.png)


Recharge time (Rprog=2.2K) was 7h28min
(https://i.imgur.com/Z1CihZa.png)

Sorry about the messed up units
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Thu, 11 December 2014, 09:00:12
thanks for the report. I honestly hoped way more than that
Title: Re: Alternative Controller for HHKB
Post by: aliceinwire on Thu, 18 December 2014, 05:15:46
thanks for the report. I honestly hoped way more than that

just see is using the 2000mah ? yes one day is not so much, but hasu is still fixing some leakage from what i know.
Is also not using idle mode.
Title: Re: Alternative Controller for HHKB
Post by: Sturmfrau on Mon, 22 December 2014, 20:41:16
thanks for the report. I honestly hoped way more than that

just see is using the 2000mah ? yes one day is not so much, but hasu is still fixing some leakage from what i know.
Is also not using idle mode.

Well I think you could slap in atleast 4 pieces of 18650 size battery in there with 3200mah capacity. I think panasonic is the one that makes those batteries. Would last way longer.
Title: How to change oneshot modifier to right shift?
Post by: x1a0 on Sat, 27 December 2014, 07:40:16
Hi,

I've tried changing the corresponding line in my keymap.c file:
Code: [Select]
[7] = ACTION_MODS_ONESHOT(MOD_RSFT)
But it does not change anything after flashing...

Thanks!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 27 December 2014, 08:48:52
Oneshot modifier keeps its effect for ONESHOT_TIMEOUT ms after press the key.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#43-oneshot-modifier
What is your timeout?

If it is 300 You have to press following 'a' key within 300ms to get 'A'. Press and release 'Shift', then press 'a' quickly, you will get 'A'.
Title: Re: Alternative Controller for HHKB
Post by: x1a0 on Mon, 29 December 2014, 17:48:52
Oneshot modifier keeps its effect for ONESHOT_TIMEOUT ms after press the key.
https://github.com/tmk/tmk_keyboard/blob/master/doc/keymap.md#43-oneshot-modifier
What is your timeout?

If it is 300 You have to press following 'a' key within 300ms to get 'A'. Press and release 'Shift', then press 'a' quickly, you will get 'A'.
Oh, that reply title was eaten...

I want to change the one shot modifier to right shift, so I edited the keymap as above. But it's still on left shift
Title: Re: Alternative Controller for HHKB
Post by: admiralvorian on Tue, 30 December 2014, 18:20:45
how would one go about disabling one_shot all together? I type way too fast for the stock timeout on my left shift.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 30 December 2014, 18:54:33
x1a0,
I confirmed that it works as what I expected. I used MOD_RSFT in this line instead of MOD_LSFT.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/keymap_hasu.c#L206

what do you use to know which shift the key registers? I use xev or showkey on linux, aquakeytest on windows.
Title: Re: Alternative Controller for HHKB
Post by: x1a0 on Wed, 31 December 2014, 04:37:18
@hasu

Thanks for the reply :)

EDIT: It's working now! Sorry that I didn't read doc very carefully and misunderstood how the keymap works (basically those FNn definition, i thought it was for F1~F12 on normal keyboards...). Thanks again for this awesome project - now I can play with my ideas... :p

I am using a Mac and use an app called key-codes to check key pressing.

I just tried again, it's still on left shift...

Here is the change in my file: https://github.com/x1a0/tmk_keyboard/blob/master/keyboard/hhkb/keymap_x1a0.c#L206
Title: Re: Alternative Controller for HHKB
Post by: x1a0 on Wed, 31 December 2014, 05:40:02
how would one go about disabling one_shot all together? I type way too fast for the stock timeout on my left shift.

AFAIK, you can remove the corresponding function key registration in the default layer (Layer 0). Check this line in my keymap file: https://github.com/x1a0/tmk_keyboard/blob/master/keyboard/hhkb/keymap_x1a0.c#L29

Notice the very left "LSFT" in that line, it was "FN7" there before - means that key was registered as a function key (the one-shot modifier). Now I have changed it to a normal key (LSFT), and moved the one-shot modifier to my right shift key (the "FN5" on the right side of this line).

Hope this can help you!
Title: Re: Alternative Controller for HHKB
Post by: PieterGen on Thu, 01 January 2015, 14:18:36
Just to be 100% sure: does the controller work with the HHKB Professional JP Type-S. I mean the keyboard with the Japanse layout and silenced.

I'm asking this because the GitHub page states "This controller can work with HHKB Professional, Professional 2, JP and Type-S."   But, the difference between silenced (=Type-S) and non-silenced is only in the switches, right?  Meaning, it should work for the (Professional) JP Type-S.

Can anybody confirm this please?  Thanks!  :cool:
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Fri, 02 January 2015, 02:39:20
It should just be the switches. Hasu has it working with all the different HHKB variations :thumb:
Title: Re: Alternative Controller for HHKB
Post by: admiralvorian on Fri, 02 January 2015, 17:27:50
how would one go about disabling one_shot all together? I type way too fast for the stock timeout on my left shift.

AFAIK, you can remove the corresponding function key registration in the default layer (Layer 0). Check this line in my keymap file: https://github.com/x1a0/tmk_keyboard/blob/master/keyboard/hhkb/keymap_x1a0.c#L29

Notice the very left "LSFT" in that line, it was "FN7" there before - means that key was registered as a function key (the one-shot modifier). Now I have changed it to a normal key (LSFT), and moved the one-shot modifier to my right shift key (the "FN5" on the right side of this line).

Hope this can help you!

I can't believe I didn't notice that! Thank you very much!
Title: Re: Alternative Controller for HHKB
Post by: Joey Quinn on Fri, 02 January 2015, 19:59:44
Edit: Found one  :thumb:
Title: Re: Alternative Controller for HHKB
Post by: tpc2084 on Thu, 15 January 2015, 10:53:59
I see the buying thread for Hasu's Alt HHKB controller board is now closed. Does anyone have one of these boards available for sale?  Does anyone know if Hasu is still planning on selling these boards?  I don't need the bluetooth portion, so an older revision controller would work fine for me. I do need the board for a HHKB Professional JP keyboard, so that specific connector type is necessary. Thanks in advance!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 15 January 2015, 11:34:23
It is close but slighty open :) You can still order here.
https://geekhack.org/index.php?topic=56494.0
Title: Re: Alternative Controller for HHKB
Post by: coolbho3k on Thu, 15 January 2015, 14:29:09
It is close but slighty open :) You can still order here.
https://geekhack.org/index.php?topic=56494.0
PM'd you hasu. :D

edit: if I get the latest revision of your controller board, can I solder my own Bluetooth module to it? THanks!
Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Thu, 15 January 2015, 15:04:13
It is close but slighty open :) You can still order here.
https://geekhack.org/index.php?topic=56494.0
PM'd you hasu. :D

edit: if I get the latest revision of your controller board, can I solder my own Bluetooth module to it? THanks!

It would be best to use the same chip as he is using. Theoretically you could use another one that had the same size and pin count, but you would have to also change the code to work with it.
Title: Re: Alternative Controller for HHKB
Post by: coolbho3k on Thu, 15 January 2015, 15:37:58
It is close but slighty open :) You can still order here.
https://geekhack.org/index.php?topic=56494.0
PM'd you hasu. :D

edit: if I get the latest revision of your controller board, can I solder my own Bluetooth module to it? THanks!

It would be best to use the same chip as he is using. Theoretically you could use another one that had the same size and pin count, but you would have to also change the code to work with it.

Yeah that is what I meant. The board will not support bluetooth as it comes in the mail, but I am planning to get the same chip and a LiPo battery.
Title: Re: Alternative Controller for HHKB
Post by: TheOtherAdam on Thu, 15 January 2015, 18:07:23
Hi Hasu

For you everyday HHKB do you run a Teensy++ 2.0 or a "Hasu's Alt HHKB controller board", i couldn't find the specs on your board vs the Teensy!

I would like to support yours efforts with the firmware and developing something this cool, but i also want the best controller!

Thanks for the effort you have put in!

Cheers
Adam
Title: Re: Alternative Controller for HHKB
Post by: jdcarpe on Thu, 15 January 2015, 18:53:31
hasu's controller board and the Teensy++ 2.0 (and even Teensy 2.0) share a common controller, the ATmega32U4. As long as the matrix gets to the pins on the controller IC, the firmware doesn't care which you are using!
Title: Re: Alternative Controller for HHKB
Post by: TheOtherAdam on Thu, 15 January 2015, 19:12:48
hasu's controller board and the Teensy++ 2.0 (and even Teensy 2.0) share a common controller, the ATmega32U4. As long as the matrix gets to the pins on the controller IC, the firmware doesn't care which you are using!

Hi JD

There are some differences between the Teensy++ 2.0 and event Teensy 2.0 see Teensy USB Development Board (https://www.pjrc.com/teensy/index.html)

Specification      Teensy 2.0     Teensy++ 2.0
Flash Memory     32256           130048
RAM Memory      2560              8192

I would have thought having more ram and more flash would help with many layers and complex re-mappings, but then again, it might not!

Cheers
Adam

Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 15 January 2015, 19:51:28
I'm using only TMK Alt controller board(with ATmega32U4) these days and my firmware is not tested on Teensy's any more. But both Teensy and Teensy++ are still supported.

It is no problem with RAM size but 32KB flash is a little tight for full featured firmware build. You're right but HHKB keymap consumes only 64 bytes per layer on flash you won't need so much flash area for keymap. If you want to implement features you'll need more flash.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 16 January 2015, 21:23:32
Bluetooth module RN-42 support was integrated into Alt Controller firmware now.


RN-42 specific codes are here:
https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb/rn42
Title: Re: Alternative Controller for HHKB
Post by: Sygaldry on Mon, 19 January 2015, 19:32:30
I thought I'd share some HHKB stuff I've made since august:

I made and ordered a switch cap 3d-model and attached to plastic covers:
https://imgur.com/a/kdox9
http://www.shapeways.com/model/2602069/hhkb-bt-switch-cap-v2.html

The covers aren't hard to make, but a little time consuming to get right:
- Find a piece of plastic with a color and finish that matches the case (I used a d-link dir-100 router cover)
- Cut roughly to the right size (slightly larger).
- Drill 3mm holes for the light-pipes in one of them and cut a groove for the switch cap in the other.
- Sand on a flat surface to the right size/thickness, make them the same height as the outer case edge so the topre PCB supports them from the inside with the case closed.
The cap has a tiny lip on the bottom, insert with the PCB unscrewed

Completed covers: https://i.imgur.com/MS4pfR2.jpg

For USB only you could just glue a single piece of plastic to the PCB, or solder something to holes close to the edge for support.



I also added wireless qi charging with automatic power source switching: https://imgur.com/a/9yds3
I haven't used it much yet, I'm waiting for the release of the longer range qi v1.2 resontant transmitters to place one under my tabletop: http://www.wirelesspowerconsortium.com/blog/86/major-milestones-for-v12-resonant-specification
I still haven't fixed the reset issue and won't be able to until february, otherwise it works fine and a completely wireless keyboard is nice :)



The battery I used is AFAIK the largest one that'll fit without case modifications: 3.7v 2000mah 804550 (you'd need to add longer cables and connectors)
http://www.aliexpress.com/item/804550-854550-084550-3-7vmp5-battery-flat-gps-mobile-power-remote-control/978812465.html

They shipped me a pair of slightly smaller lower capacity (1800mah) batteries the second time, so you might want to confirm the exact dimensions and capacity in case you want to order a pair.
This looks great!

Would it be possible for you to take some exact measurements for the covers so we could get a 3D model made up and put up on Shapeways?
Title: Re: Alternative Controller for HHKB
Post by: wolfv on Sun, 22 February 2015, 17:18:19
Would this work?
Teensy-LC (low cost Teensy) 62K flash, 8K RAM $11.65, Release is scheduled for March 10th
pin-compatible with Teensy 3.0 and 3.1 http://www.pjrc.com/teensy/teensyLC.html
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 22 February 2015, 19:02:47
I don't find reason not to work on that board it has more power, flash and ram than AVR.
My controller doesn't use any specific functions to AVR I believe you can port to any platform.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 22 February 2015, 19:12:08
Oh, Teensy-LC is not 5V tolerant, you will need some voltage shifters to communicate with HHKB which works in 5V.
http://www.pjrc.com/teensy/teensyLC.html#specs
Title: Re: Alternative Controller for HHKB
Post by: yankez001 on Wed, 18 March 2015, 22:36:48
Hey Hasu,
I'm trying out your hhkb controller on my HHKB Professional JP (Type-S).
I see the device under USB:
  Bus 020 Device 003: ID feed:cafe feed HHKB mod
Writing a sample keymap via dfu-programmer succeeded.
Wow, looks like it's working, awesome!
I'm gonna try my custom keymap, next.
Title: Re: Alternative Controller for HHKB
Post by: yankez001 on Thu, 19 March 2015, 09:57:35
Hi Hasu,
Pls help me out, I'm trying keymap_jp.c on HHKB Professional JP(Type-S) + your controller but ja specific key mapping doesn't respond. What am I missing?

details:
commands)
cd tmk_keyboard/keyboard/hhkb
make clean; make -f Makefile.jp KEYMAP=jp dfu

keymaps that doesn't respond)   HENK, KANA, MHEN, RO, JYEN

thanks.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 19 March 2015, 19:38:49
With default firmware shipped did those keys  work?

What is your OS and keyboard layout? With other than Japanese layout some of the keys may not be recognized.

Unfortunately I don't use JP layout usually and tested it only on US layout in Linux/Xorg. My OS recognized some of the keys at least.

And you can post your keymap so that I can examine it in my OS.
Title: Re: Alternative Controller for HHKB
Post by: yankez001 on Thu, 19 March 2015, 22:11:50
|With default firmware shipped did those keys  work?

I'm not certain but I think it didn't.

|What is your OS and keyboard layout?

I'm on Mac os x 10.10.2, JP kbd layout(img attached).

|And you can post your keymap so that I can examine it in my OS.

keymap_jp.c attached, this is the original src checked out from GitHub(tmk_keyboard/keyboard/hhkb/ ).

thanks!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 19 March 2015, 22:53:54
I confirmed all those Japanese keys are registered in Xorg/xev as original HHKB controller does.

Ah, I just remember this fact ...
Are you using NKRO function? Turn it off tmk's NKRO doesn't support those JIS keys. You can switch between normal and NKRO mode with 'LShift + RShift + N'.


Could HHKB JP with original controller send those problematic keys on Mac before?

If you have a Japanese Windows OS with JIS keyboard layout can you try HHKB on that OS?
Or if you have Japanese Windows keyboard can you try it on your Mac? And
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 19 March 2015, 23:06:46
Hmm,
This tool may resolve your problem. It seems those JIS keys don't work proplerly in OSX by default. You'll need keyboard driver or tool like this.

https://pqrs.org/osx/karabiner/seil.html
Title: Re: Alternative Controller for HHKB
Post by: yankez001 on Mon, 23 March 2015, 01:24:30
Watching the key input on Mac os x, any signal doesn't appear, so the problem is in the controller. To be clear, if I map well known keymaps (such as SPC, TAB, etc.) to the key it works, so your controller acknowleges the physical keys.

I'll try it on other OSs.
Cheers.
Title: Re: Alternative Controller for HHKB
Post by: yankez001 on Mon, 23 March 2015, 09:30:14
It turns out that it works fine on Linux. Yeah, you're right, I need a driver for mac so I'm stuck. Pls let me know if you find out something.
Cheers.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 23 March 2015, 09:45:23
Try Seil and Karabiner. I think these are exactly what you need.

https://pqrs.org/osx/karabiner/seil.html.ja
Title: Re: Alternative Controller for HHKB
Post by: yankez001 on Mon, 23 March 2015, 11:43:38
I've been trying Seil + Karabiner for a while, but with no luck, can't make the international keys and other special keys to work, urr.
BTW, I tried it on Windows and works fine.
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Tue, 24 March 2015, 12:18:50
are these available still?
Title: Re: Alternative Controller for HHKB
Post by: byker on Tue, 24 March 2015, 12:19:49
are these available still?


If you pm hasu, he will add you to a list of people who are waiting :)
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Tue, 24 March 2015, 13:12:40
are these available still?


If you pm hasu, he will add you to a list of people who are waiting :)

sent him a PM.
thank you :D
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Thu, 26 March 2015, 03:45:44
ok. got the controller and finally had time to play with it.

everything seems to be working but something strange happens. Every time I connect the keyboard the PC fans start spinning a full throttle, then they stop soon after, but they start spinning again every 10 minutes or so. Rebooting doesn't help, I have to turn the PC off and on again.

It happens only after I connect the keyboard.

Any idea?!
Title: Re: Alternative Controller for HHKB
Post by: Bromono on Thu, 26 March 2015, 05:47:52
ok. got the controller and finally had time to play with it.

everything seems to be working but something strange happens. Every time I connect the keyboard the PC fans start spinning a full throttle, then they stop soon after, but they start spinning again every 10 minutes or so. Rebooting doesn't help, I have to turn the PC off and on again.

It happens only after I connect the keyboard.

Any idea?!

You where hax0red?

On a serious note, it could be a faulty driver. Try reinstalling your input drivers.

Does the controller install its own driver or are you using default windows drivers?

I don't see this controller taking a huge load from your psu so that shouldn't be an issue.

Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Thu, 26 March 2015, 06:18:22
I'm using default drivers. I'll try to reinstall them.
Title: Re: Alternative Controller for HHKB
Post by: Ardvan on Mon, 30 March 2015, 09:59:40
Hi everyone

I own two HHKB pro (white & black) for about 10 years now and am still happy with them. Unfortunately I couldn't use them as well as I wanted because of the different hardware I work on and languages I have to write.

So a two weeks ago I decided to clean and mod both HHKB's. For the first one I even added a USB-Hub (like the pro 2 has). The second one will be without it.

This text is now written with my first modified HHKB with a Teensy++ and an LED-Bar. I even got the shift-lock LED running without any troubles.

Thanks Hasu, for your great work. :thumb:

(https://dl.dropboxusercontent.com/u/9875813/HHK/IMG_0180.JPG)

Here a glimpse inside. I know I can't press the reset button though the switch opening, because I had to turn the teensy because the usb cable for it was to thick. But even turning it around didn't help much. Anyway with the magic key combination a reset is always possible.

(https://dl.dropboxusercontent.com/u/9875813/HHK/IMG_0176.JPG)
Title: Re: Alternative Controller for HHKB
Post by: byker on Mon, 30 March 2015, 11:49:21
Hi everyone

I own two HHKB pro (white & black) for about 10 years now and am still happy with them. Unfortunately I couldn't use them as well as I wanted because of the different hardware I work on and languages I have to write.

So a two weeks ago I decided to clean and mod both HHKB's. For the first one I even added a USB-Hub (like the pro 2 has). The second one will be without it.

This text is now written with my first modified HHKB with a Teensy++ and an LED-Bar. I even got the shift-lock LED running without any troubles.

Thanks Hasu, for your great work. :thumb:

Show Image
(https://dl.dropboxusercontent.com/u/9875813/HHK/IMG_0180.JPG)


Here a glimpse inside. I know I can't press the reset button though the switch opening, because I had to turn the teensy because the usb cable for it was to thick. But even turning it around didn't help much. Anyway with the magic key combination a reset is always possible.

Show Image
(https://dl.dropboxusercontent.com/u/9875813/HHK/IMG_0176.JPG)



Great job! I love the keyset you have on that too, looks good with the black case. That led-bar that you added looks well done too!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 30 March 2015, 13:13:13
Really looks nice. Thanks for the posting.
Title: Re: Alternative Controller for HHKB
Post by: ctm on Mon, 06 April 2015, 21:10:19
Awesome! Does this firmware support fn lock?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 06 April 2015, 23:49:16
Yes. You can toggle layer.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 13 April 2015, 02:00:34
Updated firmware used in Keymap Editor to the latest version and added Keymap Editor for TMK Bluetooth controller.
Try it and give feedback.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb_bt/


(http://i.imgur.com/EMUwuYzh.png?1)
Title: Re: Alternative Controller for HHKB
Post by: Moralless on Mon, 13 April 2015, 02:34:14
Updated firmware used in Keymap Editor to the latest version and added Keymap Editor for TMK Bluetooth controller.
Try it and give feedback.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb_bt/


Show Image
(http://i.imgur.com/EMUwuYzh.png?1)


Awesome Hasu! Just got my BT controller today so I'll play around with this. But I won't be able to test the BT capabilities of it for another week since I can't find a place that has them in stock.

EDIT: I really recommend following this guide (http://) after downloading the hex file from the keymap editor that hasu made. Just have to remember that when choosing the device you have to look for "ATmega32U4"
Title: Re: Alternative Controller for HHKB
Post by: naasfu on Sat, 18 April 2015, 17:44:46
Just in case anyone runs into this behavior:

Today I was trying to reprogram my HHKB controller using Flip.  Flip would recognize my plugged in board and flashing would succeed, but then the HHKB would not work afterwards, even after resetting the controller using Flip or replugging the USB cable.  Seems like my controller got into a state where it was stuck in programming mode.  In Windows device list, I would see the ATMega device present, and it would not get recognized as a keyboard.

After lots of retries, I finally found that using the makefile's flip command would get the controller working again for me.

1.  Plug in USB cable
2.  Press the controller's bootloader button
3.  Wait for the ATMega device to appear in Windows device manager list
4.  "make -f Makefile.rn42 flip" (rn42 for BT version of the controller)

Not sure what happened since manually running Flip used to work for me, but I'll be using make flip from now on.
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Sun, 19 April 2015, 02:08:18
Updated firmware used in Keymap Editor to the latest version and added Keymap Editor for TMK Bluetooth controller.
Try it and give feedback.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb_bt/


Show Image
(http://i.imgur.com/EMUwuYzh.png?1)


works great Hasu! You are a rockstar
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Sun, 19 April 2015, 16:21:16
Updated firmware used in Keymap Editor to the latest version and added Keymap Editor for TMK Bluetooth controller.
Try it and give feedback.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb_bt/


Show Image
(http://i.imgur.com/EMUwuYzh.png?1)


Awesome Hasu! Just got my BT controller today so I'll play around with this. But I won't be able to test the BT capabilities of it for another week since I can't find a place that has them in stock.

EDIT: I really recommend following this guide (http://) after downloading the hex file from the keymap editor that hasu made. Just have to remember that when choosing the device you have to look for "ATmega32U4"

The link for the guide doesn't work :(
Title: Re: Alternative Controller for HHKB
Post by: joneslee85 on Sun, 19 April 2015, 21:50:26
dear Hasu

Firstly great work.

I'm wondering if you are planning to do a USB type C PCB? I'd order 2 instantly.
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Tue, 21 April 2015, 17:49:21
[ This has also been posted in the GB thread, probably the wrong place]

Hi all I am going to be getting my hands on a couple of the HAUS alt controllers in a few days and have been reading the documentation. I have found some of it confusing to find the best method for flashing the controller with a custom layout using a linux system. I have tried to write a step by step that I hope to improve on in the future and it has some big holes in it. Could you please help me fill in these holes so that I am ready to go when my controllers arrive? This is as far as I have got

--------------------------------------------------------------------------------------------------------------------------------

HAUS alt controller Step by Step linux (opensuse) for HHKB pro 2

1. Download DFU-programmer.

https://dfu-programmer.github.io/

2. Extract it into a directory. I picked with

# tar -xzf dfu-programmer-<version>.tar.gz

# /home/thomas/bin/

3. Install needed extra software. I had to install libusb-1_0-0 and lisbusb-devel. I did this using software management
in yast.

4. cd into dfu-programmer folder.

# cd dfu-programmer

# sudo ./configure

# sudo make

# sudo make install

4. Move back to /home/thomas/bin directory (your equvilant of)

# mv /home/thomas/bin

5. Git clone the software. Make sure git is installed.

# sudo git clone https://github.com/tmk/tmk_keyboard

6. Make you custom layout using keymap editor.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/index.html

and download the hex file

7. ......

-----------------------------------------------------------------------------------------------------------------------------

As you can see I still haven't worked out the next step correctly get the hex onto the board.
Modify message
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Tue, 21 April 2015, 18:22:44
A couple of more things. When trying

# make -f Makefile

I get

-------- begin --------
sh: avr-gcc: command not found
../../rules.mk:405: recipe for target 'gccversion' failed
make: *** [gccversion] Error 127


and when running

# sudo make -f Makefile

I get

root's password:
sh: dfu-programmer: command not found

-------- begin --------
sh: avr-gcc: command not found
../../rules.mk:405: recipe for target 'gccversion' failed
make: *** [gccversion] Error 127

I am assuming I have not configured dfu-programmer correctly. A little help please.  :D
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 21 April 2015, 18:48:42
First, install tools, you need dfu-programmer and AVR gcc. I think you can use package manager to install those tools.
https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md#download-and-install

EDIT: fixed my engrish
Title: Re: Alternative Controller for HHKB
Post by: Matt3o on Wed, 22 April 2015, 05:04:34
fixed that for you :P


HAUS alt controller Step by Step linux (opensuse) for HHKB pro 2

1. Download DFU-programmer.

https://dfu-programmer.github.io/

2. Extract it into a directory. I picked with

# tar -xzf dfu-programmer-<version>.tar.gz

# /home/thomas/bin/

3. Install needed extra software. I had to install libusb-1_0-0 and lisbusb-devel. I did this using software management
in yast.

4. cd into dfu-programmer folder.

# cd dfu-programmer

# sudo ./configure

# sudo make

# sudo make install

4. Move back to /home/thomas/bin directory (your equvilant of)

# mv /home/thomas/bin

5. Git clone the software. Make sure git is installed.

# sudo git clone https://github.com/tmk/tmk_keyboard

6. Make you custom layout using keymap editor.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/index.html

and download the hex file

7. ......

Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Wed, 22 April 2015, 17:58:32
Hey all. I have got a little further with getting the linux install going. But am still stuck. I have installed dfu-programmer, cross-avr-gcc and AVR LibC. However when I go to run

# make -f Makefile KEYMAP=hasu

i get this

-------- begin --------
avr-gcc (GCC) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


mkdir -p obj_hhkb_lufa
Compiling C: keymap_hasu.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=08ec8bb -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/keymap_hasu.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_keymap_hasu.o.d  keymap_hasu.c -o obj_hhkb_lufa/keymap_hasu.o
In file included from keymap_common.h:20:0,
                 from keymap_hasu.c:4:
/opt/cross/avr/lib/gcc/avr/4.8.3/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.
../../rules.mk:546: recipe for target 'obj_hhkb_lufa/keymap_hasu.o' failed
make: *** [obj_hhkb_lufa/keymap_hasu.o] Error 1


Any ideas?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 22 April 2015, 19:33:02
I didn't know this.
Quote
On AVR, the configure option --with-avrlibc supported since GCC 4.7.2 is turned on per default for all non-RTEMS configurations. This option arranges for a better integration of AVR Libc with avr-gcc. For technical details, see PR54461. To turn off the option in non-RTEMS configurations, use --with-avrlibc=no. If the compiler is configured for RTEMS, the option is always turned off.
https://gcc.gnu.org/gcc-4.8/changes.html

I think avr libc may conflict with newer avr gcc, remove your avr libc.
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Thu, 23 April 2015, 17:08:26
I didn't know this.
Quote
On AVR, the configure option --with-avrlibc supported since GCC 4.7.2 is turned on per default for all non-RTEMS configurations. This option arranges for a better integration of AVR Libc with avr-gcc. For technical details, see PR54461. To turn off the option in non-RTEMS configurations, use --with-avrlibc=no. If the compiler is configured for RTEMS, the option is always turned off.
https://gcc.gnu.org/gcc-4.8/changes.html

I think avr libc may conflict with newer avr gcc, remove your avr libc.

Have tried removing it and got the same error. Going to use my windows box for the time being untill I get it sorted out. Have installed easydfu so that should allow me to flash the chip with the hex created on the online editor.
Title: Re: Alternative Controller for HHKB
Post by: jackiecanev2 on Fri, 24 April 2015, 00:47:29
Updated firmware used in Keymap Editor to the latest version and added Keymap Editor for TMK Bluetooth controller.
Try it and give feedback.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb_bt/


Show Image
(http://i.imgur.com/EMUwuYzh.png?1)


Successfully flashed my own edited compiled RRkeymap.h .rn42, and thought I'd give the layout editor a try for kicks. I couldn't get the hex to flash for the life of me, either using the CLI or flip GUI (assuming less familiar users might opt for the layout editor + flip gui combo.) Not sure if I did something wrong trying to use the generated hex, but I was able to reflash my recompiled and previously working firmware and layout.... so, no harm no foul. However, I couldn't personally get any combination of the layout editor hex to flash properly...
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Fri, 24 April 2015, 02:31:41
Can someone tell me what linux os they are using and what version of the tools they are using to build and flash the controller?

Title: Re: Alternative Controller for HHKB
Post by: Smasher816 on Sat, 25 April 2015, 03:35:01
Arch Linux. Newest packages.

cmake 3.2.1-1
make 4.1-1
avr-binutils 2.25-2
avr-gcc 4.9.2-2
avr-libc 1.8.1-2
arm-none-eabi-binutils 2.25-2
arm-none-eabi-gcc 4.9.2-5
arm-none-eabi-newlib 2.2.0-2
teensy_loader_cli 2.1-1
dfu-util 0.8-1

I haven't built tmk recently but stuff like the infinity project work fine. I'v never had any issues.
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Sat, 25 April 2015, 03:49:50
Arch Linux. Newest packages.

cmake 3.2.1-1
make 4.1-1
avr-binutils 2.25-2
avr-gcc 4.9.2-2
avr-libc 1.8.1-2
arm-none-eabi-binutils 2.25-2
arm-none-eabi-gcc 4.9.2-5
arm-none-eabi-newlib 2.2.0-2
teensy_loader_cli 2.1-1
dfu-util 0.8-1

I haven't built tmk recently but stuff like the infinity project work fine. I'v never had any issues.

Many thanks it all now seems to be up and working and making hex. Fingers crossed my two controls and second hhkb should get here next week and I can start building.
Do we have a place where people can post their layout and hex for sharing?
Title: Re: Alternative Controller for HHKB
Post by: Joey Quinn on Mon, 27 April 2015, 19:27:49
I finally programmed mine, there are so many layers!
Title: Re: Alternative Controller for HHKB
Post by: Joey Quinn on Tue, 28 April 2015, 00:58:12
Playing with layouts is too damn fun! I love the mouse buttons.

Has anyone gotten caps lock to work on OSX? I don't use it much but I'd like to have access to in in a function layer.
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Tue, 28 April 2015, 02:04:37
I finally programmed mine, there are so many layers!

Spent most of my evening doing the same though still using the editor and not the .c and .h files yet. I didn't bother putting the caps lock on as have so little use for it.
Did you find that if you forgot to put the key as transparent for that above the the used function key you get stuck on that layer as I did  :rolleyes:
Title: Re: Alternative Controller for HHKB
Post by: Joey Quinn on Tue, 28 April 2015, 02:12:46
I finally programmed mine, there are so many layers!

Spent most of my evening doing the same though still using the editor and not the .c and .h files yet. I didn't bother putting the caps lock on as have so little use for it.
Did you find that if you forgot to put the key as transparent for that above the the used function key you get stuck on that layer as I did  :rolleyes:
I accidentally trapped myself in an empty layer for a bit.
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Tue, 28 April 2015, 02:15:54
I finally programmed mine, there are so many layers!

Spent most of my evening doing the same though still using the editor and not the .c and .h files yet. I didn't bother putting the caps lock on as have so little use for it.
Did you find that if you forgot to put the key as transparent for that above the the used function key you get stuck on that layer as I did  :rolleyes:
I accidentally trapped myself in an empty layer for a bit.

On my ducky zero I got a key that causes a right click action on the word my cursor is over, its really useful for a poor speller like myself. Any ideas on how to get it on the alt controller?
Title: Re: Alternative Controller for HHKB
Post by: Joey Quinn on Tue, 28 April 2015, 02:18:52
More
I finally programmed mine, there are so many layers!

Spent most of my evening doing the same though still using the editor and not the .c and .h files yet. I didn't bother putting the caps lock on as have so little use for it.
Did you find that if you forgot to put the key as transparent for that above the the used function key you get stuck on that layer as I did  :rolleyes:
I accidentally trapped myself in an empty layer for a bit.

On my ducky zero I got a key that causes a right click action on the word my cursor is over, its really useful for a poor speller like myself. Any ideas on how to get it on the alt controller?


Left and right click are built into the configurator. My third layer is all mouse actions. 
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 28 April 2015, 02:55:39
Try disabling NKRO by pressing both shift and n key. Not sure if NKRO works on Mac OSX after recent updates.

Someone is also having weird problem on Mac with TMK firmware.
Title: Re: Alternative Controller for HHKB
Post by: Joey Quinn on Tue, 28 April 2015, 03:07:58
Thanks, I'll give it a shot tomorrow.
Title: Re: Alternative Controller for HHKB
Post by: MJ45 on Tue, 28 April 2015, 04:45:38
Try disabling NKRO by pressing both shift and n key. Not sure if NKRO works on Mac OSX after recent updates.

Someone is also having weird problem on Mac with TMK firmware.
I am using Mac OSX (10.10.3 Yosemite) without any issues with NKRO active. Caps Lock works as well but I rarely use it.
Title: Re: Alternative Controller for HHKB
Post by: joric on Sat, 16 May 2015, 17:13:20
Hasu, why bluetooth controller eats so much power (battery lasts hours, not days)? Is there a way to improve it somehow?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 16 May 2015, 18:49:43
joric,
RN-42 is very easy to make a keyboard without hassle and deep knowledge of Bluetooth while it doesn'tt offer much methods to controll power. See datasheet, you can find some options related to power control and try them. Of course I already tried them all and I couldn't find useful options to improve battery life much.

Other modules may have better power control but I didn't find a module with easy solution for keyboard like RN-42. With using HCI you will be able to control a module power consumption better but you need more hassle and knowledge.
Title: Re: Alternative Controller for HHKB
Post by: alienman82 on Wed, 20 May 2015, 16:47:09
removed.
Title: Re: Alternative Controller for HHKB
Post by: alienman82 on Wed, 20 May 2015, 20:15:09
removed.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 20 May 2015, 21:19:31
Thanks for your posting!
Really looks nice.

hat is exactly what I've wanted to do but been lazy to learn CAD and 3D printing :p
Title: Re: Alternative Controller for HHKB
Post by: alienman82 on Thu, 21 May 2015, 07:33:10
removed.
Title: Re: Alternative Controller for HHKB
Post by: thefebruaryman on Thu, 21 May 2015, 15:47:34
Here is the .stl file:
https://www.dropbox.com/s/v6vtinzjoh5y06u/HHKBusbcover.stl?dl=0 (https://www.dropbox.com/s/v6vtinzjoh5y06u/HHKBusbcover.stl?dl=0)

I am kindle asking my brother in law to band a few of these through his 3d printer at work. Will let you know the results. Thanks for the file.

 :thumb: :thumb: :thumb:
Title: Re: Alternative Controller for HHKB
Post by: joric on Fri, 22 May 2015, 04:57:11
joric,
RN-42 is very easy to make a keyboard without hassle and deep knowledge of Bluetooth while it doesn'tt offer much methods to controll power. See datasheet, you can find some options related to power control and try them. Of course I already tried them all and I couldn't find useful options to improve battery life much.

Other modules may have better power control but I didn't find a module with easy solution for keyboard like RN-42. With using HCI you will be able to control a module power consumption better but you need more hassle and knowledge.

I think the matter is not the bluetooth module it's the hhkb capacitive electronics (wake up still needs a fully powered capacitive circuit). According to specs it alone draws 100 mA (probably about 80 mA without usb hubs) at 5v (doesn't even function at 3.3v, unfortunately) so a 2000 mAh battery will last only 25 hours, tops. Looks like the only way is to redesign the main board, maybe even place the whole controller there, but it's not very easy. It just wasn't designed as a low voltage keyboard. As for RN-42 it draws only 12 mA in the idle mode and 26 uA (!) in the deep sleep mode. Maybe it's possible to implement wake up using some kind of piezo vibration sensor, that could actually be the solution. E.g. this one costs only $2.95: https://www.sparkfun.com/products/9196. Or maybe it's possible to power the main board using short impulses (1/10 s.) in the sleep mode, I don't have much experience with that.


Also there's some tips about arduino/atmega battery operation (http://www.mysensors.org/build/battery):

Use the 3.3V version Arduino Pro Mini with the lower CPU clock speed (8MHz)
Sleep whenever possible by powering down the Arduino and radio. The sensor node can periodically wake up by either triggering a timer interrupt or by an attached sensor registering a reading on one of the Arduino interrupt enabled io-pins. Most of the MySensors example sketches implement sleep mode.
When powered down, the CPU, DS18B20 temp sensor and radio consume (very roughly) 120 uA - which is similar to the self discharge rate of a battery.
Disconnect the Arduino's power indicator LED by cutting the track between the LED and the resistor in series. Saves about 1.5 mA  >
Disconnect the 3.3 VDC regulator because it is not needed. Cut the Vout pin with a sharp fine wire cutter. See images to the right on how to locate regulator. Saves about 220 uA.
Power the device with two AA batteries connected in series to the PCB. You can power 5 VDC sensors using an ultra low power step up converter (see the Buying Guide below). Power regulators will reduce the battery life due constant power consumption.

And... I don't know really how much an average  keyboard sleeps when it's in use, probably almost never so all that sleep/wake thing might be worthless.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 22 May 2015, 18:20:09
Pro2 switch board itself consumes around 13mA(overall 140mA with USB Hub). And Topre capacitive switch scan is not fast so you can't cut power so long time, compared to normal passive mechanical switches. My implementation cuts power for 2/3 time of scan cyle.

Using prescaler(/2) you can 8MHz(16/2) frequency even with 16MHz crystal, I found it has same result as 8MHz crystal does in terms of power saving. Unfortunately UART doesn't work at 115200bps at 8MHz you need to change baud rate of the module or use software serial. Mine uses still 16MHz due to this.
https://www.pjrc.com/teensy/low_power.html
Title: Re: Alternative Controller for HHKB
Post by: joric on Mon, 25 May 2015, 06:11:45
Found a mod that uses a cheap 4.0 bluetooth module with a custom HID firmware https://flashandrc.wordpress.com/2014/07/27/bluetooth-hid-keyboard-mouse-bridge/ (the blog also mentions turning an ordinary hc-06 into an exact copy of RN-42-HID here https://flashandrc.wordpress.com/2014/10/04/hid-firmware-on-hc-06-bluetooth-modules/).
Title: Re: Alternative Controller for HHKB
Post by: alienman82 on Wed, 27 May 2015, 21:43:58
removed.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 30 May 2015, 06:03:03
Finally desgined and ordered PCB for my HHKB *Pro*!
I hope this works from the begining.

(http://i.imgur.com/usEwhjo.png)
Title: Re: Alternative Controller for HHKB
Post by: RoastPotatoes on Sat, 30 May 2015, 07:15:52
Just thought I'd post here that my friend and I designed and 3d printed dust covers for the usb ports on the hhkb with Hasu controller.  Here is a picture of it:

Show Image
(http://i.imgur.com/vt2KFoL.jpg)


I'll get the .stl file from my buddy and upload for anyone that wants it.  Some minimal sanding is required around the corners and edges etc.  Unfortunately, I cannot make these for anyone as my school has the machine, and I will be graduating in a week.
Could this be put on shapeways? I would be interested in having a set of these but I don't have access to a 3d printer.
Title: Re: Alternative Controller for HHKB
Post by: alienman82 on Sat, 30 May 2015, 17:56:52
removed.
Title: Re: Alternative Controller for HHKB
Post by: rsadek on Wed, 10 June 2015, 06:21:33
Oooops! I was playing with the layouts, but I don't know how to get back to where I started!
The mod arrived perfectly set up for mac. How to get back there?
-R
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 10 June 2015, 06:30:38
You can download hex file of firmware with default layout from keymap editor.

http://www.tmk-kbd.com/tmk_keyboard/editor/
Title: .
Post by: esoomenona on Wed, 10 June 2015, 08:16:33
.
Title: Re: Alternative Controller for HHKB
Post by: rsadek on Wed, 10 June 2015, 11:43:33
I was using the co figs in the github repo, but wasn't able to get back to default. Is the code for default in the repo? I assume it is but that I used the wrong keymap name.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 10 June 2015, 12:33:23
Firmware uploaded to TMK controller when shipped was built with just 'make', supposedly. Default keymap file keymap_hhkb. c should be used.

For TMK USB controller just 'make' or

make -f Makefile KEYMAP=hhkb

For TMK BT controller use

make -f Makefile.rn42 KEYMAP=hhkb


Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 16 June 2015, 18:41:07
Pro controller got worked in my keyboard now.
PM me if you are interested in getting this. I don't think there are even five owners of Pro around here and DT though :)

(http://i.imgur.com/QPobtCMl.jpg)


PCB design files are available here.
https://github.com/tmk/HHKB_controller/tree/pro1
Title: Re: Alternative Controller for HHKB
Post by: sth on Wed, 17 June 2015, 05:49:53
does it have bluetooth support?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 17 June 2015, 10:01:11
No, Pro controller has no Bluetooth support.
It is possible theoretically to add Bluetooth support to Pro, but I won't because its case has no windows(holes) for switch and LED indicators unlike Pro2.
Title: Re: Alternative Controller for HHKB
Post by: daRealMVT on Tue, 23 June 2015, 02:18:41
Dear Hasu,

I am planning to build a bluetooth module myself using an Arduino micro and a bluetooth module among other parts. I already have the Micro, but I am having doubts which bluetooth part to buy. I see there is a EZ-Key (https://learn.adafruit.com/convert-your-model-m-keyboard-to-bluetooth-with-bluefruit-ez-key-hid) by Adafruit and there is a RN-42 (http://watchmono.com/blog-entry-4760.html) module, among others (HC-05, ) (http://www.intorobotics.com/pick-right-bluetooth-module-diy-arduino-project/) . Could you explain which one you use and why?

Thank you.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 23 June 2015, 04:07:07
RN-42 because it has certification of this country authority.
Title: Re: Alternative Controller for HHKB
Post by: Baxter on Wed, 24 June 2015, 05:15:20
Just go mine installed, dfu on windows 7 is being weird at work so I'm going to have to wait a while to try some re-mappings.

On a side note I bought some of these: http://www.amazon.co.uk/gp/product/B00UYMT7W6?psc=1&redirect=true&ref_=oh_aui_detailpage_o03_s00
(Plastic USB Type Male Anti-dust Plug Caps) which with a small bit of foam or folded paper to hold them in place, fit perfectly into the two empty usb holes.
Title: Re: Alternative Controller for HHKB
Post by: wes1099 on Sun, 05 July 2015, 23:27:55
Will the firmware from the website work if I flash it onto a teensy?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 06 July 2015, 00:47:00
I assume you mean TMK keymap editor page.
I think so. TMK Alt controller is almost compatible to Teensy 2.0 excluding bootloader.

Just wire like this, see first page of schematic.
https://github.com/tmk/HHKB_controller/blob/master/schematic/HHKB_controller_revG.pdf
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/doc/HHKB.txt#L33-L52

If you follow Smasher816's guide  you have to change code and compile yourself.
https://geekhack.org/index.php?topic=57008.0
Title: Re: Alternative Controller for HHKB
Post by: acevery on Fri, 17 July 2015, 12:32:07
Dear Hasu,

USB firmware for HHKB JP works fine. But I can't get the BT firmware working...

I set "HHKB_JP = yes" in Makefile.rn42 already, however, the firmware could not make keyboard response, even under usb mode.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 17 July 2015, 17:10:25
Weird.
Your controller hardware seems like fine.

Try attached hex file and report back.

[attachurl=1]
Title: Re: Alternative Controller for HHKB
Post by: acevery on Fri, 17 July 2015, 20:01:18
I can reproduce the problem now. Your default firmware got the same problem as my customized build one.
If you switch to usb mode, and plug in the usb cable, and keyboard would not response. But if you detach the usb cable and switch to BT mode, a few seconds later(not fast as pro2, which just instantly), keyboard would be recognized and then you plug the usb cable, and switch it to usb mode, it would continue working under usb mode.


Weird.
Your controller hardware seems like fine.

Try attached hex file and report back.

(Attachment Link)

Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 17 July 2015, 20:28:50
I can reproduce the problem now. Your default firmware got the same problem as my customized build one.
If you switch to usb mode, and plug in the usb cable, and keyboard would not response.
How did you switch to USB mode? To make it USB mode there are two methods.
1) Turns BT slide SW off and plug into USB port.
2) Turns BT slide SW on and plug into USB port and press magic key combo(LShift+RShift+u).
Note that just pluging in USB cable while it is on BT mode means it is still on BT mode with charging battery.


Quote
But if you detach the usb cable and switch to BT mode, a few seconds later(not fast as pro2, which just instantly), keyboard would be recognized and then you plug the usb cable, and switch it to usb mode, it would continue working under usb mode.
If BT is already conected and BT LED lights solidly(not blinking) switching between USB and BT mode should be done instantly. Something wrong :(
Title: Re: Alternative Controller for HHKB
Post by: acevery on Sat, 18 July 2015, 00:19:02
I can reproduce the problem now. Your default firmware got the same problem as my customized build one.
If you switch to usb mode, and plug in the usb cable, and keyboard would not response.
How did you switch to USB mode? To make it USB mode there are two methods.
1) Turns BT slide SW off and plug into USB port.
2) Turns BT slide SW on and plug into USB port and press magic key combo(LShift+RShift+u).
Note that just pluging in USB cable while it is on BT mode means it is still on BT mode with charging battery.
method 1
Quote
Quote
But if you detach the usb cable and switch to BT mode, a few seconds later(not fast as pro2, which just instantly), keyboard would be recognized and then you plug the usb cable, and switch it to usb mode, it would continue working under usb mode.
If BT is already conected and BT LED lights solidly(not blinking) switching between USB and BT mode should be done instantly. Something wrong :(
seems instantly from BT to USB...

While failed in connecting via usb, if I turn BT sw on, the BT would failed to connect, however, if I detach the usb, I would just take a seconds to connect to BT.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 18 July 2015, 02:26:30
what's your host system? OSX and USB3?
Try it with other OS/system?

I don't have BT controller for JP to test at this time, I'll assemble and test it some later.
(However, I don't have Mac/OSX and USB3 at hand. I have only Linux and Windows7 system.)
Title: Re: Alternative Controller for HHKB
Post by: acevery on Sat, 18 July 2015, 02:49:28
I formerly test it under OSX + usb3.0

I test it under win7 + usb2.0 as well. With Makefile.rn42 it display that the "HHKB Mod" disconnected and failed to install drivers.
with Makefile.jp Win7 successfully install HHKB Mod as USB composite input device.

what's your host system? OSX and USB3?
Try it with other OS/system?

I don't have BT controller for JP to test at this time, I'll assemble and test it some later.
(However, I don't have Mac/OSX and USB3 at hand. I have only Linux and Windows7 system.)

Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 20 July 2015, 01:10:58
I confirmed the problem.
It seems like power saving code of Bluetooth firmware doesn't work with HHKB JP for some reason. I'll fix it later, use the following work around for a while until that.


WORK AROUND for 'BT controller for JP'
comment out 'POWER_SAVING' macro and compile firmware.

Code: [Select]
make -f Makefile.rn42 KEYMAP=jp


Code: [Select]
diff --git a/keyboard/hhkb/config_rn42.h b/keyboard/hhkb/config_rn42.h
index 21e73f1..ef63ad5 100644
--- a/keyboard/hhkb/config_rn42.h
+++ b/keyboard/hhkb/config_rn42.h
@@ -51,7 +51,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define BOOTMAGIC_KEY_SALT      KC_FN6
 
 /* power control of key switch board */
-#define HHKB_POWER_SAVING
+//#define HHKB_POWER_SAVING
 
 /*
  * Hardware Serial(UART)
Title: Re: Alternative Controller for HHKB
Post by: acevery on Tue, 21 July 2015, 05:39:41
I comment out 'POWER_SAVING' macro, however, seem not very helpful.
Waiting for the final fix :)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 21 July 2015, 05:52:11
If Your problem is not the power saving related the final fix even won't be helpful for you.

I didn't find other problem on JP so far.
Title: Re: Alternative Controller for HHKB
Post by: acevery on Tue, 21 July 2015, 21:08:43
so, it is possible the problem of my board. When you complete the fix and test of the board, please let me know :D
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 22 July 2015, 17:41:00
Try attached firmware which is applied with the work around. This is not final fix but it should work.

If it doesn't work with your board it probably has hardware problem.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 22 July 2015, 22:12:31
Fixed.

https://github.com/tmk/tmk_keyboard/commit/35203cad6ad4294409bd39dd85ff7858b353570d
https://github.com/tmk/tmk_keyboard/issues/234
Title: Re: Alternative Controller for HHKB
Post by: acevery on Sat, 25 July 2015, 02:54:24
Try attached firmware which is applied with the work around. This is not final fix but it should work.

If it doesn't work with your board it probably has hardware problem.

this firmware works
Title: Re: Alternative Controller for HHKB
Post by: acevery on Sat, 25 July 2015, 02:57:12
Fixed.

https://github.com/tmk/tmk_keyboard/commit/35203cad6ad4294409bd39dd85ff7858b353570d
https://github.com/tmk/tmk_keyboard/issues/234
with the firmware build from git, the usb mode works, but the BT mode do not properly recognized the matrix.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 29 July 2015, 00:17:06
Fixed.

https://github.com/tmk/tmk_keyboard/commit/35203cad6ad4294409bd39dd85ff7858b353570d
https://github.com/tmk/tmk_keyboard/issues/234
with the firmware build from git, the usb mode works, but the BT mode do not properly recognized the matrix.

can you describe your problem more precisely?

And try attached firmware which is built with default configuration and keymap for JP. WIth this firmware I found no problem on both USB and BT with my JP so far.
Title: Re: Alternative Controller for HHKB
Post by: acevery on Wed, 29 July 2015, 01:19:07
Forgive me for the incomplete test before. Today I try to build from fresh git clone, it works without fault. Thanks  :)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 29 July 2015, 02:31:37
Great. Enjoy!
Title: Re: Alternative Controller for HHKB
Post by: acevery on Wed, 29 July 2015, 11:12:56
Great. Enjoy!
:D
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Tue, 11 August 2015, 08:56:28
so, it looks like i'll be getting my HHKB in about 2 months :D
though.. i've actually never coded before :-[

so i looked around a bit, and found this tutorial by matt3o: http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html
but will i need (to know) anything else to be able to install and flash hasu's controller?
just want to make sure i won't run into any "am i missing something?"-moments :-X

sorry for the noobness :(
Title: .
Post by: esoomenona on Tue, 11 August 2015, 11:34:10
.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 11 August 2015, 19:56:12
Read this. If you are on Windows installing tools is a bit dodgy while it will go straight on Linux and Mac.
https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md

Matt3o's tutorial is for firmware of DIY custom keyboard. You don't have to editor source files(except for keymap) to get firmware of HHKB.


so, it looks like i'll be getting my HHKB in about 2 months :D
though.. i've actually never coded before :-[

so i looked around a bit, and found this tutorial by matt3o: http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html
but will i need (to know) anything else to be able to install and flash hasu's controller?
just want to make sure i won't run into any "am i missing something?"-moments :-X

sorry for the noobness :(
Title: Re: Alternative Controller for HHKB
Post by: rsadek on Tue, 01 September 2015, 09:35:00
My HHKB JP controller arrived last week (thanks Hasu!) which I'm unable to configure properly. Any tips on the correct config to use the JP as an English board?

The weird behavior I get is that only half the board is QWERTY at one time. Either left side or right side, depending on which mod key I hit. It seems related to switching character sets —which I know nothing about— and how OS X interprets the board. I’m not sure what the correct kb type should be, or how best to configure the firmware. Any tips would be a huge help :)

-R
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 01 September 2015, 18:24:20
rsadek,
It seems to me like you are using Pro2 firmware on your JP controller. I assume your controller is USB JP controller so you have to use the following commands to build and flash JP firmware.

Code: [Select]
make -f Makefile.jp clean
make -f Makefile.jp
make -f Makefile.jp dfu

To change keymap you can edit keymap_jp.c directly, or make your own keymap file like keymap_rsadek.c and use these commands.

Code: [Select]
KEYMAP=rsadek make -f Makefile.jp clean
KEYMAP=rsadek make -f Makefile.jp
KEYMAP=rsadek make -f Makefile.jp dfu
Title: Re: Alternative Controller for HHKB
Post by: rsadek on Wed, 02 September 2015, 11:56:19
rsadek,
It seems to me like you are using Pro2 firmware on your JP controller. I assume your controller is USB JP controller so you have to use the following commands to build and flash JP firmware.

Code: [Select]
make -f Makefile.jp clean
make -f Makefile.jp
make -f Makefile.jp dfu

To change keymap you can edit keymap_jp.c directly, or make your own keymap file like keymap_rsadek.c and use these commands.

Code: [Select]
KEYMAP=rsadek make -f Makefile.jp clean
KEYMAP=rsadek make -f Makefile.jp
KEYMAP=rsadek make -f Makefile.jp dfu
Oddly this wasn't the problem. I had the correct makefile and layout. git pull --rebase and rebuild seems to have set everything straight. Now I see the correct behavior and will set to work on tuning my layout :)
Title: Re: Alternative Controller for HHKB
Post by: dustinhxc on Wed, 02 September 2015, 19:11:43
Hey man! I installed the controller into my HHKB Pro 2. Im using it now, I LOVE IT! Thank god I can toggle arrows, finally! Thank you once again man! :)
Title: Re: Alternative Controller for HHKB
Post by: uJalled on Sun, 13 September 2015, 13:58:04
Is it possible to program the 4 bottom keys on the HHKB pro 2 to arrow keys on a mac interface?
Title: Re: Alternative Controller for HHKB
Post by: dustinhxc on Sun, 13 September 2015, 14:10:44
Is it possible to program the 4 bottom keys on the HHKB pro 2 to arrow keys on a mac interface?

Take a look here for options: http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/index.html (http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/index.html)

You can program any key to any key you want. Not sure about Mac though, I use PC.
Title: Re: Alternative Controller for HHKB
Post by: yaro_b on Tue, 15 September 2015, 09:33:29
Got my second Alt Controller last week. Flashed it with my custom keymap today. Now my second HHKB Pro2 is as useful as the primary one. Thank you, hasu. You're doing a great service to the community.  :thumb:
Title: Re: Alternative Controller for HHKB
Post by: 9jack9 on Tue, 15 September 2015, 14:44:17
This looks like a fantastic project, and I'll probably be jumping in on this.

Has any thought been put into using wireless charging (a-la Qi charging stations: https://en.wikipedia.org/wiki/Qi_(inductive_power_standard) for the bluetooth controller )?

I can't speak to whether or not there is room for that inside the HHKB case.
Title: Re: Alternative Controller for HHKB
Post by: shrubkeys on Sun, 20 September 2015, 12:05:34
This looks like a fantastic project, and I'll probably be jumping in on this.

Has any thought been put into using wireless charging (a-la Qi charging stations: https://en.wikipedia.org/wiki/Qi_(inductive_power_standard (https://en.wikipedia.org/wiki/Qi_(inductive_power_standard)) for the bluetooth controller )?

I can't speak to whether or not there is room for that inside the HHKB case.

Yes. There hasn't been extensive testing, but if you search here and @/MK, you'll find IIRC two reports of success - with one as part of a build log.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 20 September 2015, 17:17:53
This is Qi charging mod.

https://geekhack.org/index.php?topic=12047.msg1558708#msg1558708
Title: Re: Alternative Controller for HHKB
Post by: kennardsmith on Sun, 20 September 2015, 22:33:43
This is Qi charging mod.

https://geekhack.org/index.php?topic=12047.msg1558708#msg1558708

This is seriously cool!
Title: Re: Alternative Controller for HHKB
Post by: manisteinn on Sat, 26 September 2015, 10:48:12
I've designed a USB type-C adapter board that replaces the mini-usb connector on hasu's board. It should be compatible with all type-c host (DFP) devices, as well as standard USB-A to C cables. I've used it for several days with no issues, it feels at least as robust as the mini-b connector, although I haven't done a stress test (yet :) ). There's no case modification necessary.

The board is available on oshpark, $1.25 for three boards!
JAE DX07S024JJ2 (http://www.jae.com/z-en/pdf/MB-0297-1E_DX07.pdf) connectors are available (https://octopart.com/search?q=DX07S024JJ2) on digikey, mouser etc at around $3 each
Resistors R1 and R2 are needed for detection by type C host (DFP) devices
Check ebay/aliexpress etc for cables, there are all kinds available there for a few dollars.

Kicad project: https://github.com/manisteinn/usb-type-c-hhkb
Image gallery: https://imgur.com/a/JwNwm
Oshpark project (rev1): https://oshpark.com/shared_projects/jm1ndqqB
USB 3.1 specification: http://www.usb.org/developers/docs/

This is Qi charging mod.

https://geekhack.org/index.php?topic=12047.msg1558708#msg1558708

This is seriously cool!

I'm planning to include the power source switching circuit on a larger version of this board! See the overlay picture in the album
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 26 September 2015, 14:38:25
Hi manisteinn,
Great job!  and thank you for the posting.
Title: Re: Alternative Controller for HHKB
Post by: rmqz on Tue, 03 November 2015, 00:20:14
..
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Wed, 04 November 2015, 18:37:42
i've just installed the controller,
but i noticed that when i hold L1, there's actually a(n initial) delay before any L1-key is registered on my PC.
so i can just type L1 + ` to get delete, but it actually takes a short while before my PC registers the delete.
this delay happens only at the beginning of pressing L1, meaning that after that short delay, any key will register instantly.
however, it does happen every time i swap to L1..

is this supposed to happen? can i fix it somehow?
the delay is rather annoying :(
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 04 November 2015, 20:45:51
What is your keymap exactly? I think you are using keymap editor,  can you post link to your keymap?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 04 November 2015, 21:01:36
Bucake,
Not completely sure but I think I fixed the problem or something very similar somewere in the past.
Are you using the latest firmware? Try keymap editor again.

I confirmed no delay on that key with default layout firmware from keymap editor.
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Wed, 04 November 2015, 21:09:44
i haven't uploaded anything yet, everything's still how it arrived.
hard to say how much the delay exactly is. somewhere between 100ms and 200ms i'd say.
there's no delay after i switch to L0, however.

edit: to be clear, it's not just Delete. it's like there is a short pause after i press L1, and only after this short pause will any key from the L1 layer come through.
i figured this shipped with latest firmware, but i guess i'll start by updating it : )
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Wed, 04 November 2015, 22:50:00
just uploaded new firmware, unfortunately the delay is still there. (i used the keymap editor to create the .hex file.)
i have 2 layers, and both have that same initial delay.

any thoughts?


edit: this is a rev.G, btw.
everything seems to be working perfectly fine, but there's that initial delay after pressing a monetary layer switch..
if i could do any tests to narrow it down, please let me know.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 05 November 2015, 01:23:43
Ah, firmware of keymap editor is not the latest and it still has the problem.
But the problem was fixed in repository.
https://github.com/tmk/tmk_keyboard/issues/201

I'll update keymap editor some later, but unitl then   you have to buld from the latest source to circumvent the problem.
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Thu, 05 November 2015, 01:45:00
nice! thanks alot for the help hasu, i'm glad it's fixable : )
i guess i'll try to figure out how to build the firmware this weekend.

thanks again, much appreciated
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 08 November 2015, 21:15:03
Updated firmwre of keymap editor for both USB and BT. You can download the latest firmware from keymap editor now.
http://www.tmk-kbd.com/tmk_keyboard/editor/

This will fix some problems including "unneeded delay in momentary layer switch".
https://github.com/tmk/tmk_keyboard/issues/201
Title: Re: Alternative Controller for HHKB
Post by: lootbag on Tue, 24 November 2015, 06:00:07
Just received my BT controller today, it is like instant gratification... even though I haven't had the chance to test out the BT function yet.
Being able to customize the layout with FLIP GUI is a lifesaver because I have zero experience with coding and writing keyboard firmware.
My desire to put together a custom 60% has all but diminished haha.

Thanks hasu!

On another note, because I am in Hong Kong, ordering a battery from sparkfun or adafruit was a no-go due to prohibitively expensive shipping.
Looked on ebay and found...
- a 2600mah http://www.ebay.com/itm/261625368941 (http://www.ebay.com/itm/261625368941)
- a 1700mah http://www.ebay.com/itm/262080723867 (http://www.ebay.com/itm/262080723867)

Both batteries are stated to have built-in circuit protection.

2600mah fits tight but works
(http://i.imgur.com/x6sRZkh.jpg)

1700mah fits but the peg on the top half of the case makes contact and doesn't allow the case to close... oops
(http://i.imgur.com/UR18gCf.jpg)

Now I am just waiting for my JST-PH connectors and crimps to arrive so I can test the BT.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 24 November 2015, 20:18:18
Thanks for posting your finding and pics.

You can still try BT without battery. Just hook up to USB port and turn BT on :D
Not *wireless* but it should work.
Title: Re: Alternative Controller for HHKB
Post by: lootbag on Thu, 26 November 2015, 17:57:10
Oh I had no idea that BT would work with no battery.
Thanks for letting me know!

And yes, it is working because I am connected to my Nexus 6P and typing, very cool!

So does this mean I can connect a USB battery pack to the HHKB and be able to use the BT function as well without internal lipo battery?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 26 November 2015, 18:08:23
Yes, you can also use USB battery pack or AC adapter with USB connector to give controller power.
Title: Re: Alternative Controller for HHKB
Post by: jiexi on Thu, 17 December 2015, 02:15:21
I can't seem to get my controller into RN-42 Config mode.

I'm using https://www.pjrc.com/teensy/hid_listen.html

I flashed the keyboard back to HHKB keymap

I run hid_listen, I connect the keyboard, it says "Listening:"

I turn on BT

According to RN42.txt, pressing LShift+RShift+Fn+O should do the initial config and I should see printing to console, but i don't see anything.


Another issue, mouse 4 and 5 don't work in BT mode for me, but they work fine USB mode.

EDIT: This is on MacOS
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 17 December 2015, 04:55:42
I can't seem to get my controller into RN-42 Config mode.

I'm using https://www.pjrc.com/teensy/hid_listen.html

I flashed the keyboard back to HHKB keymap

I run hid_listen, I connect the keyboard, it says "Listening:"

I turn on BT

According to RN42.txt, pressing LShift+RShift+Fn+O should do the initial config and I should see printing to console, but i don't see anything.


Another issue, mouse 4 and 5 don't work in BT mode for me, but they work fine USB mode.

EDIT: This is on MacOS

Yes, you should see something on hid_listen console.

Can you see version info on hid_listen with LShift+RShift+v?
Post  your version info if you can.


IIRC, it is limitation of RN-42 mouse function, it cannot send more than three buttons and horizontal scroll.
Title: Re: Alternative Controller for HHKB
Post by: jiexi on Thu, 17 December 2015, 21:35:30
Don't see anything. Will try again on windows. I only need HID Listen, right? None of the avrgcc stuff?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 17 December 2015, 22:03:52
Yes, you need only hid_listen command from PJRC.

Did you change keymap from default?
Anyway, better flash default firmware from Keymap Editor withouth editing keymap.

Title: Re: Alternative Controller for HHKB
Post by: jiexi on Fri, 18 December 2015, 00:03:16
Hid listen working in windows, but I can only get rshift + lshift + v to work. the commands just show "?"

EDIT: rshift + lshift + i doesn't print info

Code: [Select]
Magic key combination is 'LShift+RShift' by default in case of HHKB.

Here is help.

    ----- Bluetooth RN-42 Help -----
    i:       RN-42 info
    b:       battery voltage
    Del:     enter/exit RN-42 config mode
    Slck:    RN-42 initialize
    p:       pairing
    u:       toggle Force USB mode

    RN-42 info:             displays information of the module on console.
    battery voltage:        displays current voltage of battery and uptime.
    RN-42 initialize:       does factory reset and configures RN-42
    pairing:                enters Pairing mode.
    toggle Force USB mode:  switch between USB and Bluetooth

is this still correct?

Bluetooth shouldn't be connected to any device, right?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 18 December 2015, 00:52:22
From version info you are using USB version firmware. Make sure to Use BT version.
Title: Re: Alternative Controller for HHKB
Post by: jiexi on Fri, 18 December 2015, 02:58:43
I changed the key combo to KC_RALT, KC_RGUI and it's okay now. I also flashed BT firmware (not sure why it was USB before)

After I run Initial Configuration, I cannot pair to it anymore. Even if i put it into pair mode, it doesn't work.

Just stays on "Startup/configuration timer     2 times per sec", never enters "Discoverable/Inquiring/Idle     once per sec"

I tried to send Q,0 and was able to see device, but it doesn't connect. Continues to blink 2 times per sec.

Android can see it, but pairing fails.

Code: [Select]
Jiexi-MAC:Downloads Jiexi$ ./hid_listen.mac
Waiting for device:
Listening:

- Version -
DESC: t.m.k. keyboard firmware for HHKB mod
VID: 0xFEED(t.m.k.) PID: 0x4242(HHKB mod) VER: 0x0104
BUILD: a88a368 (01:14:55 Dec 18 2015)
OPTIONS: LUFA BOOTMAGIC MOUSEKEY EXTRAKEY CONSOLE COMMAND NKRO 4096
GCC: 4.9.3 AVR-LIBC: 1.8.1 AVR_ARCH: avr5
Entering config mode ...
CMD
Ver 6.15 04/26/2013
(c) Roving Networks
ECHO ON
SF,1
AOK
S-,HHKB
AOK
SS,Keyboard/Mouse
AOK
SM,6
AOK
SW,8000
AOK
S~,4
AOK
SH,003C
AOK
SY,FFF4
AOK
R,1
Reboot!
Exiting config mode ...
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 18 December 2015, 05:38:17
I have to know what your problem exactly is.
Do you think hardware of the board is ok? With default firmware does it work?
Problem is your configuration or your OS?

If you are not sure that, use default firmware downloaded from Keymap Editor.
You are still using your own firmware verion, right? This makes debug process very difficult,
because we cannot know your configuration, keymap and etc.

Quote
BUILD: a88a368 (01:14:55 Dec 18 2015)



I don't think "blink 2 times per sec" of LED appears in HID configured RN-42, config timer is function only for UART configuration of the module. Probably you are in 'Discoverable mode', in fact your Android discovered the device :D

Quote
Just stays on "Startup/configuration timer     2 times per sec", never enters "Discoverable/Inquiring/Idle     once per sec"

After initializing the moudule with LShift+RShift+Scrolllock  previous pairing information sotred in host becomes obsolete, you will have to remove that info before staring new pairing process. At least in Linux you have to. I don't know how to remove infor in Mac, though.

And reboot host is often helpful for some reason. I don't know why but really helpful sometime.



I changed the key combo to KC_RALT, KC_RGUI and it's okay now. I also flashed BT firmware (not sure why it was USB before)

After I run Initial Configuration, I cannot pair to it anymore. Even if i put it into pair mode, it doesn't work.

Just stays on "Startup/configuration timer     2 times per sec", never enters "Discoverable/Inquiring/Idle     once per sec"

I tried to send Q,0 and was able to see device, but it doesn't connect. Continues to blink 2 times per sec.

Android can see it, but pairing fails.

Code: [Select]
Jiexi-MAC:Downloads Jiexi$ ./hid_listen.mac
Waiting for device:
Listening:

- Version -
DESC: t.m.k. keyboard firmware for HHKB mod
VID: 0xFEED(t.m.k.) PID: 0x4242(HHKB mod) VER: 0x0104
BUILD: a88a368 (01:14:55 Dec 18 2015)
OPTIONS: LUFA BOOTMAGIC MOUSEKEY EXTRAKEY CONSOLE COMMAND NKRO 4096
GCC: 4.9.3 AVR-LIBC: 1.8.1 AVR_ARCH: avr5
Entering config mode ...
CMD
Ver 6.15 04/26/2013
(c) Roving Networks
ECHO ON
SF,1
AOK
S-,HHKB
AOK
SS,Keyboard/Mouse
AOK
SM,6
AOK
SW,8000
AOK
S~,4
AOK
SH,003C
AOK
SY,FFF4
AOK
R,1
Reboot!
Exiting config mode ...

Title: Re: Alternative Controller for HHKB
Post by: jiexi on Fri, 18 December 2015, 13:59:12
Dumb me... "S~, 4"

I meant to change "SM, 4"...

That makes sense why I could pair, but it would fail, or i couldn't type.

All fixed now...  :-\
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 18 December 2015, 16:04:05
Dumb me... "S~, 4"

I meant to change "SM, 4"...

That makes sense why I could pair, but it would fail, or i couldn't type.

All fixed now...  :-\

Yeah... most of people can help theirself if people took a bit more time.
We couldn't help it cause we didn't know that you did that configuration!
Title: Re: Alternative Controller for HHKB
Post by: jiexi on Fri, 18 December 2015, 19:02:36
Last thing. During my debugging, I realized that the rn42_task doesn't always get recompiled even if it changes (I was changing the hotkey for BT from lshift + rshift to ralt+rgui). Even after make clean, rn42_task isn't guaranteed to be recompiled. If you delete the obj_hhkb_rn42 folder, then it will definitely be recompiled.
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Tue, 22 December 2015, 23:37:06
Updated firmwre of keymap editor for both USB and BT. You can download the latest firmware from keymap editor now.

thank you hasu!

one small thing: i noticed that Web Back and Web Forward do not seem to be doing anything for me..?
(i'm using Win7 64bit + Chrome.)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 23 December 2015, 00:55:22
Updated firmwre of keymap editor for both USB and BT. You can download the latest firmware from keymap editor now.

thank you hasu!

one small thing: i noticed that Web Back and Web Forward do not seem to be doing anything for me..?
(i'm using Win7 64bit + Chrome.)

In keymap editor web back and forward operation have no meaning. It is just one page of web app so it doesn't make history entries on web browser.

EDIT: "web app" is not correct word, keymap editor is a just javascript program which runs completely on client side, you can use it even without network connection and server. Operations on it aren't accompanied by transition to specific URL and don't leave history on web browser. Undo and Redo of operation history would be useful but I don't have plan to add the features as of now. To be honest, I don't know about web programming enough.
Title: Re: Alternative Controller for HHKB
Post by: jiexi on Fri, 25 December 2015, 13:22:00
Weird bug for me.

I have lshift set as
Code: [Select]
ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPC)
Let's say I type in the following:

Quote
ABc

I want to replace the 'c' with 'C'
1. I tap lshift, this gives me a backspace

Quote
AB

I want to add 'C'
2. I hold lshift and press 'c'

If I do 2 slowly after 1:
Quote
ABC

But, If I do 2 quickly after 1:
Quote
Ac

B is removed, and c is not capitalized. I keep getting this problem. Changing tap timeout doesn't fix the issue. Seems to be internal delay/timer.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 25 December 2015, 20:45:05
Interesing problem, I didn't expected this when 'repeating' feature was added.

'Repeat' feature causes the problem, you can repeat Backspace(tap key) by tap and hold.
This 'repeat' is curretnly hard-coded and not configurable unfortunately.

Messy codes related are around here if you want to look into.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action_tapping.c#L227-L263


Filed this issue.
https://github.com/tmk/tmk_keyboard/issues/287

EDIT: The 'repeating' is used on some keys(Space, ; and /) on my keymap, not critical but useful sometimes.
Code: [Select]
    [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH),          // Cursor layer with Slash*
    [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN),           // Mousekey layer with Semicolon*
    [4] = ACTION_LAYER_TAP_KEY(4, KC_SPC),            // Mousekey layer with Space
Title: Re: Alternative Controller for HHKB
Post by: jiexi on Sun, 27 December 2015, 16:46:06
This is a hard one. Simply commenting out code prevents tap toggle from working... Hmm...
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 11 January 2016, 10:59:50
Updated keymap editor, it supports media keys for Mac now.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#media-control-keys-in-mac-osx
Title: Re: Alternative Controller for HHKB
Post by: zennasyndroxx on Fri, 15 January 2016, 08:46:15
there's still no way to get the hubs working with the custom controller?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 15 January 2016, 21:38:16
"no way"? Clearly way exists.
See these.
https://geekhack.org/index.php?topic=12047.msg1699177#msg1699177
https://geekhack.org/index.php?topic=57008.msg1491318#msg1491318
Title: Re: Alternative Controller for HHKB
Post by: apolotary on Sun, 31 January 2016, 02:57:09
I'm trying to flash a USB controller installed on HHKB Pro JP, using OS X 10.11.3 El Capitan. Downloaded keyboard software here: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb

Here's the command I use:

Code: [Select]
make -f Makefile.jp KEYMAP=jp dfu

And here's the output:

Code: [Select]
dfu-programmer atmega32u4 erase
dfu-programmer atmega32u4 flash hhkb_lufa.hex
Validating...
22148 bytes used (77.25%)
dfu-programmer atmega32u4 reset

When I plug the keyboard back in, there's no output. What might be the problem?

edit: full log of the compilation process: http://pastebin.com/ZQ7iBcH9
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 31 January 2016, 04:54:58
I found you forgot to add '-f' in that log.
Title: Re: Alternative Controller for HHKB
Post by: apolotary on Sun, 31 January 2016, 05:07:49
I found you forgot to add '-f' in that log.

didn't help :( also my planck now stops working after a while, perhaps I got something corrupted, I'll try restoring my system to the latest backup
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Mon, 01 February 2016, 10:49:57
i just noticed that AquaKeyTest shows 6KRO, not NKRO like i thought it should be?
am i missing something? :) i used the keymap editor to create the hex file for me. (USB, not BT.)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 01 February 2016, 17:02:46
i just noticed that AquaKeyTest shows 6KRO, not NKRO like i thought it should be?
am i missing something? :) i used the keymap editor to create the hex file for me. (USB, not BT.)

BT firmware of keymap editor disables NKRO to avoid confusion because NKRO in BT mode doesn't work. Of course BT controller can still use it in USB mode but you need to build firmware yourself.

USB firmware of keymap editor should work. See this FAQ entry.
https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
Title: Re: Alternative Controller for HHKB
Post by: Bucake on Tue, 02 February 2016, 18:36:09
USB firmware of keymap editor should work. See this FAQ entry.
https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work

thanks hasu for the reply.
i had actually tried that already - turns out it just doesn't seem to be working consistently(?)
often i have to unplug - replug the keyboard before i'm able to switch to NKRO, otherwise the command won't do anything.

another thing i noticed is that whenever i plug in the keyboard, it takes quite a long while before it's detected and working.
of course this is not an issue at all, but i do wonder why? could it be my PC, or is this normal with this controller? :)
it takes about ~15 seconds before it works, after plugging it in.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 02 February 2016, 19:21:55
HHKB controller comes up not so fast, but a few seconds. BT controller can be a bit longer due to LED blinking at startup. NKRO also works on my Windows 10 and Unbuntu 15.04 as what I expect. I didn't long test, though.

Something wrong with your PC/OS? 15 sec reminds me driver install process on Windows :D
Describing what you do and what you see in detail step by step may help, for example.
1. plugin into USB port
2. wait a few sec
3. press LShift+RShift+n
Title: Re: Alternative Controller for HHKB
Post by: venyv on Mon, 08 February 2016, 09:58:59
NVM got it working
Title: Re: Alternative Controller for HHKB
Post by: joric on Sun, 20 March 2016, 16:05:57
Just wanted to ask does it come with a preinstalled mouse layer? Which keys? If not, still, which keys do you prefer to switch into the mouse layer? Right Alt, I suppose?
Upd: Ok, Ok, there's no mouse layer by default.
Upd2: Regarding power saving, there was a discussion about using a separate wakeup sensor (proximity or piezoelectric) in order to have an ability to cut the main board completely off the grid. Not sure which sensor is better. I also think that instead of the sensor it's perfectly fine to use a separate mechanical switch (a button on the rear side or maybe hooked to the fn button or the spacebar) to wake up the board after 15 minutes of inactivity or so, that would work just fine too (I've ordered 2600 mAh battery that reportedly works for about 3 days - my Logitech MX Master works for about 8 days so it would be great to have at least something like that). Wondering if Rev G. allows this modification.
Title: Re: Alternative Controller for HHKB
Post by: feralfoo on Sun, 27 March 2016, 21:07:09
Hi @hasu,

Do you have plans to support HHKB JP in the Keymap Editor?

Updated firmware used in Keymap Editor to the latest version and added Keymap Editor for TMK Bluetooth controller.
Try it and give feedback.

http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb_bt/


Show Image
(http://i.imgur.com/EMUwuYzh.png?1)

Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 27 March 2016, 21:43:33
Hi,
I still have a plan for JP but I'm tired of maintain various keymap editors and it is pending for now. I have an idea of universal keymap editor for any TMK firmware, instead of making a editor for each keyboard.

I mean, editor for JP won't be availabe for a while at least, sorry.
Title: Re: Alternative Controller for HHKB
Post by: feralfoo on Sun, 27 March 2016, 22:30:12
I have a JP board and matching tmk controller in the mail, would be happy to help getting the keymap editor up and running for JP.

Hi,
I still have a plan for JP but I'm tired of maintain various keymap editors and it is pending for now. I have an idea of universal keymap editor for any TMK firmware, instead of making a editor for each keyboard.

I mean, editor for JP won't be availabe for a while at least, sorry.
Title: Re: Alternative Controller for HHKB
Post by: zennasyndroxx on Tue, 29 March 2016, 05:30:02
not sure if this is only me but there's multiple inputs, or chatter when you're using BT firmware on USB.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 29 March 2016, 07:49:43
not sure if this is only me but there's multiple inputs, or chatter when you're using BT firmware on USB.

Smells like hardware failure like break wire or bad solder. You will see random or wrong input when it has break wire or half-mated connector.
Title: Re: Alternative Controller for HHKB
Post by: zennasyndroxx on Tue, 29 March 2016, 07:53:17
not sure if this is only me but there's multiple inputs, or chatter when you're using BT firmware on USB.

Smells like hardware failure like break wire or bad solder. You will see random or wrong input when it has break wire or half-mated connector.
The issue is fixed now though.

I've flashed the Bluetooth firmware and I'm only using it via USB, turned Bluetooth off. There's no any other input just double or triple registration.

This issue is fixed by flashing the appropriate firmware for what connection you're gonna use
Title: Re: Alternative Controller for HHKB
Post by: rdg on Fri, 15 April 2016, 22:55:21
I just got a hhkb alt controller and am trying to use it with my HHKB-JP. But, after flashing the firmware I cannot get any keypress registered.
I have tried hid listen tool on OSX but no output - I'm not sure how else to debug - does anyone have any ideas? I'll add a gist below with output of compilation and dfu-programmer.
Compiled on OSX 10.11, avr gcc version 4.8.1 (GCC)

Code: [Select]
make -f Makefile.jp clean
make -f Makefile.jp dfu

full output
More
Code: [Select]
make -f Makefile.jp dfu

mkdir -p obj_hhkb_lufa
Compiling C: keymap_jp.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/keymap_jp.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_keymap_jp.o.d  keymap_jp.c -o obj_hhkb_lufa/keymap_jp.o

mkdir -p obj_hhkb_lufa
Compiling C: keymap_common.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/keymap_common.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_keymap_common.o.d  keymap_common.c -o obj_hhkb_lufa/keymap_common.o

mkdir -p obj_hhkb_lufa
Compiling C: matrix.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/matrix.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_matrix.o.d  matrix.c -o obj_hhkb_lufa/matrix.o

mkdir -p obj_hhkb_lufa
Compiling C: led.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/led.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_led.o.d  led.c -o obj_hhkb_lufa/led.o

mkdir -p obj_hhkb_lufa/protocol/lufa
Compiling C: ../../tmk_core/protocol/lufa/lufa.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/lufa.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_lufa.o.d  ../../tmk_core/protocol/lufa/lufa.c -o obj_hhkb_lufa/protocol/lufa/lufa.o

mkdir -p obj_hhkb_lufa/protocol/lufa
Compiling C: ../../tmk_core/protocol/lufa/descriptor.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/descriptor.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_descriptor.o.d  ../../tmk_core/protocol/lufa/descriptor.c -o obj_hhkb_lufa/protocol/lufa/descriptor.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Class_Common_HIDParser.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_Device_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_EndpointStream_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_Endpoint_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_Host_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_PipeStream_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_Pipe_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_USBController_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_AVR8_USBInterrupt_AVR8.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_ConfigDescriptors.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_DeviceStandardReq.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_Events.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_HostStandardReq.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.o

mkdir -p obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core
Compiling C: ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_protocol_lufa_LUFA-git_LUFA_Drivers_USB_Core_USBTask.o.d  ../../tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.c -o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/host.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/host.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_host.o.d  ../../tmk_core/common/host.c -o obj_hhkb_lufa/common/host.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/keyboard.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/keyboard.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_keyboard.o.d  ../../tmk_core/common/keyboard.c -o obj_hhkb_lufa/common/keyboard.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/action.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/action.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_action.o.d  ../../tmk_core/common/action.c -o obj_hhkb_lufa/common/action.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/action_tapping.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/action_tapping.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_action_tapping.o.d  ../../tmk_core/common/action_tapping.c -o obj_hhkb_lufa/common/action_tapping.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/action_macro.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/action_macro.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_action_macro.o.d  ../../tmk_core/common/action_macro.c -o obj_hhkb_lufa/common/action_macro.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/action_layer.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/action_layer.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_action_layer.o.d  ../../tmk_core/common/action_layer.c -o obj_hhkb_lufa/common/action_layer.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/action_util.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/action_util.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_action_util.o.d  ../../tmk_core/common/action_util.c -o obj_hhkb_lufa/common/action_util.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/print.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/print.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_print.o.d  ../../tmk_core/common/print.c -o obj_hhkb_lufa/common/print.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/debug.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/debug.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_debug.o.d  ../../tmk_core/common/debug.c -o obj_hhkb_lufa/common/debug.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/util.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/util.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_util.o.d  ../../tmk_core/common/util.c -o obj_hhkb_lufa/common/util.o

mkdir -p obj_hhkb_lufa/common/avr
Compiling C: ../../tmk_core/common/avr/suspend.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/avr/suspend.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_avr_suspend.o.d  ../../tmk_core/common/avr/suspend.c -o obj_hhkb_lufa/common/avr/suspend.o

mkdir -p obj_hhkb_lufa/common/avr
Assembling: ../../tmk_core/common/avr/xprintf.S
avr-gcc -c -mmcu=atmega32u4 -x assembler-with-cpp -DF_CPU=16000000 -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Wa,-adhlns=obj_hhkb_lufa/common/avr/xprintf.lst,-gstabs,--listing-cont-lines=100 -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -include config.h  ../../tmk_core/common/avr/xprintf.S -o obj_hhkb_lufa/common/avr/xprintf.o

mkdir -p obj_hhkb_lufa/common/avr
Compiling C: ../../tmk_core/common/avr/timer.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/avr/timer.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_avr_timer.o.d  ../../tmk_core/common/avr/timer.c -o obj_hhkb_lufa/common/avr/timer.o

mkdir -p obj_hhkb_lufa/common/avr
Compiling C: ../../tmk_core/common/avr/bootloader.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/avr/bootloader.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_avr_bootloader.o.d  ../../tmk_core/common/avr/bootloader.c -o obj_hhkb_lufa/common/avr/bootloader.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/keymap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/keymap.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_keymap.o.d  ../../tmk_core/common/keymap.c -o obj_hhkb_lufa/common/keymap.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/bootmagic.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/bootmagic.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_bootmagic.o.d  ../../tmk_core/common/bootmagic.c -o obj_hhkb_lufa/common/bootmagic.o

mkdir -p obj_hhkb_lufa/common/avr
Compiling C: ../../tmk_core/common/avr/eeconfig.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/avr/eeconfig.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_avr_eeconfig.o.d  ../../tmk_core/common/avr/eeconfig.c -o obj_hhkb_lufa/common/avr/eeconfig.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/mousekey.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/mousekey.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_mousekey.o.d  ../../tmk_core/common/mousekey.c -o obj_hhkb_lufa/common/mousekey.o

mkdir -p obj_hhkb_lufa/common
Compiling C: ../../tmk_core/common/command.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_hhkb_lufa/common/command.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_hhkb_lufa_common_command.o.d  ../../tmk_core/common/command.c -o obj_hhkb_lufa/common/command.o

Linking: hhkb_lufa.elf
avr-gcc -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=4096 -DHHKB_JP -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8  -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=4e317c2 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=hhkb_lufa.elf -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/hhkb_lufa.elf.d  obj_hhkb_lufa/keymap_jp.o obj_hhkb_lufa/keymap_common.o obj_hhkb_lufa/matrix.o obj_hhkb_lufa/led.o obj_hhkb_lufa/protocol/lufa/lufa.o obj_hhkb_lufa/protocol/lufa/descriptor.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.o obj_hhkb_lufa/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.o obj_hhkb_lufa/common/host.o obj_hhkb_lufa/common/keyboard.o obj_hhkb_lufa/common/action.o obj_hhkb_lufa/common/action_tapping.o obj_hhkb_lufa/common/action_macro.o obj_hhkb_lufa/common/action_layer.o obj_hhkb_lufa/common/action_util.o obj_hhkb_lufa/common/print.o obj_hhkb_lufa/common/debug.o obj_hhkb_lufa/common/util.o obj_hhkb_lufa/common/avr/suspend.o obj_hhkb_lufa/common/avr/xprintf.o obj_hhkb_lufa/common/avr/timer.o obj_hhkb_lufa/common/avr/bootloader.o obj_hhkb_lufa/common/keymap.o obj_hhkb_lufa/common/bootmagic.o obj_hhkb_lufa/common/avr/eeconfig.o obj_hhkb_lufa/common/mousekey.o obj_hhkb_lufa/common/command.o --output hhkb_lufa.elf -Wl,-Map=hhkb_lufa.map,--cref -Wl,--gc-sections     -lm

Creating load file for Flash: hhkb_lufa.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature hhkb_lufa.elf hhkb_lufa.hex
dfu-programmer atmega32u4 erase --force
Erasing flash...  Success
Checking memory from 0x0 to 0x6FFF...  Empty.
dfu-programmer atmega32u4 flash hhkb_lufa.hex
Checking memory from 0x0 to 0x547F...  Empty.
0%                            100%  Programming 0x5480 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]  Success
0%                            100%  Reading 0x7000 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]  Success
Validating...  Success
0x5480 bytes written into 0x7000 bytes memory (75.45%).
dfu-programmer atmega32u4 reset
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 15 April 2016, 23:24:44
 
I just got a hhkb alt controller and am trying to use it with my HHKB-JP. But, after flashing the firmware I cannot get any keypress registered.
I have tried hid listen tool on OSX but no output - I'm not sure how else to debug - does anyone have any ideas? I'll add a gist below with output of compilation and dfu-programmer.
Compiled on OSX 10.11, avr gcc version 4.8.1 (GCC)

It loosks dfu-programmer flashes controller successfully, but you need sudo?
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Build#cant-program-on-linux-and-mac

Also did you use sudo with hid_listen?
https://github.com/tmk/tmk_keyboard/wiki/FAQ#hid_listen-cant-recognize-device
Title: Re: Alternative Controller for HHKB
Post by: feralfoo on Fri, 15 April 2016, 23:50:13
I just got a hhkb alt controller and am trying to use it with my HHKB-JP. But, after flashing the firmware I cannot get any keypress registered.
I have tried hid listen tool on OSX but no output - I'm not sure how else to debug - does anyone have any ideas? I'll add a gist below with output of compilation and dfu-programmer.
Compiled on OSX 10.11, avytr gcc version 4.8.1 (GCC)

Hi @rdg,

I get similar issues with my tmk'ed hhkb jp, and it appears to be OSX not picking up the keyboard, try unplugging/replugging/typing a few times.
For me sometimes it will work straight away and sometimes it will take 3 or more unplugs/replugs, but it always starts working eventually :D
Title: Re: Alternative Controller for HHKB
Post by: rdg on Sat, 16 April 2016, 00:21:06
It loosks dfu-programmer flashes controller successfully, but you need sudo?
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Build#cant-program-on-linux-and-mac

Also did you use sudo with hid_listen?
https://github.com/tmk/tmk_keyboard/wiki/FAQ#hid_listen-cant-recognize-device

I had flashed with sudo in previous attempts, but the result is the same. I never get anything from hid_listen after "Waiting for device:....... Listening:". The computer detects the keyboard it seems but no keypresses.


Hi @rdg,

I get similar issues with my tmk'ed hhkb jp, and it appears to be OSX not picking up the keyboard, try unplugging/replugging/typing a few times.
For me sometimes it will work straight away and sometimes it will take 3 or more unplugs/replugs, but it always starts working eventually :D

Hmm, tried about 10 and no result yet unfortunately. (edit: I also tried w/ windows, but same result)


One thing to confirm after reading everything i can - is there a different controller hardware for the JP than the pro 2 - did I buy the wrong board?

I have 2016/01 Rev.J (I ordered it through 1upkeyboards). Thanks for the advice so far everyone!
(edit: I see this on your order page, which makes me think I made a mistake:     USB:  0+(Pro2) / 1+(JP) / Ask(Pro1) )

Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 16 April 2016, 00:29:33
I just got a hhkb alt controller and am trying to use it with my HHKB-JP. But, after flashing the firmware I cannot get any keypress registered.
I have tried hid listen tool on OSX but no output - I'm not sure how else to debug - does anyone have any ideas? I'll add a gist below with output of compilation and dfu-programmer.
Compiled on OSX 10.11, avytr gcc version 4.8.1 (GCC)

Hi @rdg,

I get similar issues with my tmk'ed hhkb jp, and it appears to be OSX not picking up the keyboard, try unplugging/replugging/typing a few times.
For me sometimes it will work straight away and sometimes it will take 3 or more unplugs/replugs, but it always starts working eventually :D

hmm, it seems something wrong happens in USB enumeration. I found my firmware on HHKB is clearly slower than other projects like alps64 in kernel log of enumeration process. I don't know why. I'll have to look into  when I get time.


EDIT: This issue was filed. https://github.com/tmk/tmk_keyboard/issues/331
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 16 April 2016, 00:42:48
It loosks dfu-programmer flashes controller successfully, but you need sudo?
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Build#cant-program-on-linux-and-mac

Also did you use sudo with hid_listen?
https://github.com/tmk/tmk_keyboard/wiki/FAQ#hid_listen-cant-recognize-device

I had flashed with sudo in previous attempts, but the result is the same. I never get anything from hid_listen after "Waiting for device:....... Listening:". The computer detects the keyboard it seems but no keypresses.
"Listening:" means hid_listen conneted to keyboard and waiting for output. No problem here.


Quote
Hi @rdg,

I get similar issues with my tmk'ed hhkb jp, and it appears to be OSX not picking up the keyboard, try unplugging/replugging/typing a few times.
For me sometimes it will work straight away and sometimes it will take 3 or more unplugs/replugs, but it always starts working eventually :D

Hmm, tried about 10 and no result yet unfortunately. (edit: I also tried w/ windows, but same result)


One thing to confirm after reading everything i can - is there a different controller hardware for the JP than the pro 2 - did I buy the wrong board?

I have 2016/01 Rev.J (I ordered it through 1upkeyboards). Thanks for the advice so far everyone!
(edit: I see this on your order page, which makes me think I made a mistake:     USB:  0+(Pro2) / 1+(JP) / Ask(Pro1) )


Ah, it is wrong controller for your HHKB JP. You cannot buy JP controller from the shop so far, controller you bought is actually for Pro2. Pro2 and JP have diffrent pinouts and diffrent shape connecter and they should not mate each other correctly.


Title: Re: Alternative Controller for HHKB
Post by: rdg on Sat, 16 April 2016, 09:51:26
Ah, it is wrong controller for your HHKB JP. You cannot buy JP controller from the shop so far, controller you bought is actually for Pro2. Pro2 and JP have diffrent pinouts and diffrent shape connecter and they should not mate each other correctly.

Got it, the connection did feel a little loose, but not so loose that it felt wrong.  I'll send you a pm/email about ordering the JP version. Thanks for all the info!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 25 April 2016, 21:53:55
I'll add pics and info later.

PFU HHKB BT internal shots:
http://imgur.com/a/YfcYt/all

Product info:
https://www.pfu.fujitsu.com/hhkeyboard/bt/

And MEMO.
Quote

HHKB Professional BT
====================
Internal shots:
http://imgur.com/a/YfcYt/all

Product info:
https://www.pfu.fujitsu.com/hhkeyboard/bt/


Controller
----------
m430f5510 TI MSP430
http://www.ti.com/lit/ds/symlink/msp430f5506.pdf


bu48**
Rohm reset IC
http://rohmfs.rohm.com/jp/products/databook/datasheet/ic/power/voltage_detector/bu48xxg-j.pdf
bu4819      1.9V
    Z11 for Battery voltage to MCU
bu4820 x3   2.0V
    Z10 for Battery voltage to MUC
    Z12 for VOUT of Bluetooth module to MUC
    Z16 for VOUT of Bluetooth module
bu4822      2.2V
    Z17 for Battery voltage to MUC


LTC4415 Z15 power switch
siwtch between battery and USB power
http://www.linear.com/product/LTC4415


S1170B33 Z14 voltage regulator
http://datasheet.sii-ic.com/en/voltage_regulator/S1170_E.pdf

TPS2065 Z9 USB pwoer distribution switch
http://www.tij.co.jp/product/jp/TPS2065
http://www.tij.co.jp/jp/lit/ds/symlink/tps2065.pdf


CN2: To Power board
10  GND
8   USB power
9   Battery
7   DIPSW1
6   DIPSW2
5   DIPSW3
4   DIPSW4
3   DIPSW5
2   DIPSW6
1   Reset



Bluetooth module
----------------
bcm20730

ath432
atmel I2C EEPROM
http://www.atmel.com/images/atmel-8568-seeprom-at24c256c-datasheet.pdf

GM30G ??DC-DC stepup??
has inductor and diode


Switch board
------------
LV07A open-drain driver
http://www.ti.com/lit/ds/symlink/sn74lv07a.pdf

LW051A analog multiplexer
http://www.ti.com/lit/ds/symlink/sn74lv4051a.pdf


some chips are engraved




Power board
-----------
CN4: To Controller
1   GND
3   USB power
2   Battery
4   DIPSW1
5   DIPSW2
6   DIPSW3
7   DIPSW4
8   DIPSW5
9   DIPSW6
10  Reset
Title: Re: Alternative Controller for HHKB
Post by: joric on Tue, 26 April 2016, 01:58:06
This is a bold move. Not sure lettering could be read. I'll try digital microscope when I get mine.
(http://i.imgur.com/4JmoxVk.jpg)
It's probably easier to find out what those chips really do in the circuit.
They look very similar to LV07A though, not sure why they are engraved.
Title: Re: Alternative Controller for HHKB
Post by: hanya on Tue, 26 April 2016, 03:02:16
Thank you for sharing the pictures of BT model. It looks USB lines from MCU are not connected to external connector, but just connected to test points.
It seems PCB to PCB connector between the controller board and switch board is one of HRS DF12 series, but its height is not sure.
Title: Re: Alternative Controller for HHKB
Post by: joric on Tue, 26 April 2016, 11:22:16
Hasu, I'd like to know how does the rear button work? Is it a simple push button as on bluetooth headphones or a two-position switch as on Filco?
Is this button really the only way to wake up a keyboard after 30 minutes of inactivity or it's just a bad google translate from here:

http://japanese.engadget.com/2016/04/11/hhkb-happy-hacking-keyboard-profess/
"HHKB Professional BT" is automatically power if there is no 30-minute character input has become the specifications turned off. The power will turn on the power button long press, but then re-connect automatically to the terminal which has been pairing just before

Also, how does the LED work? Does it glow all the time when the keyboard is active?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 26 April 2016, 16:18:34
Hasu, I'd like to know how does the rear button work? Is it a simple push button as on bluetooth headphones or a two-position switch as on Filco?
Is this button really the only way to wake up a keyboard after 30 minutes of inactivity or it's just a bad google translate from here:

http://japanese.engadget.com/2016/04/11/hhkb-happy-hacking-keyboard-profess/
"HHKB Professional BT" is automatically power if there is no 30-minute character input has become the specifications turned off. The power will turn on the power button long press, but then re-connect automatically to the terminal which has been pairing just before

Also, how does the LED work? Does it glow all the time when the keyboard is active?

It is normal tact switch just like one used on my TMK Alt controler, not two-position. The push button is only wakeup method  and you cannot use keyboard keys to wakeup in "30min-power down mode".
You can configure this power down mode with DIPSW6,  it is disabled when "Wake Up enable"(ON) and you can type anytime and never power down. By default factroy setting it is configured as "Wake Up disable"(OFF) or power down mode is enabled.

LED turns off after it is connected.
Title: Re: Alternative Controller for HHKB
Post by: Belfong on Tue, 26 April 2016, 19:00:16
Ohhhhh! Very good to know there is a Dip switch for never sleep!!!! Now, I'm Really interested in this HHKB!
Title: Re: Alternative Controller for HHKB
Post by: attheicearcade on Wed, 27 April 2016, 08:19:36
Thanks for these photos hasu, it would certainly be interesting to see what those engraved chips are. Can possibly make out an LV74A from one of them. The other large chip is a little blurry, can anyone get a better photo? Is there anything else hiding under the controller?

Edit: took a closer look at the photos. I have some initial thoughts but they are quite uncertain:

Z1 is the LV07A, driving the columns. It seems that there are two analog multiplexers taking row input: Z2 and Z3. The output line is joined near the bottom of the board and fed into the small cluster of components by the Topre logo. What are Z4 and Z5? I'm thinking voltage boost is done here, perhaps op amps of some kind. The output of this leads to R22 shown here http://i.imgur.com/HrAuS0V.jpg after which presumably the sensing is done. I think the top chip in that photo is LV74A and the key state is held in the flip flop for the controller to read. Looks like the lines leading off to the top of that photo go back to the controller. Maybe the smaller chip is a variable resistor.

Interesting to note that there are a low number of columns (1 LV07A) compared to rows (2x LW051A) (if my guess is right anyway). Normal HHKB2 had only one analog mux. I think this is related to the change of sensing mechanism. Possibly the new method is less robust, leading to the problem of voltage drop when too many keys are on a single row. Of course this could all be completely wrong.
Title: Re: Alternative Controller for HHKB
Post by: joric on Wed, 04 May 2016, 11:23:48
Got my HHKB BT today. Tried to swap cases with HHKB Pro 2 (TL;DR: needs a lot of carving but generally possible, not without a sacrifice, bluetooth board overlaps the stand comparment for about 5-8 mm; it's probably better to use a HRS DF12 20 pin ribbon cable). Posted pics here https://geekhack.org/index.php?topic=81269.msg2161778#msg2161778
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 04 May 2016, 22:32:33
Thank you for sharing the pictures of BT model. It looks USB lines from MCU are not connected to external connector, but just connected to test points.
It seems PCB to PCB connector between the controller board and switch board is one of HRS DF12 series, but its height is not sure.

You're right, it is DF12 and height is probably 3mm and USB pins of the controller are not pulled out to any connector unfortunately, without fine job soldering you won't be able to add USB interface.


Thanks for these photos hasu, it would certainly be interesting to see what those engraved chips are. Can possibly make out an LV74A from one of them. The other large chip is a little blurry, can anyone get a better photo? Is there anything else hiding under the controller?

Edit: took a closer look at the photos. I have some initial thoughts but they are quite uncertain:

Z1 is the LV07A, driving the columns. It seems that there are two analog multiplexers taking row input: Z2 and Z3. The output line is joined near the bottom of the board and fed into the small cluster of components by the Topre logo. What are Z4 and Z5? I'm thinking voltage boost is done here, perhaps op amps of some kind. The output of this leads to R22 shown here http://i.imgur.com/HrAuS0V.jpg after which presumably the sensing is done. I think the top chip in that photo is LV74A and the key state is held in the flip flop for the controller to read. Looks like the lines leading off to the top of that photo go back to the controller. Maybe the smaller chip is a variable resistor.

Interesting to note that there are a low number of columns (1 LV07A) compared to rows (2x LW051A) (if my guess is right anyway). Normal HHKB2 had only one analog mux. I think this is related to the change of sensing mechanism. Possibly the new method is less robust, leading to the problem of voltage drop when too many keys are on a single row. Of course this could all be completely wrong.

I guess Z4 is Topre custom sense chip or comparater(ADC?) and Z5 is digipot, I have to look into existent Topre chips and its circuit to get clear vision.

Title: Re: Alternative Controller for HHKB
Post by: joric on Thu, 05 May 2016, 06:25:58
Don't buy 13-pin JST connectors on Ebay, people. But if you do, make sure they are 1.5 mm (http://uk.farnell.com/jst-japan-solderless-terminals/b13b-zr/header-zh-top-13way-1-5mm/dp/1830906) not 2.5 mm ones.
(http://i.imgur.com/sjqe3xY.jpg)
*facepalm*
Title: Re: Alternative Controller for HHKB
Post by: RavenII on Sun, 08 May 2016, 18:57:00
I'll just leave my little contribution here... (https://www.reddit.com/r/MechanicalKeyboards/comments/4i5a4z/modification_designing_a_little_cover_for_those/)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 08 May 2016, 19:36:11
I'll just leave my little contribution here... (https://www.reddit.com/r/MechanicalKeyboards/comments/4i5a4z/modification_designing_a_little_cover_for_those/)

Great job! Thanks for sharing with us.
Title: Re: Alternative Controller for HHKB
Post by: RavenII on Sun, 08 May 2016, 20:20:09
Great job! Thanks for sharing with us.

And thank YOU for making the HHKB that much better with the controller. I swear, my requirement for a keyboard is whether or not it can take TMK, I can't live without it.
Title: Re: Alternative Controller for HHKB
Post by: phutro on Tue, 10 May 2016, 12:14:45
The Adafruit 2500mAh battery fits with a small modification made to the top shell's interior stabilizing feet.

http://imgur.com/a/vN3Xl
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 10 May 2016, 12:29:55
The Adafruit 2500mAh battery fits with a small modification made to the top shell's interior stabilizing feet.

http://imgur.com/a/vN3Xl

Thanks for the info!  I added the link to the first post.
https://geekhack.org/index.php?topic=71517.0
Title: Re: Alternative Controller for HHKB
Post by: phutro on Tue, 10 May 2016, 12:41:03
The Adafruit 2500mAh battery fits with a small modification made to the top shell's interior stabilizing feet.

http://imgur.com/a/vN3Xl

Thanks for the info!  I added the link to the first post.
https://geekhack.org/index.php?topic=71517.0

Thank you for this fantastic controller!
Title: Re: Alternative Controller for HHKB
Post by: joric on Wed, 11 May 2016, 07:36:08
The Adafruit 2500mAh battery fits with a small modification made to the top shell's interior stabilizing feet.
http://imgur.com/a/vN3Xl
Yeah, I had to cut those stems off completely to put a HHKB BT keyswitch board there (and a part of leftmost stem as well).
Doesn't seem like they are essential or make the case more sturdy or something (it was pretty sqeaky), so it's fine without them.

(http://i.imgur.com/AcRZKay.jpg)

More pics here http://imgur.com/a/YYAOv
Title: Re: Alternative Controller for HHKB
Post by: RavenII on Thu, 12 May 2016, 08:25:39
There's no need to clip anything (https://imgur.com/a/hQV2Y) on your HHKB to get the Adafruit 2500 (785060 dimensions) Battery to fit. All you have to do is bend the protection circuit away from the written side of the battery (if the battery is sitting with the writing side up, you bend the circuit downwards)...

The rest of the "mod" involves simply bending the aluminum around the battery, namely the corners, and bottom. If you were to stand the battery up, where the circuit side is on top...the bottom of the battery can be pushed in. The aluminum is pretty loose (which I'm assuming is in the event of expansion)...

You finagle the bottom, and the corners, and it fits perfect. No clipping of the case or anything.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 12 May 2016, 15:06:01
There's no need to clip anything (https://imgur.com/a/hQV2Y) on your HHKB to get the Adafruit 2500 (785060 dimensions) Battery to fit. All you have to do is bend the protection circuit away from the written side of the battery (if the battery is sitting with the writing side up, you bend the circuit downwards)...

The rest of the "mod" involves simply bending the aluminum around the battery, namely the corners, and bottom. If you were to stand the battery up, where the circuit side is on top...the bottom of the battery can be pushed in. The aluminum is pretty loose (which I'm assuming is in the event of expansion)...

You finagle the bottom, and the corners, and it fits perfect. No clipping of the case or anything.

Nice! I'll add this in the thread, thanks.
Title: Re: Alternative Controller for HHKB
Post by: kasakka on Fri, 13 May 2016, 02:22:37
Does the alternative controller work with the Japanese layout version of the HHKB? I'm going to Japan in about a month and was considering picking up one of those since it has more buttons than the regular one (I need them bottom corner arrow keys).
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 13 May 2016, 02:31:28
Does the alternative controller work with the Japanese layout version of the HHKB? I'm going to Japan in about a month and was considering picking up one of those since it has more buttons than the regular one (I need them bottom corner arrow keys).
Sure, it works with JP model(PD-KB420).
Title: Re: Alternative Controller for HHKB
Post by: kasakka on Fri, 13 May 2016, 02:57:30
Does the alternative controller work with the Japanese layout version of the HHKB? I'm going to Japan in about a month and was considering picking up one of those since it has more buttons than the regular one (I need them bottom corner arrow keys).
Sure, it works with JP model(PD-KB420).

Excellent! Any recommendations where I should go keyboard/keycap shopping in Tokyo?
Title: Re: Alternative Controller for HHKB
Post by: Atredl on Fri, 20 May 2016, 17:47:19
Since there are people getting their BT HHKB's does anyone know if Hasu's controller will work with the BT version? My guess is that it won't since the board will probably work slightly differently. Be good to find out though.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 20 May 2016, 20:11:54
Since there are people getting their BT HHKB's does anyone know if Hasu's controller will work with the BT version? My guess is that it won't since the board will probably work slightly differently. Be good to find out though.

Your guess is right. It doesn't work with HHKB Professional BT physically and logically. It think it is possible to make new alt controller for it but it doesn't make sense to replace its bluetooth controller mainly in terms of  cost. Instead, you will be able to program its controller MSP430 with your own firmware and it makes more sense. It would be great if someone can set to on this work.
Title: Re: Alternative Controller for HHKB
Post by: Karura on Fri, 24 June 2016, 02:15:13
Hasu, I'm looking for a reliable and light-weight keyboard and plan to use my HHKB as such.

Do you think there are any benefits to getting the USB-only controller?

I think I like BT and being able to connect wirelessly, but for the sake of reliability and being bug-free, would you recommend buying the USB only controller?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 24 June 2016, 09:30:33
Hi,
I don't think USB controller has advantage against BT one in terms of reliability. BT controller has equivalent connectivity of USB and Bluetooth connection is also stable and responsive and as far as I have tested.
BT controller will work for you if you can stand its cost and limitations, in particular short battery life.
Title: Re: Alternative Controller for HHKB
Post by: qnm on Mon, 27 June 2016, 19:38:36
Hey Hasu,

Would you make a BT board (or a USB if it's simpler) with a USB-C connector?

There's a mod board already available here https://oshpark.com/shared_projects/jm1ndqqB

 -- Rob
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 27 June 2016, 20:33:43
Hi,
No I have no plan for a while at least.
Cables and connectors have no variety and not cheap yet. Type-C is rather big and you will have to file your case to fit the connector.

And mini is not bad at all for keyboard and I have no problem with it. But I like reversible micro cable so far :D
Title: Re: Alternative Controller for HHKB
Post by: Gatix on Fri, 22 July 2016, 11:38:34
Hi, Hasu. I have the USB controller and after flashing it takes about 62 seconds for the board to boot up (no keypresses registers) everytime I plug the board. Is this normal or did I do something wrong?

Here's my keymap (https://github.com/Gatix/tmk_keyboard/blob/master/keyboard/hhkb/keymap_gatix.c). I just added a layer for vim keys.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 22 July 2016, 11:57:46
Hi, Hasu. I have the USB controller and after flashing it takes about 62 seconds for the board to boot up (no keypresses registers) everytime I plug the board. Is this normal or did I do something wrong?

Here's my keymap (https://github.com/Gatix/tmk_keyboard/blob/master/keyboard/hhkb/keymap_gatix.c). I just added a layer for vim keys.

I can't see any problem on your keymap and it should work.
62 secs everytime? totally wierd. after the delay does it works as expected?

See /var/log/syslog, you should see output like this when plugin. It takes a few seconds to boot up.
Code: [Select]
ul 23 01:54:35 desk kernel: [584015.608037] usb 1-1.3.3: new full-speed USB device number 106 using ehci-pci
Jul 23 01:54:35 desk kernel: [584015.701995] usb 1-1.3.3: New USB device found, idVendor=feed, idProduct=cafe
Jul 23 01:54:35 desk kernel: [584015.702003] usb 1-1.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jul 23 01:54:35 desk kernel: [584015.702007] usb 1-1.3.3: Product: HHKB mod
Jul 23 01:54:35 desk kernel: [584015.702010] usb 1-1.3.3: Manufacturer: t.m.k.
Jul 23 01:54:37 desk kernel: [584017.451082] input: t.m.k. HHKB mod as /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/0003:FEED:CAFE.0200/input/input413
Jul 23 01:54:37 desk kernel: [584017.505945] hid-generic 0003:FEED:CAFE.0200: input,hidraw5: USB HID v1.11 Keyboard [t.m.k. HHKB mod] on usb-0000:00:02.1-1.3.3/input0
Jul 23 01:54:37 desk kernel: [584017.523046] input: t.m.k. HHKB mod as /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.1/0003:FEED:CAFE.0201/input/input414
Jul 23 01:54:37 desk kernel: [584017.523937] hid-generic 0003:FEED:CAFE.0201: input,hidraw6: USB HID v1.11 Mouse [t.m.k. HHKB mod] on usb-0000:00:02.1-1.3.3/input1
Jul 23 01:54:37 desk kernel: [584017.550060] input: t.m.k. HHKB mod as /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.2/0003:FEED:CAFE.0202/input/input415
Jul 23 01:54:37 desk kernel: [584017.632589] hid-generic 0003:FEED:CAFE.0202: input,hidraw7: USB HID v1.11 Device [t.m.k. HHKB mod] on usb-0000:00:02.1-1.3.3/input2
Jul 23 01:54:37 desk kernel: [584017.652170] hid-generic 0003:FEED:CAFE.0203: hiddev0,hidraw8: USB HID v1.11 Device [t.m.k. HHKB mod] on usb-0000:00:02.1-1.3.3/input3
Jul 23 01:54:37 desk kernel: [584017.670527] input: t.m.k. HHKB mod as /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.4/0003:FEED:CAFE.0204/input/input416
Jul 23 01:54:37 desk kernel: [584017.760741] hid-generic 0003:FEED:CAFE.0204: input,hidraw9: USB HID v1.11 Keyboard [t.m.k. HHKB mod] on usb-0000:00:02.1-1.3.3/input4

Title: Re: Alternative Controller for HHKB
Post by: Gatix on Fri, 22 July 2016, 12:22:32
Yes, it works normally after that boot up time.

I'm on mac, there's nothing on /var/log/system.log about HHKB and tmk
Title: Re: Alternative Controller for HHKB
Post by: Gatix on Fri, 22 July 2016, 12:44:08
I get this from the system log after plugging out the board:

Code: [Select]
No interval found for . Using 8000000
No interval found for . Using 8000000
No interval found for . Using 8000000
No interval found for . Using 8000000
No interval found for . Using 8000000
No interval found for . Using 8000000
No interval found for . Using 8000000
No interval found for . Using 8000000
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 22 July 2016, 12:52:08
I can't get any idea from the log output, I'm not familiar with OSX. What does that mean?

Does default firmware downloaded from keymap editor works normally?
http://www.tmk-kbd.com/tmk_keyboard/editor/hhkb/index.html
Title: Re: Alternative Controller for HHKB
Post by: Gatix on Fri, 22 July 2016, 13:42:39
I tried flashing the default from the repo and from the keymap editor as well. Still getting up to a minute of boot time.

I have a 2014/09 Rev. D controller by the way. Appreciate your help on this one.
Title: Re: Alternative Controller for HHKB
Post by: Gatix on Sun, 24 July 2016, 00:34:00
Hello again, Hasu. So I solved the 60 second boot time by simply restarting my laptop  :)) It now boots up in 3 seconds, sorry about that.

I have another problem, the board is not registering any keycode with the GUI key. I've tried it on multiple computers (windows and mac) and I've also tried a different keystroke to isolate if it's the switch. It's just not registering any input with the GUI key.

EDIT: Solved by disabling Bootmagic
Title: Re: Alternative Controller for HHKB
Post by: yangdigi on Mon, 03 October 2016, 09:12:28
http://www.microchip.com/wwwproducts/en/RN42
RN41/42 Firmware v6.30 Release Notes say:
FIXED ISSUES
• Command “C,<adr>” re-connects to the specified Bluetooth address in
PDL

So with v6.30 manual switching connections is possible now.
Title: Re: Alternative Controller for HHKB
Post by: tlattimore on Mon, 28 November 2016, 10:06:10
This is awesome work, Hasu!

I would really like to make this upgrade to my HHKB Pro 2. The only question I have is whether or not the charging component of the bluetooth controller version automatically shuts off once the battery is charged to prevent overcharging/overheating? Does anyone know?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 28 November 2016, 19:26:55
This is awesome work, Hasu!

I would really like to make this upgrade to my HHKB Pro 2. The only question I have is whether or not the charging component of the bluetooth controller version automatically shuts off once the battery is charged to prevent overcharging/overheating? Does anyone know?

It has MCP73832-2ACI/OT as charger chip which controls charge current properly. Just note that you have to use battery with protection circuit for further security.
Title: Re: Alternative Controller for HHKB
Post by: tlattimore on Tue, 29 November 2016, 15:23:06
Quote
It has MCP73832-2ACI/OT as charger chip which controls charge current properly. Just note that you have to use battery with protection circuit for further security.

Awesome! Thanks, Hasu.
Title: Re: Alternative Controller for HHKB
Post by: venyv on Sun, 11 December 2016, 10:58:23
Anyone else have any issues running this through a USB hub? I am getting some weird issues. When I plug it in through the hub it does not work and makes my speakers pop ever few seconds and the computer runs really slow. If I plug it directly into the USB on the computer it seems to work fine.
Title: Re: Alternative Controller for HHKB
Post by: robotmaxtron on Wed, 04 January 2017, 20:02:55
Anyone else have any issues running this through a USB hub? I am getting some weird issues. When I plug it in through the hub it does not work and makes my speakers pop ever few seconds and the computer runs really slow. If I plug it directly into the USB on the computer it seems to work fine.

I'm running mine through a KM hub without any problems.
Title: Re: Alternative Controller for HHKB
Post by: YangG on Tue, 10 January 2017, 17:15:12
Hi Hasu,

Thank you for your hard work to make HHKB more powerful. I have a HHKB pro2 and am really interested in your bt controller. I have a few question about your future plan for the controller:
1) do you have any plan to add the function to make user easy switch between paired bt devices? It looks like the controller will auto connect the latest connected device, but if the user wants to switch between devices, he needs to manually disconnect the latest device. It seems there is no easy way to quickly switch devices, but the controller could remember 8 paired devices. Is there any way to have the "easy switch" functionality?
2) in bt mode, the battery won't last for days depending on the capacity of the battery. Do you have any plan to improve the battery life in near future?

Best,
Yang
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 10 January 2017, 17:31:20
1) Current version of  BT module doesn't support switching devices, so tweaking firmware cannot add this feature. But with newer module we can support this in future but not sure.
2) no. With this module we can not improve battery consumptin largely.
EDIT:  Also we may need to replace topre switch pcb, half of battery is consumed by scanning topre switch.

Complete new hardware desgin is required for these things.
Title: Re: Alternative Controller for HHKB
Post by: Atredl on Sat, 14 January 2017, 19:07:55
Is it possible to map the spacebar to act as a hold for function on this controller?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 14 January 2017, 22:42:11
I think so, but it depends on what you want with the function.
Firmware supports 'dual role key' that allows you to assign two different actions on a key in general.

Sent from my Nexus 5X

Title: Re: Alternative Controller for HHKB
Post by: robotmaxtron on Sat, 14 January 2017, 22:52:58
Is it possible to map the spacebar to act as a hold for function on this controller?

Yes. Check out the spacefn examples with QMK.
Title: Re: Alternative Controller for HHKB
Post by: Atredl on Sat, 14 January 2017, 23:44:06
I think so, but it depends on what you want with the function.
Firmware supports 'dual role key' that allows you to assign two different actions on a key in general.

Sent from my Nexus 5X

My idea was to have it act as a left hand accessible function button since the hhkb doesn't have an extra bottom below the left shift key. My goal would be for it to simply mirror what the right function key does. Is that doable?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 15 January 2017, 21:58:11
I think so, but it depends on what you want with the function.
Firmware supports 'dual role key' that allows you to assign two different actions on a key in general.

Sent from my Nexus 5X

My idea was to have it act as a left hand accessible function button since the hhkb doesn't have an extra bottom below the left shift key. My goal would be for it to simply mirror what the right function key does. Is that doable?

Yes, it is possible. You can use this 'spacefn' mapping as starting point.
https://goo.gl/zHcyu0
Title: Re: Alternative Controller for HHKB
Post by: kentt on Mon, 30 January 2017, 14:43:16
I was thinking of trading up from my hhkb pro 2 to the khkb pro BT jp.  Is there a custom controller for that. I have one for my pro 2.
Title: Re: Alternative Controller for HHKB
Post by: dr-slump on Wed, 01 February 2017, 14:38:16
I was thinking of trading up from my hhkb pro 2 to the khkb pro BT jp.  Is there a custom controller for that. I have one for my pro 2.

I'm on the fence for a Pro JP model too & would like to add a Hasu controller if that's even possible
Title: Re: Alternative Controller for HHKB
Post by: osxoep on Wed, 01 February 2017, 17:32:52
I was thinking of trading up from my hhkb pro 2 to the khkb pro BT jp.  Is there a custom controller for that. I have one for my pro 2.

I'm on the fence for a Pro JP model too & would like to add a Hasu controller if that's even possible

hasu controller + pro jp works

not sure if there's a bluetooth version yet
Title: Re: Alternative Controller for HHKB
Post by: dr-slump on Thu, 02 February 2017, 06:14:33
I was thinking of trading up from my hhkb pro 2 to the khkb pro BT jp.  Is there a custom controller for that. I have one for my pro 2.

I'm on the fence for a Pro JP model too & would like to add a Hasu controller if that's even possible

hasu controller + pro jp works

not sure if there's a bluetooth version yet



Thanks for the info !  Now I only have to source some Novatouch stems  :eek:
Title: Re: Alternative Controller for HHKB
Post by: mmdango on Thu, 09 February 2017, 13:42:50
Hi guys!

Quote
System control is not supported
        It can't send Power, Wake and Sleep keys.
Not sure if this above quote is relevant, but...

I currently have the DIP switch 6 on for my HHKB which allows me to wake up my mac using the HHKB. Will the BT controller affect that functionality? If it's relevant, I am on Sierra OSx 10.12.2.
Title: Re: Alternative Controller for HHKB
Post by: Tactile on Fri, 10 February 2017, 21:49:20
I've had someone ask where I got the USB plugs for the empty holes left in the rear of my HHKB after installing Hasu's controller (which doth rock, BTW. Thanks, Hasu!).

I just did a search on Ebay for "USB port (cover,plug)" and found these:
[attach=1]

They are a little undersize because they are designed for hardware inside the holes, not just an empty hole. I just wrapped some Kapton tape around the body to add a little dimension and they're now a nice press fit. I used Kapton tape because it's very thin, allowing very fine "adjustment" by layering, and also because it has an adhesive which won't weep out over time.

...and it looks like this:
[attach=2]
Title: Re: Alternative Controller for HHKB
Post by: robotmaxtron on Mon, 13 February 2017, 10:08:45
I've had someone ask where I got the USB plugs for the empty holes left in the rear of my HHKB after installing Hasu's controller (which doth rock, BTW. Thanks, Hasu!).

I just did a search on Ebay for "USB port (cover,plug)" and found these:
(Attachment Link)

They are a little undersize because they are designed for hardware inside the holes, not just an empty hole. I just wrapped some Kapton tape around the body to add a little dimension and they're now a nice press fit. I used Kapton tape because it's very thin, allowing very fine "adjustment" by layering, and also because it has an adhesive which won't weep out over time.

...and it looks like this:
(Attachment Link)

Just as another point of reference, I opt'd for a slightly more custom approach. Using a design previously uploaded in this thread, saved in github https://github.com/robotmaxtron/HHKB-usb-dust-covers (https://github.com/robotmaxtron/HHKB-usb-dust-covers) I got some printed for about $10 I think at Shapeways.

(http://i.imgur.com/Tv0Gu2ml.jpg)
Title: Re: Alternative Controller for HHKB
Post by: DRAZAH on Thu, 23 February 2017, 10:26:15
Anyway to get a USB port on the Hasu controller like the stock HHKB? I know they aren't much power but I use mine for my G900 wireless receiver dongle, I was about to get a HASU controller but was unaware that I would lose the 2 USB ports, I don't need both but would need 1 because its somewhat of a game change for me.
Title: Re: Alternative Controller for HHKB
Post by: alh84001 on Fri, 03 March 2017, 17:41:41
Time for a couple of stupid questions:
1) if sticking to USB, I could also use tmk usb->usb converter, with a difference of being limited to 6KRO. Any other notable differences?
2) is Pro BT keyboard fully unsupported in a sense that there are electrical/connection differences, or is it unsupported in a sense that built-in BT won't work, and current controller board can't be physically installed into the case? In other words, if you take out the PCB, connect it to the controller, would it work? (lack of (proper) programmability is such a bummer with that board)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 03 March 2017, 18:42:51
Time for a couple of stupid questions:
1) if sticking to USB, I could also use tmk usb->usb converter, with a difference of being limited to 6KRO. Any other notable differences?
2) is Pro BT keyboard fully unsupported in a sense that there are electrical/connection differences, or is it unsupported in a sense that built-in BT won't work, and current controller board can't be physically installed into the case? In other words, if you take out the PCB, connect it to the controller, would it work? (lack of (proper) programmability is such a bummer with that board)

1) And you cannot remap 'Fn' key with USB-USB converter.
2) ProBT is completely diffferent keyboard physically and electrically.
Title: Re: Alternative Controller for HHKB
Post by: alh84001 on Fri, 03 March 2017, 19:04:52
1) You mean you can't move Fn to another key, or you can't map anything else to Fn key? You can still use it, right?
2) Even the PCB? Interesting.

Thanks!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 03 March 2017, 19:15:06
1) You mean you can't move Fn to another key, or you can't map anything else to Fn key? You can still use it, right?
2) Even the PCB? Interesting.

Thanks!

1) the latter. You can define layer change action on any key except for key with legend 'Fn'.
2) Some pics of Pro BT.
https://imgur.com/a/YfcYt
Title: Re: Alternative Controller for HHKB
Post by: devoi on Tue, 07 March 2017, 19:31:17
Would increasing the matrix refresh rate be a possibility? I'd assume it depends on how the capacitor charges over time and whether or not the controller itself is the thing that dictates it, so I'm not entirely sure.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 07 March 2017, 21:18:28
Would increasing the matrix refresh rate be a possibility? I'd assume it depends on how the capacitor charges over time and whether or not the controller itself is the thing that dictates it, so I'm not entirely sure.

Interesting subject.
First, my Alt controller emulates scan method/timing of original Topre controller so both takes almost same time to scan matrix. And Pro2(and Pro1) scans 8x8 matrix for 15ms while JP scans 16x8 for 15ms, you will know that JP scans twice faster actually there. Pro2 and JP uses same sensing chip TP1684, Pro2 will be able to scan at same rate as JP, namely for 7.5ms.

You can see all of scanning code in this one file. Difference is just following lines, you can use 30us instead of 75us for Pro2 and push it on more.
The delay time is needed to wait until settling signal of switch capacitance before sensing next switch.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/matrix.c
Code: [Select]
#ifdef HHKB_JP
            // Looks like JP needs faster scan due to its twice larger matrix
            // or it can drop keys in fast key typing
            _delay_us(30);
#else
            _delay_us(75);
#endif

This is logic analyzer chart when scanning of FC660C which has 16x8 matrix and essentially same as JP. From this pic it takes around 110us to check a switch.
(https://i.imgur.com/9XoNTev.png)

And this is actual waveform from switch sensor, it seems to take 10us to settle signal after sensing. Cyan line is identical to LVC138A_~EN(A0) in pic above and yellow indicates voltage of signal sensed by TP1684.
(https://i.imgur.com/VMT2VYA.png)

And some pics can be found here.
https://imgur.com/a/jat2a
Title: Re: Alternative Controller for HHKB
Post by: devoi on Fri, 10 March 2017, 18:34:02
After looking at a few reviews of the official BT model, are there any limitations (in the keyboard itself, less the controller) keeping away the possibility of a new revision that has a better handling of battery power? I believe LeandreN's review claimed about 3 months off of two AA batteries.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 10 March 2017, 18:38:57
Yeah its great. Long battery life. Get it. No woe.

Btw did you try tweaking scan code? I'm curious what you find.

Sent from my Nexus 5X

Title: Re: Alternative Controller for HHKB
Post by: devoi on Fri, 10 March 2017, 21:23:27
As far as I can tell, changing the scan rate was a decent success. I haven't had any issues since I changed the 75us delay down to the 30us that the JP uses.

Is there currently an idea of an updated controller using a more modern version of bluetooth, and would that come with higher power efficiency? I get about 2-3 days of use off of one charge (using a 2000mah battery), which isn't too bad, but doesn't compare too well to the months of charge that the PFU BT model gets with just two AA batteries.
Title: Re: Alternative Controller for HHKB
Post by: Daphen on Sat, 11 March 2017, 17:32:39
Hey, I just got a USB alt controller and have installed it, the keyboard doesn't close 100%, is that normal? (It's basically fine and I can live with it, it's just cracking when pushing on the back plate.)

The real question I came here to ask is how do I set up a program that actually flashes the hex files onto the keyboard?
Am I stupid? I can't seem to find anything other than some posts about "FLIP" which only seems to be available on Windows.
The only programmable keyboard I've had was the White Fox and the instructions for that was so straight forward that I managed without a hassle.
I'm a web developer and am comfortable with the command line but all the directions I've found are vague and I don't understand them, so if there's a clear guide for the USB version of the controller for Mac, it would be great if someone could give me a link or something.

Sorry if this is super noobish, I just didn't know where to turn.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 11 March 2017, 18:17:40
Hey, I just got a USB alt controller and have installed it, the keyboard doesn't close 100%, is that normal? (It's basically fine and I can live with it, it's just cracking when pushing on the back plate.)

The real question I came here to ask is how do I set up a program that actually flashes the hex files onto the keyboard?
Am I stupid? I can't seem to find anything other than some posts about "FLIP" which only seems to be available on Windows.
The only programmable keyboard I've had was the White Fox and the instructions for that was so straight forward that I managed without a hassle.
I'm a web developer and am comfortable with the command line but all the directions I've found are vague and I don't understand them, so if there's a clear guide for the USB version of the controller for Mac, it would be great if someone could give me a link or something.

Sorry if this is super noobish, I just didn't know where to turn.

Which model is your hhkb? In case of Pro2 or JP you have to put ferrite core on cables right place to close tidily. In any case it should close.

Check MANUAL section in first post of this thread and wiki for flashing TMK HHKB Alt controller.
https://geekhack.org/index.php?topic=71517.0
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware
Title: Re: Alternative Controller for HHKB
Post by: Daphen on Sat, 11 March 2017, 18:34:27
Hey, I just got a USB alt controller and have installed it, the keyboard doesn't close 100%, is that normal? (It's basically fine and I can live with it, it's just cracking when pushing on the back plate.)

The real question I came here to ask is how do I set up a program that actually flashes the hex files onto the keyboard?
Am I stupid? I can't seem to find anything other than some posts about "FLIP" which only seems to be available on Windows.
The only programmable keyboard I've had was the White Fox and the instructions for that was so straight forward that I managed without a hassle.
I'm a web developer and am comfortable with the command line but all the directions I've found are vague and I don't understand them, so if there's a clear guide for the USB version of the controller for Mac, it would be great if someone could give me a link or something.

Sorry if this is super noobish, I just didn't know where to turn.

Which model is your hhkb? In case of Pro2 or JP you have to put ferrite core on cables right place to close tidily. In any case it should close.

Check MANUAL section in first post of this thread and wiki for flashing TMK HHKB Alt controller.
https://geekhack.org/index.php?topic=71517.0
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware

I have the Pro 2 Type-S. I'll have to dive deeper tomorrow.. Thanks.
Title: Re: Alternative Controller for HHKB
Post by: Daphen on Sun, 12 March 2017, 06:13:03
Hey, I just got a USB alt controller and have installed it, the keyboard doesn't close 100%, is that normal? (It's basically fine and I can live with it, it's just cracking when pushing on the back plate.)

The real question I came here to ask is how do I set up a program that actually flashes the hex files onto the keyboard?
Am I stupid? I can't seem to find anything other than some posts about "FLIP" which only seems to be available on Windows.
The only programmable keyboard I've had was the White Fox and the instructions for that was so straight forward that I managed without a hassle.
I'm a web developer and am comfortable with the command line but all the directions I've found are vague and I don't understand them, so if there's a clear guide for the USB version of the controller for Mac, it would be great if someone could give me a link or something.

Sorry if this is super noobish, I just didn't know where to turn.

Which model is your hhkb? In case of Pro2 or JP you have to put ferrite core on cables right place to close tidily. In any case it should close.

Check MANUAL section in first post of this thread and wiki for flashing TMK HHKB Alt controller.
https://geekhack.org/index.php?topic=71517.0
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware

So I actually just have to install dfu with homebrew (done already) and then run these commands:
dfu-programmer atmega32u4 erase --force
dfu-programmer atmega32u4 flash <layout I made with the TMK layout editor.hex>
dfu-programmer atmega32u4 reset

In my terminal with the keyboard connected, followed by pressing the red button, am I missing something?
Do I have to place the hexfile in a specific folder? Do I have to stand in the same folder that my hexfile is placed in?
I don't even have to stand in some specific folder or download some HHKB specific files from TMK's Github?

Also, is it normal that my alt controller board is green? All the pictures I've seen of it show the card being blue.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 13 March 2017, 19:14:29
Hey, I just got a USB alt controller and have installed it, the keyboard doesn't close 100%, is that normal? (It's basically fine and I can live with it, it's just cracking when pushing on the back plate.)

The real question I came here to ask is how do I set up a program that actually flashes the hex files onto the keyboard?
Am I stupid? I can't seem to find anything other than some posts about "FLIP" which only seems to be available on Windows.
The only programmable keyboard I've had was the White Fox and the instructions for that was so straight forward that I managed without a hassle.
I'm a web developer and am comfortable with the command line but all the directions I've found are vague and I don't understand them, so if there's a clear guide for the USB version of the controller for Mac, it would be great if someone could give me a link or something.

Sorry if this is super noobish, I just didn't know where to turn.

Which model is your hhkb? In case of Pro2 or JP you have to put ferrite core on cables right place to close tidily. In any case it should close.

Check MANUAL section in first post of this thread and wiki for flashing TMK HHKB Alt controller.
https://geekhack.org/index.php?topic=71517.0
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware

So I actually just have to install dfu with homebrew (done already) and then run these commands:
dfu-programmer atmega32u4 erase --force
dfu-programmer atmega32u4 flash <layout I made with the TMK layout editor.hex>
dfu-programmer atmega32u4 reset

In my terminal with the keyboard connected, followed by pressing the red button, am I missing something?
Do I have to place the hexfile in a specific folder? Do I have to stand in the same folder that my hexfile is placed in?
I don't even have to stand in some specific folder or download some HHKB specific files from TMK's Github?

Also, is it normal that my alt controller board is green? All the pictures I've seen of it show the card being blue.

Note that you have to press red button on your controller to enter flash(DFU bootloader) mode before running dfu-programmer commands. Of course, you have to give proper path of hex file on the command as other command line tools require. And you may need to add 'sudo' to the commands as the document says.

Yes, new revision of TMK Alt controller pcb is green, but it may be changed in future.
Title: Re: Alternative Controller for HHKB
Post by: Daphen on Mon, 13 March 2017, 19:19:43
Hey, I just got a USB alt controller and have installed it, the keyboard doesn't close 100%, is that normal? (It's basically fine and I can live with it, it's just cracking when pushing on the back plate.)

The real question I came here to ask is how do I set up a program that actually flashes the hex files onto the keyboard?
Am I stupid? I can't seem to find anything other than some posts about "FLIP" which only seems to be available on Windows.
The only programmable keyboard I've had was the White Fox and the instructions for that was so straight forward that I managed without a hassle.
I'm a web developer and am comfortable with the command line but all the directions I've found are vague and I don't understand them, so if there's a clear guide for the USB version of the controller for Mac, it would be great if someone could give me a link or something.

Sorry if this is super noobish, I just didn't know where to turn.

Which model is your hhkb? In case of Pro2 or JP you have to put ferrite core on cables right place to close tidily. In any case it should close.

Check MANUAL section in first post of this thread and wiki for flashing TMK HHKB Alt controller.
https://geekhack.org/index.php?topic=71517.0
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware

So I actually just have to install dfu with homebrew (done already) and then run these commands:
dfu-programmer atmega32u4 erase --force
dfu-programmer atmega32u4 flash <layout I made with the TMK layout editor.hex>
dfu-programmer atmega32u4 reset

In my terminal with the keyboard connected, followed by pressing the red button, am I missing something?
Do I have to place the hexfile in a specific folder? Do I have to stand in the same folder that my hexfile is placed in?
I don't even have to stand in some specific folder or download some HHKB specific files from TMK's Github?

Also, is it normal that my alt controller board is green? All the pictures I've seen of it show the card being blue.

Note that you have to press red button on your controller to enter flash(DFU bootloader) mode before running dfu-programmer commands. Of course, you have to give proper path of hex file on the command as other command line tools require. And you may need to add 'sudo' to the commands as the document says.

Yes, new revision of TMK Alt controller pcb is green, but it may be changed in future.

Awesome. So press button, run commands, point at correct hex file path, done?
Title: Re: Alternative Controller for HHKB
Post by: krutmob on Mon, 27 March 2017, 15:45:25
Can the Hasu be flashed over bluetooth, or do I need it to be connected via USB to program it?

Also, when using Git Bash I can't get "sudo" or "make" commands to run. What am I doing wrong?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 27 March 2017, 16:31:59
You need USB to flash firmware.
I don't know what git bash is actually but sudo should be available on Mac and Linux.

Sent from my Nexus 5X

Title: Re: Alternative Controller for HHKB
Post by: krutmob on Mon, 27 March 2017, 16:46:45
I abandoned using Git Bash. The instructions on the GitHub repo are ridiculous if you're not a programmer. I saw this post on Reddit (https://www.reddit.com/r/MechanicalKeyboards/comments/4d03zp/review_setting_up_a_hasu_controller_on_my_hhkb/), and loaded up a .hex with FLIP.

The board still does not communicate with the computer via bluetooth correctly. The computer recognizes the bluetooth and it is connected, but it doesn't work as a keyboard. No keystrokes are recognized. What do I need to do?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 27 March 2017, 16:56:24
What did you do to get firmware in fact?
Are you trying to compile from source? I  need to know what command and options did you use exactly.

I'm guessing you are using wrong firmware.

Are you on which os? Mac or Linux?

Sent from my Nexus 5X

Title: Re: Alternative Controller for HHKB
Post by: krutmob on Mon, 27 March 2017, 17:08:38
I made the firmware here: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?hhkb_rn42

I am on Windows 10.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 27 March 2017, 17:19:27
Ok.
Assuming you are using TMK Bluetooth controller it should work.

this instruction on Wiki on GitHub doesn't work for you?
https://github.com/tmk/tmk_keyboard/wiki#atmel-flip-for-windows

I can't come up with what wrong with you.

Sent from my Nexus 5X

Title: Re: Alternative Controller for HHKB
Post by: m3ll3n on Mon, 27 March 2017, 17:37:42
thinking about getting one of these, nice work hasu  :thumb:
Title: Re: Alternative Controller for HHKB
Post by: krutmob on Mon, 27 March 2017, 17:44:01
EDIT: I don't know what happened, but it's working now. Thank you Hasu! I'm sorry for the trouble.
Title: Re: Alternative Controller for HHKB
Post by: bayfury on Sat, 15 April 2017, 16:40:21
Howdy folks. Anyone know if the mod is compatible with the HHKB Bluetooth keyboard: PD-KB600BN ?
Title: Re: Alternative Controller for HHKB
Post by: SpAmRaY on Sat, 15 April 2017, 16:56:34
Howdy folks. Anyone know if the mod is compatible with the HHKB Bluetooth keyboard: PD-KB600BN ?
No it's a totally different setup.
Title: Re: Alternative Controller for HHKB
Post by: Stabilized on Wed, 10 May 2017, 11:45:34
Has anyone else experienced coil whine with their bluetooth controller when in USB mode? I thought it was because I didn't have a battery in, but even with one in I get this very slight coil whine which is driving me a bit crazy!
Title: Re: Alternative Controller for HHKB
Post by: devoi on Mon, 22 May 2017, 10:42:52
Has anyone else experienced coil whine with their bluetooth controller when in USB mode? I thought it was because I didn't have a battery in, but even with one in I get this very slight coil whine which is driving me a bit crazy!

I think it depends on the computer and how "clean" the USB power is. On my main home computer, it works perfectly fine with no noise. On my work computer, there's a bit of a high pitched noise that comes from the controller.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 22 May 2017, 21:08:53
Has anyone else experienced coil whine with their bluetooth controller when in USB mode? I thought it was because I didn't have a battery in, but even with one in I get this very slight coil whine which is driving me a bit crazy!

I think it depends on the computer and how "clean" the USB power is. On my main home computer, it works perfectly fine with no noise. On my work computer, there's a bit of a high pitched noise that comes from the controller.

And it depends on your ears, I can hear only 100Hz-14000kHz(14kHz) with this video. I guess you are hearing around 15kHz-20kHz noise I cannot hear. https://youtu.be/qNf9nzvnd1k (https://youtu.be/qNf9nzvnd1k)

I can hardly hear when it is installed and in use. I can hear the noise only when controller is given power without it installed, btw.

DC-DC boost converter used there has relatively old design and lower switch frequency, with my oscilloscope it shows 10kHz to 75kHz depending on power source voltage and output load. It seems the frequency is low when light load on output and high voltage of power soruce. Newer design converter with high freq, different coil or capacitors may help, though, it is not a solution to you aparently.

And this discussion may be helpful. I tried hotglue on coil and capacitor but it doesn't work for noise, btw.
http://www.edaboard.com/thread254663.html
Title: Re: Alternative Controller for HHKB
Post by: devoi on Mon, 22 May 2017, 22:25:43
At this point, is there really anything available that could extend the life of the battery? I enjoy being able to use it wirelessly and especially having a remappable layout is very nice but the time it takes to drain a battery just seems too short. I'm not sure if anyone here has a PFU BT HHKB and has looked at the internals, because whatever magic circuitry (or maybe hopefully software tricks) they use to get months off of two double-A batteries could be really useful with something like this (maybe a new revision?)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 22 May 2017, 22:47:18
At this point, is there really anything available that could extend the life of the battery? I enjoy being able to use it wirelessly and especially having a remappable layout is very nice but the time it takes to drain a battery just seems too short. I'm not sure if anyone here has a PFU BT HHKB and has looked at the internals, because whatever magic circuitry (or maybe hopefully software tricks) they use to get months off of two double-A batteries could be really useful with something like this (maybe a new revision?)

I thinik you can reduce AVR power consumption with less frequent matrix scan and aggressive sleep especially when it is not typed long time. It may causes unresponsiveness greatly on user experience, though. We will need new bluetooth module and to replace switch PCB completely in addition to controller PCB to improve battery life fundamentally.

PFU HHKB BT uses new 3V controller instead of classic 5V and BT3.0 module bcm20730 equipped with Broadcom proprietary technique for low power consumption.
Title: Re: Alternative Controller for HHKB
Post by: SICAR187 on Sat, 03 June 2017, 15:01:17
Anyone w/ a JP have any ideas on a Mod to route the power to the dip switch opening/window? My thinking is to remove the ON/OFF switch and run some jumper wires to the opening, still haven't come up w/ a clever way to actuate/toggle (don't know the proper word) them once they're there. Any ideas are welcome. thanks in advance!


ETA: Turns out if you remove the ON/OFF switch, you must bridge the connection or the BT will not get power. It's simple, just use the metal piece that is part of the switch itself, it wedges in and stays in place. This mod should only be done if you feel comfortable with it, AKA at your own risk, as I do NOT know any of the long/short term effects.

Also the 2500mah Adafruit battery works as stated by another member, by folding the circuitry. It's just a PITA, took me a good 20 minutes.

Title: Re: Alternative Controller for HHKB
Post by: futurecrime on Tue, 06 June 2017, 17:08:54
I'm having trouble figuring out how to implement my layer switching.  I'm trying to have Layer 0 as QWERTY, Layer 1 as standard HHKB function layer with arrows, etc, and Layer 2 as my Colemak layer.  I want to use Fn+Q to turn on QWERTY (Layer0) and Fn+C to turn on Colemak (Layer2).  After installing it works ok until I switch to Colemak, then the function key stops working and I can't use layer 1 or switch back to layer 0.  Can anybody help me out?  My keymap is here: https://goo.gl/HnMO42

Thanks in advance!


Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 06 June 2017, 17:16:13
check this. higher layer hides lower ones except for having TRNS.
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#02-layer-precedence-and-transparency
Title: Re: Alternative Controller for HHKB
Post by: futurecrime on Wed, 07 June 2017, 14:53:15
Well I figured it out, just needed to put my function layer on the highest layer (2) and have QWERTY and Colemak on 0 & 1. Also only need one toggle key, not two.  Posting this in case some other idiot gets stuck on the same simple thing...

Here's the updated keymap:
https://goo.gl/zsBln5
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Tue, 13 June 2017, 23:14:21
Hey Hasu, thanks for the awesome controller! I just received my fc660c controller and it's great!

I'm trying to map C-[ to ESC. So far I have tried mapping ACTION_LAYER_MODS(3, MOD_LCTL) to left control, and Layer 3 [ to ESC, but I think when I press C-[, it triggers C-ESC, which is not exactly what I want. Is there a way to do this?

Thanks again!

edit: One thing I've thought of us to map left control to L3, and map every key on Layer 3 to ACTION_MODS_KEY(MOD_LCTL, KC_1) etc, but that seems very tedious and it seems like there's a better way to do this.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 14 June 2017, 01:57:14
at this point unfortunately you have to write code and compile it.  the code should remove LCTL  before send ESC and restore the modifier state at the end. not easy but still possible.

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.


Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Wed, 14 June 2017, 02:44:48
at this point unfortunately you have to write code and compile it.  the code should remove LCTL  before send ESC and restore the modifier state at the end. not easy but still possible.

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.


I got it to work with:

Code: [Select]
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case ESCX:
            if (record->event.pressed) {
                unregister_mods(MOD_BIT(KC_LCTL));
                register_code(KC_ESC);
                unregister_code(KC_ESC);
                register_mods(MOD_BIT(KC_LCTL));
                send_keyboard_report();
            }
            break;
    }
}

copying stuff from hhkb/unimap_hasu.c

It appears to be working pretty well, though I don't understand the event lifecycle, so I don't really get why the if (record->event.pressed) is necessary, i just added it because it was registering twice without it.

Please let me know if there's anything I'm missing!

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.

This would be great!
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Wed, 14 June 2017, 02:45:59
I also couldn't figure out how to get dprint to work, I think proper debugging output would've saved me some trial and error. Is that documented anywhere? I couldn't find it. I'm also not really a c programmer.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 14 June 2017, 19:25:09
That code looks like nice. It is good idea to send both press and release of ESC in the press event of ESCX, it makes situation simple. You don't have to have send_keyboard_report(), each register/unregister functions themselves call it.

With 'record->event.pressed' you can discriminate between 'key press' and 'key release' event. action_function() is called twice when the both events occur, so in general you have to know which event you are handling at the time.

'dprintf()' spits message out to 'hid_listen' command line tool when debug is on, while 'xprintf()' always prints regardless of debug state. You can turn debug on with LShift+RShift+D combo.
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Wed, 14 June 2017, 21:39:37


That code looks like nice. It is good idea to send both press and release of ESC in the press event of ESCX, it makes situation simple. You don't have to have send_keyboard_report(), each register/unregister functions themselves call it.

With 'record->event.pressed' you can discriminate between 'key press' and 'key release' event. action_function() is called twice when the both events occur, so in general you have to know which event you are handling at the time.

'dprintf()' spits message out to 'hid_listen' command line tool when debug is on, while 'xprintf()' always prints regardless of debug state. You can turn debug on with LShift+RShift+D combo.

awesome, thanks for the pointers! I tried dprintf with hidlisten, and I see output of character codes, but not log messages I added with dprintf, so I'm not sure what I'm doing wrong.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 14 June 2017, 21:58:10
hid_listen should displays like below. You will see 'Listenning:' when you get connected to your keyboard and will see 'debug: on' when you press the combo. Did you see those output on hid_listen?

Also refer this FAQ entry. https://github.com/tmk/tmk_keyboard/wiki/FAQ#debug-console

Code: [Select]
Device disconnected.
Waiting for new device:.......
Listening:

debug: on
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Fri, 16 June 2017, 01:06:37
It's not a big deal, since I got everything working now, but this is what I see when I add a `dprint()` and try to debug:

Code: [Select]
Waiting for device:
Listening:

debug: on
^[^[^[
debug: off

keyboard: on
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 0^[0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

debug: off

debug: on
^R

debug: off
^[^[jlij^C
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 16 June 2017, 01:14:54
It's not a big deal, since I got everything working now, but this is what I see when I add a `dprint()` and try to debug:

Code: [Select]
Waiting for device:
Listening:

debug: on
^[^[^[
debug: off

keyboard: on
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 0^[0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
keyboard: 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

debug: off

debug: on
^R

debug: off
^[^[jlij^C

Looks like it works well so you can use dprintf() in your code when you need to debug some later :D
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Fri, 16 June 2017, 12:49:32
But that's *with* debug statements in the code, on keys that I was pressing. Where are the debug messages supposed to show up?
Title: Re: Alternative Controller for HHKB
Post by: sinegav on Sat, 17 June 2017, 18:03:04
I've had someone ask where I got the USB plugs for the empty holes left in the rear of my HHKB after installing Hasu's controller (which doth rock, BTW. Thanks, Hasu!).

I just did a search on Ebay for "USB port (cover,plug)" and found these:
(Attachment Link)

They are a little undersize because they are designed for hardware inside the holes, not just an empty hole. I just wrapped some Kapton tape around the body to add a little dimension and they're now a nice press fit. I used Kapton tape because it's very thin, allowing very fine "adjustment" by layering, and also because it has an adhesive which won't weep out over time.

...and it looks like this:
(Attachment Link)

Just as another point of reference, I opt'd for a slightly more custom approach. Using a design previously uploaded in this thread, saved in github https://github.com/robotmaxtron/HHKB-usb-dust-covers (https://github.com/robotmaxtron/HHKB-usb-dust-covers) I got some printed for about $10 I think at Shapeways.

Show Image
(http://i.imgur.com/Tv0Gu2ml.jpg)


Hey thank you so much for this!!  ;D I was always wondering what I would use to cover these holes with.
It was a bit hard to find them actually, so if anyone is looking here is a link for it: http://www.ebay.com/itm/10Pcs-Plastic-USB-A-Male-Anti-Dust-Plug-Stopper-Cap-Cover-Black-Clear-SH-E4Y8-/252874131909?hash=item3ae07909c5:g:jAQAAOSwN6JY9NCv
Title: Re: Alternative Controller for HHKB
Post by: JunkFace on Tue, 27 June 2017, 10:50:55
I was just wondering if I could restore the function (FN) key to the HHKB after a Hasu Bluetooth controller has been installed.  I don't see any place to set this up in the firmware, only keys to change the layers.  I've gotten so used to the HHKB's layout not having the FN key is a real pain.  I'd be fine with the layers if it worked like a switch but if its going to change the whole keyboard layout that won't do for multi-key commands like ctrl+alt+del or alt+printscreen, ctrl+f5 etc.  Anyone have any insight on this?  I'd really like to avoid remapping several layers, making new macros or doing any kind of software level keybindings.

Please let me know!
Title: Re: Alternative Controller for HHKB
Post by: Atredl on Tue, 27 June 2017, 11:30:53
I was just wondering if I could restore the function (FN) key to the HHKB after a Hasu Bluetooth controller has been installed.  I don't see any place to set this up in the firmware, only keys to change the layers.  I've gotten so used to the HHKB's layout not having the FN key is a real pain.  I'd be fine with the layers if it worked like a switch but if its going to change the whole keyboard layout that won't do for multi-key commands like ctrl+alt+del or alt+printscreen, ctrl+f5 etc.  Anyone have any insight on this?  I'd really like to avoid remapping several layers, making new macros or doing any kind of software level keybindings.

Please let me know!
Go to the "Layer switching and etc" tab, there you'll find layer switch(momentary) options. You can use L1 and it will act exactly like the original FN key on the stock HHKB as long as you have all your functions on Layer 1.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 28 June 2017, 03:31:11
I was just wondering if I could restore the function (FN) key to the HHKB after a Hasu Bluetooth controller has been installed.  I don't see any place to set this up in the firmware, only keys to change the layers.  I've gotten so used to the HHKB's layout not having the FN key is a real pain.  I'd be fine with the layers if it worked like a switch but if its going to change the whole keyboard layout that won't do for multi-key commands like ctrl+alt+del or alt+printscreen, ctrl+f5 etc.  Anyone have any insight on this?  I'd really like to avoid remapping several layers, making new macros or doing any kind of software level keybindings.

Please let me know!
it comes with  FN key similar to stock controller by default, you won't need worry. use keymap editor if you want to change keymap.
Title: Re: Alternative Controller for HHKB
Post by: clee290 on Sun, 02 July 2017, 18:10:45
Hi everyone!

First I just wanted to thank Hasu for this awesome controller! I've had mine for about a month now and it has been working great!

Right now, the firmware that I've been using was created using the website in the OP (http://www.tmk-kbd.com/tmk_keyboard/editor/). I was just wondering, can I create a QMK firmware and flash that to my HHKB too?

Thanks!
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 04 July 2017, 03:04:07
Hi everyone!

First I just wanted to thank Hasu for this awesome controller! I've had mine for about a month now and it has been working great!

Right now, the firmware that I've been using was created using the website in the OP (http://www.tmk-kbd.com/tmk_keyboard/editor/). I was just wondering, can I create a QMK firmware and flash that to my HHKB too?

Thanks!

Hi,
Simple answer is no, you can't use QMK firmware with TMK keyboard editor in general. Technically it is still possible with tweaks but I guess its explanation is not what you want.

If you want to use QMK firmware you better build it from source code, they have decent documents and community support. It doesn't seems QMK has support for  bluetooth controller, though.
Title: Re: Alternative Controller for HHKB
Post by: clee290 on Tue, 04 July 2017, 10:05:57
Hi everyone!

First I just wanted to thank Hasu for this awesome controller! I've had mine for about a month now and it has been working great!

Right now, the firmware that I've been using was created using the website in the OP (http://www.tmk-kbd.com/tmk_keyboard/editor/). I was just wondering, can I create a QMK firmware and flash that to my HHKB too?

Thanks!

Hi,
Simple answer is no, you can't use QMK firmware with TMK keyboard editor in general. Technically it is still possible with tweaks but I guess its explanation is not what you want.

If you want to use QMK firmware you better build it from source code, they have decent documents and community support. It doesn't seems QMK has support for  bluetooth controller, though.

Thank you :) 

Edit: Also, once I build the .hex file, would I just need to flash it to my keyboard like I had done previously? Or would I need to do something differently to prepare it for a different type of firmware?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 04 July 2017, 20:10:30
Edit: Also, once I build the .hex file, would I just need to flash it to my keyboard like I had done previously? Or would I need to do something differently to prepare it for a different type of firmware?

Same method should work, there are no diffrence there.
Title: Re: Alternative Controller for HHKB
Post by: clee290 on Tue, 04 July 2017, 23:05:44
Edit: Also, once I build the .hex file, would I just need to flash it to my keyboard like I had done previously? Or would I need to do something differently to prepare it for a different type of firmware?

Same method should work, there are no diffrence there.

Awesome, thanks Hasu!
Title: Re: Alternative Controller for HHKB
Post by: ttezz on Wed, 05 July 2017, 05:43:59
Hi, I need some help with the QI wireless charge modification  in this page by [manisteinn]

https://imgur.com/a/9yds3

I know nothing about the hardware / eletronic stuff.. :-[
how is it possible to connect the relay to the pcb ?
I have checked the hw design.. It seems like PPTC, JP0, JP1.. ?
but what pin should I connect with exactly?

and what is the black small parts located right to the jst battery power pin..?
He mentioned only the relay.. but nothing about it...



Title: Re: Alternative Controller for HHKB
Post by: kenmai9 on Wed, 05 July 2017, 12:46:41
@Hasu or anyone,

Is it possible to add macros to your tmk editor? Or is it possible to use EasyAVR?

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?hhkb

Thanks
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 05 July 2017, 13:33:22
no unfortunately at this time. to use macro you have to edit code and compile with command line tools.
Title: Re: Alternative Controller for HHKB
Post by: kenmai9 on Wed, 05 July 2017, 14:09:14
no unfortunately at this time. to use macro you have to edit code and compile with command line tools.

Alrighty thanks! I guess I'll start figuring that out. Cheers
Title: Re: Alternative Controller for HHKB
Post by: online on Sun, 23 July 2017, 08:02:18
I'm thinking to get a JP type-s, and noted drilling is required for Hasu BT.
Can I use USB mode without battery installed? Will the controller fits without drilling holes?
I will most likely use it wired but in case I want to try Bluetooth later.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 23 July 2017, 17:53:16
I'm thinking to get a JP type-s, and noted drilling is required for Hasu BT.
Can I use USB mode without battery installed? Will the controller fits without drilling holes?
I will most likely use it wired but in case I want to try Bluetooth later.

no, you need holes to install the TMK bluetooth controller into HHKB JP.
Title: Re: Alternative Controller for HHKB
Post by: online on Mon, 24 July 2017, 12:30:49
I'm thinking to get a JP type-s, and noted drilling is required for Hasu BT.
Can I use USB mode without battery installed? Will the controller fits without drilling holes?
I will most likely use it wired but in case I want to try Bluetooth later.

no, you need holes to install the TMK bluetooth controller into HHKB JP.
Thanks for your reply.
oh well, I guess I will settle on the wired one.
Title: Re: Alternative Controller for HHKB
Post by: 0100010 on Fri, 18 August 2017, 11:52:33
Dumb question // but if one uses the TMK keymap editor to create the hex file // do you only also need FLIP to program the controller?  Or is there still a need to compile firmware first?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 18 August 2017, 17:10:11
Dumb question // but if one uses the TMK keymap editor to create the hex file // do you only also need FLIP to program the controller?  Or is there still a need to compile firmware first?

yes, you don't have to compile if you use keymap editor, from which you can download precomiled firmware. you need just a flash tool(FLIP/dfu-programmer) to program your controller.
Title: Re: Alternative Controller for HHKB
Post by: 0100010 on Fri, 18 August 2017, 21:32:52
Nice - makes it easy.

One more question - the 4 through holes near the USB port, can they be used as break out points for the USB power / data lines (in yellow below)?

(https://s22.postimg.org/ejslejok1/USBth.png)



If they are, was thinking of using a vertical PCB mount female USB A port, wired to those points, in one of the same locations that the original controller has its USB hub ports (to use a USB A port for the HHKB instead of the mini USB port).

(https://s22.postimg.org/gpmw91s0h/USBAPCBV.png)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 18 August 2017, 22:26:21
Nice - makes it easy.

One more question - the 4 through holes near the USB port, can they be used as break out points for the USB power / data lines (in yellow below)?

Show Image
(https://s22.postimg.org/ejslejok1/USBth.png)




If they are, was thinking of using a vertical PCB mount female USB A port, wired to those points, in one of the same locations that the original controller has its USB hub ports (to use a USB A port for the HHKB instead of the mini USB port).

Show Image
(https://s22.postimg.org/gpmw91s0h/USBAPCBV.png)



Hmm, I'm not sure what your intention is.
yes, the 4 pins breakouts USB lines(VUSB, D-, D+ and GND). You will want to use Type-B connector, not Type-A in most cases, to connect to host PC with normal A-B cable.

Just to be sure, my TMK Alt Controller has no USB hub function.
Title: Re: Alternative Controller for HHKB
Post by: 0100010 on Fri, 18 August 2017, 23:01:41
Yes, normally type B port would be best, just not sure there is room.  Know a type A port would fit, since the original controller had a pair there previously.

Goal would be to have a more robust port than USB mini, for connecting the HHKB to the PC.
Title: Re: Alternative Controller for HHKB
Post by: tinyprawn on Sun, 20 August 2017, 22:40:43
Hasu,

I have an already-modified HHKB that has the programmable controller but it doesn't have the bluetooth components on it. From what I've seen, it looks like the footprint is there for the bluetooth chip. Can I pick up some components from Digikey and solder them on to make it bluetooth?

I have a reflow oven if SMD soldering is necessary.

Thanks for all of your contributions to the community.  I've been enjoying my AEK ALPS64 for a year now and I look forward to this enhanced HHKB.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 20 August 2017, 23:23:37
Yes, normally type B port would be best, just not sure there is room.  Know a type A port would fit, since the original controller had a pair there previously.

Goal would be to have a more robust port than USB mini, for connecting the HHKB to the PC.

Ah, it makes sense. Yes, you can uses the breakout pins if mini USB receptacle happens to be broken for some reason.
I believe Hirose receptacle my controller uses is reliable and durable enough for normal uses. I'll offer repair or replacement service at reasonable cost when the connector is messed.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 20 August 2017, 23:32:24
Hasu,

I have an already-modified HHKB that has the programmable controller but it doesn't have the bluetooth components on it. From what I've seen, it looks like the footprint is there for the bluetooth chip. Can I pick up some components from Digikey and solder them on to make it bluetooth?

I have a reflow oven if SMD soldering is necessary.

Thanks for all of your contributions to the community.  I've been enjoying my AEK ALPS64 for a year now and I look forward to this enhanced HHKB.

Sure, you can. It is Microchip(which merged Roving Networks some ago) RN42-I/RM. And  you can find parmeter of other componets easily in schematic.
https://octopart.com/rn42-i%2Frm630-microchip-70466722

https://github.com/tmk/HHKB_controller

This BOM may be old and not updated but will be still useful. Let me know if you find any incorrectness.
https://github.com/tmk/HHKB_controller/blob/master/BOM.txt
Title: Re: Alternative Controller for HHKB
Post by: tinyprawn on Mon, 21 August 2017, 11:57:46
Hasu,

I have an already-modified HHKB that has the programmable controller but it doesn't have the bluetooth components on it. From what I've seen, it looks like the footprint is there for the bluetooth chip. Can I pick up some components from Digikey and solder them on to make it bluetooth?

I have a reflow oven if SMD soldering is necessary.

Thanks for all of your contributions to the community.  I've been enjoying my AEK ALPS64 for a year now and I look forward to this enhanced HHKB.

Sure, you can. It is Microchip(which merged Roving Networks some ago) RN42-I/RM. And  you can find parmeter of other componets easily in schematic.
https://octopart.com/rn42-i%2Frm630-microchip-70466722

https://github.com/tmk/HHKB_controller

This BOM may be old and not updated but will be still useful. Let me know if you find any incorrectness.
https://github.com/tmk/HHKB_controller/blob/master/BOM.txt

Awesome! Thanks.
Title: Re: Alternative Controller for HHKB
Post by: tinyprawn on Tue, 29 August 2017, 13:27:04
I remember seeing something about adjusting the actuation sensitivity but I can't find it now. I notice that I occasionally will be resting my pinky on shift and selecting huge numbers of icons or rows or whatever.

I take my pinky off and the key doesn't even move but the shift key is released. I'd like to make the keys just a bit less sensitive.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 29 August 2017, 16:55:44
I remember seeing something about adjusting the actuation sensitivity but I can't find it now. I notice that I occasionally will be resting my pinky on shift and selecting huge numbers of icons or rows or whatever.

I take my pinky off and the key doesn't even move but the shift key is released. I'd like to make the keys just a bit less sensitive.

You will find CP1-4 on switch board PCB with which you can access to digital potentiometer  BU9831 using I2C.  Connect the CP to unused pins on your controller. You will be able to configure actuation of whole board, note that you cannot change actuation point key by key.

Datasheet of the chip:
http://pdf.datasheetcatalog.com/datasheets/150/365042_DS.pdf


And this code for FC660C but it would be kind of helpful.
https://geekhack.org/index.php?topic=88439.msg2403275#msg2403275
Title: Re: Alternative Controller for HHKB
Post by: tinyprawn on Thu, 07 September 2017, 10:45:23
Another inquiry...

I would like to add a small piezoelectric buzzer to the board the same way it exists on the Planck. My HHKB is not the JP model but there is a component called "JP" which appears to support the larger matrix for that layout. The C6 pin from the atmega controller which has the proper timers and things to support the audio mechanism is used to support one of these extra rows.

Would the JP component malfunction if the trace to PC6 is severed?  From reviewing the code, as long as HHKB_JP is not defined, it shouldn't try to send or read that port.

The physical trace seems easy enough to isolate so if JP component will function without it, I'd probably clip that and jump the buzzer wire to the atmega pin directly.
Title: Re: Alternative Controller for HHKB
Post by: sinegav on Thu, 07 September 2017, 10:50:33
I have a question about the TMK firmware.

There used to be a function layer that could be accessed by holding down the space bar. I think you could get to layer 4, anyway. My concern is that I do not see this feature anymore, and I was wondering if it's called something else now? I need it for my space FN layout. And unfortunately I'm not very good at coding myself. I tried looking at how the TMK works. But a bit out of my reach for now. I need a dual role key.

Thanks!

Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 19 September 2017, 15:42:55
Another inquiry...

I would like to add a small piezoelectric buzzer to the board the same way it exists on the Planck. My HHKB is not the JP model but there is a component called "JP" which appears to support the larger matrix for that layout. The C6 pin from the atmega controller which has the proper timers and things to support the audio mechanism is used to support one of these extra rows.

Would the JP component malfunction if the trace to PC6 is severed?  From reviewing the code, as long as HHKB_JP is not defined, it shouldn't try to send or read that port.

The physical trace seems easy enough to isolate so if JP component will function without it, I'd probably clip that and jump the buzzer wire to the atmega pin directly.

Sorry for late...
You are rite, C6 is not used on Pro2 controller you can use the pin freely. C6(and C7) are used only for JP controller.

Post pics when you finish buzzer mod! Clicky HHKB is reallly fun :D
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 19 September 2017, 15:48:16
I have a question about the TMK firmware.

There used to be a function layer that could be accessed by holding down the space bar. I think you could get to layer 4, anyway. My concern is that I do not see this feature anymore, and I was wondering if it's called something else now? I need it for my space FN layout. And unfortunately I'm not very good at coding myself. I tried looking at how the TMK works. But a bit out of my reach for now. I need a dual role key.

Thanks!



Idea of Space FN is generally implemented  with 'dual role' key function.
In TMK the 'dual role' key is called as 'tap' key and you need to refer it with ACTION_LAYER_TAP_KEY() in keymap.

EDIT: This is Space FN in keymap editor, use 'Code edit' tab to see detail of action.
https://goo.gl/xoewce
Title: Re: Alternative Controller for HHKB
Post by: donut_sauce on Fri, 22 September 2017, 18:08:12
no unfortunately at this time. to use macro you have to edit code and compile with command line tools.

Alrighty thanks! I guess I'll start figuring that out. Cheers

+1 for this! I would love to have this if at all possible:-)
Title: Re: Alternative Controller for HHKB
Post by: online on Wed, 04 October 2017, 11:30:44
Hello,

I want to set a winkey lock and mac mode(swapping winkey and alt key position) on my jp

The way I do this is by adding a layer with 'no' key on win key and toggle to the layer. Same goes to mac mode - new layer with swapped alt and win key.

I find this is a bit clumsy to achieve this, and sometime it lock the alt key when it's in mac mode.
Can anyone suggest a smarter way to do this?

In additionto above, is there a way to reset the keyboard back to the layer 0 rather than unplug?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 04 October 2017, 14:24:29
share your keymap for start point, first.

when your keymap state is rotten unplug is easy and preferable for recovery. but you can push program button and run 'dfu-programmer launch' to restart controller instead.
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Fri, 13 October 2017, 00:01:16
at this point unfortunately you have to write code and compile it.  the code should remove LCTL  before send ESC and restore the modifier state at the end. not easy but still possible.

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.


I got it to work with:

Code: [Select]
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case ESCX:
            if (record->event.pressed) {
                unregister_mods(MOD_BIT(KC_LCTL));
                register_code(KC_ESC);
                unregister_code(KC_ESC);
                register_mods(MOD_BIT(KC_LCTL));
                send_keyboard_report();
            }
            break;
    }
}

copying stuff from hhkb/unimap_hasu.c

It appears to be working pretty well, though I don't understand the event lifecycle, so I don't really get why the if (record->event.pressed) is necessary, i just added it because it was registering twice without it.

Please let me know if there's anything I'm missing!

I have a plan to add action just like ACTION_MODS_KEY except for   removing modifier instead of adding.

This would be great!

Hey Hasu, I'm having a weird issue. Again, I'm trying to simulate ctrl-[ (since I've mapped the normal ` key to ` instead of esc, because I actually use the ` key).

Here's the part of my setup that matters:

Code: [Select]
#define AC_L1       ACTION_LAYER_MOMENTARY(1)
#define AC_L2       ACTION_LAYER_MOMENTARY(2)
#define AC_1CTL     ACTION_LAYER_MODS(1, MOD_LCTL)
#define AC_ESCX     ACTION_FUNCTION_TAP(ESCX)

// emulates FC660C default keymap
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
    [0] = KMAP(
        GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     VOLU,
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     VOLD,
        1CTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,
        LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,UP,
        L2 ,LALT,LGUI,          SPC,                     RGUI,RALT,L2,  LEFT,DOWN,RGHT
    ),
    [1] = KMAP(
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,    TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,ESCX,TRNS,TRNS,    MUTE,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          CAPS,TRNS,
        TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS
    ),
};

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    switch (id) {
        case ESCX:
            if (record->event.pressed) {
                unregister_mods(MOD_BIT(KC_LCTL));
                register_code(KC_ESC);
                unregister_code(KC_ESC);
                register_mods(MOD_BIT(KC_LCTL));
            }
            break;
    }
}

The problem is that AC_1CTL seems to have some delay before it triggers. I'm used to hitting ctrl-[ pretty quickly, which works natively in terminal emulators. But after applying this code, it often misses the ctrl part and I just end up typing [, which is very frustrating. Is this a known issue? Is there any way I can make ACTION_LAYER_MODS(1, MOD_LCTL) trigger more quickly?
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Fri, 13 October 2017, 00:05:13
Another option I was thinking about was replacing LBRC on Layer 0 with a custom function that just checks to see if LCTRL is pressed, but I'm not sure how to check that.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 13 October 2017, 00:14:55
Try  ACTION_FUNCTION instead of ACTION_FUNCTION_TAP.

Code: [Select]
#define AC_ESCX     ACTION_FUNCTION_TAP(ESCX)
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Fri, 13 October 2017, 02:24:39
Try  ACTION_FUNCTION instead of ACTION_FUNCTION_TAP.

Code: [Select]
#define AC_ESCX     ACTION_FUNCTION_TAP(ESCX)

Thanks, I'll try that tomorrow (my keyboard is at work). Can you explain what the difference is between ACTION_FUNCTION and ACTION_FUNCTION_TAP?
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Fri, 13 October 2017, 15:57:51
Thanks, it worked! But I still don't really understand why...
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 16 October 2017, 16:52:43
ACTION_FUNCTION_TAP is used when you wan to define your own tap key and dual role key(tap key) is imposed some delay inherently. In this case you don't need tap key there you can use ACTION_FUNCTION.
Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Mon, 16 October 2017, 18:12:21
ACTION_FUNCTION_TAP is used when you wan to define your own tap key and dual role key(tap key) is imposed some delay inherently. In this case you don't need tap key there you can use ACTION_FUNCTION.

Got it, makes sense. Thanks so much for the info!

On an unrelated note, have you seen this article: https://danluu.com/keyboard-latency/

Unfortunately, the measurement he did was from beginning of keypress, instead of from actuation. But I was wondering if you've done any measurement/optimization of latency in the controller hardware or the tmk software.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 16 October 2017, 22:02:20
ACTION_FUNCTION_TAP is used when you wan to define your own tap key and dual role key(tap key) is imposed some delay inherently. In this case you don't need tap key there you can use ACTION_FUNCTION.

Got it, makes sense. Thanks so much for the info!

On an unrelated note, have you seen this article: https://danluu.com/keyboard-latency/

Unfortunately, the measurement he did was from beginning of keypress, instead of from actuation. But I was wondering if you've done any measurement/optimization of latency in the controller hardware or the tmk software.

Nice reading. It suits better for topre haters thread :p
But I'm not surprised at the result at all,  in fact Topre key scan rate is sloooow at least :D
I don't know but they might improve on newer keyboards like Realforce RGB.

Title: Re: Alternative Controller for HHKB
Post by: sodiumjoe on Mon, 16 October 2017, 22:43:13
Interesting, so does your controller and the tmk firmware add any latency? Is it negligible in comparison with the key scan rate?
Title: Re: Alternative Controller for HHKB
Post by: devoi on Mon, 16 October 2017, 22:53:46
IIRC you can change the scan rate in the matrix file - the lowest "stable" I've seen is about 30 micro-seconds per column (I believe it's column)
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 17 October 2017, 02:31:40
Interesting, so does your controller and the tmk firmware add any latency? Is it negligible in comparison with the key scan rate?

HHKB original controller takes around 15ms to scan keys. TMK simulates original timing by default but as devoi said you can change scan rate and speed up to 7.5ms as twice easily.
I guess firmwares use one or a few milli secs to handle keymap and other things? but not sure.

If you have to avoid latency for some reason traditional mechanical contact switch would be easy and useful.
Title: Re: Alternative Controller for HHKB
Post by: donut_sauce on Wed, 22 November 2017, 09:00:49
Apologies if this has already been asked but is there a "reset"  key on the tmk gui editor? Would love to be able to soft reset my HHKB without having to hard reset with the red button everytime I want to flash a new hex. Would be great to just be able to hit a key on the board to go into a flashable state.

Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 22 November 2017, 12:17:56
Apologies if this has already been asked but is there a "reset"  key on the tmk gui editor? Would love to be able to soft reset my HHKB without having to hard reset with the red button everytime I want to flash a new hex. Would be great to just be able to hit a key on the board to go into a flashable state.



unfortunately soft reset isn't  supported in keymap editor yet. I'll add that soon later.
You can use 'magic command' with LSHIFT+RSHIFT+Puase if your keymap has those keys.
https://github.com/tmk/tmk_keyboard#magic-commands
Title: Re: Alternative Controller for HHKB
Post by: rabbitl on Fri, 29 December 2017, 00:25:41
I've received hasu's Controller(with BT), works perfectly for me
Title: Re: Alternative Controller for HHKB
Post by: vegs on Wed, 24 January 2018, 03:49:39
I got the controller for my Pro 1 yesterday. Works like a charm. Easy to install and program :thumb:
Title: Re: Alternative Controller for HHKB
Post by: hasu on Fri, 16 March 2018, 05:08:01
Firmware is updated a little for Bluetooth controller. Check this post.

https://geekhack.org/index.php?topic=71517.msg2578237#msg2578237
Title: Re: Alternative Controller for HHKB
Post by: ttezz on Sun, 15 April 2018, 00:35:36
hasu, thanks always, you won't be able to image how your works changed my life..
I just can't work with any other keyboards any more. you have full control of my life .....
I'm planning to buy one more controller, before that, I want to ask you something.

how many pairing info can the board save? & is there a way to switch between device without turning off the host bluetooth?
and how the bluetooth connection priority works?

I can switch device when I turn off the host bluetooth.

But I just want to know how many connection does the board can save.

and is there a way to switch device, without turning off the computer bluetooth?

In windows, to turn off the keyboard bluetooth, I have to delete the pairing or turn off entire bluetooth..

and ,,,

I don't care how much it cost, I would pay 1000 dollar, seriously

If you could upgrade the board just the bluetooth battery life and, this device switching function. and usb mini -> usb c....
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sun, 15 April 2018, 18:29:21
The bluetooth module can store last eight pairing infos. Unfortunately I could not find how to switch between devices without disconnecting current device explicitly as you described. The module always tries to connect device connected last time automatically if it is not available second last one and so on.
Title: Re: Alternative Controller for HHKB
Post by: tex_live_utility on Tue, 24 April 2018, 18:16:59
.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 24 April 2018, 18:50:12
.

Deleting post are not helpful at all :(

How did you resolve your problem? Share your problem and solution. It is what makes this community helpful and  great.


Quote from notification mail.
Quote
Are there any specific instructions for using Atmel FLIP I should know about? I have Atmega32u4 selected, I generated a HEX from the online tool, I pressed the reset button on the back, but I'm getting an error that I could not read from or write to the USB device. I believe I have the correct driver installed because it shows up in the Device Manager as a libusb-win32 device.
Title: Re: Alternative Controller for HHKB
Post by: devoi on Wed, 23 May 2018, 13:51:48
has there been a working example of changing the actuation distance with the four calibration points? I'm very interested in doing this but I'm a bit frightened of messing up whatever value is stored in the BU9831's EEPROM. Even though the FC660C uses a very similar method (if not the same method) for its actuation distance, I'm sure that the particular addresses and instructions vary a bit.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Wed, 23 May 2018, 14:11:47
No. Actuation point in HHKB cannot be changed from controller and you have to access the digipot from test points on switch PCB as you say. I didn't try to work with it and don't have any info about it except for ones on the first post. Read datasheet and write program to control the digipot.
Title: Re: Alternative Controller for HHKB
Post by: joric on Mon, 05 November 2018, 23:56:31
An interesting nrf51-based hhkb pro 2 controller has arrived on taobao, claims several weeks on a single charge. @hasu what do you think https://geekhack.org/index.php?topic=71517.msg2676544#msg2676544
Title: Re: Alternative Controller for HHKB
Post by: hasu on Tue, 06 November 2018, 00:17:00
An interesting nrf51-based hhkb pro 2 controller has arrived on taobao, claims several weeks on a single charge. @hasu what do you think https://geekhack.org/index.php?topic=71517.msg2676544#msg2676544

Seems promising. It would be great if they can publish firmware source code and hardware design. Did you contact them?

Buy some and send me one!
Title: Re: Alternative Controller for HHKB
Post by: joric on Tue, 06 November 2018, 08:07:32
Nope, I'm not in China and I haven't ever used Taobao also they want 20 people to start manufacturing. Maybe ask someone from China.
Title: Re: Alternative Controller for HHKB
Post by: joric on Thu, 29 August 2019, 03:50:21
Please help with the HHKB matrix code on nrf52. I'm getting ghosting or something, each keystroke is followed by a sequence of symbols from the other part of the matrix.

From what I see I don't really need a precision timer because there's no V-USB interrupts, I'm debugging on hardware USB, it's way less CPU-consuming.
I could do everything just busywaiting with delays without measuring time intervals.
The whole matrix is just 60*20us = 1200us ? 1.2ms ? Maybe double that but still, 2 ms is nothing. I can just do a critical section or something.

The "ghosting" is very specific. Each keystroke is followed by few '2's, the length of the sequence depends of how long I hold the key, it also autorepeats.
E.g. if I type qwerty I get something like q222w222e22r2222t222y222222. If I type '2' I get 2qqqq or something.

Maybe somebody knows what causes that?

See this problem in details with the code https://github.com/joric/nrfmicro/wiki/HHKB-BLE

Also video


Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 29 August 2019, 17:28:33
I can't remember exactly all of what I tweeked the code for timing of matrix scan, but that code section is time critical and you have to guard that section with some method or other.

I don't know why you refer to V-USB but I don't think V-USB is not related here. ATMega32u4 on my controller uses also hardware USB too. Note that even with hardware USB it interrupts user code occasionally at least with ATMega32u4 and I almost belive your are interrupted by NRF. You have to check it with debugger or oscilloscope.

Yes, just guard that code as critical section.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Thu, 29 August 2019, 17:47:22
This is what you are working? If so code section below is the critical section. It can't be interrupted and you have to read KEY_STATE within 20us after KEY_ENABLE.

https://github.com/joric/qmk_firmware/tree/nrf52-hhkb

https://github.com/joric/qmk_firmware/blob/194439057dff81d71c16c73b5998d7de047c8823/keyboards/hhkb_ble/rev1/matrix.c#L138-L169
Title: Re: Alternative Controller for HHKB
Post by: yangdigi on Tue, 03 September 2019, 03:35:49
Please help with the HHKB matrix code on nrf52. I'm getting ghosting or something, each keystroke is followed by a sequence of symbols from the other part of the matrix.

From what I see I don't really need a precision timer because there's no V-USB interrupts, I'm debugging on hardware USB, it's way less CPU-consuming.
I could do everything just busywaiting with delays without measuring time intervals.
The whole matrix is just 60*20us = 1200us ? 1.2ms ? Maybe double that but still, 2 ms is nothing. I can just do a critical section or something.

The "ghosting" is very specific. Each keystroke is followed by few '2's, the length of the sequence depends of how long I hold the key, it also autorepeats.
E.g. if I type qwerty I get something like q222w222e22r2222t222y222222. If I type '2' I get 2qqqq or something.

Maybe somebody knows what causes that?

See this problem in details with the code https://github.com/joric/nrfmicro/wiki/HHKB-BLE

Also video

The magic 2. NOT any other keys, only KEY 2.
I've come across a few times with it.
When reading key state is not stable, the magic 2 comes.
But not like your video shows that several 2 come together, I just get one extra KEY 2 a time.
Title: Re: Alternative Controller for HHKB
Post by: joric on Tue, 03 September 2019, 05:57:42
The magic 2. NOT any other keys, only KEY 2.
I've come across a few times with it.
When reading key state is not stable, the magic 2 comes.
But not like your video shows that several 2 come together, I just get one extra KEY 2 a time.
Ohh yangdigi! Well, thanks, at least I know somebody stumbled upon it, what you did, different timings? I didn't have any problems on pro micro (32u4) personally but I've used 5v one and nrfmicro is 3.3v maybe it needs different timings, gotta look at your firmware.

BTW got your controller today, very cool, I've just recently discovered Mass Storage bootloader on Atmegas (https://github.com/joric/lufa/tree/promicro/Bootloaders/MassStorage) and it still looks like magic to me. Also the layout editing site, I don't want to edit and compile firmwares anymore.

Also that god damned miniusb. Tried to replace it with microusb, no luck, this one uses incompatible (thru-hole) footprint =( hope it needs less charging than before, I don't want to keep microusb cable on the table. What about type-c or microusb revisions? Microusb fits just fine (see https://imgur.com/a/aZIS1).

Anyway you've gone way further than me. I've had plans on nRFMicro and PCBA assembly (possibly Elecrow) but I don't think there's a demand in comparison with the HHKB controller.
Title: Re: Alternative Controller for HHKB
Post by: yangdigi on Tue, 03 September 2019, 09:04:04
The magic 2. NOT any other keys, only KEY 2.
I've come across a few times with it.
When reading key state is not stable, the magic 2 comes.
But not like your video shows that several 2 come together, I just get one extra KEY 2 a time.
Ohh yangdigi! Well, thanks, at least I know somebody stumbled upon it, what you did, different timings? I didn't have any problems on pro micro (32u4) personally but I've used 5v one and nrfmicro is 3.3v maybe it needs different timings, gotta look at your firmware. Got your controller today, very cool, I've just recently discovered Mass Storage bootloader on Atmegas (https://github.com/joric/lufa/tree/promicro/Bootloaders/MassStorage) and it still looks like magic to me. Also the layout editing site, I don't want to edit and compile firmwares anymore. But what's the reason for the flipped battery connector, was it, like, random?

Show Image
(https://i.imgur.com/bh4uwuJ.jpg)


Also that god damned miniusb. Tried to replace it with microusb, no luck, this one uses incompatible (thru-hole) footprint =( hope it needs less charging than before, I don't want to keep microusb cable on the table. What about type-c or microusb revisions? Microusb fits just fine (see https://imgur.com/a/aZIS1).

Anyway you've gone way further than me. I've had plans on nRFMicro and PCBA assembly (possibly Elecrow) but I don't think there's a demand in comparison with the HHKB controller.

My first battery that I got from a keyboard is as what I use. So I just keep it with all my boards and batteries I bought.
Here is USB Type-C for HHKB. I don't want to destroy my case, so I make a daughter board to hole type-c.
[attachimg=1]
[attachimg=2]

About magic 2.
One time was that my battery might touch the hhkb board. And when I woke up the keybaord by pressing a key, it gave me an extra KEY 2.
Another time was that if I used 3.3v for MCU but VBAT for HHKB board,  it did not work correctly and sometimes gave me a 2.
But, with 3.3V for both MCU and HHKB, it already works without any problems for months.
Title: Re: Alternative Controller for HHKB
Post by: joric on Wed, 04 September 2019, 07:59:07
Any chance to get that USB-C raiser board? Kicad project or something? Why it's so crowded, I assumed it needs a couple of 5.1k resistors on CC pins just to get recognized as an USB device and that's about it?
Title: Re: Alternative Controller for HHKB
Post by: yangdigi on Sat, 14 September 2019, 07:26:14
Please help with the HHKB matrix code on nrf52. I'm getting ghosting or something, each keystroke is followed by a sequence of symbols from the other part of the matrix.

From what I see I don't really need a precision timer because there's no V-USB interrupts, I'm debugging on hardware USB, it's way less CPU-consuming.
I could do everything just busywaiting with delays without measuring time intervals.
The whole matrix is just 60*20us = 1200us ? 1.2ms ? Maybe double that but still, 2 ms is nothing. I can just do a critical section or something.

The "ghosting" is very specific. Each keystroke is followed by few '2's, the length of the sequence depends of how long I hold the key, it also autorepeats.
E.g. if I type qwerty I get something like q222w222e22r2222t222y222222. If I type '2' I get 2qqqq or something.

Maybe somebody knows what causes that?

See this problem in details with the code https://github.com/joric/nrfmicro/wiki/HHKB-BLE

Also video

I've got a board and took a quick test with your code.
matrix.c 129 to 131.
Code: [Select]
            //if (matrix_prev[row] & (1<<col)) {
                KEY_PREV_ON();
            //}
The keys should work without "222"  problem now.
Hope this helps.
Title: Re: Alternative Controller for HHKB
Post by: hasu on Sat, 14 September 2019, 19:12:13
I'm almost sure that code is needed for reliabble key sensing from my research and understandings, it is needed to realize key hysteresis.

I've got a board and took a quick test with your code.
matrix.c 129 to 131.
Code: [Select]
            //if (matrix_prev[row] & (1<<col)) {
                KEY_PREV_ON();
            //}
The keys should work without "222"  problem now.
Hope this helps.

Title: Re: Alternative Controller for HHKB
Post by: nathanchere on Wed, 30 October 2019, 12:00:10
My first battery that I got from a keyboard is as what I use. So I just keep it with all my boards and batteries I bought.
Here is USB Type-C for HHKB. I don't want to destroy my case, so I make a daughter board to hole type-c.
(Attachment Link)
(Attachment Link)

Is there any plan to either sell through something like kbdfans or at least run a group buy? I would be all over this
Title: Re: Alternative Controller for HHKB
Post by: joric on Wed, 11 December 2019, 03:26:54
I'm almost sure that code is needed for reliabble key sensing from my research and understandings, it is needed to realize key hysteresis.
I haven't really tried the new code yet, still waiting for the new nRFMicro revision with an extra mosfet on board.
Just wondering can we expect a teardown of the new HHKB 2019 models? Have you got your hands on one of those? )

Here is USB Type-C for HHKB. I don't want to destroy my case, so I make a daughter board to hole type-c.
Huh I just realized the USB-C riser board is not that large, it's about the size of USB-C plus a couple of 5.1K CC pulldowns.
Considering we got a bunch of all new all USB-C HHKB models yesterday, any chance of getting this board opensourced on github?
The footrpring must be tricky, considering MiniUSB has through-hole design (not sure what's underneath, don't want to desolder it).

Upd. I've also made an YDKB USB-C riser board today: https://github.com/joric/usb-c

Not tested yet, so no warranty whatsoever.
Title: Re: Alternative Controller for HHKB
Post by: myaccount on Mon, 30 December 2019, 02:30:23
So, I searched the thread and the forums...

Can this be used with a HHKB Lite 2; PD-KB200W/U ?
Title: Re: Alternative Controller for HHKB
Post by: hasu on Mon, 30 December 2019, 21:05:37
No, this controller doesn't support the keyboard.

So, I searched the thread and the forums...

Can this be used with a HHKB Lite 2; PD-KB200W/U ?

Title: Re: Alternative Controller for HHKB
Post by: joric on Tue, 14 January 2020, 11:44:59
The keys should work without "222"  problem now.
Hope this helps.

Nope, looks like it's something else. Probably timing is a bit off, need more testing.
On an unrelated note, could you please share your schematics and PCB design for the USB-C riser board for the YDKB HHKB BLE? It seems pretty complicated, couldn't figure out what is that 3.0V pin (3V looks like logic level but what does it do?) Why there's a 4 pin header but only 3 pins is used? See https://github.com/joric/usb-c/wiki
Title: Re: Alternative Controller for HHKB
Post by: yangdigi on Wed, 15 January 2020, 06:49:58
The keys should work without "222"  problem now.
Hope this helps.

Nope, looks like it's something else. Probably timing is a bit off, need more testing.
On an unrelated note, could you please share your schematics and PCB design for the USB-C riser board for the YDKB HHKB BLE? It seems pretty complicated, couldn't figure out what is that 3.0V pin (3V looks like logic level but what does it do?) Why there's a 4 pin header but only 3 pins is used? See https://github.com/joric/usb-c/wiki

share url: https://pan.baidu.com/s/1GRVWRTVLLEIGZ9QZkFz1gg 
pswd: mnyy
Title: Re: [TMK] Alternative Controller for HHKB
Post by: joric on Wed, 15 January 2020, 21:12:22
Got it, thanks! https://github.com/joric/usb-c/releases/download/original/USB_C.for.HHKB_BLE.Gerber.zip
Title: Re: Alternative Controller for HHKB
Post by: joric on Mon, 09 March 2020, 10:21:21
share url

What bootloader are you using for the YDKB controller, btw? I have this
but it needs erasing the files before updating them, not very handy:

https://redd.it/c886jv

https://github.com/joric/lufa/tree/promicro/Bootloaders/MassStorage

https://github.com/abcminiuser/lufa/issues/148

Title: Re: Alternative Controller for HHKB
Post by: yangdigi on Tue, 17 March 2020, 22:50:57
share url

What bootloader are you using for the YDKB controller, btw? I have this
but it needs erasing the files before updating them, not very handy:

https://redd.it/c886jv

https://github.com/joric/lufa/tree/promicro/Bootloaders/MassStorage

https://github.com/abcminiuser/lufa/issues/148


The virtual drive should have as more free space as the bin file.
Windows needs this to determine whether you can replace the file.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: Kyuroko on Tue, 30 June 2020, 10:12:51
Hi hhkb users,
I swapped out my controller, but i ran into this issue where the keyboard would register random key inputs. I heard that it is commonly caused by the ribbon cable connection. After several days of trial, i got frustrated and jumped the cables between the pcb and controller rather dealing with the weird connection. However the random key input problem still occurred. Could there be another cause of this problem?
Here is the picture of my wire jump: https://imgur.com/a/xa2XQhy
Title: Re: [TMK] Alternative Controller for HHKB
Post by: hasu on Tue, 30 June 2020, 10:21:29
That alt controller worked well before?
Topre stock controller had smilar issue with the cable?

In my case ribbon cable failed on another side(switch board) and I had to take apart switch board completely to replace original component with compatible one.

https://imgur.com/a/ZlibW7v
HHKB in the pics is my testbed with long cable, btw.

Random key input is almost random or has specific pattern?
Paste the random keys here, I may find clue to determine which wire is faulty.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: Kyuroko on Tue, 30 June 2020, 12:15:31
That alt controller worked well before?
Topre stock controller had smilar issue with the cable?

In my case ribbon cable failed on another side(switch board) and I had to take apart switch board completely to replace original component with compatible one.

https://imgur.com/a/ZlibW7v
HHKB in the pics is my testbed with long cable, btw.

Random key input is almost random or has specific pattern?
Paste the random keys here, I may find clue to determine which wire is faulty.

I got a spare stock controller along with the usb only custom controller. This occurs on all three controllers. Here is a small piece of the random presses, its kind of hard to get much because the keyboard would also register random short cuts like volume, spotlight search, login out... Here is a small piece: ¿Ï˙ƒ¥˙¬˙÷ÏÒΩ¬˙ΩΩ÷¬˙∆‘“æ÷ƒ˙¬ƒ÷ƒ¿
Title: Re: [TMK] Alternative Controller for HHKB
Post by: hasu on Tue, 30 June 2020, 18:30:41
Whas is your OS, keyboard layout and application that displays the random string?
I don't even know how to input those charactors. It seems many keys go wrong severely and many wires.
This problem happens on other computers?

I guess this comes from bad connection somewhere between controller and switch board or faulty on switch board itself.

From your pic it looks you didn't remove metal pieces(contact) from wires yet, in my experience connection fails in where crimping wire and contacts. Cut off the contacts and solder wires directly if you don't have plan to reuse those contacts. Or you may need to replace all wires and connector completely as I did.

If you need new connector contacts and housing check this.
http://www.jst-mfg.com/product/pdf/eng/eZH.pdf


Also, if you took apart switch board for mod, cleaning or something recently before this problem, try reassembly it from scratch. I know some people had problem after improper lubrication, silencing mod and reassmbly.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: Kyuroko on Tue, 30 June 2020, 19:54:33
The problem occurs on both mac and windows. I'll try disassembling/re-assemble from scratch and clean the pcb this coming weekend. Could you explain more about the removing the contacts? Im not following
Title: Re: [TMK] Alternative Controller for HHKB
Post by: hasu on Tue, 30 June 2020, 20:36:28
The problem occurs on both mac and windows. I'll try disassembling/re-assemble from scratch and clean the pcb this coming weekend. Could you explain more about the removing the contacts? Im not following

I meant these by the 'contacts' in previous post.
The pic is not clear so I though these are contacts, but they are solder blob perhaps?
(https://i.imgur.com/AttMVBN.jpg)

The contact looks like this, just to be clear.
https://www.digikey.jp/product-detail/en/jst-sales-america-inc/SZH-002T-P0.5/455-1130-1-ND/527362

Title: Re: [TMK] Alternative Controller for HHKB
Post by: Kyuroko on Wed, 01 July 2020, 23:28:38
Yea they are solder blobs, it was really a sloppy job. I tested the connectivity with my voltmeter and all of the wires are connected.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: devoi on Fri, 31 July 2020, 15:26:11
re-posting from the other thread, I wrote some simple C routines to adjust the actuation height via the on-board digipot;
Just to confirm, does either controller (USB / BT) have 3 available GPIO ports? It appears that they do, looking at the images in the OP post, but I'd just like to confirm first.
It turned out to be a lot simpler than I had originally thought (my naive approach before looking at the datasheet was that it would require using the I2C driver, but it's just simple serial), and I can share the code (or potentially fork the tmk/qmk repo if I can successfully get it working), but I'd have to purchase a controller first. 3 wires would be required between the controller and main-board, either via solder or perhaps some clever approach that involves pressure-connecting to 3 of the 4 "calibration point" pads using spring-type connections, fastened to the case. Right now it uses a simple atmel development board (328 xmini) external to the keyboard that I just have wires connecting through.

To summarize how each of the features work:
R/W mode must be enabled with two different "commands" - the digipot is by default in read mode, but must be changed to write mode to write memory or wiper, and changed back to read.
Commands are sent via 16-bit words, started with the chip select signal low, as well as a low-starting high-ending rising-edge clock which data is synced to via the DIO pin.
To put the controller in write-mode, I send 0xA300 (MSB-first) to the controller, and I've confirmed it working with a clock period of 4us. For read mode, I use 0xA000. The rightmost byte in this scenario really doesn't matter, as I believe the controller would normally check it for an address.

To read the wiper, the digipot must be in read-mode, meaning either it's been sent read-mode as a command or it has been just powered (defaults to read mode). Afterward, the command 0xAB00 is used. The DIO line is then changed to a read-input, then the next 8 bits are read. These 8 bits are sent in order of D0-D7, with the final bit D7 being irrelevant. This value is the current step value. This gives a total of 128 different steps, of which a sub-section can be used for adjusting the height, as some resistance values are too low and some are too high. In my case, the default value is 0x27, which is stored in memory and recalled whenever the board turns on.
If this is added as a feature, I would suggest writing to the wiper with the controller on-boot and storing this in the controller's EEPROM, rather than overwriting the digipot's EEPROM, to reduce risk. I'm curious if the default value is different for some users, and that 0x27 (measured ~29.97k ohms on board) is calibrated just for my board. I would need someone to check resistance between the two small test points to the side of the digipot chip to confirm, after the board is powered.

To write to the wiper, two 16-bit words are required. I first send the command 0xA600 (sent via MSB first order) which constitutes the command (0xA6) and an irrelevant memory address (so I use 0x00, could be anything). To save on complexity, I reverse the "step" number binary that I want to send, so that its LSB is now MSB (in other words, D0 is required before D1..D7), as the serial write sends MSB first. I then shift 8 bits left as an empty byte is required after. For example, if I wanted to write step 1/127 to the board, I would send 0xA600 to indicate wiper write, then 0x8000 (I think). Step 2/127 would be 0xA600 then 0x4000 if I'm doing the math right. This should immediately write the wiper position to step*100k/127 ohms, I think. For posterity I do two more clock cycles (the chip ignores these, I believe). Then pull ~CS high, and disable writing to the chip, same as with the other commands.

I haven't tried writing to the EEPROM yet, just in case. I don't think there's much danger in doing so, as I can just re-write the original calibrated value, but I'd much prefer leaving the default value there just in case anything goes wrong. As mentioned previously, I don't think there would be much danger in simply writing the wiper position every time the board turns on using the controller, since there's a default value in the chip. I haven't checked to see if the chip recommends a low number of writes, but I doubt it.
Ideally adjusting the distance dynamically would have to be done in a way that doesn't lock the user out (after setting it one step too low), so that the user has the ability to fix it. Perhaps there would need to be a way to confirm that the current setting is possible to type on.

If anyone has questions, please let me know! :D
Title: Re: [TMK] Alternative Controller for HHKB
Post by: hasu on Fri, 31 July 2020, 22:06:17
devoi,
Thanks for sharing the great write up. It would be helpful for people to implement the feature.

As for my TMK controller two GPIOs are freely available on pinouts but three. Unused pins can be found easily and usable with some soldering jobs except for 'BT controller for HHKB JP'. TMK controller board can't support this feature without some tikering job. You won't have to get TMK controller to test this feature.

Reference code for your current setup would be good enough for us tinkerers.

In my Pro2 resistance between VW(=VH) and VL is 24.41KOhm when powered and around 65KOhm without power. I'm not sure how to measure it correctly but touched VW pin with red probe.

For other people interested datasheet of the digipot BU9831 is available here.
https://datasheetspdf.com/pdf/365041/Rohm/BU9831/1
Title: Re: [TMK] Alternative Controller for HHKB
Post by: devoi on Sat, 01 August 2020, 14:47:44
In my Pro2 resistance between VW(=VH) and VL is 24.41KOhm when powered and around 65KOhm without power. I'm not sure how to measure it correctly but touched VW pin with red probe.

It's possible that PFU lowered the key a known distance and then adjusted the digipot value until it would just barely actuate, which gives credence to the aptly named "calibration points". I can assume that the internal value within the digipot is also different given the different resistance.

I've made the code available via (https://pastebin.com/RQYiGK5W (https://pastebin.com/RQYiGK5W)), as I feel it's not big enough for its own repo (yet). I'll make a fork of the tmk/qmk repo if I get my hands on a controller in the near future. At a glance, it appears ports D0-D3 and F0-F1 are available either as test points or for GPIO use. Could you confirm if that's the case?
Title: Re: [TMK] Alternative Controller for HHKB
Post by: hasu on Sat, 01 August 2020, 20:30:12
In my Pro2 resistance between VW(=VH) and VL is 24.41KOhm when powered and around 65KOhm without power. I'm not sure how to measure it correctly but touched VW pin with red probe.

It's possible that PFU lowered the key a known distance and then adjusted the digipot value until it would just barely actuate, which gives credence to the aptly named "calibration points". I can assume that the internal value within the digipot is also different given the different resistance.

I've made the code available via (https://pastebin.com/RQYiGK5W (https://pastebin.com/RQYiGK5W)), as I feel it's not big enough for its own repo (yet). I'll make a fork of the tmk/qmk repo if I get my hands on a controller in the near future. At a glance, it appears ports D0-D3 and F0-F1 are available either as test points or for GPIO use. Could you confirm if that's the case?

Thanks for sharing the code.
D0 and D1 is not used by default firmware. D2, D3, F0 and F1 is used for Bluetooth controller.
All pins can be used to support Bluetooth or JP model, except for D0 and D1.

I'd go with D6 if I add this with feature TMK controller. The pin is currently used for Caps LED which has no critical function. I believe no one have trouble without the LED.  But you may go with any pin below.

Not-used pins available for user:
- Bluetooth controller for HHKB JP has D0, D1
- Bluetooth controller for HHKB Pro2 has D0, D1, C6, C7.
- USB controller for HHKB JP has D0, D1, D2, D3, D4, D5, F0, F1, F4, F5, F6, F7, E6
- USB controller for HHKB Pro2 has D0, D1, D2, D3, D4, D5, F0, F1, F4, F5, F6, F7, E6, C6, C7

Schematics is available here.
https://github.com/tmk/HHKB_controller/blob/master/schematic/HHKB_controller_revG.pdf
Title: Re: [TMK] Alternative Controller for HHKB
Post by: devoi on Sat, 01 August 2020, 22:05:19
Not-used pins available for user:
- Bluetooth controller for HHKB JP has D0, D1
- Bluetooth controller for HHKB Pro2 has D0, D1, C6, C7.
- USB controller for HHKB JP has D0, D1, D2, D3, D4, D5, F0, F1, F4, F5, F6, F7, E6
- USB controller for HHKB Pro2 has D0, D1, D2, D3, D4, D5, F0, F1, F4, F5, F6, F7, E6, C6, C7

Thanks for the information - I'll keep everyone updated if I can get a demo working using just the controller. It's unfortunate that it doesn't seem easily doable with the BT JP model, though.
Title: Re: Alternative Controller for HHKB
Post by: joric on Fri, 09 October 2020, 01:34:41
But not like your video shows that several 2 come together, I just get one extra KEY 2 a time.
Bluetooth stopped working on YDKB HHKB Pro 2 controller. Green LED flashes only in bootloader mode. Battery indicator shows 12. BLE hardware reset doesn't help. Any ideas? Charger/regulator/Anything else to check/replace? Can't find what's wrong with it. Battery apparently works, green LED flashes if the keyboard is in bootloader mode even with the cable unplugged.
Upd. Enabled BT, made green LED flash with LShift+RShift+W or F+J but it won't advertise and doesn't show up, so I can't pair it anymore. Battery indicator now always shows 45.
Upd 2. Finally made it working. Got it in BT devices after reset as Adafruit BLE and it worked. Hardware reset as here (pin to shield) http://help.ydkb.io/doku.php?id=en:ble-series:reset-ble
Upd 3. Anyone managed to pul 18650 there? Is there enough space for 18650? I don't have one to try beforehand.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: devoi on Sat, 13 March 2021, 21:30:33
Finally got my hands on a USB-C controller and got variable lift up and working  ;D
There's a little bit of modding required - and my implementation only works for the USB controller. I had to jump across three components to get easy access to the 32u4's I/O:
(https://i.imgur.com/kFTAoPd.jpg)
Rather than putting wires all across the board I sacrificed some of the bluetooth module's pins so I could have three easy access pins. Jumping across R23, R8, and pins 2 and 3 of Q1 was needed to connect the RX, TX, and CTS RN42 points directly to the 32u4. I used some magnet wire to connect to pins 1-3 of the digipot on the main board, so that PD5 -> ~CS, PD2 -> ~SK, and PD3 -> DIO of the BU9831. The code snippet I posted earlier uses PORTC/PINC but after modification it worked if I added custom actions to the tmk keymap. Even though I've had one of these controllers a few years ago I only just found out about the really useful hid_listen debugging.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: sartrism on Fri, 19 March 2021, 09:59:29
Do you have any plan to support JP Pro bluetooth? If not, I'm interested in DIY, so any tip is appreciated. I wonder if you don't make a kit for it because it is totally different.

I bought your kit for USB version few months ago mainly because the previous usb port is broken, but after experiencing QMK-enabled HHKB, I cannot live with normal keyboards :( Also my another BT version HHKB has been almost useless due to its inconsistent connection issue. I've never used it after few months I bought it.

But after learning some technical details since I got to know about QMK, it seems like enabling BLE is relatively easy now given some controllers like nice!nano is available with ZMK firmware. I wonder if you can use say nice!nano instead of teensy in one of your pictures, which will greatly save some space for much larger battery if necessary as well as enabling ZMK which supports some functionality for BT.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: phinix on Thu, 28 April 2022, 08:41:28
Will there be HASU controller for new HHKB in the future?
Those with USB-C models, classic and hybrid.
Title: Re: [TMK] Alternative Controller for HHKB
Post by: joric on Mon, 18 July 2022, 05:49:33
A guy named @kanru managed to make HHKB Pro 2 ZMK firmware for the wireless nicenano/nrfmicro controllers. That's pretty neat! I'm going to try that. https://github.com/kanru/hhkb-nicenano-zmk Wiring looks even better than the conventional Pro Micro pinout by HBar, it's all on one side:

(https://user-images.githubusercontent.com/852547/179495062-3690c2f4-714e-4810-b17b-00c21faed5f2.jpg)

It's probably also possible to use it as the only controller for HHKB Classic/Hybrid since they use the same switchmatrix protocol, see https://geekhack.org/index.php?topic=106213.0