PS/2 Keyboard and Mouse Question
hippy
Posts: 1,981
Are PS/2 keyboards and mice hot-pluggable/unpluggable when used with the Propeller ProtoBoards, Demo Boards etc ?
That's in terms of electrical damage rather than how any Spin/PASM handler may react to such an occurence.
There are all sorts of warnings which say "don't" when it comes to PC's but I've never read a comprehensive explanation as to why not, just dire warnings that electrical damage can occur ( keyboard/mouse and/or motherboard ).
That's in terms of electrical damage rather than how any Spin/PASM handler may react to such an occurence.
There are all sorts of warnings which say "don't" when it comes to PC's but I've never read a comprehensive explanation as to why not, just dire warnings that electrical damage can occur ( keyboard/mouse and/or motherboard ).
Comments
(Having said that I'll fry a motherboard in the morning doing it.. )
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with the Protoboard? - Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card? - PropDOS
A Living Propeller FAQ - The Propeller Wiki
(Got the Knowledge? Got a Moment? Add something today!)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley
Traffic is slow at times, but Parallax orders·always get here fast 8)
Post Edited (jazzed) : 4/21/2008 3:21:46 PM GMT
i worked for the company that invented the PS/2 port. I have not yet fryed any port device or the port itself after a few 1000 hot plugs within 20 years.
On the PS/2 port you have 4 pins connected ( 5V, clock, data ,GND). Depending on the angle you try to put the plug in, the worst thing , that can happen is: plugging +5V first, then either the clock or data pin. But both pins are designed for 5 volt operation. Since most all keyboards and mice are powered by the main board of your PC, that shouldnt pose a problem.
Except, in that fry cases , ESD was involved.
I can conform cases, where the keyboard or mouse didnt work after hotplugging; but this is keyboard/mouse HW and/or SW issue . e.g.: Older keyboards relied on a keyboard controller reset during BIOS boot (you could see it on the flashing num/shift/scroll LED's); plugged in later,they didnt work; you had to reboot your PC.
On the prop: e.g. FEMTOBASIC. during startup it tries to find a keyboard, else it displays the message "NO KEYBOARD FOUND" . If you forget to plug in your keyboard before startup, it will never look again for one. so you have plug your keyboard and restart your prop and it works.
now i understand your question.
the proto- and demoboard have only 100 ohm series resistors for keyboard and mouse port. the general recommendation from parallax is at least 1kohm, when interfacing to 5 volt devices.
so in the worst case we get I= (U5v- UpropmaxIO) / 100, which is (5-3,3)/100 = 1.7mA for a high level . for a low level on an I/O pin, and thats what we should be assuming for a hot plug worst case it is (U5v-0)/100, which is 5 ma, which is well below the max sink limit of 30mA for an I/O pin. Even with the additional specification of maximum group sink limitof 100mA, you will not reach that limit.
so, should not be a problem with the prop.
1) Hot-swapping is not recommended
2) Hot-swapping should not cause damage, however,
3) Hot-swapping is done entirely at your own risk
4) Hot connection of the keyboard/mouse may not always be detected by the software
Both DAT and CLK are meant to be open-collector so I can visualise how less robust hardware could be hard-driving the lines with an expectation of the state the bus and that could cause problems on hot connection.
The Parallax Keyboard driver lets the lines float high as input, and outputs low to pull the bus down, so the bad case would be +5V on a bus line while pulling low, which through the 100R would be 50mA.
That's 25% above the rated 40mA sink shown in the datasheet. 120R would drop it to 42mA, 150R to 33mA.
Edit : @ propelleruser999 : Looks like you were typing as I was. But I think you have an error with 5/100=0.005
Extra Edit : Assuming the keyboard could put +5V out on DAT or CLK without there being any current limiting there. Given that there is either no pull-up in the keyboard itself or at least 25R there shouldn't be any problem. Only if the keyboard hard-pulled the line to +5V would there be a problem, and that would also be a problem under normal use.
Post Edited (hippy) : 4/21/2008 2:48:09 PM GMT
at first i have to agree to my (10 times) mistake.
corrected:
so in the worst case we get I= (U5v- UpropmaxIO) / 100, which is (5-3,3)/100 = 17mA for a high level . for a low level on an I/O pin, and thats what we should be assuming for a hot plug worst case it is (U5v-0)/100, which is 50 ma, which is well above the max sink limit of 30mA for an I/O pin.
i now say: in the case of hot plugging not quickly enough, you could do damage. I dont think the time you need to plug a connector will be more than 1 second.
but may be Chip Gracey has done some evaluations, how long overloading a pin wil be sacrificed by the prop.
I need to scope signals on keyboard and mouse, in what state they are most of the time. i hope its mostly 0 volts.
Keep you informed.
i hope its mostly 5 volts.
The problem on big systems, like PCs, seems to be that the O.S. can't adapt to a hot-plugged mouse, due to software issues. At least, this has been my experience; you had better have the mouse plugged in before starting windows, otherwise it won't see it. Keyboards seem to have looser rules.
As far as the mouse.spin and keyboard.spin drivers go, they (re)configure the mouse or keyboard whenever it gets plugged in anew, which is a lot more than a PC ever seemed to do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
And many thanks for that. I hadn't checked how it behaved in such circumstances, but that saves additional work.