VOGONS


HIDman - USB to PS/2 converter (Open Source)

Topic actions

First post, by rasteri

User metadata
Rank Member
Rank
Member

I'd like to announce an open-source project I've been working on for the last month.

It's a small dual-port USB HID-to-PS/2 converter that supports USB Keyboards, Mice and Game Controllers. That means you can connect a gamepad to your DOS PC and have it emulate a keyboard. This is (IMO) super useful for old games that don't support joysticks, or have limited support.

HIDman will autodetect devices on either USB port, and will happily work with composite devices too - those little USB wireless combined mouse/keyboard dongles are a great choice.

IMG_20220901_165352~2.jpg
Filename
IMG_20220901_165352~2.jpg
File size
566.18 KiB
Views
5951 views
File license
Public domain
IMG_20220901_165402~2.jpg
Filename
IMG_20220901_165402~2.jpg
File size
433.86 KiB
Views
5951 views
File license
Public domain
IMG_20220903_141133~2.jpg
Filename
IMG_20220903_141133~2.jpg
File size
762.77 KiB
Views
5951 views
File license
Public domain

It's based on the CH559 from WCH, which is a great little chip for USB devices. The firmware is still under development but it works on all the PCs I've tried it on and I'm very keen to get it tested on some more. Support for serial mice and AT keyboards should be easy to implement - I'm already planning these features.

I know there are a few USB to PS/2 converters available already, but none of them supported all the features I wanted, and the CH559's dual USB ports give it a very low part count (and thus cost). I may sell some of them once I get the firmware a little more finalized.

Full source for the code, PCB, and enclosure is available in Github - https://github.com/rasteri/HIDman
It's heavily based on this project - https://github.com/atc1441/CH559sdccUSBHost

Last edited by rasteri on 2022-09-18, 23:25. Edited 1 time in total.

Reply 2 of 224, by Zup

User metadata
Rank Oldbie
Rank
Oldbie

