Converting G80-11900 Touchboard to bluetooth?

User avatar
browncow

25 Nov 2022, 21:05

Hey there. I recently got my hands on one of these cherry G80 boards with built in touchpad. Except the switches which i don't like, the reason i went for this board is to use it in a couch-computer situation because of the touchpad. However the ps/2 interface for this use is less than ideal. I want to convert this board to some sort of wireless interface, be it bluetooth or some other wireless radio.
I figured a slim li-po battery would fit inside the board in one place. Because cherry doesnt use a switchplate, instead, the PCB is supported on plastic extrusions that go along the entire bottom of the case, space is limited! So the electronics would have to be compact. something like a pro micro would fit. I plan to replace the original cable with a charging jack, not to modify the case in any way. How would you guys go about such a ps2>wireless conversion? Hardware and software wise, i am completely new to this. Any ideas will be helpful! :roll:

Findecanor

25 Nov 2022, 21:22

There exist Bluetooth adaptors for keyboards, but I dunno if they support both keyboard and trackpad.
Too bad that you got a PS/2 keyboard: there are USB versions of the G80-11900 also.If you don't have one of those then you'd also need to also put a PS/2-to-USB converter in there.

Know also that the trackpad is an old type that emulates a two-button mouse. There is no two-finger scroll, pinch-to-zoom or anything like that.

User avatar
browncow

25 Nov 2022, 21:26

Findecanor wrote:
25 Nov 2022, 21:22
There exist Bluetooth adaptors for keyboards, but I dunno if they support both keyboard and trackpad.
Too bad that you got a PS/2 keyboard: there are USB versions of the G80-11900 also.If you don't have one of those then you'd also need to also put a PS/2-to-USB converter in there.

Know also that the trackpad is an old type that emulates a two-button mouse. There is no two-finger scroll, pinch-to-zoom or anything like that.
I thought there would be a newer version, but thanks for pointing this out. Unfortunetely i have to work with what i got, so yeah i would have to find a way to convert both mouse and keyboard from ps/2 to usb and then wireless. I use the keyboard currently with a simple converter that has usb on one side, and ps/2 for both mouse and keyboard on other side. It does work, so i figure, would that work if i just used a USB > bluetooth converter on top of that?

User avatar
jsheradin

25 Nov 2022, 22:24

I messed with a G80-11900 a while ago also with the intention of converting it to wireless for my HTPC. In short my findings were that QMK on a 16MHz 32u4 can read in the trackpad PS/2 and work over BT/USB with autoswitch just fine. Trackpad itself can run at 3.3V just fine. Keyboard controller really doesn't like much below 5V so you'd probably want to gut it and run the matrix directly off the replacement microcontroller.

