geekhack

geekhack Community => Ergonomics => Topic started by: Me on Wed, 24 March 2021, 10:11:41

Title: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 10:11:41
I have a question about split keyboards. When handwiring split kbs, do you need 2 microcontrollers? I have heard from people on this forum that you do, but I have seen builds with one. If not, how would you go about wiring it with one? Here is my layout for reference:

http://www.keyboard-layout-editor.com/#/gists/9d86179bad23b8cd5f583829da37af64
Title: Re: Split kb controller(s)?
Post by: yui on Wed, 24 March 2021, 10:24:11
when designing yourself both are valid designs, either you pass data between the boards with a controller on the salve talking to the master, or you can have the matrix cable go from one to the other, although that can become unwieldy it is a cheaper options to 2 controllers a 3rd option is to make both controllers communicate with the pc.

the 1 controller with matrix wires going through to the other half has been seen a few times in OEM split or tenting boards while most customs are so expensive to start with that a 2nd 3 to 5 $ controller does not make much differences.
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 10:36:32
Quote
a 3rd option is to make both controllers communicate with the pc.
this MAY work in a few instances but is not the majority case.

because they are two SEPARATE usb devices, modifiers, shift, layer shifts, etc do not translate to the other separate device.
typically, holding shift on one keyboard and typing a "m" on the other keyboard will not give you an "M".
... again, there are a few instances that this MAY work, but i would not count on it. (mac & linux do not play this way)
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 10:55:46
So you're saying I can wire up a matrix for both, then wire up one of the sides completely with the controller, then route the wires that come from the rows and columns on the other side through the middle cable, then wire those to the controller?
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 10:58:21
working on a crude diagram for you
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 11:00:32
ok, I think that that will help a lot
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 11:26:15
with two cheap controllers, the whole setup is a lot cleaner. and you can get two or more promicros for the price of one of the larger controllers (promicros $3-$8/ea, teensy ++2.0 = $24)

ok. so here's a crude drawing of the wiring for 2 controllers with one thin cable between them
[attach=1]

and here's what it looks like passing the matrix between the two halves
[attach=2]

***technically you COULD get away with one promicro with the amount of keys in your design but the matrix would be a lot more confusing. you don't have enough i/o pins on a promicro to wire it straight like the example above. you'd have to cut down the number of i/o pins used by combining columns to make the electrical matrix more square. something like gipetto's crushed paper matrix example  (https://geekhack.org/index.php?topic=103573.msg2840939#msg2840939)*** though it can be done, i highly DON'T suggest this for your 1st build, let alone your 1st build that's also a split.
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 11:32:02
another thought....
get a pair of keeb.io's viterbi pcb's (https://keeb.io/collections/frontpage/products/viterbi-keyboard-pcbs-5x7-70-split-ortholinear) (they just came back in stock) and build your case around that. would save you from all of the wiring as it's a split 5x7 orho just like your layout and you wouldn't have to put keys in the outermost 3 columns on the bottom row if you didn't want to.

....would be a great 1st project that you could easily accomplish.
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 11:33:52
Thanks, but I honestly kinda want to handwire as it will be a nice challenge for me. I prob will either get 2 promicros or 1 teensy/elite c. I need 20 pins with one controller and I think that the promicro only has 18.
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 11:38:36
yep.
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 11:52:13
Thanks!
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 12:05:11
Hey. I was thinking about using a thinner wire for the wires connecting the rows/columns on the right side to the left side instead of a ribbon cable so that the mid cable would be thinner. How thin can a wire be for this kind of thing?
Title: Re: Split kb controller(s)?
Post by: vvp on Wed, 24 March 2021, 12:07:20
The most easy way to co connect the second half without an additional controller (or port expander) and still using small number of wires is to use shift registers. Here is an example how to do it:
[attachimg=1]
Here is how it may look in a keyboard:
https://deskthority.net/viewtopic.php?p=347675#p347675
Here are many other ways how to save pins in a keyboard matrix:
http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/

As I already indicated in another thread, the quickest way to connect a keyboard matrix is using magnet wire. You can go down to Ø 0.1 mm.
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 12:12:41
i have a spool 30 gauge of multiple color strands i picked up off of amazon (ASIN : B07L11CM8L). could probably run them through a paracord sleeve to make it look nice.
i'd stick with the 24-ish gauge solid core (from network cables) for the halves, little easier to manipulate & make it stay in place.

thanks for the links vvp
Title: Re: Split kb controller(s)?
Post by: vvp on Wed, 24 March 2021, 12:34:49
Shift registers are slightly cheaper than IO expander but they add 2 wires for the connection. Overall, it is best not to concentrate on price in a first keyboard build. Going with two controllers is probably easier if the firmware already supports it. If the prefered firmware does not already support it then it is a bad solution (it adds a lot of firmware work). IO expander is slightly more work on the firmware side than the shift registers.
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 12:44:36
yes. tons of split pcb's on the market all support dual promicros or similar controllers. firmware is already written, just dump in your layout, pins, keymap, etc. and it's done.

i've done it for a couple one-of's others have built here on the forum. between, KLE, the firmware, VIA and a spare promicro i can troubleshoot the layout/firmware without actually building it. VIA does a good job representing the layout in the firmware visually and is usually pretty easy to catch any goofs on your 1st "make" of a new layouts firmware.
Title: Re: Split kb controller(s)?
Post by: vvp on Wed, 24 March 2021, 12:59:45
OK, two controllers sound good then.
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 13:55:34
Would something like this work for the matrix?
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 13:58:41
Or would I have to do something like this:
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 14:11:22
[attach=1]
Or would I have to do something like this:


this one. and i'll tell you why, let me mark up the 1st one & explain
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 14:15:42
ok?
Title: Re: Split kb controller(s)?
Post by: nevin on Wed, 24 March 2021, 14:22:57
[attach=1]
because when you do this. electrically, the ones that share the same color also occupy the same spot in the matrix. think of the matrix as a grid. you can't have two boxes occupying the same spot on the grid.
Title: Re: Split kb controller(s)?
Post by: Me on Wed, 24 March 2021, 14:25:31
Thats what I figured, just wanted to make sure so that if it was true, I could save a few pins. Thanks!