I'd like to use an Arduino Duemilanove as a PS2 keyboard emulator, that I can plug into a laptop. I would need to know the electrical connections, although I could gut an old PS2 keyboard as a starting point and maybe drive its internal electronics. I assume that would require generating some kind of matrix of input values, in place of the physical keyboard.
Any advice or pointers will be gratefully received.
Start with the links in the "Further readings" section of Arduino Playground - PS2Keyboard. You will find the protocols, scan codes, and everything you need to send out of the Arduino to the laptop, if you follow those links through about one or two levels deep.
We are discussing here about how to send characters (and other data) into a laptop's PS2 keyboard (& mouse) input port?
Yes, the original question asked for help sending keyboard info from the Arduino to a laptop. The referenced page has a section titled "Further readings" near the bottom of the page. If you follow the links in that "Further readings" section, you will find details of the PS2 keyboard communication protocols and electrical interfaces.
(Sorry, I almost didn't read your post because of the distracting scrolling line in your signature.)
Thanks TBAr that's very helpful although, to be clear, yes I am trying to emulate a keyboard, not interface with it, so it looks like I have work to do.
Main question I have next is with clock rates. The reading I have done mentioned 20 to 30 kHz, so I'm wondering how critical that is. If I drive the clock and data much slower will it still work, I wonder. I assume the clock pin mentioned in the Playground write-up is generated by the library code and not a built-in hardware feature?
I could try to reverse engineer the keyboard interface code, but I think I will start very simply from first principles. The references you pointed me to are very helpful. Thanks again.
BTW I'm a complete Arduino newbie. It's great fun!
Ok I have uploaded to the playground a library that implements the device side of the ps/2 protocol. I used it in a couple projects, including a sun type 5 to ps/2 interface. Also the ps/2 port on the computer can provide plenty of power to drive the arduino
Ok I have uploaded to the playground a library that implements the device side of the ps/2 protocol. I used it in a couple projects, including a sun type 5 to ps/2 interface. Also the ps/2 port on the computer can provide plenty of power to drive the arduino
Very interesting! I have also made such a library, and it's quite similar to yours. However, I've had some timing-issues, especially when I try to emulate both a mouse and a keyboard at the same time. Have you tried this with your library? I will definitely look into this later today, as it might solve some problems I've been struggling with for weeks.
Well, your library wasn't really suited for my application (my library have read- and write-buffers, and I would need to change a lot of things to manage without them) so I just replaced my own ps2read/write-routines with yours (very slightly modified). So far it's looking good I'm going to test it further, and if your code did the trick you deserve a big THANK YOU I've struggled with the timing for almost two months now...
Very interesting! I have also made such a library, and it's quite similar to yours. However, I've had some timing-issues, especially when I try to emulate both a mouse and a keyboard at the same time. Have you tried this with your library? I will definitely look into this later today, as it might solve some problems I've been struggling with for weeks.
I have used it as a mouse and a keyboard but never both at once
Also looking for a way to cut my pc's ps2 keyboard and plug an arduino there...
Couldnt make the ps2dev.h to work.
Couldnt find ps2dev.h references or something that I could read to build my own application.
Actually Im kind of stuck...sorry.
Any help?
A simple sample to compile within arduino which will make it send a letter 'A' to PC for each second would be a nice start.
It seems an Arduino acting as a keyboard via PS/2 is easier (hardware and software wise) than doing it via USB
To sum up in a pair of words... "MUCH easier."
The USB method requires you to essentially BIT-BANG the USB HID Emulation on the Arduino. While some Micro controllers are now built with USB HID support... the ones we use do not. A lot of people have used the software solution provided here --> V-USB - A Firmware-Only USB Driver for Atmel AVR Microcontrollers to build USB devices with AVR chips. (So it can be done)
The PS2 protocol is a simple synchronous serial connection and we already have the library code in the playground.
Hardware wise, can I basically hook the port straight up to the arduino? Do I need to do something smarter? Finding lots of stuff about hooking up a keyboard to an arduino, but not the reverse....