Shop OBEX P1 Docs P2 Docs Learn Events
Program SX to act as HID device ie keyboard? ??HELP PLEASE — Parallax Forums

Program SX to act as HID device ie keyboard? ??HELP PLEASE

gth629egth629e Posts: 40
edited 2008-02-10 03:19 in General Discussion
Okay,

Here is what I need to do or find out if it is possible.

Lets say I have 20 standard I/O switches. With the propeller chip, can you detect those switches and program it to send ASCII keyboard codes to the PC via PS/2 or USB.

So pretty much I need to detect when a switch has been closed and in return send the ASCII command to computer. Like making your own keyboard. Also it would have to be able to realize when a key is continuously pressed.

I am at whits end and I know this has to be possible with some kind of PIC.


Please let me know if you have any idea. Thanks

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-02-07 02:39
    You want to use a SX to generate the PS/2 keyboard "code" in response to button-pushes from·your own·keypad made of push-button switches?
  • gth629egth629e Posts: 40
    edited 2008-02-07 02:50
    Yep that would be fantastic lol
  • gth629egth629e Posts: 40
    edited 2008-02-07 02:51
    I've been researching for about a week and I'm at whits end lol
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-02-07 02:57
    The SX can certainly do serial output·and since it supports an interrupt it should be able to "detect" that a button is being held down, too.

    What do you know about the "scancodes"?
  • gth629egth629e Posts: 40
    edited 2008-02-07 03:00
    I have a list of the scan codes, thats not an issue.

    http://www.asciitable.com/

    But it would need to hookup via a usb or ps/2 and be detected as a HID keyboard.

    Like this

    http://www.asciitable.com/
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-02-07 03:08
    With regard to a "standard" PS/2 keyboard -- it's not an "intelligent" device, is it (ATN, kybd : ACK, kybd·: ATN, kybd : ACK, kybd·: ...)?

    I think that the SX should be able to knock-out the pulse-trains you require, they are very fast.

    Post Edit:
    Another thing -- a PS/2 keyboard·sends scancodes and that's different from ASCII codes.

    Post Edited (PJ Allen) : 2/7/2008 3:13:53 AM GMT
  • gth629egth629e Posts: 40
    edited 2008-02-07 03:15
    Okay that is good to know,

    How would I program the pulse trains?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-02-07 03:23
    Here's some information that you need to review ─· http://www.computer-engineering.org/ps2keyboard/

    As·for "how to do it"...
    There's a clock signal and the make & break pulse-trains (data).
    First find out what you need to do (which keys are you going to simulate, what are their "make/break" criteria), and·"focus, focus, focus --·like a laser beam."· Do more research.

    If you're looking for a ready-to-go canned solution, I don't have one for you.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-07 03:24
    First you have to understand what you're trying to do. If you want to support a PS/2 keyboard port, start with the Wikipedia article here:
    en.wikipedia.org/wiki/PS/2_connector. There are links to other useful information.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-07 03:28
    The Stamps ought to be able to generate PS/2 keyboard codes using the SHIFTOUT and SHIFTIN statements described in the Parallax Basic Stamp Manual. It ought to be straightforward to experiment with this, but you'll have to do the work. You won't find a ready-made example.
  • BeanBean Posts: 8,129
    edited 2008-02-07 03:28
    This might help a bit http://www.sxlist.com/techref/ubicom/lib/io/dev/keys/picboard.htm

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com



    Post Edited (Bean (Hitt Consulting)) : 2/7/2008 3:33:08 AM GMT
  • MikeKMikeK Posts: 118
    edited 2008-02-07 04:07
    Why not open a ps/2 keyboard, take out the controller board, and connect your switches to it in place of the keyboard membrane switches? Why re-invent the wheel?
  • gth629egth629e Posts: 40
    edited 2008-02-07 04:28
    I would do that but it is a bit of a pain and besides I want to make quiet a few of these.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-07 05:10
    At this point you have lots of links to similar projects any of which you could use as a model.
    You'll need to pick one and begin to learn and use the programming tools available for the
    platform so you can modify the program to do exactly what you want. Although the SX is
    fairly cheap and has nice tools, there are no ready-made examples of what you want. The
    Microchip and Atmel devices are cheap, particularly for the configurations used in the sample
    projects you've been pointed to. Enjoy yourself. You'll have a great, though occasionally
    frustrating learning experience that you will get no matter what platform you choose.
  • pjvpjv Posts: 1,903
    edited 2008-02-07 05:32
    Hi gth629e;

    I have made a commercial product that I sell for some serious $$ that uses an SX 28 to do just that. So; it IS possible... just a bunch of work.

    Cheers,

    Peter (pjv)
  • T'SaavikT'Saavik Posts: 60
    edited 2008-02-10 03:19
    If you are looking for something cheap, quick, easy and probably better then you will ever achieve without spending massive amounts of time on it, I'd recommend checking out these products.

    arcadecontrols.com/arcade_input.shtml#KeyboardEncoders

    I own the keywiz myself. It has a ton of profiles i switch on the fly with batch files, works pretty well.
    That, and there is a purple robed wizard that shoots laser beams (freaking laser beams man!) out of his eyes at the chip while it re-programs, how can you go wrong?!
Sign In or Register to comment.