geekhack

geekhack Community => Keyboards => Topic started by: Ysaquerai on Tue, 24 March 2009, 13:48:47

Title: USB vs Ps2 Keyboards
Post by: Ysaquerai on Tue, 24 March 2009, 13:48:47
I just want to ask the members of this forum. What basically benefits do we get when we use a  usb or ps2 keyboard?

Ps2
Enable Full N-Key Rollover

USB
Convenient / Plug and Play
Faster Data Transfer?

How about the 1ms USB keyboard as advertised on most gaming keyboards? Does this really affect on most games as opposed to using Ps2.

Care to add? So that we could settle this once and for all on geekhack.
Any info scientific or not would be greatly appreciated.
Title: USB vs Ps2 Keyboards
Post by: itlnstln on Tue, 24 March 2009, 13:51:44
PS2 can enable NKRO, but it doesn't mean that it will have NKRO.  USB is more convenient, IMO.  That, and some USB have hubs, which I find quite nice, but, IMO, not enough USB keyboards come with hubs.  I am not sure about the faster data transfer part, however.
Title: USB vs Ps2 Keyboards
Post by: Mikecase00 on Tue, 24 March 2009, 14:24:13
I see little additional value in a USB keyboard over PS/2 a similar board with a PS/2 plug, especially if there's no built in USB hub.  There may be benefits to motherboard and laptop manufacturers because they don't need to expose/build/support an additional port type, but for the end user, I can't think of any advantage to USB.  The additional speed/bandwidth potential of the USB cable seem wasted on a keyboard, I mean, how much data are you likely pushing as you type?

I honestly believe the switch to USB boards is widely driven by hardware manufacturers wanting to simplify the number of different types of ports on a computer, nothing more.
Title: USB vs Ps2 Keyboards
Post by: patrickgeekhack on Tue, 24 March 2009, 15:08:14
I prefer USB over PS/2 for convenience not because it's necessarily better.

None of the current computers at my place has a PS/2 port, and I cannot see notebook manufacturers adding this port on their notebooks going forward.
Title: USB vs Ps2 Keyboards
Post by: Ysaquerai on Tue, 24 March 2009, 16:32:12
How come USB can only handle 6 maximum keys for the N Key Rollover but the older Ps2 Plug can unlock the full potential for the Rollover keyboards?

Seems this is the only major factor for using Ps2 nothing more?
Title: USB vs Ps2 Keyboards
Post by: bhtooefr on Tue, 24 March 2009, 17:21:54
Because of an artificial limitation in the USB spec.

You could create a proprietary device class that supports NKRO with no issue.
Title: USB vs Ps2 Keyboards
Post by: CX23882 on Tue, 24 March 2009, 17:42:32
With Windows 2000 onwards I don't mind USB keyboards (and 6-key rollover is fine), but USB with Windows 98SE was an absolute nightmare.  If you only have a USB keyboard and mouse, and you decide to change them, it is impossible to get into Windows 98 because it sits at a New Hardware Wizard prompt.  You can't proceed through the wizard because you have no way to click the buttons either with the mouse or the keyboard (because you've replaced them!).  At least in 2000/XP/Vista HID devices are silently installed.

I guess it wasn't that much of an issue because the majority of 98-era machines had PS/2 ports.  And even if you did only have USB it is only an issue if you replace both the keyboard and mouse at the same time.

I've run into it a few times with my old KVM because it emulated a USB keyboard and mouse with different IDs to my actual hardware keyboard/mouse.  My current KVM doesn't suffer this problem thankfully.

The only other issue I recall is the "jerky USB mouse" problem, but those days are long gone.  On the other hand nForce2 systems had an annoying issue when running with APIC interrupts whereby PS/2 keyboards screwed up the timing of PCI devices, but that system didn't last very long.  A lot of people loved the nForce2 but for me it was the buggiest chipset I had ever used, even worse than the dog-ass slow VIA Apollo 133A and it's pathetic PCI performance.  I ran with a PS/2 keyboard and USB mouse for a long time.  I only went completely USB when I bought a Dell Dimension E521 which lacks PS/2 ports.  Before then I was perfectly happy with PS/2 keyboards such as the lovely Unicomp Customizer 105.
Title: USB vs Ps2 Keyboards
Post by: MANISH7 on Tue, 24 March 2009, 18:09:13
Oddly enough, this issue has indeed tickled me in the past. I get tickled by the most random, inane things. I like to buy stuff that will last me for life. Keyboards are no exception. I'm tickled by the fact that 15 years later, I may have a tough time connecting my PS2 keyboard because by then PS2 would be completely forgotten and perhaps unsupported. USB would still last a few years until mechanical keyboards themselves became obsolete (the Doomsday of this forum!).

To answer your question, I'm going to join the choir and sing...CONVENIENCE!
Title: USB vs Ps2 Keyboards
Post by: patrickgeekhack on Wed, 25 March 2009, 15:19:33
Quote from: MANISH7;25310
USB would still last a few years until mechanical keyboards themselves became obsolete (the Doomsday of this forum!).


I would still keep my keyboards just to be able to listen to the sound from time to time. When I was about 12 years old, I used to play on my dad's calculator just because I like the sound of the keys. I still do actually :-) This calculator is still around, and every time I fly back, I play with it a few times.

The next time I fly back, I'll stop by my old school and see if they have some IBM Model M kicking around and if they want to get rid of them. I'm hoping they do :) They still had some in 1998.
Title: USB vs Ps2 Keyboards
Post by: nowsharing on Sun, 12 April 2009, 05:55:42
Are there power usage benefits to using an active usb converter? I read this at clickykeyboards.com:

