# PS/2 keyboard with RS232 (DB9) workstation port

I'm currently awaiting for dispatch/delivery of a 1995 PS/2 Model M keyboard w/attached flat cable but a missing PS/2 plug

It seems those flat cables were not very sturdy. (Yes, I checked the model number, it's PS/2).

Once cleaned up and checked out, my guess is the two easiest/least $choices would be: 1. replace the original cable with a new one and use an active PS/2 -> USB converter. 2. crack open the above converter, hard wire it to the existing controller inside the keyboard case and wire in a nice USB cable with or without a socket. But while looking through the collection of things I have stubbornly refused to throw away every year, I came across two things which at different times held permanent residence in my sack along with the rest of my gear: 1. a PS/2 to serial adaptor I think it was original issue with the early Microsoft Serial Mouse 2.0 which had a PS/2 plug. 2. a USB Prolific PL2303 Serial Port board (invaluable) Eventually cannibalised from it's original junction box and hard wired into my Palm III's sync base so as to make it USB instead of serial. Since my Sun Ultra 24 workstation has an on-board RS232 which at some time in the past I enabled in BIOS and properly set up to use my serial data-logging hardware ... ~$ sudo dmesg | grep -i tty
--- snip ---
[1.821872] 00:02: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
--- snip ---
~\$

... and the PS/2 -> DB9 adaptor has this pinout:

https://i.stack.imgur.com/t12O8.gif

Would it be possible to wire the PS/2 Model M with a DB9 plug and directly use my workstation's serial port, like it was possible with the PS/2 mouse?

ie: I'd avoid converting PS/2 to USB and solve the current draw issue some PS/2 keyboards have and free a USB port.

Software wise, it would be (?) a question of loading the now blacklisted PS/2 module in my Linux Devuan installation.

I'd appreciate your input.

That PS/2 to serial adapter is meant only for mice that already have support for both PS/2 and RS232 interfaces built in, so the adapter only needs to connect correct wires to correct pins, so it does no signal conversion.

There is no way such an adapter or equivalent cabling can work with your PS/2 keyboard which has no built-in support for RS232 interface.

If you're not averse to building some hardware and possibly writing a driver of your own, you might be able to make something work ... but I think that's going to be a lot of work.

The PS/2 keyboard interface is "just" a start bit, 8 data bits, odd parity, and a stop bit, with each bit synchronized to a clock signal. (See, for example, https://www.youtube.com/watch?v=7aXbh9VUB3U where someone goes through how to plug a PS/2 keyboard into their breadboard 6502 computer.) But it won't work with a serial port because of that clock signal -- an RS232 serial port expects the data bits to be sent at a fixed frequency. (It also expects the electrical levels to be +/-12V, not +5/0V. Most serial driver chips do this level translation for you though.)

It may be possible to read the bits coming out of the keyboard into a shift register, then connect the shift register's output to a 16550A chip, then connect that UART to the serial port of your computer. (Assuming the 16550A output voltages are correct.) But I don't know if the "serial keyboard" driver will work with that electrical-level translator, or if it would also require changing the data coming from the keyboard.

And, I don't know if such a "serial keyboard" driver even exists. It won't be the ps2 driver, I don't think, unless that driver has options to read from a serial port instead of the PS/2 hardware.

Even if a serial keyboard driver does exist, the potential data inconsistency is why you might need to write a driver as well. (Or stick a microcontroller in between the shift register and the 16550A ... or use the microcontroller's UART.) If the serial keyboard driver is expecting the same data from the keyboard as the PS/2 port sends (that is, a series of 8-bit scan codes), then it will work fine to design and build some kind of converter.

• Hello: thank you (both) for taking the time to enlighten me with respect to this. I did have a vague idea that this could would be problermatic. I guess my best bet is to use the active PS/2 -> USB adapter. Cheers, G May 30 at 13:59

Thank you (both) for taking the time to enlighten me with respect to this.

I did have a vague idea that this could would be problematic but ignored the PS/2 to serial adapter was 'only' for devices with built in support for RS232 and PS/2.

So that settles it.

As I need a simple and straightforward solution, I'll use the only one that fits. ie: an active PS/2 -> USB adapter.

Cheers,

G.