I am always amazed that keyboards still do this. We have scanning matrices because back when I was a new engineer pins on a microprocessor were both expensive (larger packages) and they required more gates in the CPU (more expensive CPU) or chip doing the scanning. Today transistors are free and surface mount BGA packages can put down a lot of pads pretty simply[1]. So your typical 104 key keyboard could actually have 104 actual wires that the CPU scanned. And even if you don't want to put down a 144 ball BGA (that is only 12 balls by 12 balls, logic is fast enough that you could connect all of the keys to a bunch of serial shift registers, and scan a complete bitstream of all keys 1000 times a second. Easily matching the reaction times of humans.
So where is that keyboard?
Just to be crisp here, an STM32F429 can have 135 digital I/Os in the 208 quad flat pack. It also has a megabyte of flash and 192K of RAM. It also has a USB Phy built right in so you can just wire it up to a USB connector. Its $8 in 1K quantities in that package. So parts : chip, PC board, 120 or so switches and plastic case and key caps. Sure its more expensive than the $0.75 AVR chip they currently use but we're talking high end keyboards here.
Indeed there are now lots of high-end keyboards with no (or effectively almost no) keyboard-matrix ghosting problems. Actually, many of them still have USB-related rollover limitations: it's hard to fathom how someone can design a brand-new USB keyboard with no rollover limitations in the keyboard matrix, price it at $100+, and still not think (or bother?) to implement the obvious multiple-USB-keyboards workaround—looking at you, Razer!—but there you are. Still, you can find ones (like the Sidewinder discussed in the OP) with competent USB, or you can fall back to PS/2 (welcome to the future).
To my mind the interesting problem is how to get NKRO down into every keyboard. I'm sure it's possible with sufficiently clever engineering, but even with an almost-zero cost burden over bog-standard 2KRO this is almost certainly one of those frustrating situations where mass quality is achievable but only if you can get customers and manufacturers to know and care enough.
> Sure its more expensive than the $0.75 AVR chip they currently use but we're talking high end keyboards here.
Would extra PCB layers would be another significant source of increased cost here?
I was amazed when my Das Keyboard came with a USB->PS2 adapter, and said to use the PS2 to get N-key rollover (I think it's limited to 6 on USB.)
I am still slightly amazed every time I remember that the older format is higher spec - although I assume it is something to do with bandwidth on a "serial bus" (especially since most keyboards are forced to run at USB1.1 speed, for some reason).
Anyone who can explain these mysteries is welcome to reply :)
I'm not an expert either, but afaik it's not a speed issue, just an issue of compatibility with USB's standard driver-spec-thingy for keyboards: its authors decided that six keys (plus modifiers, iirc) should be enough for anybody, right?
Which is where the 6 key roll over comes from. However this is really the minimum implementation so that BIOS'es can use USB keyboards. If you read the spec carefully there isn't anything that says you can't implement a different reporting structure, as long as your HID driver is expecting it. My guess is rather than ship "special" keyboard drivers they just use the standard one, and they opt to use PS/2 connectors which work in the same way (they are really just a serial port and can send as many keys as they want) for the 'corner' case of full n-key rollover.
Thank you. So the issue is that Das can't be bothered with coding and maintaining custom drivers for every OS under the sun. I guess that's fair.
Also, I've never actually run into a problem using it over USB on a Mac or PC, so I guess it can't be that bad! (I do play games, but this keyboard goes on my work machine in whichever office that is.)
In the case of a keyboard you would not need more than 4 layers even for a fairly dense ball grid chip because you have lots and lots of space (the keys require spacing) and that lets you run traces fairly circuitously. But a 4 layer PCB is about 2.5x the cost of a two layer board in the designs I've done, and still the cost of the PCB is quite small. (One design I did a two layer version was 0.85 per PCB (4 x 3.5") and when I pushed it to four layers to get down to under 4 x 2" it was $2/PCB so 2.35x the cost.)
The method that some manufacturers are using to obtain NKRO is to have the USB keyboard enumerate as several HID keyboard devices at once, and map physical keys to virtual keyboards.
A serial bus of unique identifier switches (1wire or similar) connecting all the keys with a single loop could be cheaper at scale and solve NKRO. Possibly work on many vastly different (a few buttons to hundreds) product lines with the same ASIC with say only one or two support components per application.
You are correct, that is an nicely elegant solution. You could even use the top of a 'key' chip as the land point for the key, either magnetic or capacitive activation.
"We can stick millions of bytes on an image, but hundreds of small transactions? Too difficult!"
The transistors on an IC are like pixels on an image. Every individual component is a single transaction. Not surprisingly it's way cheaper to transfer an 1MB picture than 100 small requests that each have their own overhead.
It's a difference between the processes they are made with. It would also be expensive to have hundreds of individual transistors. It's the fact that they live in the same packaging and are manufactured at the same moment into the silicon what makes them cheap.
This is funny because the first keyboard I had, back in the 386 days (1992 I think), didn't had this problem. I remember playing two player games on it without any "ghosting". The keyboard was very solid - hard plastic keys and metal backplate. It was nearly indestructible. Even though new keyboards appeared over time, we still used this one for about 12 years, particularly because that all new keyboards had this ghosting issue. I never understood why. After the 12 years space key began to malfunction a bit and we had to throw it out. It was a sad day for us :(.
Which is funny to me because I remember playing Asterax on my Quadra running system 7.1 or something, and my friend Reid and I yelling at each other "stop turning! I need to go forward!" or vice versa.
Nowadays I can't imagine buying a keyboard that shares the same technical limitations. I would consider it ... I don't know, disrespectful to my 12-year-old self, that 20 years later I'd still be dealing with the same dumb problem.
The main issue is cost, as always; the keyboards from that era (IBM Model M and such) cost $100-$150 at the time, which would be even more nowadays. The hardware in those was much more as you'd expect it to be. The technique described in this article is much simpler to make, requires no soldering, etc.
You can splurge on a more expensive keyboard (I have a Filco Majestouch at home) that don't use this cheap techinque and have a much better feel.
I've been looking for the Majestouch NINJA [BrownSwitch/Fullsize/US ASCII] (1). If I find one, I hope I can get the proposal past my minister of finance.
So where is that keyboard?
Just to be crisp here, an STM32F429 can have 135 digital I/Os in the 208 quad flat pack. It also has a megabyte of flash and 192K of RAM. It also has a USB Phy built right in so you can just wire it up to a USB connector. Its $8 in 1K quantities in that package. So parts : chip, PC board, 120 or so switches and plastic case and key caps. Sure its more expensive than the $0.75 AVR chip they currently use but we're talking high end keyboards here.