Quote
Online reports indicate that vintage IBM ps/2 keyboards pull up to 100x more current compared to modern keyboards (112 mA vs 1.2 mA). see reference: (http://www.geocities.com/jszybowski/keyboard/index.htm). One way to resolve this problem to add resistors to change the voltage, or an easier non-destructive fix is to use an active ps/2 to USB plug-in converter with built-in electronics.

This sounds like it might add a longer life to older Ms?
Title: USB vs Ps2 Keyboards
Post by: huha on Sun, 12 April 2009, 06:47:26
Quote from: Ysaquerai;25292
How come USB can only handle 6 maximum keys for the N Key Rollover but the older Ps2 Plug can unlock the full potential for the Rollover keyboards?

Seems this is the only major factor for using Ps2 nothing more?



I prefer USB for several reasons:
1) Hot-plugging. I use it a lot.
2) Widespread availability of ports. I can connect USB keyboards to any current notebook without much hassle. Connecting PS/2 keyboards is much harder.
3) The mini-DIN plug used for PS/2 absolutely sucks. Aligning the thing without seeing it is extremely annoying.

So if you absolutely need n-key rollover, use PS/2. If you don't, use USB.

But why does PS/2 support n-key rollover and USB doesn't? PS/2 transfers make/break codes, like this:

Code: [Select]

make:  1C
break: F0 1C


If you press and hold multiple keys (I don't feel inclined to look up the scan codes, so I'm just making them up):

Code: [Select]

make:  1C
make:  1D
make:  1E
make:  1F
make:  20
make:  21
make:  22
break: F0 1C
break: F0 1D
break: F0 1E
break: F0 1F
break: F0 20
break: F0 21
break: F0 22


USB, on the other hand, has a fixed-length (7 Byte) data packet. The first byte contains ctrl, alt, shift etc., the remaining 6 contain key presses. There's no make/break, the host just sees when a value changes.

Code: [Select]

00 00 00 00 00 00 00
00 04 00 00 00 00 00    press a key
00 00 00 00 00 00 00    release a key


It gets nasty when you press more keys than this packet can handle (again, making codes up):

Code: [Select]

00 00 00 00 00 00 00
00 04 00 00 00 00 00    press a key
00 05 04 00 00 00 00    press another key. Data order is arbitrary.
00 06 05 04 00 00 00    press another key.
00 07 06 05 04 00 00    and another one
00 08 07 06 05 04 00    etc.
00 09 08 07 06 05 04    now, we have pressed 6 keys. What happens when we press another one?
00 01 01 01 01 01 01    Woops. Phantom state (actual data representation, 01 denotes the phantom state)
00 0A 08 07 06 05 04    Key released, no phantom state any more.
...                     release the other keys
00 00 00 00 00 00 00


So non-working n-key rollover with a USB connection is a side effect of the data packet. Custom drivers and protocol could solve this, but I don't know if anyone is doing this as of now. In fact, given the puny market for anything offering more than 6-key rollover (not including modifiers!), I highly doubt anyone will ever do.

-huha
Title: USB vs Ps2 Keyboards
Post by: itlnstln on Sun, 12 April 2009, 09:14:32
Quote
But why does PS/2 support n-key rollover and USB doesn't? PS/2 transfers make/break codes, like this:


