39

I remember when USB mouses came out those green PS/2 to USB adapters were around. (I cannot remember to have seen a purple keyboard adapter doing the same. But that doesn't mean anything.)

I always was sure they were passive with only wires inside.

But PS/2 is a completely different specification on the electronical level. So from that point of view there has to be an IC inside.

So was there an IC inside or not? Or maybe PS/2 is somehow compatible with USB?

Please note I am only talking about an adapter to connect an USB mouse to a PS/2 slot. Not any other adapters.

zomega
  • 5,362
  • 4
  • 25
  • 52
  • 7
    I believe that those adapters only work with certain mice. – Eric Brown Jan 15 '24 at 20:43
  • @EricBrown I have never seen a USB mouse that doesn't speak PS/2 as well. – AndreKR Jan 19 '24 at 13:51
  • @AndreKR I've got multiple mice that only speak USB and I find plenty when I'm taking such an adapter, plus an active PS2→USB adapter, plus a laptop to the thrift stores to find ones that do. You're just used to experiencing the economies of scale of having so many mice using the same ASIC for so long. – ssokolow Jan 19 '24 at 20:32
  • @ssokolow It might also be selection bias where I prefer certain brands and those brands implement PS/2. – AndreKR Jan 19 '24 at 20:50

3 Answers3

68

You are correct, they are only passive adapters with wires inside.

There is no IC inside.

And no, PS/2 protocol is not in any way compatible with USB protocol.

The trick is, the chip inside the mouse and/or keyboard can detect to which port they are connected and then either use PS/2 or USB protocol.

The adapters do not work with devices that do not understand both protocols.

Justme
  • 31,506
  • 1
  • 73
  • 145
  • While I think this is correct for mice, I think the protocol must work differently for keyboards. I use one of those "double-up" passive adaptors on a daily basis to connect my AT keyboard (I also have an AT to PS/2 adaptor) into my USB port. My AT keyboard was purchased in 1993, before USB was even a thing... – David Fulton Jan 16 '24 at 09:55
  • 8
    @DavidFulton That's guaranteed to be an active adapter with a chip inside doing the conversion. But passive adapters did exist for keyboards as well. – vidarlo Jan 16 '24 at 10:01
  • 8
    @DavidFulton No it doesn't. Either the devices are new enough to support both protocols, or, then you need an active adapter. Adapters were passive back then, these days having an active adapter to make those old devices work may be common. – Justme Jan 16 '24 at 10:35
  • 4
    @DavidFulton you are describing a male-USB/female-PS2 adaptor. The opposite of what the question is about. – OrangeDog Jan 16 '24 at 12:07
  • @OrangeDog - You're right. I think the comments / feedback are still relevant, as the same passive / active debate still holds (and I must have always been getting active adaptors), but I'd missed that it was converting a USB mouse to a PS2 connector, rather than the other way around. – David Fulton Jan 16 '24 at 12:51
  • 5-pin DIN and PS/2 keyboards spoke the same protocol; the adaptor is passive and requires no support from the keyboard. However, serial and PS/2 mouses use a different protocol. There were passive adaptors for those, which required mouse support (this was around 1992). I don't know if there were tri-procol mice or not (serial, PS/2, USB) – CSM Jan 16 '24 at 14:11
  • 4
    @CSM This wasn't about DIN and PS/2, but adapters between USB and PS/2. And not entirely true, because, if you go further back, PC and AT keyboards were not protocol compatible despite the identical DIN connector. I also don't recall tri-protocol mice, I think there were transition era between RS232 and PS/2 mice and later between PS/2 and USB. No need to support all three. – Justme Jan 16 '24 at 14:19
  • @CSM I can't even think of dual serial - PS/2 mice, and I had a lot of kit when they would have been current, including some esoteric things like an IR serial remote control with mouse (TrackPoint style) and programmable keys - on Win95. – Chris H Jan 16 '24 at 16:04
  • 2
    Any idea how the detection was done? Did it just use the difference in power supply voltage to change the protocol and pin usage? – Toby Speight Jan 16 '24 at 16:25
  • 1
    @ChrisH Dual serial - PS/2 mice existed, as I had at several back in the day. The one I used the most was branded Genius and had a central up/down rocker button for scrolling. This would have been in about 1998. – Alex Taylor Jan 16 '24 at 17:37
  • @Justme Yes, both PC XT and PC AT keyboards used the same 5-pin DIN connector but were protocol (and electrically) incompatible. Back in this age, they couldn't even auto-detect and switch on their own. My keyboard had a switch underneath to select between the XT and AT mode. When PS/2 came along, they kept the same protocol and just made the connector smaller. They also added a PS/2 protocol for the mouse, but created a new, dedicated protocol for it so it was very important to color match the mouse and keyboard because they wouldn't work if swapped. – penguin359 Jan 17 '24 at 02:42
  • 1
    @penguin359 not accurate. XT and AT were electronically compatible open-collector buses at physical interface. Only the bit-level logical frame protocol was different, and AT was expanded to be bidirectional. PS/2 protocol used AT as base and kept the bit-level protocol but added new commands, and separate commands/reaponses for mice. There was no different colour coding to the PS/2 connector until Microsoft and Intel came up with the PC-97 standard, released in 1998 and only then colour coding started to appear. Some host controllers supported auto detect mouse/KB swap and AT/XT KB protocols. – Justme Jan 17 '24 at 04:50
  • @TobySpeight USB plugs are designed to provide power before connecting the data line, and the reverse happens when disconnecting. It's a matter of getting power on the right line and then powering on the right circuit. Not particularly difficult since you can control how the passive adapter connects to the mouse. There is no guarantee that the PS/2 adapter needs to work with another PS/2 mice, and typically they do not. – Nelson Jan 17 '24 at 08:41
  • 2
    @Nelson that does not apply when you are not hot-plugging the mouse. It also needs to work when it is kept connected to computer and the computer is turned on, so how the USB connector is physically made to support hot-plugging does not apply detecting if mouse is connected to a PS/2 or USB port. – Justme Jan 17 '24 at 08:47
24

The adapter is passive. The mouse is designed to talk either USB or PS/2 and can figure out which is currently connected

dave
  • 35,301
  • 3
  • 80
  • 160
  • I don't know whether there's any combination which makes use of this, but for completeness there are apparently 'phones etc. which have a physical USB port which can be conditioned for different purposes (e.g. debug mode, reflash) depending on the resistor on the ID line. https://xdaforums.com/t/the-samsung-anyway-jig.1629359/ Hence /potentially/, something acting like a mouse could declare that it wanted simple serial protocol on the USB data pins: however I don't believe this applied to the simple passive (green) adapters which predate both this level of sophistication and the ID pin itself. – Mark Morgan Lloyd Jan 17 '24 at 13:16
  • @MarkMorganLloyd No it definitely does not work how you potentially pictured it to work, the mouse is unable to declare such things and PC side cannot switch the USB (old, USB1, USB Type-A) data pins into other protocols. It is weird how so many people stray from the asked question, speculating how it could work, but it's the mouse that detects to which kind of port it is connected. Perhaps if someone could post a new question like "How did a old mouse detect if it was connected to PS/2 or USB port" I could try to answer it. – Justme Jan 17 '24 at 17:10
  • New question posted as suggested by @Justme - https://retrocomputing.stackexchange.com/questions/28298/how-did-a-old-mouse-detect-if-it-was-connected-to-ps-2-or-usb-port – dave Jan 17 '24 at 17:16
  • @Justme Granted, I was wandering :-) – Mark Morgan Lloyd Jan 17 '24 at 19:55
