Shop OBEX P1 Docs P2 Docs Learn Events
Simulate keyboard with Propeller — Parallax Forums

Simulate keyboard with Propeller

salokcinsalokcin Posts: 6
edited 2009-02-23 01:19 in Propeller 1
Hi there, just wondering if any of you fine folks can help me understand how I might build something similar to "Ultimarc's I-Pac" using the Propeller. I basically need to be able to plug my Prop in via USB and have it act as a keyboard. I want to be able to use Spin to send commands, like "Ctrl+G" etc.

Any pointers in the right direction would be MUCH appreciated!

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-02-19 17:11
    Start by pleading with bradC to release his HID stuff. Prepare to spend a bit of time on this too.
  • J. A. StreichJ. A. Streich Posts: 158
    edited 2009-02-19 17:15
    I think PS2 would be a lot easier to replicate, if you can use PS2 for it instead.
  • salokcinsalokcin Posts: 6
    edited 2009-02-19 17:17
    Hey thanks for the FAST replies and good info. I'd rather not use PS2 (because the machine it will be attached to doesn't have PS2). Someone else suggested hacking a keyboard and firing off keystrokes somehow using the Propeller. I may look into that. ( I know, _super_ dirty! )
  • J. A. StreichJ. A. Streich Posts: 158
    edited 2009-02-19 17:43
    salockin, that's not a bad idea, and shouldn't be terribly difficult to do -- but it will likely be time consuming to get the key map down. What is this for, out of curiosity?

    EDIT: It may even be easier if you can find an old infrared keyboard reciever (you may not even need the keyboard, but it'd make it easier) then replace the IR reciever with a lead from the micro controller. If you get the keyboard as well, then figguring out what pulses represent what key because even easier. Just a thought.

    Post Edited (J. A. Streich) : 2/19/2009 5:48:29 PM GMT
  • salokcinsalokcin Posts: 6
    edited 2009-02-19 17:53
    That's a good idea. I'll see what I can dig up.

    This is for a CNC mill I'm building. I'm using Mach3 CNC control software from Artsoft. You can assign basically ANYTHING in the system to fire on a custom key combination. You can also assign anything in the system to one of 5 input pins on the parallel port (definitely not enough pins!).

    I want to simulate a keyboard so I can hook up a bunch of buttons using their keyboard combinations.

    Mach3 does allow you to setup a "port" (as far as I know this is always a printer port). Then it will listen on whatever "pin" you tell it to in order to see if that pin is high or low. If I knew more about how all these ports work I might be able to figure out how to simulate a port (or use the port that's setup when I plug my PPDB in) and query the Propeller pins. I just simply don't grasp enough to know if that's possible first off, and how to do it secondly.
  • salokcinsalokcin Posts: 6
    edited 2009-02-19 18:01
    Now that I think of it, the keyboard may not be the best idea. I'd like to be able to do switches and not just buttons. I'd like to know the state of a switch at any given time, so emulating a keyboard won't do that trick I think.
  • salokcinsalokcin Posts: 6
    edited 2009-02-21 04:54
    Alright, I've figured out what I need to do! Thanks again!

    The software, Mach3, actually allows me to communicate with the propeller chip using the Modbus protocol over serial. I'm trying to figure this out (pretty new with serial).

    So Mach3 sends a command in a set of bytes that can be 8+ bytes (depending on the command). I've been reading over FullDuplexSerialPlus (over and over!) and playing around with it, trying to figure out the best way to do this. I just need to get a byte array that contains all the bytes coming in. I don't know how to do this on a dynamic number of bytes.

    If I can get this figured out I think I'm home free. Any help is much appreciated! Thanks again!
  • salokcinsalokcin Posts: 6
    edited 2009-02-23 01:08
    Just wanted to update before people spend time writing up suggestions. I got it ALL figured out now [noparse]:)[/noparse]
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-02-23 01:19
    A plan ends well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
Sign In or Register to comment.