Someone (I think bhtooefr) can probably explain it better, but it's something about USB not being able to handle the amount/speed of input a PS2 port can.  I think part of it might be due to PS2 ports being exclusively designed around input (keyboards, mice, etc.) and USB being the "utility infielder."  (Baseball season is back! :) )
Title: USB vs Ps2 Keyboards
Post by: huha on Sun, 12 April 2009, 09:22:33
USB supports several transfer modes. I think normally, keyboards are just polled more or less regularly, but it shouldn't be too hard to make them use other transfer modes: USB supports giving a device a certain guaranteed bandwidth and latency, so this would alleviate problems with "lag" or whatever you want to call it. I think it's grossly exaggerated by the gaming crowd, though. However, I don't think it's worthwile slowing down the whole bus just to have a lag-free keyboard. Certain devices, i.e. audio and video hardware, need a certain bandwidth and latency to actually work, but a keyboard doesn't.

-huha
Title: USB vs Ps2 Keyboards
Post by: itlnstln on Sun, 12 April 2009, 10:04:27
Quote from: huha;28437
USB supports several transfer modes. I think normally, keyboards are just polled more or less regularly, but it shouldn't be too hard to make them use other transfer modes: USB supports giving a device a certain guaranteed bandwidth and latency, so this would alleviate problems with "lag" or whatever you want to call it. I think it's grossly exaggerated by the gaming crowd, though. However, I don't think it's worthwile slowing down the whole bus just to have a lag-free keyboard. Certain devices, i.e. audio and video hardware, need a certain bandwidth and latency to actually work, but a keyboard doesn't.

-huha


I don't know much about the protocols myself, but I remember bhtooefr saying something along the lines that manufacturers use the HID driver since it's pretty much already set up for them.  If manufacturers were to use a custom device/driver, they could overcome this limitation, but of course, this would add to the expense of said device.
Title: USB vs Ps2 Keyboards
Post by: iMav on Sun, 12 April 2009, 10:13:05
Quote from: huha;28424
1) Hot-plugging. I use it a lot.
2) Widespread availability of ports.

These are the two biggies for me.  

Shutting down a computer just to swap a keyboard is ridiculous.  

Every computer I have has USB.  Not all of them have PS/2 ports.
Title: USB vs Ps2 Keyboards
Post by: huha on Sun, 12 April 2009, 10:15:13
Quote from: itlnstln;28441
I don't know much about the protocols myself, but I remember bhtooefr saying something along the lines that manufacturers use the HID driver since it's pretty much already set up for them.  If manufacturers were to use a custom device/driver, they could overcome this limitation, but of course, this would add to the expense of said device.


Yes, that's about it. USB is extremely flexible when it comes to implementing your own ideas, but I don't think any company wants to spend money on developing their own keyboard controller (because standard controllers use the standard HID behaviour, so you wouldn't be able to use that) as well as drivers for umpteen operating systems.

-huha
Title: USB vs Ps2 Keyboards
Post by: Ysaquerai on Sun, 12 April 2009, 11:04:41
How about the 1ms polling rate speed on most USB Gaming keyboards, does this really benefit vs most generic keyboards that are not able to UP the polling rate?

I know for a fact that mouse/mice can really benefit in this areas (like 2ms), how about the keyboard?
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Sun, 12 April 2009, 11:25:10
I'd think that it should be far more critical for the mouse (which has to transmit its position changes) than for the keyboard. Then again, in some action shooter you're probably happy about every ms of delay you can save.

huha, thanks for the explanation of USB vs. XT/AT keyboard transfer btw (which absolutely makes sense). I'm not so much into the digital stuff.
Title: USB vs Ps2 Keyboards
Post by: o2dazone on Sun, 12 April 2009, 12:40:39
One thing to also figure, is that having a ps2 connection keeps a residual surge to the port so when you go standby, you can turn your machine back on with it, opposed to hitting the power button :)
I dunno...I have an nkro keyboard, and while that's nice, I find myself using the "pull out of standby via keyboard" method much more often. I've also had more new machines recognize my keyboard via ps2. Everytime I go USB it's always throwing me some funky error (winxp64), which requires me to unplug and plug it back up. But that could be an issue with the machine and not the board.
Title: USB vs Ps2 Keyboards
Post by: bhtooefr on Sun, 12 April 2009, 22:01:59
One huge advantage to PS/2 vs. USB that I don't think has been mentioned...

PS/2 is interrupt driven.

USB is polled.

This means PS/2 uses (in some cases significantly) less CPU than USB. Especially if you crank the polling rate up.

Anyway, I don't understand the details, but I would believe the standard was created how it was to allow for as small data packets as possible, to transfer them quickly. However, there's a couple ways to work around this.