The major roadblock I ran into is that the 32u4 can only run at 8MHz on 3.3V (the most you're going to get out of a lithium battery unless you go multicell, booster, etc). At 8MHz everything works but the processor just can't keep up with the trackpad and has constant hitching and lost strokes.

It's entirely possible to make this happen with a replacement controller that drives the matrix and speaks PS/2 to the trackpad but the 32u4 is not the chip to do it. An nRF52840 based board running QMK or ZMK might be a good place to start.

User avatar
browncow

25 Nov 2022, 22:46

jsheradin wrote:
25 Nov 2022, 22:24
I messed with a G80-11900 a while ago also with the intention of converting it to wireless for my HTPC. In short my findings were that QMK on a 16MHz 32u4 can read in the trackpad PS/2 and work over BT/USB with autoswitch just fine. Trackpad itself can run at 3.3V just fine. Keyboard controller really doesn't like much below 5V so you'd probably want to gut it and run the matrix directly off the replacement microcontroller.

The major roadblock I ran into is that the 32u4 can only run at 8MHz on 3.3V (the most you're going to get out of a lithium battery unless you go multicell, booster, etc). At 8MHz everything works but the processor just can't keep up with the trackpad and has constant hitching and lost strokes.

It's entirely possible to make this happen with a replacement controller that drives the matrix and speaks PS/2 to the trackpad but the 32u4 is not the chip to do it. An nRF52840 based board running QMK or ZMK might be a good place to start.
I was sure somebody would have the same idea before me for that keyboard! it's just perfect layout for that use case. Thanks for sharing your knowledge. I didn't think of completely replacing the controller though. How exactly? do you make the trackpad work with QMK? Would say, something like the blackpill board be sufficient? i have one

User avatar
browncow

25 Nov 2022, 22:59

Also, i would be extremely grateful if You still got the matrix sketched out somewhere. :D

User avatar
jsheradin

26 Nov 2022, 03:18

There's some docs for PS/2 input on QMK here: https://github.com/qmk/qmk_firmware/blo ... 2_mouse.md It pretty much works out of the box. If I remember right, interrupt configuration had the best performance but it required soldering to a normally unconnected pin on the IC of the Adafruit Feather 32u4 Bluefruit. At 8MHz it was still too choppy to be useable.

I didn't make it as far as mapping out the matrix but it should be easy enough. The board is a standard 2KRO diode-free matrix so you just buzz out the rows/cols, assign pins, and throw it at your firmware of choice.

I've never played with the Blackpill before but the spec page sounds pretty good. You'll probably need to do some work to get QMK/ZMK up and running but it should definitely be sufficient in terms of compute power.

User avatar
Muirium
µ

26 Nov 2022, 10:43

I'll be interested to see where you get with this. I've a handful of keyboards I mean to convert to Bluetooth, too; for just the same reason: lying back without wires is a whole welcome headspace of its own. My Hasu converted HHKBs get so much use precisely because they're so adaptable they can do this. The rest of my boards want a look in!

If only it were always so simple as buying a replacement PCB from Hasu. :lol:

As for mapping the matrix: done a few of those myself. Once you pull out a controller, the whole keyboard is your oyster. But it's also your responsibility, as you've noted with the tight space you're dealing with. My Marquardt Mini is the apotheosis of that: so little room, but so perfect a size for a lap keyboard, ngh!

Jsheradin is right about the ATmega 32u4 being just too damn slow for bearable trackpad use. Much better to use a single and more modern processor to handle keyboard, trackpad logic and the Bluetooth itself. Needless duplication of parts has a real effect on battery life: these Hasu controllers I love only have a few days of battery life. When doing it from scratch, you can and should choose a more capable piece of hardware and use its power saving as designed.

User avatar
browncow

26 Nov 2022, 20:23

So after spending some time writing down the matrix, i think i've hit a conceptual wall.
The problem is that, as jsheradin said, 32u4 is too slow for the trackpad, however, it has bluetooth support with QMK.
the STM based blackpill is fast enough for sure, but QMK doesnt support bluetooth on it, as it's limited to AVR chips only, not ARM.
ZMK has bluetooth support on ARM chips, HOWEVER, there is no ps/2 device support.
I am running out of options here. Write a custom module for ZMK to support ps/2 composite device? beyond my capabilities.
Add bluetooth support to QMK on arm chips?
is there any other way to convert this board without major programming jobs beyond my capabilities? It's beggining to look super hard. :?

User avatar
Muirium
µ

26 Nov 2022, 20:36

Yup.

It’s great when someone has already done the work so (relative) normals like us can simply tweak the key map, add a few macros, call it a day and hit build.

The number of folks who can actually hack this stuff together is many orders of magnitude fewer on the ground.

User avatar
browncow

26 Nov 2022, 20:46

The other option is running the 32u4 at 16Mhz. if it would be enough for the trackpad, i don't mind having to supply higher voltage to it. as there is enough place for a bigger battery

User avatar
Muirium
µ

26 Nov 2022, 20:54

Just off the top of my head:
  • Wouldn’t double clock speed throw the PS/2 timing logic way out of whack?
  • Doesn’t power consumption scale with clock speed squared?
I am not an electrical engineer etc. etc.

User avatar
browncow

26 Nov 2022, 21:02

The power consumption wouldn't be that much of concern if i just used a decent sized battery, however what i see now is that the adafruit board that jsheradin used has a lot of stuff integrated to it. I'm not sure if the additional components would be fine with more voltage. I think i'm just going to try run the trackpad with a pro micro on 16mhz just to try if it's worth it or not. Shame the ZMK people weren't interested in supporting ps/2 devices :/

User avatar
browncow

27 Nov 2022, 17:26

OK so interesting finds so far, i'm using a promicro at 16Mhz powered via usb for now.
Interrupt mode was rather choppy. So i decided on trying USART mode. Soldered a wire to the pin that normally goes to the LED in the pro micro. That worked a bit better! I found a project of one guy who made a teensy conversion for this board but the version that had trackball. He used USART mode. It was a bit better! but still quite choppy, i mean it would be sort of usable but not really good. So i thought why the heck not to try Busywait mode. SUPER SMOOTH :lol:

User avatar
browncow

30 Nov 2022, 15:24

While waiting for the electronic components to get shipped, i was looking for replacement switches because i'm not a big fan of cherry blacks. I found a good deal on kailh box white (i would prefer jades but these were at a good price locally so i went for it.) First time testing click-bar switches and i have to say i am pleased :D However, there are two problems. First one is fairly simple to solve. the original cherry switches have jumpers in them that this board seems to use as part of the matrix. Kailhua doesn't have those. So i will just have to solder some jumpers separately. Other problem is more severe:
DSC_0670.JPG
DSC_0670.JPG (3.22 MiB) Viewed 66243 times
Kailh switches do not have the two plastic pegs which align the switch in the pcb. To add on that, the switch legs are so small that you can twist it like that and it's really hard to set it straight for soldering. This would make the process super tedious...
DSC_0671.JPG
DSC_0671.JPG (2.83 MiB) Viewed 66243 times
So i started to sketch out a solution to the switch alignment problem. :D
cherry.PNG
cherry.PNG (19.67 KiB) Viewed 66243 times
I will report soon how that went about. 1,5mm steel is my choice of material.

User avatar
Muirium
µ

30 Nov 2022, 22:39

Oh boy! Yes, a plate’s really going to help with orientation in that case. So long as there’s room for it in the (literal) case. You’re still going to have a lot of fun manually replicating all the jumpers.

User avatar
browncow

30 Nov 2022, 23:35

Muirium wrote:
30 Nov 2022, 22:39
Oh boy! Yes, a plate’s really going to help with orientation in that case. So long as there’s room for it in the (literal) case. You’re still going to have a lot of fun manually replicating all the jumpers.
There isn't a room in the case, because this case "squeezes" the pcb with the top part. so best i can do is try to make a plate in few separate pieces. it is a tight fit, but if i pull this off it will still be so much easier to solder the damn switches! i don't care if it's four separate plates then really... as long as i don't have to manually align every switch :?
DSC_0675.JPG
DSC_0675.JPG (2.34 MiB) Viewed 66161 times
There's no holes to screw the plate to the pcb aviable. so i think i will just make an edge bend there, and just rest on the pcb, to set the height for the switches. same thing on the other side:
photo_2022-11-30_23-28-43.jpg
photo_2022-11-30_23-28-43.jpg (92.28 KiB) Viewed 66161 times
In total i would have to make one alphanumeric plate, two for function/home/delete/etc, and one for numpad. i will skip the nav keys because it's just four keys that i can bear to align manually. We'll see how it goes! drawing that one plate took me a hour :lol:

User avatar
Muirium
µ

30 Nov 2022, 23:44

Riiight, I see where you’re going with this. Essentially using a plate (in several sections) for a switch orientation guide, rather than the fundamental mounting point for the keyboard. It’s an… inventive approach. Are you sure you hate those MX blacks enough to justify the work? :lol:

I think it’s an interesting project. I’m kinda wondering if. even with a plate, these switches will feel like they’re PCB mounted, more-or-less. That’s usually a bad thing, feel-wise, though opinions differ.

User avatar
browncow

30 Nov 2022, 23:55

Muirium wrote:
30 Nov 2022, 23:44
Riiight, I see where you’re going with this. Essentially using a plate (in several sections) for a switch orientation guide, rather than the fundamental mounting point for the keyboard. It’s an… inventive approach. Are you sure you hate those MX blacks enough to justify the work? :lol:

I think it’s an interesting project. I’m kinda wondering if. even with a plate, these switches will feel like they’re PCB mounted, more-or-less. That’s usually a bad thing, feel-wise, though opinions differ.
You are correct, i would like to make a proper plate for the WHOLE board, but the case design makes it impossible. The top part of the case just goes all the way down to the pcb in many places. Though still i think even with those plates, the board should stiffen a lot physically, im going to do some tests before and after when i get to it. Because in stock form on that cherry board you can literally see the flex of the pcb when you press a bit harder on the keys. :lol: And well i'm more of an alps and futaba fan, and everything clicky and crisp so cherry blacks are really not my thing :lol:
So far quick summary: The multiplexers have arrived, got the keyboard matrix worked out. Touchpad works smoothly with the 32u4 at 16mhz. The trick was to use the (least advertised) BUSYWAIT mode. Ordered a 3,7V lipo battery that will fit in the case (almost), i will have to cut off a little bit of the plastic extrusion inside and some unused plastic standoffs. (this board has a TON of unused things in the moulding) :lol: Also there are pads and holes for three additional keys around the escape key. I wonder what they would be?

User avatar
browncow

03 Dec 2022, 19:59

Progress so far:
I've managed to cut (and weld because i didn't have a way to bend it at the time and i didn't exactly trust my calculations to be right in such tight space) the plate, got it right second time.
plate prototype.jpg
plate prototype.jpg (726.18 KiB) Viewed 65881 times
Top: first plate i cut in free time at work. Enter key and holes for spacebar stabs are a bit too much to the left side. i Had to fix that in the second try that's on the bottom. I work on a cnc turret punch machine, these have few advantages over the lasers actually!
desoldering.jpg
desoldering.jpg (706.16 KiB) Viewed 65881 times
Desoldered all the cherries for the alphanumeric cluster. I decide to leave them on the arrow keys (for playing oldschool racing games on my TV i prefer linear switches.) :lol:
fitting plate with switches.jpg
fitting plate with switches.jpg (629.58 KiB) Viewed 65881 times
Switches fit into the plate neatly. In my infinite wisdom though, i assumed Cherry's spacing between keys is 19,00mm. However, it turned out to be something about 19,10mm, which made it a very tight fit later on :cry: i will have to fix that if i want to make the plate again. it was such a small misalignment i've managed to make it fit though.
plate and switches in case.jpg
plate and switches in case.jpg (633.76 KiB) Viewed 65881 times
All the switches and plate in place, test fitting before soldering.
plate zoom 1.jpg
plate zoom 1.jpg (453.34 KiB) Viewed 65881 times
Curious detail of the reliefs in the plate side i had to make to clear the jumpers in the pcb. one of 5 such reliefs. :lol:
case .jpg
case .jpg (383.35 KiB) Viewed 65881 times
I cut out few of plastic bits in the case that were taking up the space for the new stuff. Few standoffs that didnt do anything, and four that provided support for the original controller. Also i've accidently ordered a USB type C battery charger. Turned out, a type C to micro usb adapter, served as a perfect charging port for the board, it will be much harder to break it accidentally and i can easily replace the battery charger pcb if i need to.
electronics.jpg
electronics.jpg (354.86 KiB) Viewed 65881 times
Layout of the electronics, pro micro and the multiplexer will be on the green proto boards, soldered to the keyboard pcb.
proto board.jpg
proto board.jpg (864.96 KiB) Viewed 65881 times
I couldn't order a correct length proto board for my use (it can't be larger because it will interfere with the case) so i've cut two smaller ones and joined them together with super glue. Should be good enough to hold the controller and multiplexer.
JUMPERS 1.JPG
JUMPERS 1.JPG (3.62 MiB) Viewed 65828 times
Kailhua box switches do not have the integrated jumpers Cherries have, so i had to replicate that with some bent wire.
JUMPERS 2.JPG
JUMPERS 2.JPG (3.35 MiB) Viewed 65881 times
All the replacement jumpers soldered. Not every holes needed to have them as there are redundant traces in the pcb.
Now what there is left to do is software and figuring out how to flash a cheap bluetooth module with RN-42 software.
What i can tell is the plate HAS made the keyboard feel stiffer. Especially with the welded three sides, it is very stiff on it's own. when soldered to the pcb by the switches, the whole aplha cluster has no flex whatsoever. the rest of the pcb has though, and the case itself flexes under it. However i've not tested it yet with the case screwed together, it should be better. It made soldering the switches not painful though so i'd count that as a win. I will make comparsion video later as i've recorded how the board flexed without the plate. :D
Last edited by browncow on 03 Dec 2022, 22:02, edited 1 time in total.

User avatar
Muirium
µ

03 Dec 2022, 21:14

Nicely done. You’ve done a neat job on the hardware side. Best of luck getting the software in matching shape!

User avatar
browncow

03 Dec 2022, 21:59

Muirium wrote:
03 Dec 2022, 21:14
Nicely done. You’ve done a neat job on the hardware side. Best of luck getting the software in matching shape!
Thanks! i will need it as i'm much more of a hardware guy than software xD

User avatar
jsheradin

04 Dec 2022, 00:41

Very good progress on the board so far! The boxed plate is really cool; I don't think I've seen that done before. I believe historically keyboards were spaced at 3/4inch, a nice round number. Modern stuff being metric means typical spacing is 19.05mm.

So you're planning to stick with the 32u4 and run it at 16MHz? What sort of battery management/booster/charger are you going to use?

User avatar
browncow

04 Dec 2022, 10:47

jsheradin wrote:
04 Dec 2022, 00:41
Very good progress on the board so far! The boxed plate is really cool; I don't think I've seen that done before. I believe historically keyboards were spaced at 3/4inch, a nice round number. Modern stuff being metric means typical spacing is 19.05mm.

So you're planning to stick with the 32u4 and run it at 16MHz? What sort of battery management/booster/charger are you going to use?
I should have thought it would be a round number in inches not metric. :roll: yeah, you're right 19,05 would be it. I'll have to change that spacing and the plate would be perfect. If you'd be interested i can make another one sometime :D
I bought a simple usb battery charger as you can see on the pic, i'm going to limit the amperage to about what a PC usb port can handle. I'll try to stick with the 32u4 because that early test with touchpad seemed fine. I will see if it runs at 3,7V at 16mhz (because some reportedly can) if not, i have a small booster to bring it up to 5V. we will see :lol:
I'm curious if You have tried the busywait mode for your touchpad? because i've tried all three and this worked the best and really usable.

User avatar
browncow

11 Jan 2023, 20:21

Long overdue update because this is a very "in the meantime" project.
It works ^^ I will record some video soon to show how the touchpad works. Right now it looks like this:
20230111402.jpg
20230111402.jpg (913.86 KiB) Viewed 64151 times
The proto board with two multiplexers is using female goldpin connectors for ease of removal. I figured i will have to do that many times during testing. On the right side there is a step up buck converter for powering the ps/2 OEM touchpad controller with 5V.
Plenty of space left for a big battery. I ended up using the same adafruit feather board as jsheradin (thanks for tips) because after buying HC05 bluetooth modules and trying to flash them with firmware i got fed up with them as they really didn't want to get flashed :roll:
20230111404.jpg
20230111404.jpg (1.02 MiB) Viewed 64151 times
Other side of the multiplexer board. Everything barley fits, but it does fit. :lol:
20230111403.jpg
20230111403.jpg (568.52 KiB) Viewed 64151 times
Battery lives on the left. Another advantage of the adafruit feather (Albeit pricey) it comes with a LiPo charger circuit built in.
20230111400.jpg
20230111400.jpg (408.5 KiB) Viewed 64151 times
From the back it looks rather obvious, i have to cover up the way too big hole for the usb connector with something, because at some point i swapped the switch and controller around. (didn't fit that way because of some plastic bits inside the case.)
So Far: Keyboard works, except the lock lights. Probably something is connected wrongly, i must have just messed it up during assembly. Trackpad works, and it's rather snappy and smooth, key to that was to use the BUSYWAIT (least reccomended :lol: ) mode in the QMK settings. It only gets a bit laggy when i move a bit further from the reciever, but i think that's just a crappy bluetooth usb dongle i got.

To Do:

-Mount the feather board more reasonably. Cover the hole i chewed out with something less horrible looking.
-Add 3rd mouse button for scrolling. (this is something i really wanted to do!)

Sourced a mouse switch from some crappy mouse. So far so good, but how the heck would i mount it? i don't want to remove the two switches that are already there, and in the middle between them, there is that connector for the touchpad ribbon cable:
20230111407.jpg
20230111407.jpg (559 KiB) Viewed 64149 times
Only reasonable way to do this i think is to have the 3rd switch above it. So i got to drawing a mount i could have my friend 3D print for me. It utilises the holes that are already in the switches. Very convenient that those are here :D
Capture2.PNG
Capture2.PNG (213.18 KiB) Viewed 64151 times
first piece would go through the holes with those pegs.
Capture.PNG
Capture.PNG (103.27 KiB) Viewed 64151 times
and second piece, also doubling as the keys themselves. Then the 3rd switch will just be added as another key in the matrix outputting the 3RD mouse button scancode. Thanks for sticking around if you did and all the help! ^^

User avatar
jsheradin

12 Jan 2023, 00:33

This is a really cool project - awesome to see it finally coming together!

I really need to dust off mine at some point.

User avatar
browncow

12 Jan 2023, 11:19

jsheradin wrote:
12 Jan 2023, 00:33
This is a really cool project - awesome to see it finally coming together!

I really need to dust off mine at some point.
You should! thanks for help and leading me onto the right track. If you want i can give you my arduino sketch for this. I've used two HC4067 multiplexers, one for rows and one for columns

User avatar
jsheradin

12 Jan 2023, 13:55

Please do post your scripts, matrix, etc. It'll save a ton of time for people in the future.

User avatar
browncow

13 Jan 2023, 22:00

jsheradin wrote:
12 Jan 2023, 13:55
Please do post your scripts, matrix, etc. It'll save a ton of time for people in the future.
I'll post both scripts and matrix, just have to make it more readable before :lol:

User avatar
Muirium
µ

14 Jan 2023, 13:14

I'll definitely be keeping an eye on this for my own long-stalled Feather project.

Post Reply

Return to “Workshop”