VOGONS


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

Topic actions

Reply 480 of 514, by rasteri

User metadata
Rank Oldbie
Rank
Oldbie
keenmaster486 wrote on 2025-02-25, 20:33:

Any suggestions for a basic USB switch that works with HIDMAN? I tried this one: https://www.amazon.com/Switcher-Computers-Key … e/dp/B0CHY8L11W with no luck. My keyboard works fine when connected directly, but not through the switch.

Have you tried the latest beta? - https://github.com/rasteri/HIDman/releases/tag/v1.1.5g

We changed some stuff in the hub init code that might fix your problem.

Failing that I'll maybe buy one of those hubs and see what the issue is

Reply 481 of 514, by keenmaster486

User metadata
Rank l33t
Rank
l33t
rasteri wrote on 2025-02-26, 08:23:

Have you tried the latest beta? - https://github.com/rasteri/HIDman/releases/tag/v1.1.5g

We changed some stuff in the hub init code that might fix your problem.

Failing that I'll maybe buy one of those hubs and see what the issue is

That worked. Thanks very much.

Note: I had to install and run the tool as root to write the firmware on Linux. Otherwise it couldn't find the USB device.

World's foremost 486 enjoyer.

Reply 482 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member

Hey @rasteri

I'm building one of these and my RGB diodes are wrong...

The attachment Screenshot 2025-03-04 193100.png is no longer available

I bought this part

https://www.digikey.co.uk/en/products/detail/ … RRGBCC3/1784918?

but the pinout is wrong...

The attachment Screenshot 2025-03-04 193249.png is no longer available

Do you know where I can source a small quantity of the correct diodes or a suitable alternative (delivered in to the UK)?

https://jlcpcb.com/partdetail/TUOZHAN-P4_1204 … _1_5TA/C2827295

The attachment Screenshot 2025-03-04 193323.png is no longer available

Reply 483 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member
Lostdotfish wrote on 2025-03-04, 19:37:
Hey @rasteri […]
Show full quote

Hey @rasteri

I'm building one of these and my RGB diodes are wrong...

The attachment Screenshot 2025-03-04 193100.png is no longer available

I bought this part

https://www.digikey.co.uk/en/products/detail/ … RRGBCC3/1784918?

but the pinout is wrong...

The attachment Screenshot 2025-03-04 193249.png is no longer available

Do you know where I can source a small quantity of the correct diodes or a suitable alternative (delivered in to the UK)?

https://jlcpcb.com/partdetail/TUOZHAN-P4_1204 … _1_5TA/C2827295

The attachment Screenshot 2025-03-04 193323.png is no longer available

Think I found some.

https://www.aliexpress.com/item/1005006287610 … .13721802EqB07j

Hand soldering these is fun...

Tested this one without the LED and it took the firmware ok. Not going to solder the rest of the ports on until I have the diodes in hand.

I'll have a few of these spare when I'm done - building up the minimum order quantity - so anyone in the UK that might want one, let me know.

Reply 484 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member

So here's a thought - could this project be extended to encompass DB15 gameport devices? Lots of nice USB joysticks out there with no DOS compatibility due to lack of USB support under DOS...

Reply 485 of 514, by Emerson Wagner

User metadata
Rank Newbie
Rank
Newbie

Does anyone have different link to WCH's ISP tool? The one from github to wch website is 404 when I press download.

Reply 487 of 514, by Emerson Wagner

User metadata
Rank Newbie
Rank
Newbie
keenmaster486 wrote on 2025-02-26, 16:45:
rasteri wrote on 2025-02-26, 08:23:

Have you tried the latest beta? - https://github.com/rasteri/HIDman/releases/tag/v1.1.5g

We changed some stuff in the hub init code that might fix your problem.

Failing that I'll maybe buy one of those hubs and see what the issue is

That worked. Thanks very much.

It worked also for this Ugreen KVM.

Reply 488 of 514, by keenmaster486

User metadata
Rank l33t
Rank
l33t
Emerson Wagner wrote on 2025-03-06, 04:01:

