Pages: [1]   Go Down
Author Topic: Parallax "PS/2 Mini-Keyboard"  (Read 946 times)
0 Members and 1 Guest are viewing this topic.
NS Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,     Has anyone else tried interfacing this keyboard with Arduino? If so I'd like to hear about their experience.
I could read the key codes it puts out "right out of the box", but there are some serious problems with them. Most serious is that there are eight pairs of keys that give the same code e.g. both the '[' key and the 'T' key output a 0x74 . None of the keys send a Break code, and the codes sent do not follow PS/2 protocol.
  Parallax has a disclaimer in their description of the product saying that it is "designed for use with the Parallax Propeller Chip" but I can't see how any host could distinguish between keys that send the same key code. What am I missing here?
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a link for the product?

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

NS Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, here's the link...........

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/Keyboard/List/0/SortField/4/ProductID/338/Default.aspx

This keyboard is not in their print catalog, only on their web store.

Glen
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would this help?
http://www.arduino.cc/playground/Main/PS2KeyboardExt2

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

NS Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Kari for that.   I used that library (PS2Keyboard.h  and .cpp) to handle the interface to the keyboard and it worked just fine. I had no trouble receiving the key codes, but if several keys share some of the codes, then the keyboard is unusable, unless there is some work-around that I can't imagine.  smiley-cry
Glen
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6374
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if several keys share some of the codes, then the keyboard is unusable
That seems unlikely.  It's not like a PS2 keyboard is rocket science.  It's more likely that the library doesn't handle "extended" keyboard codes or something  (IIRC, the PS2Keyboard.cpp library only handled a limited number of keys)...  (have you tried connecting the keyboard to a PC?)

You might try http://code.google.com/p/ps2keypolled/ (which is sort of old by now, but implements some different strategies.)
Logged

NS Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
[That seems unlikely.  /quote]
Unlikely, but true. There were eight pairs of keys with the same codes, and there were other inexplicable oddities.
Quote
It's not like a PS2 keyboard is rocket science
True, but it is muddled science. The assignment of the key codes in the original PS/2  keyboards must have made sense on some level (perhaps on a physical level of the pcb) but they bear no relationship to each other or to the ASCII codes which they have to be translated into.
And to further confuse the issue the work of detecting, debouncing, buffering and interpreting keypresses was divided between a "keyboard encoder" in the keyboard and a " "keyboard controller" in the host computer, the two being in two-way communication. So when we try to interface an Arduino board with a PS/2 keyboard we are working with half a system. And even worse, the Parallax PS/2 keyboard, as it turns out, is PS/2 in name only. It does have PS/2 style connector.
However, I have it sorted out now, or at least to the extent that the keyboard will serve my purposes.  I contacted Parallax support staff and they sent me a list of the key code assignments in their keyboard. They have assigned the codes rationally, i.e. like the ASCII codes, and have kept the printing and non-printing codes in separate groups.
   The authors of the PS2Keboard.h and .cpp files did some reassigning of codes in an attempt to make the PS/2 mish-mash more reasonable.  So, the selective reassignment of codes in PS2Keyboards.pss  and the total reassignment of codes in the Parallax keboard gave me a system in which several keys were assigned the same code (this happened eight times), some keys had no code, and some printable keys were given control functions and vice versa.   As a kludge I went into the PS2Keyboard library files on my PC and re-reassigned some key codes to resolve most of the conflicts and I now have a working keyboard that talks to my Arduino Uno.
      The Parallax Mini keyboard is a nice little 88-key keyboard, with full-size keys Only the numeric kepad keys have been omitted.  Check it out at
http://tinyurl.com/62h7y7q
Now if someone would write a library for it the world would be a better place  smiley-grin
Logged

Pages: [1]   Go Up
Jump to: