Author Topic: Hand Wiring a Split Keyboard  (Read 11570 times)

0 Members and 1 Guest are viewing this topic.

Offline nevin

  • Thread Starter
  • Posts: 1646
  • Location: US
Hand Wiring a Split Keyboard
« on: Sun, 14 May 2017, 10:35:09 »
What i'd like, is a place we can collectively put together the information/resource links for hand wiring a split keyboard.

There's plenty of documentation on hand wiring a keyboard from scratch as well as the firmware to run it. What i think is lacking is the documentation & "how-to" of hand wiring a split keyboard. Yes, you could just run all the wires for the matrix from one side to the other, but what i'd like to see is a more elegant solution like what has been done with the ergodox (i2c over TRRS?) or similar but in a homemade fashion.

I think the main part of this will be how the two halves connect & how they "talk" to each other. And be able to create this out of readily available components.

I am not an electronics or software engineer, so it will rely heavily on the very knowledgeable users of this great community. I really just wanted to put this out as a starting point.

1. Two halves of a keyboard matrix
2. How do they connect
3. What components are needed
4. What firmware supports this method
5. Example keymap/firmware configuration

     (and i will do my best to compile/document the process so it's easy for others to follow)

What are your thoughts?
Anyone willing to lend their brain?
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline yoippari

  • Posts: 27
Re: Hand Wiring a Split Keyboard
« Reply #1 on: Tue, 16 May 2017, 16:45:54 »
I'm new here and a handwired split keyboard is probably my first project so I was going to ask something similar. I think I read that the lets split is just two keyboards that each function as half. With that I mind I was considering something like a usb splitter in the case to connect both the teensy and have a port to connect the other side. Would also allow a third connection for a number pad.

Offline nevin

  • Thread Starter
  • Posts: 1646
  • Location: US
Re: Hand Wiring a Split Keyboard
« Reply #2 on: Tue, 16 May 2017, 17:43:51 »
I was thinking the same thing till i did a little research.

If you set them up as separate keyboards (even though it's only half a keyboard) when you press a modifier or Fn key on one side it will not transfer or be registered for the other half. This is where the tricky part comes in.

Take two of your current keyboards, plug them both into your computer/laptop whatever... press the shift on one & a letter on the other. Did you get a capital letter? (nope)

I typically only use modifiers on the left side of my boards, and the Fn on the right side.

The let's split board does use 2 micro controllers but they talk to each other over the TRRS jack and is only connected to the computer by the main controller. (reference: https://github.com/nicinabox/lets-split-guide)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline nachie

  • Posts: 48
  • Location: California
    • KapCave
Re: Hand Wiring a Split Keyboard
« Reply #3 on: Tue, 16 May 2017, 21:07:47 »
What i'd like, is a place we can collectively put together the information/resource links for hand wiring a split keyboard.

There's plenty of documentation on hand wiring a keyboard from scratch as well as the firmware to run it. What i think is lacking is the documentation & "how-to" of hand wiring a split keyboard. Yes, you could just run all the wires for the matrix from one side to the other, but what i'd like to see is a more elegant solution like what has been done with the ergodox (i2c over TRRS?) or similar but in a homemade fashion.

I think the main part of this will be how the two halves connect & how they "talk" to each other. And be able to create this out of readily available components.

I am not an electronics or software engineer, so it will rely heavily on the very knowledgeable users of this great community. I really just wanted to put this out as a starting point.

1. Two halves of a keyboard matrix
2. How do they connect
3. What components are needed
4. What firmware supports this method
5. Example keymap/firmware configuration

     (and i will do my best to compile/document the process so it's easy for others to follow)

What are your thoughts?
Anyone willing to lend their brain?

I am not an electronics engineer either. I am fairly new to mechanical keyboards, but have some experience with electronics. I am planning to hand wire a split keyboard. Here is what I have so far.

To connect the two halves:
1. Use a controller in one half and an IOExpander in the other. (Look at Ergodox)
2. Use controllers in both halves that talk over either serial or I2C. (Look at Let's Split)

The two halves can then be connected using a TRRS cable (4 connectors). I have also seen people use usb cables, sata cables. The TRRS should suffice for the connections listed above.

As for the firmware I am looking at QMK (https://github.com/qmk/qmk_firmware) which supports both these configurations. Its pretty straight forward to modify the keymaps based on what you are looking for. The example keymaps are in the 'keyboards' directory for each type of keyboard (https://github.com/qmk/qmk_firmware/tree/master/keyboards/lets_split/keymaps/i2c).

There are a lot of people here who know more than me. But this might be a good start.
AHKB | GSKT-00 | Arya | Båge | Paladin64

Offline nevin

  • Thread Starter
  • Posts: 1646
  • Location: US
Re: Hand Wiring a Split Keyboard
« Reply #4 on: Wed, 17 May 2017, 04:27:56 »
Thanks. Yeah, figured those were the two main options, component wise to connect the two halves.

Thanks for pointing out a firmware that will support this setup as well.

...little digging...

EXCELLENT! This is exactly what i was looking for. Was afraid it was going to be some complex/convoluted set of circuitry on one half or the other. Two identical controllers flashed with the same firmware on each with a couple wires to connect the two halves. I can't believe it's that simple. Fantastic.
168574-0
https://github.com/qmk/qmk_firmware/tree/master/keyboards/lets_split

I've heard of the QMK firmware, a branch of TMK, but haven't dug into it till now. It's extremely well documented.

Thank you again for your help on this.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Tye

  • Posts: 69
Re: Hand Wiring a Split Keyboard
« Reply #5 on: Wed, 17 May 2017, 11:02:00 »
I am interested in this from the software side. For my project, I did actually design a PCB but the initial work was done hand-wire/breadboard. Making the Ergodox code that is in QMK to be more generic would pave the way to many more split boards, I believe. I had to slow down the time I have for this project for personal reasons but I still VERY much want to complete it.

Here's a link to my attempt to get QMK working with a split custom board (caution: UGLY work in progress):
https://github.com/tyetye/qmk_firmware/tree/master/keyboards/boomerang_scratch

Here's the PCB:
https://easyeda.com/TyeEasyEDA/Boomerang_Keyboard-a2d4e41a4fbf4da490f883c4b93fd55c

Even though it's a PCB now, it started out as hand wire and the issues are similar.



Offline Tye

  • Posts: 69
Re: Hand Wiring a Split Keyboard
« Reply #6 on: Wed, 17 May 2017, 11:05:19 »
To connect the two halves:
1. Use a controller in one half and an IOExpander in the other. (Look at Ergodox)
2. Use controllers in both halves that talk over either serial or I2C. (Look at Let's Split)

Personally, I prefer the Ergodox method because there is only one side to program and keep in sync. Also, the IO Expander used in the Ergodox is really narrow so you can squeeze it in almost anywhere. (There's a surface mount version too that's REALLY tiny if you're adventurous)

Offline nevin

  • Thread Starter
  • Posts: 1646
  • Location: US
Re: Hand Wiring a Split Keyboard
« Reply #7 on: Wed, 17 May 2017, 12:21:16 »
Personally, I prefer the Ergodox method because there is only one side to program and keep in sync. Also, the IO Expander used in the Ergodox is really narrow so you can squeeze it in almost anywhere. (There's a surface mount version too that's REALLY tiny if you're adventurous)

Ok, so what would the circuitry on the I/O expander side look like? (obviously, other than the matrix itself)
Are there more than a few components for the I/O expander to talk back to the controller in the other half?

I was just trilled that it could be accomplished with two cheap controllers that are readily available (simple setup). Without having to try to build a complex circuit without a pcb.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Tye

  • Posts: 69
Re: Hand Wiring a Split Keyboard
« Reply #8 on: Wed, 17 May 2017, 12:57:36 »
Ok, so what would the circuitry on the I/O expander side look like? (obviously, other than the matrix itself)
Are there more than a few components for the I/O expander to talk back to the controller in the other half?
Sorry, writing this between meetings. It's pretty easy to find the schematic online. Only a couple of capacitors and resistors are needed. If we're already talking about building a split board, it's a trivial amount of work/cost compared to the project as a whole.

I was just trilled that it could be accomplished with two cheap controllers that are readily available (simple setup). Without having to try to build a complex circuit without a pcb.
Yeah, that is a good point too. The Teensy/IO Expander option would run about 26USD so it's not too pricey either, though. I got mine from Amazon with free shipping.

Either way, I've noticed (and now personally experienced) that many of these split board projects get stopped at the firmware level. Some sort of matrix/firmware standardization would benefit the split custom community immensely.

And I just want to reiterate... Just my opinions. Obviously, there's not much consensus within the community so far.

Offline Tye

  • Posts: 69
Re: Hand Wiring a Split Keyboard
« Reply #9 on: Wed, 17 May 2017, 13:00:27 »
Also, just want to be clear... I do not believe the Let's Split components are any easier, nor more difficult, to hand wire than the Ergodox components.

Offline nevin

  • Thread Starter
  • Posts: 1646
  • Location: US
Re: Hand Wiring a Split Keyboard
« Reply #10 on: Wed, 17 May 2017, 14:45:44 »
between meetings.. no worries. i'm in no hurry.

Either way, I've noticed (and now personally experienced) that many of these split board projects get stopped at the firmware level. Some sort of matrix/firmware standardization would benefit the split custom community immensely.

That's where all the variables come in to play. (wiring up your matrix & connecting to controller)
It all depends on how you wire your matrix & what pins you connect them to. Unless you emulate your matrix off of a current project that has done the hardware & firmware to support it as well.

So you feel a disconnect between wiring up a matrix & getting it to register in a firmware. It is a trick i'm sure. (i haven't done one yet but am learning a lot every day looking into the subject)

Here's a tutorial i ran across that should be helpful. (by the wonderful matt3o) https://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html
it's based off the GH60 TMK firmware, but since QMK is a fork of TMK it shouldn't be too much of a stretch. At least to get the matrix recognized on the teensy. From there it should just be matching up what's being recognized with what you want it to be in your keymap.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Tye

  • Posts: 69
Re: Hand Wiring a Split Keyboard
« Reply #11 on: Wed, 17 May 2017, 21:18:36 »
Thoughts up to this point:
Use QMK instead of TMK. TMK is very nice and I am glad Hasu made it but he has been very clear that he only wants to support boards that he owns and can test himself. QMK is more open to custom boards and accepting keymaps outside of the Planck and Ergodox.

QMK actually already has a really nice script to create the folder/files for a new board. Unfortunately, this script is only for one-piece "traditional" boards. It won't work with a split board without some custom code. This is the part where I hope the community could work toward some "standards". (thank you for starting this thread!)

matt3o's guide is, indeed, a very good start. Especially to help understand things by getting directly into the code. Most of it is handled by QMK's set up script, though.

The comments below are assuming a layout loosely based on the Ergodox. So, Teensy on right hand board and IO Expander on left hand board.
The QMK script actually gets us off to a good start for the Teensy side. If you specify the correct pins, you can register keypresses very quickly.

The difficult part is with the left hand Expander side. I've had a couple of experienced keyboard builders say that the Ergodox code is really weird and I can confirm. So, it's not a simple matter of just ripping the code from that. The Ergodox config files have some oddities like transposing the rows and columnn in its matrix.
I am not certain, but I think this is because most "regular" keyboards scan row-by-row, top to bottom. The Ergodox seems to scan column-by-column. This is only a guess, but I assume this is so the rows don't have to be read across the split (half the row read by Expander -- half the row read by Teensy -- easier to just scan in column, left to right). Does that make sense?
Unfortunately, this makes the job of making these script generated files to be generic much more difficult. The way that the IO Expander and Teensy communicate still isn't clear to me. I'm sure it's straightforward but it's a lot to learn at one time. I've made progress with various versions of my QMK fork but, like I said, I've had to scale back the time I spend on it the last couple of months.

I hope this input is within the spirit of what you wanted for this thread?

Offline nevin

  • Thread Starter
  • Posts: 1646
  • Location: US
Re: Hand Wiring a Split Keyboard
« Reply #12 on: Thu, 18 May 2017, 03:06:39 »
I hope this input is within the spirit of what you wanted for this thread?

Absolutely. It's part of what we're trying to figure out & document so it's easy to follow, easy to be modified, and easy to be repeated with successful results.

Thank you for your time, patience & input on the subject.

...spent the last couple hours researching... will add more later, have to get back to work.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline tornarchon

  • Posts: 3
Re: Hand Wiring a Split Keyboard
« Reply #13 on: Tue, 20 June 2017, 01:47:43 »
QMK actually already has a really nice script to create the folder/files for a new board. Unfortunately, this script is only for one-piece "traditional" boards. It won't work with a split board without some custom code. This is the part where I hope the community could work toward some "standards". (thank you for starting this thread!)

I recently just finished building and programming a Lets Split - there are actually quite a few guides out there for programming it using QMK (such as https://github.com/CampAsAChamp/LetsSplitWindowsGuide). So I can confirm that it works for 2 piece boards.