Pages: [1] 2   Go Down
Author Topic: PS2 Keyboard Emulator  (Read 9129 times)
0 Members and 1 Guest are viewing this topic.
Ottawa, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino... it's gonna work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Regards to all,
Mark
Ottawa, Ontario, Canada
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Start with the links in the "Further readings" section of http://www.arduino.cc/playground/Main/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.
« Last Edit: July 17, 2009, 08:56:04 pm by TBAr » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
Eureka does not mean what you think.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[size=12]
Hello!
We are discussing here about how to send characters (and other data) into a laptop's PS2 keyboard (& mouse) input port?

The referenced page discusses the wonders of having the Arduino communicate with a keyboard.
----
/me
[/size]

Time is like sleep, it goes faster when you're not using it.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.)
« Last Edit: July 17, 2009, 10:15:19 pm by TBAr » Logged

Ottawa, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino... it's gonna work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Regards,
Mark
Ottawa, Ontario, Canada
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the contribution!

That library would be at the bottom of this page.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for doing the link
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 147
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 147
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: July 23, 2009, 02:38:17 pm by skumlerud » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone have a working implementation of any arduino PS/2  keyboard emulator library? I can't seem to get the ps2dev one to work. QQ
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
[ch12420][ch12387][ch12401][ch12426]!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

smiley-wink
Btp~
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I second that :-)

A basic overview of what's needed (hardware and software) wise would be great.

It seems an Arduino acting as a keyboard via PS/2 is easier (hardware and software wise) than doing it via USB.
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1655
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 --> http://www.obdev.at/products/vusb/index.html 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.
Logged

Pages: [1] 2   Go Up
Jump to: