PDA

View Full Version : PS/2 Interface Driver



jburke71
05-08-2008, 10:57 PM
Hey All,

I'm thinking about working on a project that will require interfacing to a computer via the PS/2 port. I'm not familiar with the PS/2 spec, so I thought I would ask for some guidance and/or resources.

A couple of questions:

1.) Has anyone done this? If so, how did you go about doing it.
2.) Is there an existing driver? If not, what's the best way to go about creating one and are there resources for the PS/2 spec?
3.) Would it be easier to use USB instead of PS/2?

My understanding of the PS/2 interface (what little I have) has come from interfacing a keyboard with the Prop using the existing drivers, but with this project, I want to go from the Prop to the Keyboard input on the computer. I think that's enough to start with. Any thoughts, ideas, suggestions or pointers are greatly appreciated.

Thanks,

Jason

PS: As an interesting aside, part of this project might include designing a binary keyboard for my girlfriend's father. As a result of a childhood accident he's blind and missing both hands. A challenge to be sure, but my thought was to use a three button interface (1, 0 and <enter>) to input binary ASCII codes for each letter along with an attached speaker to say the letter after every 8 bits. The <enter> button is either for an actual enter key, or to send the letter to the computer.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing to see down here. Move along...

Paul Baker
05-08-2008, 11:04 PM
Yes, the Demo Board already has 2 PS/2 connectors on it, and there are drivers for both mouse and keyboard located in the home directory of the Tool: (mouse.spin and keyboard.spin), btw PS/2 is much easier than USB.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

Post Edited (Paul Baker (Parallax)) : 5/8/2008 4:09:37 PM GMT

jburke71
05-08-2008, 11:56 PM
Paul Baker (Parallax) said...
Yes, the Demo Board already has 2 PS/2 connectors on it, and there are drivers for both mouse and keyboard located in the home directory of the Tool: (mouse.spin and keyboard.spin), btw PS/2 is much easier than USB.


Hi Paul,

Thanks for the quick response and info. I've actually wired up (on a breakout board) a PS/2 input for my Prop Education Kit, and connected a keyboard to it and used the drivers to read from the keyboard.

However, I want use the Prop as a custom keyboard controller (i.e.: send keyboard make/break codes to PC via PS/2 port based on button pressed), and it doesn't look like the keyboard driver supports doing this. I could only find methods to read the keyboard state.

Jason

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing to see down here. Move along...

Agent420
05-09-2008, 12:21 AM
yeah, there's a difference between reading a keyboard and emulating one. The protocol is the same, but you're on the other side of the master / slave device fence.

I've done a couple of ps2 projects in the past, but I'm fairly new to the Propeller. A quick glance at the ps2 demo files suggests that it only offers the keyboard input functionality.

here's the reference material I've used in the past... Hope it's some help.

http://www.burtonsys.com/ps2_chapweske.htm

jburke71
05-09-2008, 01:42 AM
Agent420 said...
yeah, there's a difference between reading a keyboard and emulating one. The protocol is the same, but you're on the other side of the master / slave device fence.



I've done a couple of ps2 projects in the past, but I'm fairly new to the Propeller. A quick glance at the ps2 demo files suggests that it only offers the keyboard input functionality.



here's the reference material I've used in the past... Hope it's some help.



http://www.burtonsys.com/ps2_chapweske.htm


Thanks for the reference. It seems to be the only thing out there when I do a google search for "PS/2 Keyboard Interface|Protocol".

After reading this article (and another one by the same author), I'm wondering if I can use one of the serial drivers for this. A PS/2 keyboard is, after all, talking to the PC serially. The timing might need to be more exacting though. Hmm...

Thanks for the thoughts Agent420, very helpful.

Jason

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing to see down here. Move along...

stevenmess2004
05-09-2008, 04:08 AM
There was someone on the forums here that was working on PS2 output to a computer. It may have been deSilva but I can't remember. Try having a look in the obex, OBCs project index and the prop magazines here http://forums.parallax.com/showthread.php?p=716256
http://forums.parallax.com/showthread.php?p=717404
http://forums.parallax.com/showthread.php?p=721797