Author Topic: Alternative Controller for HHKB  (Read 339971 times)

0 Members and 4 Guests are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #600 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline rabbitl

  • Posts: 1
Re: Alternative Controller for HHKB
« Reply #601 on: Fri, 29 December 2017, 00:25:41 »
I've received hasu's Controller(with BT), works perfectly for me

Offline vegs

  • Posts: 531
  • Location: Norway
  • partiboi69
Re: Alternative Controller for HHKB
« Reply #602 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:
Unikorn | Klippe+ | 910 RE | Rukia

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #603 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline ttezz

  • Posts: 2
Re: Alternative Controller for HHKB
« Reply #604 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....
« Last Edit: Sun, 15 April 2018, 00:42:22 by ttezz »

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #605 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline tex_live_utility

  • Posts: 598
Re: Alternative Controller for HHKB
« Reply #606 on: Tue, 24 April 2018, 18:16:59 »
.
« Last Edit: Tue, 24 April 2018, 18:22:47 by tex_live_utility »

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #607 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline devoi

  • Posts: 35
  • Location: MA
Re: Alternative Controller for HHKB
« Reply #608 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.

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #609 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.
« Last Edit: Wed, 23 May 2018, 14:14:02 by hasu »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline joric

  • Posts: 125
Re: Alternative Controller for HHKB
« Reply #610 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

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #611 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!
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline joric

  • Posts: 125
Re: Alternative Controller for HHKB
« Reply #612 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.

Offline joric

  • Posts: 125
Re: Alternative Controller for HHKB
« Reply #613 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


« Last Edit: Fri, 30 August 2019, 04:58:15 by joric »

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #614 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #615 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline yangdigi

  • Posts: 77
  • Location: China
Re: Alternative Controller for HHKB
« Reply #616 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.

Offline joric

  • Posts: 125
Re: Alternative Controller for HHKB
« Reply #617 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.
« Last Edit: Tue, 03 September 2019, 10:32:00 by joric »

Offline yangdigi

  • Posts: 77
  • Location: China
Re: Alternative Controller for HHKB
« Reply #618 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


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.
225600-0
225602-1

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.

Offline joric

  • Posts: 125
Re: Alternative Controller for HHKB
« Reply #619 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?
« Last Edit: Wed, 04 September 2019, 08:03:16 by joric »

Offline yangdigi

  • Posts: 77
  • Location: China
Re: Alternative Controller for HHKB
« Reply #620 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.

Offline hasu

  • Thread Starter
  • Posts: 2962
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Alternative Controller for HHKB
« Reply #621 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.

TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt