VOGONS


First post, by keenmaster486

User metadata
Rank l33t
Rank
l33t

I have found a great deal of information on going the other way around - that is, using a PS/2 or AT keyboard with a USB port on a modern computer.

But what if I want to use my USB keyboard with my retro PC's? I cannot find any information, anywhere, on this! It's almost as if nobody ever wanted to try this!

I know that USB keyboards used to have compatibility with PS/2 if you had the right passive adapter. But I'm pretty sure most modern keyboards no longer have this functionality. The keyboard I'm trying to use is a modern mechanical gaming keyboard.

I cannot find any active adapters that go from USB female to PS/2 or AT male. Perhaps one could be constructed with an Arduino or something?

Anyone else tried to do this before?

World's foremost 486 enjoyer.

Reply 3 of 51, by dr_st

User metadata
Rank l33t
Rank
l33t

While it's true that most modern USB keyboards do not offer PS/2 compatibility, some do. What is your keyboard?

https://cloakedthargoid.wordpress.com/ - Random content on hardware, software, games and toys

Reply 4 of 51, by TheNoOne

User metadata
Rank Newbie
Rank
Newbie

I'm working on a USB keyboard to PS/2 converter using a Raspberry Pi Pico if anybody is interested: https://github.com/No0ne/ps2pico
Currently the return channel (PC->keyboard) isn't implemented yet, so no LEDs on the USB keyboard light up.

Reply 5 of 51, by Repo Man11

User metadata
Rank Oldbie
Rank
Oldbie

I've used USB keyboard→PS/2 adapter→AT adapter before when that was all I had for an old computer, but daisy chained adapters stick out too far so as soon as I had a PS/2 keyboard I used that instead.

"I'd rather be rich than stupid" - Jack Handey

Reply 7 of 51, by TheNoOne

User metadata
Rank Newbie
Rank
Newbie
mrzmaster wrote on 2022-07-17, 20:29:

USB4VC is a pretty cool project.

True! I also backed that project on kickstarter. But if I just want to use only a keyboard I think booting a whole Pi is a bit much, plus the Pico+keyboard can be powered directly of the PS/2 port.

Reply 9 of 51, by adalbert

User metadata
Rank Oldbie
Rank
Oldbie
TheNoOne wrote on 2022-07-23, 18:38:

Great! I bought Pico right after the premiere, but didn't get too much time to play around. I had multple tries with USB/PS2 adapters for mouse or keyboards, but had mixed success, especially with mouse (USB to serial is pretty easy, but PS/2 mouse emulation can be pretty janky). It's really nice that you are working on this project, as such an adapter would be extremely useful (a small and cheap one, no OLED screens, something that just works and can be used in large quantities).

I quickly plotted a board for the transistors and flashed the firmware (BTW I used 3v3 zeners, i think they may be a bit safer). Done some quick testing:

pico-ps2proto.jpg
Filename
pico-ps2proto.jpg
File size
74.98 KiB
Views
2805 views
File license
Public domain

- Keyboard adapter works with Dell C840 (Pentium 4) laptop. Caps/numlock LEDs don't work (as expected), but the functions do work
- With my i7 6700K PC (it still has PS/2 port) the keyboard adapter didn't work. But the LED on the Pico was flashing as I was pressing the keys. And the Num-lock LED did lit up on the keyboard (?) for some reason
Note: I am using 1 meter long PS/2 cable. It is shielded with ground connected to the shield, but maybe that may be an issue.

I already started designing a PCB with full sized USB (wires from the test pads would need to be routed) that could be piggybacked on the Pico:

picousbps2.png
Filename
picousbps2.png
File size
47.73 KiB
Views
2805 views
File license
GPL-2.0-or-later

Do you think it would be possible to adapt the code to also work with USB mouse? And would be combo mouse/keyboard operation be possible (with additional GPIO/transistors)? There is only one USB port on Pico, but I'm thinking about using Logitech Unifying wireless mouse/keyboard combo sets, or some other wireless mouse/keyboard combos. If yes, I could add additional transistors and PS/2 header to the PCB design.

BTW the new wireless Pi Pico W could give some interesting possibilites of remote control of the old machines.

Repair/electronic stuff videos: https://www.youtube.com/c/adalbertfix
ISA Wi-fi + USB in T3200SXC: https://www.youtube.com/watch?v=WX30t3lYezs
GUI programming for Windows 3.11 (the easy way): https://www.youtube.com/watch?v=d6L272OApVg

Reply 10 of 51, by TheNoOne

User metadata
Rank Newbie
Rank
Newbie

Wow, a custom PCB, cool!
I didn't find any open source projects with easily available parts that do this, so I tried with a Pi Pico.
(might be that normally Arduino boards don't support USB host mode)
As I'm not an engineer there are still quit some hardware and software bugs left. I only have a logic analyzer and I need to buy an oscilloscope to see the wave form transitions.

Keyboard adapter works with Dell C840 (Pentium 4) laptop. Caps/numlock LEDs don't work (as expected), but the functions do work

LEDs should work on the first release version 0.1

With my i7 6700K PC (it still has PS/2 port) the keyboard adapter didn't work. But the LED on the Pico was flashing as I was pressing the keys. And the Num-lock LED did lit up on the keyboard (?) for some reason

The Pico LED should always flash if you press or release a key. If not then the keyboard wasn't detected by the Pico. This sometimes happens, don't know why, maybe there is a capacitor needed on 5v or I'm not using the TinyUSB library correctly? Replugging the USB keyboard should fix this.

I think the input stage with the zener diodes isn't optimal as I also had mixed results. I only did static voltage measurements using a multimeter but I couldn't see how the transitions look like. Maybe we should try something with a BSS138? https://duckduckgo.com/?q=level+bss138&t=h_&i … mages&ia=images

You can test if its the input stage by disconnecting GPIO 14, 17 and the zener diodes and pulling the GPIOs to 3.3V.
That way only the output side is working, but this might also be a problem as there are no ACKs replied to host requests.

Do you think it would be possible to adapt the code to also work with USB mouse? And would be combo mouse/keyboard operation be possible (with additional GPIO/transistors)?

Yes! It should be possible using only one Pico for both devices as TinyUSB supports multiple devices and hubs.
I also found out that all my USB mice with the PixArt chip still do native PS/2 using the green passive adapter!
E.g. the official Raspberry Pi Mouse or the Microsoft Basic Optical Mouse

There is only one USB port on Pico, but I'm thinking about using Logitech Unifying wireless mouse/keyboard combo sets, or some other wireless mouse/keyboard combos.

Ah interessing, I'll have to check how such a receiver appears on the USB side.

BTW the new wireless Pi Pico W could give some interesting possibilites of remote control of the old machines.

Also thought about that! I already have a Pico W at home, will try it some time.

Reply 12 of 51, by Lylat1an

User metadata
Rank Member
Rank
Member

I'm using a Tripp-Lite adapter for my Retro Rig, it's not easy to find these days: https://www.tripplite.com/ps-2-to-usb-converter~0dt60002

I have it hooked up to a USB KVM and a Soarer's Converter as well.

Reply 14 of 51, by lti

User metadata
Rank Member
Rank
Member

That Tripp-Lite converter looks nice, and there are a decent amount of US sellers (I don't know about the rest of the world). It seems a little expensive, but it isn't too far off from some of the hobby projects (like the one above that wastes a full Raspberry Pi just for the USB host functionality).

The Raspberry Pi Pico looks like a nice option. I think it would also work as a PS/2 or serial mouse converter as well. If it will work with a USB hub, you could even make it do both at the same time. I think it's a lot more powerful than you need, but it's $4.

Reply 15 of 51, by TheNoOne

User metadata
Rank Newbie
Rank
Newbie
TheNoOne wrote on 2022-09-11, 16:34:

The keyboard+mouse variant is ready for testing: https://github.com/No0ne/ps2x2pico/releases/tag/alpha-0.2

It does work with a hub! Soon I'll test a logitech unifying receiver for a wireless kb/ms combo.

Reply 17 of 51, by dekkit

User metadata
Rank Member
Rank
Member
TheNoOne wrote on 2022-09-13, 06:13:

@adalbert successfully tested a logitech unifying receiver: https://raw.githubusercontent.com/No0ne/ps2x2 … co/main/hw4.jpg

Excellent project btw - i'm building two at the moment but they are not working - i am assuming my level shift circuit is borked.

- i just want to confirm can i use a 1N4729 Zener Diode for this (3.6v 1W)?
- the cathod side of the diode is facing GPIO 14
- what keyboards have been confirmed to work

I think its my wiring but everything seems to map ok, so i'm thinking either my parts of wired something incorrectly.

any assistance appreciated! - fyi i'm referencing this on your github

schematic of level shifter.png
Filename
schematic of level shifter.png
File size
7.11 KiB
Views
2368 views
File license
CC-BY-4.0

Reply 18 of 51, by TheNoOne

User metadata
Rank Newbie
Rank
Newbie
dekkit wrote on 2023-01-21, 12:25:

- i just want to confirm can i use a 1N4729 Zener Diode for this (3.6v 1W)?

yes, that should be ok

dekkit wrote on 2023-01-21, 12:25:

- the cathod side of the diode is facing GPIO 14

correct, the marking on the diode faces the GPIO pin

dekkit wrote on 2023-01-21, 12:25:

- what keyboards have been confirmed to work

I've tested it with a PERIBOARD-106 M and a Logitech Wireless keyboard using a Unifying receiver.

Please measure the voltage you get on GPIO 14/17, should be above 2.5V. Maybe the pullup resistor on the motherboard is not low enough? Also, is the Pico LED blinking when you pressing keys?
You could also build the ps2x2pico project using an off the shelf logic level converter and just connect the keyboard part. But the firmware can not be mixed up as the transistor circuit is inverting the bits and the bidirectional logic level converter is not!