Need some advice on building a split keyboard

karlrenard

21 Sep 2016, 10:47

I have successfully built a couple of handwired keyboards, among others the excellent Atomic keyboard.

Now I have started looking at building a split keyboard, with my own design. I am unsure how to go about solving the communication between the two parts.

My first, naïve plan was this: take a look at the Ergodox specs, and see if I could understand enough to use the Ergodox solution for split halves without the pcb, i.e. with hand wiring the electronics. I like the way the Ergodox halves can be connected/disconnected with a detachable cable, and I was thinking that the solution should be usable even with a slightly different layout.

I have a few questions, however. First, the Ergodox site (ergodox.org) seems to be down, and I don't know how to get hold of the pcb specifications.

Second: do you guys think this is a good approach? Are there well-working simpler solutions to connecting two keyboard halves? And would the approach I'm thinking of - to use the electronics from ergodox but hand-wiring the connections - work?

Findecanor

21 Sep 2016, 20:14

Sure it could work.
The I/O expander that the ErgoDox uses has 16 I/O lines on two 8-bit ports. The ErgoDox configures it to use one port for strobing and one port for sensing, thus a maximum of a 8×8 matrix but you don't have to do it that way. Each line is individually configurable either as an input or output so you could configure it a bit differently but then you would have to alter the firmware a bit more.

Here's a circuit diagram that I had found, but I forget who had made it. I don't think it is official... I don't see the capacitor on the I/O expander-side.
circuit-diagram.png
circuit-diagram.png (76.36 KiB) Viewed 5321 times
You could also:
* Use two separate keyboards, each with its own USB cable. It usually works but there are some situations where it doesn't, involving hubs or on MacOS.
* Use a thick or wide cable in-between halves wired directly to the matrix. The first-generation Goldtouch is like this.
In general, the closer the logical matrix is to a square, the less number of signal lines will be needed for the same number of keys.

karlrenard

27 Sep 2016, 10:44

Thank you so much, that was exactly what I needed.

And what do I do with that capacitor? I have seen it described as optional, but other sites say that it's a good idea to include it. I am not entirely sure I have understood where it should be placed. And is there something else required other than connecting it in the right place? In the assembly instructions for the Massdrop ergodox, there is a connection between to pins on the expander that the instructions say should be shorted if the capacitor is used. Is that always the case?

wolfv

30 Sep 2016, 08:53

A decoupling capacitor between the power and ground suppresses noise.
Some keyboards use a capacitor to debounce switches.
Other keyboards use firmware to debounce switches.

If the keyboard half has 24 keys or less, use shift registers.
If the keyboard half has more then 24 keys or has LEDs, use an I/O expander.
Here are some tutorials on connecting split keyboards:
https://github.com/wolfv6/keybrd/blob/m ... yboards.md
https://github.com/wolfv6/keybrd/blob/m ... gisters.md
https://github.com/wolfv6/keybrd/blob/m ... ith_IOE.md

User avatar
mecano

30 Sep 2016, 11:30

wolfv talking about speed do you think there is a benefit in using i/o expander instead of charlieplexing each sides (not talking about others side effects as number of wires and so on)?

Findecanor

30 Sep 2016, 11:49

If you do charlieplexing, I think you will lose rollover.

User avatar
mecano

30 Sep 2016, 13:17

Yes indeed, forgot that, any benefit in using the MCP23017 instead of the MCP23S17?
I have no idea how fast the I2C interface is on the teensy but if running at proc speed that'll be a 6MHz boost.

Findecanor

30 Sep 2016, 14:09

The MCP23S17 has SPI interface instead of I2C. SPI would need two more signal lines in the interconnect cable.
The AVR should support both.

User avatar
mecano

01 Oct 2016, 12:33

Yup wolfv is using this one in his tutorial while the MCP23017 looks more interresting.

edit: didn't read the chip on your schematic, the MCP23018 looks to be basically the same with a 5v tolerant pin, so it's even better, thanks for sharing ;)

wolfv

07 Oct 2016, 01:07

MCP23017 and MCP23S17 are push-pull.
MCP23018 and MCP23S18 are open drain.

MCP23017 and MCP23018 are I2C.
MCP23S17 and MCP23S18 are SPI.

I2C is fast enough for scanning up to 5 rows.
The keybrd_DH (DodoHand) sketch polls 5 rows over I2C at 7.5ms per keyboard scan.
I2C speed is limited by the I/O expander and length of wire (not the controller's speed).

SPI is much faster, but requires 2 additional wires.
I would use SPI if the I/O expander scans more then 5 rows.

climbalima

08 Oct 2016, 23:02

QMK now has support for the Let's Split which uses a pro micro in each hand. It is the easiest to hand wire by far.

Post Reply

Return to “Keyboards”