geekhack

geekhack Community => Keyboards => Topic started by: Solastice on Wed, 20 July 2022, 15:58:46

Title: How to make a vintage keyboard have N-Key Rollover
Post by: Solastice on Wed, 20 July 2022, 15:58:46
I have this old keyboard, and thanks to your suggestions I'm getting a new plate cut for it!
I was entertaining the idea of soldering diodes to the switches and making it have N-key rollover but I'm unsure if it's possible. It's a 5 pin din keyboard, so maybe it only supports 4 key rollover.

It seems the pcb is traced with some commonsense, no weird matrix shenanigans to me (though I'm not exactly qualified to tell). Is it possible? Ideally, I'd like to use the same microcontroller it already has. I figure I just solder one end of the diode to the row and then solder the diode to the trace for the row?

PS Maybe y'all can also ID this keyboard lol. Bought it from an ebay auction but there was no info other than it has white alps lol.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: Findecanor on Wed, 20 July 2022, 16:51:45
No, you can't easily add diodes to an existing PCB not made for it. Controllers work differently for 2-KRO and NKRO matrices, so the existing controller would have to be replaced even if you managed to scratch and reroute traces and squeeze diodes in there.

Your best option might be to hand-wire the switches: That is, mount the switches in the metal plate only and solder diodes and wires directly to the switch legs — and then route the rows and columns to a microcontroller.
That would entail designing a new matrix from scratch, and adapting keyboard firmware to your specific keyboard.

There are a few existing threads with such projects in the Making Stuff subforum, and a bunch of videos on Youtube on handwiring keyboards. Most of them are for Cherry MX-style switches, but it is still done the same way.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: linuxleah on Sat, 24 December 2022, 06:28:32
What about a compromise solution:

1) Add diodes
2) Remove the existing controller
3) Solder the lines from the rows and columns to a new controller (e.g. a Teensy++ or the like) and roll your own firmware using QMK

Wouldn't that work?

Is there really a need to remove the entire PCB? Can't you just gank out the controller and make use of the existing row and column wiring?
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: suicidal_orange on Sat, 24 December 2022, 06:51:16
Can't you just gank out the controller and make use of the existing row and column wiring?
The problem is that both the "rows" and "columns" (don't expect them to actually look like the rows and columns on a DIY PCB...) are directly connected between switches so you would need to cut the trace both sides of the switch.  I'm pretty sure that all the red pins are connected in this pic and the yellow would be all the cuts required to isolate them, being careful not to cut any traces which are connected to the ... I'll call this group a "column" making the other a row (https://cdn.geekhack.org/Smileys/solosmileys/laugh.gif)
[attach=1]

Then you would need to add diodes and link them all together and then link it back to the trace going to the controller (or where it used to be)  Finally you would have to map out the strange matrix and get your head round what's connected to what to put the keys in the right place in the firmware.

At this point it really is easier to just bin the PCB and handwire.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: linuxleah on Sat, 24 December 2022, 07:12:40
Hmm. While obviously the layout of the traces on that board is a mess, won't individual pins on the controller still get wired to individual 'rows' or 'columns'?

In other words: Instead of approaching things from the keys side of things, why not approach it from the controller side? Each pin on the controller talks to some 'row' or 'column', does it not? If so, surely we can approach the problem from that side, yes? Figure out what pin 1 of the controller talks to, then pin 2, then pin 3... map it out from that end?
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: suicidal_orange on Sat, 24 December 2022, 07:21:25
Sure you can map it - I've started doing this by adding the red dots, I could trace it back to the pin on the controller then pick a different colour and repeat until all the pins are mapped.  It would be easier with the actual PCB in hand using a continuity tester, though as they don't even use the left or right pin consistently for this "column" it will take twice as long as on a sane board.  But you still have to do all the careful cutting and make notes of which keys are connected and, having mapped a full size Ducky which did have all left and right pins consistent, I can say it's not much fun.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: linuxleah on Sat, 24 December 2022, 08:27:21
I respect your experience. Yes, it would make more sense to just hand wire it. Thanks for clarifying.

One thing I don't understand is, why exactly would you have to cut any of the traces?

I have been labouring under the assumption that since any given 'row' or 'column' of keys should be attached to one single lead on the existing controller, desoldering and removing the original controller should give one access to 'rows' and 'columns' (though they may not be actual, literal rows or columns, as you noted) that should be ready to use.

What brings in the necessity of cutting traces on the PCB?
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: suicidal_orange on Sat, 24 December 2022, 09:35:16
The diodes are there to stop current from going the wrong way through the switch causing ghosting when you press more than one at once (on a PCB with no diodes but a matrix matching the physical rows and columns holding A and pressing W would also type Q or S depending which way the current is going) - if there's also a trace making the same connection that will bypass the diode so it had may as well not be there.  You could connect a different controller to the existing rows and columns and implement some anti-ghosting in the firmware but it wouldn't be as good as using diodes.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: Leslieann on Sat, 24 December 2022, 11:29:55
The only benefit to modding the pcb is you can re-use the switches (maybe) and the connector (again, maybe).
It's more difficult as you're forced to remove all connections while also not damaging anything you still need and then finding solder points to start fresh.

If you put the pcb asside and just stick switches in your plate and hand wire you can swap switches easier and put the old pcb back in again should you decide you want to. Yes it costs you some money for switches but the amount of effort saved is worth it. Especially should you decide to swap switches later.

Either method is a lot of work, however preserving the pcb is like doing everything twice.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: linuxleah on Sat, 24 December 2022, 21:57:11
Makes sense. I'm sold. I'ma just cut my own plates.
Title: Re: How to make a vintage keyboard have N-Key Rollover
Post by: Solastice on Mon, 02 January 2023, 23:05:14
I appreciate all the replies lol. Yeah, i figured salvaging this old pcb would not be worth it.
Didn't help that the PCB stopped working all together just a week ago :p.

As good of an excuse as any to learn board design with an STM32