PDA

View Full Version : Advice on PS/2 Scan Codes



penelopepug
- 11th January 2006, 20:25
Hi. I've been working on a project where I have built my own RF remote control to control Winamp which serves as the MP3 player on a PC for my music collection. Winamp is visible running full screen in a 19" monitor embedded in a wall. The purpose of the remote is to send commands to operate Winamp remotely. I was using an X10 remote control and have tried others like Remote Wonder (a USB based RF remote), but their repeat rate is way to slow and as such scrolling through 100 song play lists is painfull. My remote transmitter consists of a 433 MHz RF transmitter module, a PIC16F876 and some buttons. The reciever is a 433 MHz RF module that feeds serial commands (received from the transmitter) into a PIC16F876 which in turn has several port connections to a KeyWiz keyboard encoder.

Everything works perfectly and it is super fast at scrolling (about 100 songs in 2 seconds) however my use of the Keyboard encoder was required because I do no know how to feed serial data directly into the PCs USB or serial port to be interpreted as PS2 scan codes. I know how to physically feed it but what is required to elliminate the keyboord encoder desinged for MAME? Any pointers would be appreciated. I assume I need to learn some VB or C++ to do what I want.

Melanie
- 12th January 2006, 07:13
I don't know if this is what you're after...

http://www.picbasic.co.uk/forum/showthread.php?t=81

penelopepug
- 12th January 2006, 17:46
Thanks Melanie. I'm trying to find a means to avoid the use of a keyboard encoder to receive keyboard commands. For example, if I purchased an RF receiver module that plugs into a USB port of a PC, do I have to develop an application that runs on the PC that would accept serial data and convert it into keyboard commands?

I came accross this page that lists USB 16 bit keyboard positions at
http://www.win.tue.nl/~aeb/linux/kbd/scancodes-13.html.

Does this imply that a USB port can be used to receive keyboard commands directly without running a special application? Any advice would be appreciated.

Luciano
- 12th January 2006, 18:46
http://tekgems.com/Products/tg-pbr.htm

WinAmp Multimedia PC Remote

$4.99 USD

http://tekgems.com/images/large/pbr.jpg

penelopepug
- 12th January 2006, 19:40
Thanks Luciano. I've seen that Packard Bell remote before. That remote is IR, not RF howerver I could likely adapt it However, vertually every remote I have encountered has a very slow command repeat rate for some reason. Do you know if this remote is capable of trasmitting 50 to 100 commands per second? I see the software allows you to set how many times the command is repeated but I wonder about the repeat rate. The other thing I wanted to avoid is having lots buttons that are not used (like the mouse and curser buttons) and buttons whose native funtions are mapped for something else. Currently, my remote (although not exactly pretty) has 13 dedicated buttons for the following commands or macro commands;

Volume Up (Keypad 8) - Fast Repeat Rate Required
Volume Down (Keypad 2) - Fast Repeat Rate Required
Scroll Up (Up Arrow) - Fast Repeat Rate Required
Scroll Down (Down Arrow) - Fast Repeat Rate Required
Queue Track (Q)
Play/Select (Enter)
Play Previous Track (Z)
Play Next Track (B)
Pause (C)
Toggle Shuffle Mode (S)
Sort Playlist By Title (CTRL + ShIFT + 1)
Randomize Playlist (CTRL + SHIFT + R)
Reverse Playlist (CTRL + R)

Luciano
- 12th January 2006, 20:00
Hi,

Maybe I have a solution, but what's wrong with your current
keyboard encoder? Why do you want to replace it?

Best regards,

Luciano

penelopepug
- 12th January 2006, 21:54
Hi Luciano. The use of the encoder was a work-around because I did not have a solution to feed data directly into a USB port. What I have done works perfectly, but it is a crude solution and I want to do this the best way possible. The keyboard encoder was meant to have various arcade buttons connected to it. My pics' software receives serial commands then translates those to simulate buttons being pressed by lowering various port pins connected to the button inputs of the keyboard encoder. I beleive there are serial keyboard encoders ICs but I would like a solution that feeds the commands directly into a USB port if possible. I need to understand a lot more about PC architecture I guess.

Luciano
- 12th January 2006, 22:33
Hi,

See this link.

Human Interface Device (HID) class
http://www.lvr.com/hidpage.htm

Best regards,

Luciano

penelopepug
- 13th January 2006, 06:35
Thanks Luciano. I shall dive in.

Luciano
- 13th January 2006, 09:02
Hi,

Windows XP will let you connect a PS2 and a USB keyboard at the same time.
Connect a sandard PS2 keyboard and connect your device as USB keyboard.
(XP will see them as one keyboard).

There is no need to write special software on the PC
if Windows XP sees your device as USB keyboard.

See this link:
http://www.mecanique.co.uk/products/usb/easyhid.html

* * *

Also possible with Windows XP

SerialKeys: Use an Alternative Input Device Instead of a Keyboard or Mouse

SerialKeys is accessibility feature designed for people who have difficulty using the computer's standard keyboard or mouse. SerialKeys provides support so that alternative input devices, such as single switch or puff and sip devices can be plugged into the computer's serial port.

https://www.microsoft.com/windowsxp/using/accessibility/serialkeys.mspx

How to Set Up and Use SerialKeys in Windows:
http://support.microsoft.com/?kbid=260517

Best regards,

Luciano

penelopepug
- 13th January 2006, 17:40
Wow, that appears to be exactly what I was looking for. Although my music server is running Windows 98, I plan to replace the PC soon. We have another PC running XP in our den that I can test things on anyway. I'm surprised that XP has such a facility (serial keys). It can't get any easier than that. And I'll definately check out the HID application. These potentially make possible (for me) all kinds of interesting projects. Thanks again for all of your help.

I did complete my Winamp RF Remote last night. Although the receiver is somewhat crude with respect to the hardware I used, the result is a high performance MP3 remote. It's very fast and easy to use.

What you provided me will hopefully allow me to develope something that requires a lot less hardware and construction time so that I can build some more of these for freinds and family.

Luciano
- 13th January 2006, 17:48
Hi,

If you scroll the link below you will see that:
(Microsoft has forgotten XP in the list).

APPLIES TO
• Microsoft Windows 2000 Professional Edition
• Microsoft Windows 95
• Microsoft Windows 98 Standard Edition
• Microsoft Windows 98 Second Edition
• Microsoft Windows NT Workstation 4.0 Developer Edition
• Microsoft Windows Millennium Edition

How to Set Up and Use SerialKeys in Windows:
http://support.microsoft.com/?kbid=260517

Best regards,

Luciano

penelopepug
- 13th January 2006, 18:05
Thanks! I just assumed this was an XP addition. I wish I would have known about this about 20 hours of developement and build time ago! Oh well...I'll likely experiment with this option this weekend. It seems simple enough. I'll post an update if I make any progess.