+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Advanced Member level 5
    Points: 16,663, Level: 31
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,372
    Helped
    13 / 13
    Points
    16,663
    Level
    31

    USB to PS/2 adapter, how does this work?

    I have an MCU project that accepts PS/2 keyboard. I want to investigate if I could use USB keyboards as well with it using these USB to PS/2 adaptors.

    I think that the conversion from USB protocol to PS/2 is done inside the keyboard and the keyboard detects somehow if it has been connected to a USB or USB to PS/2 adaptor. But I may be wrong.

    So how does this system work and is there any way to let the keyboard work? My project uses only pins 1,3,4,5 of the PS/2. Pins 2,6 are left unconnected.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!

  2. #2
    Full Member level 6
    Points: 2,036, Level: 10

    Join Date
    Jan 2019
    Posts
    379
    Helped
    94 / 94
    Points
    2,036
    Level
    10

    Re: USB to PS/2 adapter, how does this work?

    im sure the internet has an explanation of how it works

    this sort of thing is easier to buy than build

    https://www.newegg.com/Mouse-Keyboar...tegory/ID-3024



  3. #3
    Advanced Member level 5
    Points: 12,636, Level: 26
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Posts
    1,918
    Helped
    411 / 411
    Points
    12,636
    Level
    26

    Re: USB to PS/2 adapter, how does this work?

    Conversion is done inside the USBtoPS/2 adapter. Both under serial category , the adapter does the PS/2 format protocol conversion .



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 77,854, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,793
    Helped
    3593 / 3593
    Points
    77,854
    Level
    68

    Re: USB to PS/2 adapter, how does this work?

    Hi,

    I'm pretty sure that most of the PS/2 to USB adapters, that come with a keyboard, are just passive connectors. The intelligence is in the keyboard. This is a rather simple and low cost solution.

    Maybe there are
    PC(PS/2) --> [PS/2 adapter to USB type A] --> keyboard(USB).
    Where you may connect any USB keyboard. But I expect them to be rather expensive. They need to include all the USB_host requiremens, like timing control, bus control, being prepared for a variety of USB keyboards, power supply, USB_device_speed_detect...and handling....

    If you have an adapter by hand you may use a Ohmmeter to check the internal connections.
    Passive connections are very low ohmic.
    While true data signal should be rather high impedance when not powered. (The shown value will depend on DVM measure method)

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  5. #5
    Super Moderator
    Points: 260,279, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,460
    Helped
    13829 / 13829
    Points
    260,279
    Level
    100

    Re: USB to PS/2 adapter, how does this work?

    I agree with KlausST. Most newer USB keyboards since 2010 are no longer combo devices supporting PS/2 protocol. You need to search for keyboards that explicitly specify USB and PS/2 support. Apparently major manufacturers are gradually cleaning up their portfolio. E.g. Cherry had a cheap "eVolution Stream" model with PS/2 support, it's still available at distributors. Now they have only the professional G80-3000, but it's more expensive. There's also Fujitsu KB410 PS2. No PS/2 keyboards from Logitech any more.

    Early combo devices had PS/2 plug and a passive adapter to USB, recent have USB A plug and passive adapter to PS/2.


    1 members found this post helpful.

  6. #6
    Advanced Member level 5
    Points: 16,663, Level: 31
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,372
    Helped
    13 / 13
    Points
    16,663
    Level
    31

    Re: USB to PS/2 adapter, how does this work?

    Quote Originally Posted by FvM View Post
    Most newer USB keyboards since 2010 are no longer combo devices supporting PS/2 protocol. You need to search for keyboards that explicitly specify USB and PS/2 support.
    Well this are great news for the project. If the intelligence is inside the keyboard, then USB keyboards can be used with this project IF they support the PS/2 protocol.
    I guess the simplest thing is to try them in a real PC with PS2 support and if they work then try them in the project.

    I wonder if the intelligence is included in some PCs as well so they detect USB keyboards in their PS2 port.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



    •   AltAdvertisement

        
       

  7. #7
    Super Moderator
    Points: 260,279, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,460
    Helped
    13829 / 13829
    Points
    260,279
    Level
    100

    Re: USB to PS/2 adapter, how does this work?

    I guess the simplest thing is to try them in a real PC with PS2 support and if they work then try them in the project.
    Yes.

    I wonder if the intelligence is included in some PCs as well so they detect USB keyboards in their PS2 port.
    Unlikely. What should be the purpose?



  8. #8
    Advanced Member level 5
    Points: 16,663, Level: 31
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,372
    Helped
    13 / 13
    Points
    16,663
    Level
    31

    Re: USB to PS/2 adapter, how does this work?

    Quote Originally Posted by FvM View Post
    Unlikely. What should be the purpose?
    The purpose would be that every USB keyboard could work in the PS/2 port.
    I wondered so, because if that was the case, then USB keyboards (not-combo) would work in a PC PS/2 but not in my project.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  9. #9
    Super Moderator
    Points: 260,279, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,460
    Helped
    13829 / 13829
    Points
    260,279
    Level
    100

    Re: USB to PS/2 adapter, how does this work?

    I see what you mean. But that's not the way PCs are designed.



  10. #10
    Advanced Member level 5
    Points: 16,663, Level: 31
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,372
    Helped
    13 / 13
    Points
    16,663
    Level
    31

    Re: USB to PS/2 adapter, how does this work?

    Quote Originally Posted by FvM View Post
    You need to search for keyboards that explicitly specify USB and PS/2 support.
    I have tested it. I took a USB keyboard that I had connected to a PC through a usb to PS/2 adapter and pluged it in the project. It has been powered up (three leds are on in the beginning and then off) but nothing is being done. The keyboard does not respond to it's own commands even, like caps lock should cause the caps lock led to go on, which doesn't.

    Remember in post #1 I have not connected all the pins. Perhaps that's the problem? The pinout in these USB to PS/2 adapters could help to see what's going on inside.

    - - - Updated - - -

    I have seen this https://cdn.instructables.com/FLY/5Q...V7I.MEDIUM.jpg and it is straight forward.

    - - - Updated - - -

    Quote Originally Posted by neazoi View Post
    I have tested it. I took a USB keyboard that I had connected to a PC through a usb to PS/2 adapter and pluged it in the project. It has been powered up (three leds are on in the beginning and then off) but nothing is being done. The keyboard does not respond to it's own commands even, like caps lock should cause the caps lock led to go on, which doesn't.

    Remember in post #1 I have not connected all the pins. Perhaps that's the problem? The pinout in these USB to PS/2 adapters could help to see what's going on inside.

    - - - Updated - - -

    I have seen this https://cdn.instructables.com/FLY/5Q...V7I.MEDIUM.jpg and it is straight forward.
    UPDATE, I have tested another USB keyboard and it works perfectly ok with this USB to PS/2 adapters. SO I confirm, it is a keyboard internal electronics issue indeed.

    However both keyboards worked on the PC with a USB to PS/2 adapter, whereas only one of them worked on my project, which is weird.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  11. #11
    Super Moderator
    Points: 81,438, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,351
    Helped
    4457 / 4457
    Points
    81,438
    Level
    69

    Re: USB to PS/2 adapter, how does this work?

    The LEDs on a standard keyboard are controlled by software in the BIOS. They usually flash when an initialization code is received but there is no obligation for them to do that.
    For example, when 'NumLock' is pressed, the keyboard sends a command to the BIOS which sends a command back to turn the LED on. If there is no communication it won't work.

    PS/2 keyboard protocol is the same as used in the days of 5-pin DIN, it uses two open-collector lines, clock and data. USB needs two data lines and regenerates the clock itself so they are not inherently compatible. Beware that some USB to PS/2 (and reverse) adapters actually have a controller built into them, a direct connection wouldn't work.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  12. #12
    Advanced Member level 5
    Points: 16,663, Level: 31
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,372
    Helped
    13 / 13
    Points
    16,663
    Level
    31

    Re: USB to PS/2 adapter, how does this work?

    Quote Originally Posted by betwixt View Post
    The LEDs on a standard keyboard are controlled by software in the BIOS. They usually flash when an initialization code is received but there is no obligation for them to do that.
    For example, when 'NumLock' is pressed, the keyboard sends a command to the BIOS which sends a command back to turn the LED on. If there is no communication it won't work.

    PS/2 keyboard protocol is the same as used in the days of 5-pin DIN, it uses two open-collector lines, clock and data. USB needs two data lines and regenerates the clock itself so they are not inherently compatible. Beware that some USB to PS/2 (and reverse) adapters actually have a controller built into them, a direct connection wouldn't work.

    Brian.

    I have 3 of these converters, 2 of them are actually for mouse. They all worked with one of the two keyboards. In the other keyboard none of them worked. If they had a converter inside them, I would expect them to work with both USB keyboards, not just one of them, as far as I can understand.

    Are these USB keyboards marked as "combo" by the manufacturers? I am asking so I can describe them better to people interested in building this project.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  13. #13
    Super Moderator
    Points: 81,438, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,351
    Helped
    4457 / 4457
    Points
    81,438
    Level
    69

    Re: USB to PS/2 adapter, how does this work?

    Mouse protocol and keyboard protocols are slightly different. When a computer starts up it sends some characters to the mouse and keyboard to check for a response. If I remember correctly, the keyboard should respond to command '0x55' with '0xAA', I think the mouse should respond with 'M' followed by some data about it's capabilities (number of buttons, scroll wheel etc.). It could be that your converter is not aware of all the combinations of commands and responses.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--