1. Create a variant of the standard that DOES support NKRO, and have a proprietary driver.
2. Have the keyboard keep track of all the keys depressed, and only send to the host what it can handle. I believe key release is a separate scan-code, so this is possible. This is what the Das Keyboard is doing, and miserably failing.
3. Have the keyboard keep track of all of the keys depressed, and send everything via ASCII over USB. That would work, too, although it has its own flaws, requires a fair amount of processing power, and could still end up like the Das Keyboard issue.
Title: USB vs Ps2 Keyboards
Post by: nowsharing on Sun, 12 April 2009, 22:23:38
Quote
One thing to also figure, is that having a ps2 connection keeps a residual surge to the port so when you go standby, you can turn your machine back on with it, opposed to hitting the power button

I can come out of standby with my usb keyboard by pressing any key in Vista 64, but have to use the power button in Linux Mint.
Title: USB vs Ps2 Keyboards
Post by: Glockateer on Sun, 26 April 2009, 21:10:17
Quote from: bhtooefr;85101
One huge advantage to PS/2 vs. USB that I don't think has been mentioned...

PS/2 is interrupt driven.

USB is polled.

This means PS/2 uses (in some cases significantly) less CPU than USB. Especially if you crank the polling rate up.

Anyway, I don't understand the details, but I would believe the standard was created how it was to allow for as small data packets as possible, to transfer them quickly. However, there's a couple ways to work around this.

1. Create a variant of the standard that DOES support NKRO, and have a proprietary driver.
2. Have the keyboard keep track of all the keys depressed, and only send to the host what it can handle. I believe key release is a separate scan-code, so this is possible. This is what the Das Keyboard is doing, and miserably failing.
3. Have the keyboard keep track of all of the keys depressed, and send everything via ASCII over USB. That would work, too, although it has its own flaws, requires a fair amount of processing power, and could still end up like the Das Keyboard issue.


What would the response speed be on a PS/2 adapter? I know USB by default is 8ms because it's at 125hz. Also, if a keyboard such as Steelseries 7G uses PS/2 by default and has a USB connector, does that make it poll at 125 with the adapter being used?
Title: USB vs Ps2 Keyboards
Post by: cmr on Mon, 27 April 2009, 02:21:18
Quote
3) The mini-DIN plug used for PS/2 absolutely sucks. Aligning the thing without seeing it is extremely annoying.


USB is just as bad in my opinion
Title: USB vs Ps2 Keyboards
Post by: DesktopJinx on Mon, 27 April 2009, 02:33:48
Many years ago, HP nee Compaq switched their "slim" corporate PC to a USB-only layout, and provided USB keyboard and mouse. After three years, they went back to PS/2 keyboard and mouse. I recall having lots and lots of problems with the USB keyboards.

I have BitLocker on my Vista system, with a startup passcode. The pre-boot passcode authenticator doesn't recognize my USB Kinesis Freestyle -- my PS/2 M15 works fine.

The PS/2 KVM switchboxes I've used always worked great. The USB KVM switchboxes, always glitchy -- won't switch, keyboard or mouse dead on swtiching, bah.

I'm sure USB keyboards work great for most people in most situations, but I'll always be wary of them.

Mice, on the other hand... PS/2 is a pain.
Title: USB vs Ps2 Keyboards
Post by: Des on Mon, 27 April 2009, 05:54:55
Im just never "allowed" to go USB. let me explain.
I got a big old overkill KVMswitch from a server room upgrade a while back. (not having USB). And some of the old Computers that fill up a closet I "break" with RTOS'es now and again. So they are not to happy with USB.

That's just the personal reason I dont use Keyboard USB. Although this is an interesting discussion. Its sort of irritating PS/2 disapearing from motherboards for this reason among others. It really breaks everything here at home.

Interesting discussion.  IŽd like to ask you knowledgable people what a future without the PS/2 connection would entail?
Title: USB vs Ps2 Keyboards
Post by: huha on Mon, 27 April 2009, 06:11:38
Modern BIOSes offer legacy mode. When implemented correctly, there should be no compatibility issues with USB keyboards.

-huha
Title: USB vs Ps2 Keyboards
Post by: Des on Mon, 27 April 2009, 06:51:25
Quote from: huha;87496
Modern BIOSes offer legacy mode. When implemented correctly, there should be no compatibility issues with USB keyboards.

-huha


Ah yea, there is that.  I was thinking more on whats already said in the thread  thou, n-key rollover n'all that.

So more a possible future for n-key rollover in  USB land or not? etc.
Title: USB vs Ps2 Keyboards
Post by: huha on Mon, 27 April 2009, 07:10:06
Realistically speaking, who really needs n-key rollover? USB can handle 6 keys AND all modifiers; it's unlikely even the gaming crowd will press more than 5 keys simultaneously, having one hand using the mouse and all.
Sure, there are certain applications where NKRO is great, but developing and testing the drivers required is both cumbersome and expensive.

-huha
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Mon, 27 April 2009, 07:10:56
Sometimes it seems like typematic rate is not settable (http://ubuntuforums.org/showthread.php?t=598431) with PS/2 to USB converters. Is this a common problem?

huha, good question. Even Braille input is content with 6 keys.
Title: USB vs Ps2 Keyboards
Post by: IBI on Mon, 27 April 2009, 09:29:26
Quote from: huha;87504
Realistically speaking, who really needs n-key rollover? USB can handle 6 keys AND all modifiers; it's unlikely even the gaming crowd will press more than 5 keys simultaneously, having one hand using the mouse and all.
Sure, there are certain applications where NKRO is great, but developing and testing the drivers required is both cumbersome and expensive.

-huha


A game could easily do it with two-handed key combinations, but nobody's likely to make that sort of game given the vast majority of keyboards are limited to 3-key rollover and all the normal USB ones are limited to 6 anyway.
Title: USB vs Ps2 Keyboards
Post by: huha on Mon, 27 April 2009, 12:24:52
Quote from: IBI;87534
A game could easily do it with two-handed key combinations, but nobody's likely to make that sort of game given the vast majority of keyboards are limited to 3-key rollover and all the normal USB ones are limited to 6 anyway.


You can construct test cases, but really, I can't think of a single reason to actually need more-than-6-key rollover.
You can of course exceed this when using your computer keyboard to input notes in audio sequencers, but noone in their right mind would go to considerable lengths to buy an expensiv computer keyboard supporting simultaneous input of more than 6 notes--if this were really be required, you'd better be off buying a real keyboard.

Therefore, realistically speaking, I think 6-key rollover is enough. NKRO sounds really nice and it's a joy from a technical standpoint, but I still question its actual importance. Most human hands have just 5 fingers, after all.

-huha
Title: USB vs Ps2 Keyboards
Post by: DesktopJinx on Tue, 28 April 2009, 02:33:29
Quote from: huha;87496
Modern BIOSes offer legacy mode. When implemented correctly, there should be no compatibility issues with USB keyboards.


Lots of things in the computer industry aren't implemented correctly. If USB keyboard issues have all been addressed, that's great, I guess, but I will still be sad to see the PS2 keyboard interface go.

Thinking ahead... what USB adapter do you folks like for your Model Ms? The day may come when I have to plug my M into a USB-only system...
Title: USB vs Ps2 Keyboards
Post by: wheel83 on Tue, 28 April 2009, 02:40:38
i like the one from clickykeyboards.com  .. expensive, but you know its good.
Title: USB vs Ps2 Keyboards
Post by: Manyak on Tue, 28 April 2009, 02:43:20
Quote from: DesktopJinx;87693
Lots of things in the computer industry aren't implemented correctly. If USB keyboard issues have all been addressed, that's great, I guess, but I will still be sad to see the PS2 keyboard interface go.

Thinking ahead... what USB adapter do you folks like for your Model Ms? The day may come when I have to plug my M into a USB-only system...

I use one of these (http://cgi.ebay.com/USB-to-PS2-PS-2-Mouse-Keyboard-Adapter-Cable-for-PC-Mac_W0QQitemZ270350962830QQcmdZViewItemQQptZPCA_Cables_Adapters?hash=item270350962830&_trksid=p3286.c0.m14&_trkparms=66%3A2|65%3A1|39%3A1|240%3A1318|301%3A1|293%3A2|294%3A50), about as cheap as you can get. Any of the USB adapters with some sort of circuitry in them will work. Those are the ones that actually convert the keyboard's signaling, not just cross the PS2 wires over to USB.
Title: USB vs Ps2 Keyboards
Post by: bsvP585hUO2Y6 on Fri, 05 June 2009, 17:27:25
Quote from: Ysaquerai;81868
I just want to ask the members of this
forum. What basically benefits do we get when we use a usb or ps2
keyboard?


I'm a sucker for LEDs. And because just displaying the status of the
locking keys is a waste, I wrote a couple lines of C++ to show CPU,
disk and network activity on the keyboard's LEDs at 10ms
resolution. This works fine with 4 of the 5 USB Keyboards I own. A
Simens-Nixdorf one refuses to set the status after being abused that
way for a couple of minutes but otherwise remains functional.

The PS/2 ones however lose about every 50th keypress. Since it happens
with No-Name ones as well as HPs, Cherries and the USB ones hooked up
to PS/2 using a passive adaptor, I suspect the protocol is the
culprit. Maybe PS/2 is not designed for a significant amount of
bidirectional communication?

regards,
andreas
Title: USB vs Ps2 Keyboards
Post by: MANISH7 on Fri, 05 June 2009, 17:40:16
Quote from: wheel83;87694
i like the one from clickykeyboards.com  .. expensive, but you know its good.


Actually, you can buy that for $7 at Cyberguys (http://www.cyberguys.com/product-details/?productid=4850).
Title: USB vs Ps2 Keyboards
Post by: bsvP585hUO2Y6 on Fri, 05 June 2009, 18:58:48
Quote from: ripster;94422

So let me get this straight, the keyboard LEDs flash madly like a case LED when the hard drive is spinning?


Exactly.

Quote

Can you share more details how this works?


I'm afraid there is no way to set those LEDs independent of operating
systems. Here's how I do it on GNU/Linux:

Code: [Select]

#include <fcntl.h>
#include <linux/kd.h>
#include <sys/ioctl.h>

dev = open(&quot;/dev/console&quot;, O_RDONLY);
ioctl(dev, KDSETLED, LED_NUM | LED_CAP | LED_SCR);


There's a small collection of tools packaged in Debian that mess with
the keyboard LEDs as well:

Code: [Select]

tengen:~# apt-cache search keyboard.led
ixbiff - notify user when mail arrives by blinking keyboard LEDs
mailleds - Blink the keyboard-LEDs for incoming mail
x11-xkb-utils - X11 XKB utilities
tleds - blinks keyboard LEDs for TX and RX network packets
ledcontrol - scriptable keyboard led control
blinkd - Blinks keyboard LEDs e.g. for answering machine or fax
tengen:~#


"tleds" is the only program that too causes the symptoms on PS/2
'boards I described in my previous post. The other ones proably use
the LEDs conservatively enough to not render the 'board unusable.

If anyone is actually interested in my own undocumented and highly
experimental keyboard torturing code, I could post a tarball of that
directory.

regards
andreas
Title: USB vs Ps2 Keyboards
Post by: huha on Fri, 05 June 2009, 19:03:14
May I ask what frequency you're putting out LED state change commands? PS/2 data rate is extremely limited, so i's entirely possible you're saturating the entire bus, causing the keyboard to drop keystrokes. I can do some rough calculations as to what would be the maximum rate you can send commands to the PS/2 host (yes, you read that right, the PS/2 host is the keyboard) if you're interested.

-huha
Title: USB vs Ps2 Keyboards
Post by: bsvP585hUO2Y6 on Fri, 05 June 2009, 19:43:16
Quote from: huha;94429
May I ask what frequency you're putting out LED
state change commands? PS/2 data rate is extremely limited, so i's
entirely possible you're saturating the entire bus, causing the
keyboard to drop keystrokes.


I've tried it with different rates over PS/2, from 100Hz down to
10Hz. My observation was that the rate of lost scancodes dropped
significantly but didn't drop to zero. So it looked more like a
problem of collisions instead of saturation. I suspect those
collisions are pretty much impossible when the leds are used as
intended and the command is sent immediately after a lock key is
pressed. But I have to confess that I haven't studied the PS/2
interface to confirm this.

Quote
I can do some rough calculations as to what would be the
maximum rate you can send commands to the PS/2 host (yes, you read
that right, the PS/2 host is the keyboard) if you're interested.


Hmm, I just read the german Wikipedia article[1] about PS/2, and it
says that the clock is generated by the 'board and can vary
signficiantly. I also get the impression collisions could in theory be
detected if both senders look for the data line being pulled low
unexpectedly during the transmission. I'm afraid I'll have to hook up
a scope to see what is actually happening on the wires :-/

Footnotes:
[1]  http://de.wikipedia.org/wiki/PS/2-Schnittstelle
Title: USB vs Ps2 Keyboards
Post by: huha on Sat, 06 June 2009, 07:19:07
You'll find quite a nice description of the PS/2 protocol here (http://www.computer-engineering.org/ps2protocol/).
Host-to-device communication (I think I've mixed something up earlier--the host is still the computer, the device just generates the clock signal) should take no more than 17 milliseconds per command, which seems to be reasonable (the 11 bits required for the actual command take 1.1 milliseconds at 10 kHz clock frequency, plus the quite long time to initiate the transfer, so let's just assume the worst-case scenario and let it be 17 milliseconds), so the maximum rate at which you'll be able to churn out host-to-device commands is about 58 Hz. This should, however, fully saturate the bus, so there's not much sense in that. I suspect the controller's software shouldn't be too happy about this, but I can see no reason why it should drop keystrokes with rates under 10 Hz. Maybe a scope will be of more help there, but I suspect the controller software just doesn't anticipate so many host-to-device communication attempts and could start misbehaving and sending out errors. But that's just speculation, you'll need to check with a scope for that.

-huha
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Tue, 01 December 2009, 15:26:54
Reviving this thread to add one more aspect about USB vs. PS/2:
Using USB, I occasionally experience some dropped characters when the system 'thinks' and hangs for a moment. Originally I thought I was imagining things, but it never happens on the PS/2 board. Stupid polling. ;-/

Yes, I know, my system is probably a little slow and I have too much stuff running, but anyway.
Title: USB vs Ps2 Keyboards
Post by: bsvP585hUO2Y6 on Tue, 01 December 2009, 15:47:34
I concur that the polling is a regression with USB keyboards. I
recently noticed that my Thinkpad eats ten watts instead of nine
when idling with an external USB keyboard instead of an external
PS/2 one. Investigating a bit revealed that the processor does no
longer enter C2 sleep state as soon as the USB keyboard is hooked
up, explaining the increased power demand.

That's 10% battery life wasted because of the polling.
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Tue, 01 December 2009, 16:34:09
While we're at Thinkpads, I found it interesting that the internal one of the X61t sems to be USB. :shocked:
Which model do you have there?
Title: USB vs Ps2 Keyboards
Post by: cheater1034 on Tue, 01 December 2009, 16:35:21
usb is universal and the standard now too, every device is usb (eliminating things like game ports, ps2 ports, etc.)
Title: USB vs Ps2 Keyboards
Post by: ch_123 on Tue, 01 December 2009, 16:39:05
That doesn't automatically mean that it's the better choice.
Title: USB vs Ps2 Keyboards
Post by: microsoft windows on Tue, 01 December 2009, 16:54:05
USB keyboards take longer to detect than PS/2 models.
Title: USB vs Ps2 Keyboards
Post by: ch_123 on Tue, 01 December 2009, 17:02:26
I think proper support for hotplugging bends that issue in favor of USB.
Title: USB vs Ps2 Keyboards
Post by: Hak Foo on Tue, 01 December 2009, 22:22:02
With USB, you get no "press F12 for boot menu" time.
Title: USB vs Ps2 Keyboards
Post by: AndrewZorn on Tue, 01 December 2009, 22:27:12
must just be you
Title: USB vs Ps2 Keyboards
Post by: bsvP585hUO2Y6 on Tue, 01 December 2009, 23:11:36
Quote from: keyb_gr;137847
While we're at Thinkpads, I found it interesting that the internal one of the X61t sems to be USB. :shocked:
Which model do you have there?


It's an R40. Its internal board uses ps/2. External ones are supported via the docking port.
Title: USB vs Ps2 Keyboards
Post by: ricercar on Wed, 02 December 2009, 00:13:09
PS/2 fits in a crayon sharpener. Try that with USB!
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Wed, 02 December 2009, 03:44:25
To be honest I have not used my serial and parallel ports in ages, but they do tend to be very handy for special applications, like reviving semi-dead harddrives that have hung up due to a firmware bug, or controlling some ICs with an I2S interface (it takes a "real" parallel port for the latter though, a USB adapter won't cut it - by contrast, there are a few USB RS-232 adapters suitable for low-level stuff around).

Incidentally, even my trusty P2B-D (10 year old technology) has USB legacy support and I can use a USB keyboard for the BIOS setup just fine. Gotta try on the truly historic GA-686KDX.
Title: USB vs Ps2 Keyboards
Post by: microsoft windows on Wed, 02 December 2009, 19:03:20
Quote from: ripster;137921
Even my oldest computer (Asus A8N SLI Deluxe) allows me to access everything through USB at bootup.  In fact it's useful because I use a DiNovo Mini Bluetooth to access the media computer in a wiring closet downstairs from the TV room.  Try doing that with PS/2!


Your oldest computer is not old. Even my NEWEST machine doesn't do that!
Title: USB vs Ps2 Keyboards
Post by: HaaTa on Wed, 02 December 2009, 19:56:02
Well, I bought a Gigabyte EP35 (DS3P I think) a while a back, it actually has headers on the motherboard for serial and parallel ports. Mind you its more than a year old now.
Title: USB vs Ps2 Keyboards
Post by: Rajagra on Wed, 02 December 2009, 21:05:00
Quote from: ripster;137921
Even my oldest computer (Asus A8N SLI Deluxe) allows me to access everything through USB at bootup.


Really? Can you hit print screen from inside the BIOS to get a screendump like you can with parallel printers?
Title: USB vs Ps2 Keyboards
Post by: ricercar on Thu, 03 December 2009, 00:15:03
My Commodore SX64 has no USB, no PS/2, but it does have mechanical key switches.
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Thu, 03 December 2009, 03:04:40
Quote from: Rajagra;138225
Really? Can you hit print screen from inside the BIOS to get a screendump like you can with parallel printers?

That most probably not. I think the HID protocol was the only one deliberately kept simple so that key codes could be extracted just by looking at the packets.
Title: USB vs Ps2 Keyboards
Post by: grantb3 on Thu, 03 December 2009, 10:25:16
Quote from: Hak Foo;137914
With USB, you get no "press F12 for boot menu" time.


I do.
Title: USB vs Ps2 Keyboards
Post by: nowsharing on Wed, 31 March 2010, 16:47:48
Quote
Are there power usage benefits to using an active usb converter? I read this at clickykeyboards.com:

Quote:
Online reports indicate that vintage IBM ps/2 keyboards pull up to 100x more current compared to modern keyboards (112 mA vs 1.2 mA). see reference: (http://www.geocities.com/jszybowski/keyboard/index.htm (http://www.geocities.com/jszybowski/keyboard/index.htm)). One way to resolve this problem to add resistors to change the voltage, or an easier non-destructive fix is to use an active ps/2 to USB plug-in converter with built-in electronics.

This sounds like it might add a longer life to older Ms?

Sorry to dig up this old thread. My blue cube came in today and it reminded me of a question I asked in this thread: Does converting to USB make our old Ms draw less current, perhaps extending the life of the onboard electronics?
Title: USB vs Ps2 Keyboards
Post by: Rajagra on Wed, 31 March 2010, 16:56:12
Quote from: ripster;168456
Now the M2 - those have like a 50% failure rate.


Sounds right. 50% of the 2 electrolytic capacitors in mine had failed, making it unusable. :rofl:

Fine since the repair though.:thumb:
Title: USB vs Ps2 Keyboards
Post by: keyb_gr on Wed, 31 March 2010, 17:54:59
Quote from: nowsharing;168453
Does converting to USB make our old Ms draw less current, perhaps extending the life of the onboard electronics?

Of course not. That text you quoted wasn't worded overly well. It's not like the adapter would magically decrease the power consumption, but rather the higher current available with USB power compared to problematic PS/2 ports makes things more likely to work. It should be a +5V supply in either case.
Title: USB vs Ps2 Keyboards
Post by: ch_123 on Wed, 31 March 2010, 18:07:32
The keyboard is going to consume as much power as it needs regardless. The issue here is that there are some motherboards whose PS/2 ports are inferior to the likes of the Blue Cube or the Belkin, so they actually are more reliable when used with the latter.
Title: USB vs Ps2 Keyboards
Post by: kishy on Wed, 31 March 2010, 19:21:56
Since current was brought up, I should mention this (I will edit this post very soon after making it, because I need to get to one of the links in my sig to find what I'm looking for)

Edit: had to go through 14 pages to find it, but I found it.

http://geekhack.org/showpost.php?p=123069&postcount=186

1986 terminal keyboard was identified as using nearly 200mA of juice. I thought I had included a test with a normal Model M at the same time; apparently not. Presumably the controller PCBs don't differ too much though.
Title: USB vs Ps2 Keyboards
Post by: Manyak on Thu, 01 April 2010, 01:13:34
Quote from: ch_123;168483
The keyboard is going to consume as much power as it needs regardless. The issue here is that there are some motherboards whose PS/2 ports are inferior to the likes of the Blue Cube or the Belkin, so they actually are more reliable when used with the latter.


It's not the adapter that allows more power, it's the USB ports of the PC you're connecting it to.
Title: USB vs Ps2 Keyboards
Post by: Nonmouse on Thu, 01 April 2010, 01:18:57
Quote from: ripster;138230
What's a parallel port???  :biggrin1:


You can't be serial....
Title: USB vs Ps2 Keyboards
Post by: Nonmouse on Thu, 01 April 2010, 01:31:42
Quote from: ripster;168566
Yes I am.  USB is infinitely more powerful than PS/2.

Try boiling water with a PS/2 port.

I think I DIN hear you correctly....
Title: USB vs Ps2 Keyboards
Post by: ch_123 on Thu, 01 April 2010, 03:28:59
Quote from: Manyak;168560
It's not the adapter that allows more power, it's the USB ports of the PC you're connecting it to.


Never said otherwise. In theory, PS/2 offers more power, but in reality, a lot of motherboards skimp on it.
Title: USB vs Ps2 Keyboards
Post by: kishy on Thu, 01 April 2010, 05:29:45
Quote from: ch_123;168574
Never said otherwise. In theory, PS/2 offers more power, but in reality, a lot of motherboards skimp on it.


Sorry but what's the theory behind that? Spec called for a max of 200 or 250 mA, I can't recall which.

USB spec requires a minimum supply to keep a device drawing up to 500mA happy at all times.