It worked also for this Ugreen KVM.

Good to know.

World's foremost 486 enjoyer.

Reply 489 of 514, by rasteri

User metadata
Rank Oldbie
Rank
Oldbie

I did some rough preliminary latency measurements, I posted the results on github but I'll copy-paste them here too :

Latency is a pretty consistent 1ms when measured the way USB4VC does it (USB packet start -> PS/2 Packet Start). This is equivalent to USB4VC when run on a Raspberry Pi 2 (also 1ms), but double USB4VC on a Pi4 (0.5ms).

To put things in perspective though, I also measured it a different way - I wrote a small DOS program to emit a beep whenever a key is pressed. Then with a microphone recorded the audio of me pressing a key. The average time between keypress and beep was 25ms on both the USB keyboards I tried. We can surmise that USB4VC would manage 24.5ms in this test.

Then I tested a random PS/2 keyboard I had (an HP OEM thing) and it came out around 20ms. My program only adds around 0.2ms of this latency (I measured with a logic analyzer).

So given we're talking about double-digit inherent latencies anyway, I don't think it's worth chasing fractions of a millisecond on top of that - but I've done almost zero optimization at this point so I'm sure we could get closer to USB4VC if we really wanted to.

Reply 490 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member

My replacement LEDs arrived today and I got my first board assembled.

The attachment PXL_20250312_123542978.jpg is no longer available
The attachment PXL_20250312_123536519.jpg is no longer available

Hand assembly at 0603 and 0.5mm IC pitch is fun

Reply 492 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member
rasteri wrote on 2025-03-12, 14:50:
Lostdotfish wrote on 2025-03-12, 12:41:

My replacement LEDs arrived today and I got my first board assembled.

Nice work, is it behaving OK?

Sorry for the late reply, I was troubleshooting issues with it and the general answer to your question is no - not behaving...

So today I built up a 2nd one to see if I had just messed up on the first one. But I am getting the same results.

Both boards do not always go into boot loader mode - more often than not I get a device has malfunctioned warning in Windows and the comm port device fails to appear.

Once I managed to program them - they behave as expected during initial testing.

Button cycles the mode LED correctly
LED flashes on keypresses / mouse inputs

Then more weirdness

If I connect the front PS2 to the PC and connect a USB mouse to the HIDMAN - DOS loads and the mouse is detected correctly. Both USB ports will work with the mouse.
If I connect the rear PS2 port on the HIDMAN to the mouse PS2 port on my PC - DOS fails to fully load - the Cute Mouse driver hangs

If I connect a USB keyboard to the HIDMAN and the rear PS2 to my PC keyboard PS2 - it works as expected

If I connect the rear PS2 port to the PC PS2 Keyboard and the front PS2 port to the PC mouse PS2 port - the LED blinks on input on keyboard and mouse BUT keyboard is unresponsive on the PC

It's really odd that I have the same set of issues on 2 assembled devices. Any ideas what might be the issue?

I have a suspicion that it may be an issue with 12MHz crystal...

Reply 493 of 514, by rasteri

User metadata
Rank Oldbie
Rank
Oldbie
Lostdotfish wrote on 2025-03-22, 15:26:

If I connect the rear PS2 port on the HIDMAN to the mouse PS2 port on my PC - DOS fails to fully load - the Cute Mouse driver hangs

The rear PS/2 port (i.e. the one next to the serial port) is the keyboard port. You shouldn't be plugging it into the mouse port on your PC.

If I connect the rear PS2 port to the PC PS2 Keyboard and the front PS2 port to the PC mouse PS2 port - the LED blinks on input on keyboard and mouse BUT keyboard is unresponsive on the PC

First, make sure you're on latest beta - https://github.com/rasteri/HIDman/releases/tag/v1.1.5g

Also, you aren't trying to hotplug PS/2 devices are you? Both the computer and hidman need to be switched on together at the same time, they talk to each other during bootup. If you have to unplug/replug HIDman's PS/2 ports you need to reboot the PC before trying to use it

Finally, if you can, get me a HID dump? start a text editor, go to advanced menu and "log HID data", then unplug/replug your USB devices. Then save the text file and paste it here (or send it to me)

Reply 494 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member
rasteri wrote on 2025-03-22, 16:12:

The rear PS/2 port (i.e. the one next to the serial port) is the keyboard port. You shouldn't be plugging it into the mouse port on your PC.

Ah, I thought I'd read somewhere that your device sends mouse and keyboard data on both ports (and that you can run a Y cable out the back port to send mouse and keyboard data all out of the single rear port)

First, make sure you're on latest beta - https://github.com/rasteri/HIDman/releases/tag/v1.1.5g

I am.

Also, you aren't trying to hotplug PS/2 devices are you? Both the computer and hidman need to be switched on together at the same time, they talk to each other during bootup. If you have to unplug/replug HIDman's PS/2 ports you need to reboot the PC before trying to use it

No, full cold boots on each iteration during testing

Finally, if you can, get me a HID dump? start a text editor, go to advanced menu and "log HID data", then unplug/replug your USB devices. Then save the text file and paste it here (or send it to me)

I will have a go at this.

Any idea why I struggle to get the devices into bootloader mode? I have to plug and replug multiple times to get them into flash mode - and then sometimes WCHISPStudio fails to erase the flash and fails to write the firmware

Reply 495 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member

So a quick report on this.

If I have both the Mouse and the Keyboard PS/2 cables connected, the keyboard fails to work (with both a standard wired keyboard and mouse and a logitech wireless keyboard with built in touchpad). The HIDMan LED blinks but no keystrokes make it to the PC.

With just the keyboard connected I get this HID data on hotplug (device is actually a logitech K400R wireless keyboard and touchpad)

Logging. Press ESC to stop R to redetect...
I0 L8- 00 00 00 00 00 00 00 00

reenumerating all ports
port 0
gdd.fail
port 1
gdd len8
mps 8
addr ok 0
gddfull ok 18
Device Descriptor
12 01 00 02 00 00 00 08 6D 04 2B C5 03 12 01 02
00 01

0x046D 0xC52B 0x1203
Config Descriptor
09 02 54 00 03 01 04 A0 31 09 04 00 00 01 03 01
01 00 09 21 11 01 00 01 22 3B 00 07 05 81 03 08
00 08 09 04 01 00 01 03 01 02 00 09 21 11 01 00
01 22 94 00 07 05 82 03 08 00 02 09 04 02 00 01
03 00 00 00 09 21 11 01 00 01 22 5D 00 07 05 83
03 20 00 02

gcd ok 84

Interface 0
InterfaceProtocol 1

Interface 0 Report Descriptor -
05 01 09 06 A1 01 95 08 75 01 15 00 25 01 05 07
19 E0 29 E7 81 02 81 03 95 05 05 08 19 01 29 05
91 02 95 01 75 03 91 01 95 06 75 08 15 00 26 FF
00 05 07 19 00 2A FF 00 81 00 C0

set boot mode - 1 - 0
SetReport

Interface 1
InterfaceProtocol 2

Interface 1 Report Descriptor -
05 01 09 02 A1 01 85 02 09 01 A1 00 95 10 75 01
15 00 25 01 05 09 19 01 29 10 81 02 95 02 75 0C
16 01 F8 26 FF 07 05 01 09 30 09 31 81 06 95 01
75 08 15 81 25 7F 09 38 81 06 95 01 05 0C 0A 38
02 81 06 C0 C0 05 0C 09 01 A1 01 85 03 95 02 75
10 15 01 26 FF 02 19 01 2A FF 02 81 00 C0 05 01
09 80 A1 01 85 04 95 01 75 02 15 01 25 03 09 82
09 81 09 83 81 00 75 06 81 03 C0 06 BC FF 09 88
A1 01 85 08 95 01 75 08 15 01 26 FF 00 19 01 29
FF 81 00 C0

set boot mode - 0 - 0

Interface 2
InterfaceProtocol 0

Interface 2 Report Descriptor -
06 00 FF 09 01 A1 01 85 10 95 06 75 08 15 00 26
FF 00 09 01 81 00 09 01 91 00 C0 06 00 FF 09 02
A1 01 85 11 95 13 75 08 15 00 26 FF 00 09 02 81
00 09 02 91 00 C0 06 00 FF 09 04 A1 01 85 20 95
0E 75 08 15 00 26 FF 00 09 41 81 00 09 41 91 00
85 21 95 1F 09 42 81 00 09 42 91 00 C0

done reenumerating

Reply 496 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member

With both cables connected - holding the HIDMan button does not result in the menu outputting in the text editor (which is no surprise as no keystrokes seem to make it to the PC with both cables installed)

This is on an Socket 7 TX chipset based system.

https://theretroweb.com/motherboards/s/tmc-my … -ti5tt-ver.-1.1

I have some other motherboards around so I will test on something else when I get a moment.

Reply 497 of 514, by rasteri

User metadata
Rank Oldbie
Rank
Oldbie
Lostdotfish wrote on 2025-03-22, 17:14:

Ah, I thought I'd read somewhere that your device sends mouse and keyboard data on both ports (and that you can run a Y cable out the back port to send mouse and keyboard data all out of the single rear port)

You can, but you have to use the Y-cable, even if you're only plugging one device into that port. You can't just use the keyboard port as a mouse port without the Y-cable. (and you might have to swap keyboard and mouse on the Y-cable, they all seem to be wired differently).

Any idea why I struggle to get the devices into bootloader mode? I have to plug and replug multiple times to get them into flash mode - and then sometimes WCHISPStudio fails to erase the flash and fails to write the firmware

No idea, that is very suspicious, none of my hidmen do that. An incorrect crystal (or crystal load capacitors) could certainly cause that. But maybe try programming it on a different PC, or using a different cable, etc. (also make sure nothing's plugged into PS/2 ports while flashing firmware)

Lostdotfish wrote on 2025-03-22, 17:29:

With both cables connected - holding the HIDMan button does not result in the menu outputting in the text editor (which is no surprise as no keystrokes seem to make it to the PC with both cables installed)

This is also extremely suspicious. Perhaps your motherboard grounds the unused PS/2 pins - that might cause issues. Try it on a different motherboard like you suggested, and if that fixes it I'll maybe add an option to disable the unused PS/2 pins

Reply 498 of 514, by Lostdotfish

User metadata
Rank Member
Rank
Member
rasteri wrote on 2025-03-22, 17:41:
Lostdotfish wrote on 2025-03-22, 17:14:

Any idea why I struggle to get the devices into bootloader mode? I have to plug and replug multiple times to get them into flash mode - and then sometimes WCHISPStudio fails to erase the flash and fails to write the firmware

No idea, that is very suspicious, none of my hidmen do that. An incorrect crystal (or crystal load capacitors) could certainly cause that. But maybe try programming it on a different PC, or using a different cable, etc. (also make sure nothing's plugged into PS/2 ports while flashing firmware)

I purchased the same crystals as in your BOM but what arrived is not the same I think...

This is what I have.

The attachment PXL_20250322_174402732.jpg is no longer available

https://www.aliexpress.com/item/1005007089912 … .1cdd18027aDYWF

and these are the load capactitors

https://www.mouser.co.uk/ProductDetail/603-C0603JRNPO9BN100

Reply 499 of 514, by rasteri

User metadata
Rank Oldbie
Rank
Oldbie
Lostdotfish wrote on 2025-03-22, 17:29:

With both cables connected - holding the HIDMan button does not result in the menu outputting in the text editor (which is no surprise as no keystrokes seem to make it to the PC with both cables installed)

Aha - I had a look at a photo of your motherboard and it does indeed ground the spare PS/2 pins.

Looks like I'll have to add an option to disable the auxilliary pins on hidman's end too.