11

As others are saying, they're passive adapters and, as these two pinout sites detail, they work by connecting the USB Data- line to the PS/2 Data line and the USB Data+ line to the PS/2 Clock line and relying on the mouse to recognize whether it's seeing PS/2 flow control signalling or the beginnings of a USB initialization handshake.

USB Pin Name USB Pin # PS/2 Pin Name PS/2 Pin #
VDC +5V 1 VDC +5V 4
Data- 2 Data 1
Data+ 3 Clock 5
Ground 4 Ground 3

(However, as the first of the two sites says, they might also contain 10k pull-up resistors on the data and clock lines since that can help with compatibility.)

I can personally confirm that they only work with mice whose controller ICs know how to speak both protocols. (I keep an eye out for such dual-protocol optical mice when thrifting because they're cheaper and/or less work than buying or building an active USB-to-PS/2 adapter in this day and age.)

Toby Speight
  • 1,611
  • 14
  • 31
ssokolow
  • 6,746
  • 2
  • 25
  • 40
  • The PC won't send clock out to any device on a PS/2 interface. It is always the device that sends out clock when it wants to send data, and also when PC has requested to send data to device. – Justme Jan 17 '24 at 21:44
  • @Justme Fair point. I phrased that badly. – ssokolow Jan 17 '24 at 22:36
  • Can it damage an USB mouse (which doesn't support PS/2 signals) if you connect it to a PS/2 slot using an adapter? – zomega Jan 18 '24 at 11:25
  • @zomega, I haven't observed such occasion. Wold be very unlikely. – akostadinov Jan 18 '24 at 20:30
  • @ssokolow Can you confirm that a green adapter is the same as a purple adapter because pins are the same? – zomega Feb 01 '24 at 17:28
  • I've never owned a purple adapter but everything I've read about PS/2 ports says that the pinout is the same for keyboard and mouse unless it's one of those half-green/half-purple laptop "dualport" connectors meant to be used with a Y cable, in which case the mouse's clock and data lines are relocated to the unused pins. Given that laptops without dualport connectors would sometimes give you one port that could take a keyboard or mouse but not both, I don't see how it could be any different. – ssokolow Feb 01 '24 at 23:34