Can it work with multi-keyboards (my keyboard is NKRO, and to achieve that it presents itself as multiple devices?

Also, old Amstrad keyboards used a proprietary protocol... could it be supported?

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 3 of 224, by rasteri

User metadata
Rank Member
Rank
Member
DerBaum wrote on 2022-09-03, 16:08:

Maybe think about adding XT keyboard output if its possible. They are super rare.

It should be relatively simple to do this. I'll maybe reach out to some local retro computer groups and see if anyone has an XT I can borrow.

Zup wrote on 2022-09-03, 16:48:

Can it work with multi-keyboards (my keyboard is NKRO, and to achieve that it presents itself as multiple devices?

I'm not sure currently, but if not it certainly could be made to. I'll grab an NKRO keyboard at some point to test with.

Also, old Amstrad keyboards used a proprietary protocol... could it be supported?

You read my mind - I have a PC1640 that really needs a new keyboard, so supporting Amstrads is a high priority for me 😀

Reply 4 of 224, by DerBaum

User metadata
Rank Oldbie
Rank
Oldbie
rasteri wrote on 2022-09-03, 16:55:
DerBaum wrote on 2022-09-03, 16:08:

Maybe think about adding XT keyboard output if its possible. They are super rare.

It should be relatively simple to do this. I'll maybe reach out to some local retro computer groups and see if anyone has an XT I can borrow.

That would be great!
I own a Schneider Euro XT and i did not get a keyboard with it.
If you are in germany i would be happy if i could help you by borrowing the XT to you for your experiments for as long as you need it. (of course i will borrow it to everywhere but shipping would be expensive...)

FCKGW-RHQQ2

Reply 5 of 224, by rasteri

User metadata
Rank Member
Rank
Member
DerBaum wrote on 2022-09-03, 17:04:

I own a Schneider Euro XT and i did not get a keyboard with it.

I was going to say... how did you not get a keyboard with a EuroPC?! But then I googled and I never realised there were desktop versions. Nice looking computer!

Does it speak normal XT keyboard protocol? I know some Schneider computers were based on Amstrad ones

Reply 6 of 224, by DerBaum

User metadata
Rank Oldbie
Rank
Oldbie
rasteri wrote on 2022-09-03, 20:05:

Does it speak normal XT keyboard protocol? I know some Schneider computers were based on Amstrad ones

I actually dont know... I tried a AT Keyboard and it did not work.
So i assumed it needs a XT Keyboard (idea based on the XT name).

I just see pictures of working Euro XTs with the original keyboard. Maybe its special...
SCHNEIDER-CHERRY-Tastatur-f%C3%BCr-Euro-PC-XT.jpg

EDIT:
I just found this website wich shows it with another (probably generic) keyboard
https://oldcrap.org/2022/02/12/schneider-euro-xt/

OH NO i just saw the Varta Battery... I have to dig it up and remove it as soon as possible...

FCKGW-RHQQ2

Reply 7 of 224, by rasteri

User metadata
Rank Member
Rank
Member
DerBaum wrote on 2022-09-03, 20:14:

I actually dont know... I tried a AT Keyboard and it did not work.
So i assumed it needs a XT Keyboard (idea based on the XT name).

Looks like it's based on the FE2010A, so yeah probably needs an XT keyboard.

I'll hit you up if I can't find anything local by the time I want to do XT keyboards.

Reply 9 of 224, by keropi

User metadata
Rank l33t++
Rank
l33t++

very nice, this will be super-useful once it has serial support as it will be truly universal

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 10 of 224, by rasteri

User metadata
Rank Member
Rank
Member
carlostex wrote on 2022-09-14, 05:53:

This is pretty awesome. I just wish it did game controllers converting to a normal gameport.

If this design works well then I might consider adding analog joystick support to a future revision. I wonder if it would be possible to fake the analog joystick without digipots by using careful timing...
(would still require a new board design though, maybe I do a "HIDman pro" later 😀 )

keropi wrote on 2022-09-14, 06:55:

very nice, this will be super-useful once it has serial support as it will be truly universal

Thanks! PS/2 to DB-9 and DIN-5 adapters are plentiful so I don't think it'll even require a new board

Reply 11 of 224, by tabm0de

User metadata
Rank Member
Rank
Member
keropi wrote on 2022-09-14, 06:55:

very nice, this will be super-useful once it has serial support as it will be truly universal

Thanks! PS/2 to DB-9 and DIN-5 adapters are plentiful so I don't think it'll even require a new board

Just a intresses question, how will the power be designed for it? will it just be taking power from keyboard slot? unsure as I guess a serial interface might not be able to power it and will that be enought to power usb devices?

naa, nothing yet...

Reply 12 of 224, by rasteri

User metadata
Rank Member
Rank
Member
tabm0de wrote on 2022-09-27, 06:34:

Just a intresses question, how will the power be designed for it? will it just be taking power from keyboard slot? unsure as I guess a serial interface might not be able to power it and will that be enought to power usb devices?

Serial mice were powered from the serial port, but that was a bit hacky (it used data pins as power pins) so I'll probably just power everything from the keyboard port.

Old keyboards typically use a lot more power than modern ones so I don't think that'll be a problem, but I've put a polyfuse on the board so that will hopefully prevent any nastiness. Certainly I wouldn't go using any sun-level-brightness RGB boards but a standard keyboard with three status LEDs will be fine 😀

Now that I think about it though, I will need to add voltage level translators for the serial port. Not a problem for power consumption, but it will mean a board respin. My plan is to do a second "HIDMAN AT/XT" version with DIN5 and DE9 connectors.

Reply 13 of 224, by TheNoOne

User metadata
Rank Newbie
Rank
Newbie

The case design is very cool!

I also started a USB keyboard/mouse converter accidentally at the same time 😁
Mine uses a Pi Pico, but I don't have a custom PCB or case.

Keyboard only: https://github.com/No0ne/ps2pico
Keyboard+Mouse: https://github.com/No0ne/ps2x2pico

Reply 14 of 224, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
rasteri wrote on 2022-09-27, 09:52:
Serial mice were powered from the serial port, but that was a bit hacky (it used data pins as power pins) so I'll probably just […]
Show full quote
tabm0de wrote on 2022-09-27, 06:34:

Just a intresses question, how will the power be designed for it? will it just be taking power from keyboard slot? unsure as I guess a serial interface might not be able to power it and will that be enought to power usb devices?

Serial mice were powered from the serial port, but that was a bit hacky (it used data pins as power pins) so I'll probably just power everything from the keyboard port.

Old keyboards typically use a lot more power than modern ones so I don't think that'll be a problem, but I've put a polyfuse on the board so that will hopefully prevent any nastiness. Certainly I wouldn't go using any sun-level-brightness RGB boards but a standard keyboard with three status LEDs will be fine 😀

Now that I think about it though, I will need to add voltage level translators for the serial port. Not a problem for power consumption, but it will mean a board respin. My plan is to do a second "HIDMAN AT/XT" version with DIN5 and DE9 connectors.

Some recent Corsair keyboards do consume a lot of power (mainly for its RGB), that they made their keyboard connectors use USB 3.0 (so the keyboard can draw up to 900mA from the port instead of 500mA), despite most of the internal stuffs remain USB 2.0. Those keyboards will show signs of insufficient voltage when connected to USB 2.0 ports/hubs, or underpowered USB 3.0 ones, and can be a hit-or-miss to work in such environments. When connected to a USB 3.0 hub with a reliable 12V power supply, such keyboards will work stable even if the hub's connection to the host PC is only USB 2.0.

Gaming Keyboards, especially those equipped with LED, consume a lot more power for its own operation than normal ones, but not as much power for communication with the host, so if the keyboard is behind a sufficiently powered hub there would be less burden to the converter, but I don't think the converter could drive such keyboards directly.

Still, this looks like some interesting development... It might be helpful with PS2/USB KVMs (that can accept both PS/2 and USB keyboard or mice, and can output as either), as these KVMs still can't properly handle complex USB gaming keyboards/mice and only simple USB ones would work as intended.

Reply 15 of 224, by tabm0de

User metadata
Rank Member
Rank
Member
TheNoOne wrote on 2022-09-27, 19:11:
The case design is very cool! […]
Show full quote

The case design is very cool!

I also started a USB keyboard/mouse converter accidentally at the same time 😁
Mine uses a Pi Pico, but I don't have a custom PCB or case.

Keyboard only: https://github.com/No0ne/ps2pico
Keyboard+Mouse: https://github.com/No0ne/ps2x2pico

I was checking those out 😀 before i asked in the forum 😀 i will make one just need to find a mouse to cut so i have the later ps/2 cables with colors and icons 😜

naa, nothing yet...

Reply 16 of 224, by rasteri

User metadata
Rank Member
Rank
Member

I could actually use the same tiny enclosure for the serial version if I made people use an RJ45->DE9 cable (which are very commonplace)

Attachments

Reply 17 of 224, by keropi

User metadata
Rank l33t++
Rank
l33t++
TheNoOne wrote on 2022-09-27, 19:11:
The case design is very cool! […]
Show full quote

The case design is very cool!

I also started a USB keyboard/mouse converter accidentally at the same time 😁
Mine uses a Pi Pico, but I don't have a custom PCB or case.

Keyboard only: https://github.com/No0ne/ps2pico
Keyboard+Mouse: https://github.com/No0ne/ps2x2pico

this is also nice, it deserves it's own thread IMHO

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website