How many people still have a PS/2 keyboard kicking around in 2020? Admittedly asking such a question of the Hackaday audience is probably cheating (there’s a decent chance one of you will type a comment on one just to prove a point), but even the most pedantic reader has to admit that it’s a long dead standard. So we’re hardly surprised to hear that [Turbaned Engineer] didn’t have one handy when he tried to boot a motherboard so old that he couldn’t access the BIOS with a USB keyboard.
But rather than waiting for an adapter to show up in the mail, he decided to rig up an Arduino Nano to mimic a PS/2 keyboard just long enough for him to navigate the system configuration. Since that basically meant he only needed the arrow keys and Enter, he was able to rig up a handful of momentary buttons to serve as input. We wouldn’t recommend typing out your memoirs with such a spartan board, but it’s certainly good enough to juggle around the order of boot devices.
The fun didn’t stop there, though. [Turbaned Engineer] also had to clean some corrosion and fix a blown resistor on a bank of RAM to drag this old soldier over the finish line. He didn’t have a case handy, so he made a free-form one using the polycarbonate packaging that ICs ship in. The final machine isn’t exactly a sleeper, but it’s good enough to play Super Mario Bros. 3 on the TV.
At the end of the day, the minimal input device [Turbaned Engineer] put together isn’t so far removed from other homebrew keyboards we’ve seen recently. It seems that QMK even has some basic support for the PS/2 interface. Not that it would come up very often, but a “retro” mode might be an interesting addition to your next custom keyboard build.
47 thoughts on “Arduino Gets Old PC Booted And Back Into Action”
DIN keyboard here, PS/2 is too modern for me.
DIN 5 or DIN 6? Both connectors are DIN.
I have one that’s a DIN 8
From the article:
> Fiber optics to carry the Power and HDD light to the panel.
I like his style!
QMK doesn’t support emulating a ps2 keyboard, its support is limited to ps2 host for trackballs and mice.
With the delays in shipping these days, waiting for an adapter is an exercise in patience. Good thing the hacker here didn’t need to order an Arduino, switches, breadboard and a connector. How well is your hacker lab equipped? Of course, my lab has plenty of that and even several PS/2 Keyboards (yes, I’m typing on one now). In fact, my KVM switch is PS/2 and I use adapters to go the other way. But that’s not the point here. It’s clear that the Arduino is a fun controller and solves a lot of problems. Another possible hack would have been to use the serial port of the Arduino to accept characters from a terminal then convert to PS/2. The ultimate hack would be to use the USB port on the Arduino to fully convert a USB keyboard to PS/2. Why stop the fun at just a few switches?
He had an arduino Nano, so no USB Host for a self-made adapter. With other Arduinos/ compatible boards with USB Host feature that should totally work.
When I got a refurbished i7 in 2016, I chose to make sure it had ps/2, VGA, and serial ports. I use the first two, though it turned out I haven’t used the serial port (or the parallel port).
It has no floppy disk connector, I decided I could live without that, though I still have the previous two comouters, and they have floppy drives.
There are still die hard gamers thinking that PS/2 has lower latency. :P
While PS/2 may have lower initial latency, but it takes longer to transmit a packet if the key stroke sequence is longer than 1 byte. i.e. some of the keys and key release. USB 2.0 full speed can have much lower polling intervals and much faster transmission vs the 10-20kbps speed.
The hardware is there in the Super I/O chip even when the motherboard vendor no longer bother to have connectors for them. They monitors voltages, fan speed control, serial, parallel port, PS/2 and even include diag LED on some.
I don’t know if it is still the case, but PS/2 keyboards used to be used on secure machines with USB disabled to prevent storage devices being attached.
Quite a few super I/O chips have ditched the parallel port in order to save on pin count. The serial port is likely to stay for a very long time because of how useful it is for low level debugging, albeit without most of the handshaking lines – might still have RTS/CTS if you’re lucky.
i think its the usb stack that is the real slow down. old skool ps2 was interrupt driven so it was a lot faster.
of course usb is lighting fast these days and the usb stack isnt really that much of a monster to such fast hardware as what we now use.
someone probably already scienced this.
Standard USB keyboards don’t support n-key roll-over. PS/2 sends make-break codes, while USB sends a fixed length data packet which holds the status of six arbitrary codes. The keyboard cannot send more/longer codes, so additional keys are ignored.
One thing is the fact that PS/2 causes a hardware interrupt, whereas USB keyboards use software polling. It’s slower to transmit subsequent key presses, but due to the PS/2 protocol, the keyboard doesn’t have to wait to start transmitting – it simply starts transmitting as soon as it registers a key change.
The default USB polling rate causes an average 4 ms and a maximum of 8 ms extra delay, plus the command delay, because the host computer has to tell the keyboard to start sending the data.
That’s no longer the case with xHCI.
“The xHCI reduces the need for periodic device polling by allowing a USB 3.0 or later device to notify the host controller when it has data available to read, and moves the management of polling USB 2.0 and 1.1 devices that use interrupt transactions from the CPU-driven USB driver to the USB host controller. EHCI, OHCI, and UHCI host controllers would automatically handle polling for the CPU if there are no changes that need to be made and if no device has any interrupts to send but they all rely on the CPU to set the schedule up for the controllers. If any USB device using interrupt transactions does have data to send, then an xHCI host controller will send an interrupt to notify the CPU that there is a USB interrupt transaction that needs handling. Since the CPU no longer has to manage the polling of the USB bus, it can spend more time in low power states.”
I could be missing something, but what you wrote sounds to me like it’s for saving power on the CPU, not for reducing latency on the protocol side?
Until my most recent move I kept (and used) a collection of IBM model M keyboards with the AT DIN connector, even older than the ps2 interface…
Okay, since you asked for it, this is being typed on an NMB RT-101+INTEL keyboard from 1994. It has an AT connector with a PS/2 adapter to plug into my computer.
What a youngster that keyboard is.. My two most used KB are older than I am, and still giving a nicer typing experience than anything more modern I’ve tried.. Some of the newer mechanical keyswitch designs are damn good though..
I did actually have to select a motherboard when replacing my failed one very carefully so I can just go on using the nice keyboards.
Let the pedantry begin!
I have at least 4 keyboards on a shelf downstairs featuring the original DIN connector (https://upload.wikimedia.org/wikipedia/commons/7/75/DIN_Keyboard_Connector.jpg).
Of the keyboards in use 2 of them are true blue IBM model M’s (which never wear out) and 2 are replicas.
I have a box of ps/2 kbs and mice in the junk pile. I threw out an old ibm kb way back and I’m still kicking myself over it.
I’ve kept an AT keyboard w/ PS2 adaptor handy for tackling problems on old machines. Only need it once or twice a year but it gets used even in 2020
The kyb is question I’m not sure of its model. It’s an early 90s knockoff of a better mechanical model – and is mechanical itself. Came to me from an adult student who was boarding with my parents. He left them his whole PC when he moved out thinking they could use it, I ended up giving it to my employer for a site where an ancient ADM5 terminal had died – us techs wanted to preserve the clackity-clack experience.
We lost that contract and the site was decommissioned at a later date. I’d heard that the PC got moved to a another facility with similar equipment – in another city. Didn’t really care but I would have taken that keyboard if I had the chance.
About a decade went by and I was in that city installing a different type of equipment at a different site, and it involved decommisioning some old gear. And there was that old PC sitting there as a maintenance terminal, looking quite a bit worse for wear. Since the install included new maintenance PCs, I got to take my keyboard back.
And if anyone is wondering, yes that ADM5 terminal was saved from the bin – it still resides in the company’s “history” cabinet in reception, next to the valve radios and gigantic hardrives etc.
Why do you guys put all the [names] in [brackets]? It’s ugly and [annoying].
They always have. If I had to guess, I would say its because some people have really weird handles and if you don’t put them in brackets, you’d get sentences that don’t make sense.
200 watts to play Mario.
mmmmm bad luck… Mother board no so much old since it has 4 Sata ports on it. USB support should be arround at that time isn’t it?
There are many motherboards that have USB, but still require a PS/2 keyboard to work with the BIOS. USB hardware was included on motherboards long before support was ever included in a BIOS, and it was long after that before all motherboards included BIOS USB support.
I was talking about harddrive SATA ports on the mother board. they where +/- after the USB BIOS support. But I was not abble to found a proper timeline on the web to see the level of bad luck here… ;-D (more to see level of my wrongness)
My desktop keyboard is branded “Leading Edge”, found it in the trash, works perfectly, it is an AT keyboard connected through a PS/2 adapter. It is cool to type on having all Alps switches.
I wanted to “one up” the challenge, but I can’t seem to put my hands on an RJ11 to PS/2 converter at the moment. Why must they always change the standards? What was wrong with RJ11? Spare cables were ubiquitous!
Who used rj11 for keyboards? Something in Eurooe?
The HP150 used an odd keyboard connector, can’t remember what. The Mac Plus had something like the rj11. Maybe DEC terminals? But they’d not have”proper” keyboards.
I’ll give you a hint:
64K, dual 5-1/4″, and….(ahem), “portable”…(cough, cough).
yep I definately had some old terminal that used RJ11 for keyboard, went in the bin with a hoard of stuff that I now regret letting go.
From your wording, it sounded like an “IBM compatible” with an odd connector.
Except if a keyboard put out ascii, there really was no standard before the IBM PC. The connector is irrelevant, the codes aren’t compatible.
I think I still have a surplus keyboard with no matrix, just the keyswitches mounted on a metal panel. I wired it up to use with my Radio Shack Color Computer. I do have a pre-AT keyboard, which doesn’t put out the right codes (though the same form as at keyboards). I might still have my Mac Plus keyboard.
But having junk around isn’t the same thing as having old hardware that still works with current computers.
Go back a little further, to when the floppies and the mains current feeding it were the only things compatible with anything, that is, if you knew how to reformat the floppies, anyway.
Here’s a giveaway: Arthur C. Clark used one to coordinate between Sri Lanka and his Los Angeles liaison during production of “2010”.
The IBM Portable Personal Computer used an RJ11 connector for its keyboard… Memories!
let me count… 4. I have 4 PS/2 keyboard at home. If i dig in the basement, maybe also a old IBM keyboard with DIN bus.
i haven’t purchased a keeb since the 90s. im using this old dell keyboard i found in the dumpster. i did find a mechanical corsair keeb in a dumpster, but i havent got around to cleaning it yet (im not even sure how, never cleaned a mechanical), so it resides on my shop computer.
I have a Sandy Bridge era ASUS mainboard that was future-thinking and got rid of the PS/2 port completely… only there’s a bug in the UEFI that’s never been fixed where it doesn’t detect a keyboard if it’s missing the numeric keypad.
So I have my 10keyless main keyboard, and some random $8 Logitech piece of crap plugged in and then any keyboard opens the UEFI just fine. 🤦♂️
How did these USB to PS/2 adapters work? I sort of imagined that all USB-keyboards actually can start i a electrical PS/2 mode provided it’s connected through the adapter.
If it’s a passive USB to PS/2 adapter it literally just re-routes the USB wires to a PS/2 connector. i.e. 5V, GND, D+, D- on the USB socket get connected to 5V, GND, CLK, DAT on the PS/2 plug.
Then, when the microcontroller in the USB device starts up it detects whether it is plugged into a USB host or not. If it is, it starts up the USB interface on D+/D-, otherwise it uses the same pins as CLK/DAT for PS/2 communication.
It is device-specific. Not all USB devices have this dual-mode capable firmware.
I assume it was just humour in the article that one of us would be typing on a ps2 keyboard.. I think many of us would be – I still have prob 50/50 ps2/usb keyboards here..
Ps2 just works on everything. you don’t need any bios or os support, and they work year after year after year…
I’m surprised the person in this article just didn’t go get one off the shelf, or ring a friend for one… Or even just get an adapter out of the draw (I’d have at least 10 of them).
As much as I enjoy a good hack, which this is — and as much as I applaud the dude’s inventiveness and persistence…
This was absolutely a job for a run to a nearby Goodwill or thrift shop. A fiver (two at the most) and a few minutes on the bus (or Uber / Lyft / local service / etc) would’ve done this in in a total of maybe 30min to a full hour.
A commendable hack, for a hacks sake, but a quick check on Amazon would have turned up a whole host of PS/2 keyboards and adapters.
Keyboard Error: Press F1 to continue
Almost all laptops still use PS/2 inside for keyboard communication.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)