usb keypad


+ Reply to Thread
Results 1 to 11 of 11

Thread: usb keypad

  1. #1
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default usb keypad

    Hi,
    I am very new to your forum and I wish to greet all of you.
    I am hardware engineer and so I need a little help, when I am stick with software.
    I have to made strange looking “usb” keyboard with big buttons, that will interact with “On Key what ever” event on regular PC. I will switch IP Cameras.
    So in tree beers time I draw some hardware (attached below). I call this “kitchen made” prototype, because I will make him there. Well, I can buy numeric pad and put her in my grande buttons box (GBB) but this will not make me happy. It will be nice to choose char code for keys or even a string.
    So I need help. After 2 hours googleing I have no answer on this – how to tell to PC, that this is standard keyboard?

    I extend my board with LCD, RS232 and ICSP capability just in case. If someone find my board useful and if this someone lives in Europe, I can send him a board.
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2009
    Posts
    722

  3. #3
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    Thanks
    I started the thread, so I feel duty to finish. Down is the hardware ready to go.
    There is a little error in the circuit. The diode D1 is in wrong direction.
    Name:  DSC00102.jpg
Views: 604
Size:  34.7 KB

  4. #4
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    There is some code. The keyboard is ok, but the usb out freezes the pic.
    Also windows don’t recognize the board as keyboard. I try to use
    #define use_usb_bus_sense_io
    from kbddesc1.asm, but I got undefined variable error in USB18 here:

    957: # ifdef use_usb_bus_sense_io
    958 btfss usb_bus_sense
    959 bra somewhere

    What to do?
    Attached Files Attached Files

  5. #5
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    Well, there is missing USBInit in the code.
    This is happen when my beer is over.
    Now Windows say: "There is unknown usb device"
    What must to be changed in the descriptor?

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,256

    Default Re: usb keypad

    I cheat when it comes to simple keypad applications. I just take the PCB from an old USB keyboard and hack the 2 connectors . The ones I have used so far use 2 connectors, then I map the connectors into a table.

    The nice thing is that the USB communication is already complete and Windows recognizes yor device without problem. You can connect more than 1 identical keyboards in Windows XP.

    There are several examples on google to hack a USB keyboard.
    Not as dumb as yesterday, but stupider than tomorrow!

  7. #7
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    Thanks Daemon
    The task I'm doing is litlle more complicated.
    I need to send serial commands to other devices (HDMI Switch, etc.) and Keyboard events simultaneously from
    this board. I also image a situation to receive commands from something.
    If I use standart keypad I must to design serial-to-command-to-matrix decoder and vs.
    By the way the board is still not recognized by Windows as HID. I check report descriptor twice,
    the device descriptor seems ok but pic freezing by usbout.
    May be some configs are wrong? I dont have any.

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,256

    Default Re: usb keypad

    I'm stuck to using my cell phone so I can't do serious debugging.

    Do you issue that USB SERVICE command or whatever it is called to keep your connection alive?

    Sorry, wished I could be of more help.

    Robert

  9. #9
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    OK its done. The problem was in the serial bootloader.
    And for ICSP the reset cap C3 must be far below 100nF - 10nF or lower.
    I will post code soon as is ready. Then will make fun with the serial bootloader. I love UARTs!
    Thank you Demon, you break myself talking hardly.
    Cheers to all of you.
    FOB

  10. #10
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    ANDDDDDDDDDDDD: The Grande Button Box (GBB)
    But I still have questions.
    1. Can I simple relocate code and interrupts with some ORG
    when I use serial bootloader?
    2. Is there some negotiation between PC and usb HID(KBD) like these
    with PC/2 keyboard -
    code?
    When I plug the box everything seems ok except that: the first pressed key is doing
    strange things – repetition of chars, TAB, Window switching or nothing. And this relays to elapsed time from plug to press?!.
    3. Is there “USB READY” call back or just a bit for such purpose?
    Attached Images Attached Images  

  11. #11
    Join Date
    Dec 2011
    Location
    Sofia, BG
    Posts
    18

    Default Re: usb keypad

    I have little fight with snp.exe ( XP Antispyware 2012) worm in may PC, but I am the winner.
    So this is the code for now. In my app I will remove the LCD and will add a lot of serial communication. This will be kind of consumer but friend of mine app.
    My pbp version is 2.47. All is compiled with mpasm. I put all files from the directory in zip.
    You must have a dir called pbp and pbpusb18.lib and pbppic18.lib files there.
    You must quote configs in 18F2550.inc file.
    Thanks for all descriptors and sample code and sorry for my Win(dot)English = almost.
    This forum really helps me.
    Very Christmas
    Boyan Petrov as Fob
    Sofia
    Bulgaria
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts