Shop OBEX P1 Docs P2 Docs Learn Events
usb keyboard (and mouse) to propeller — Parallax Forums

usb keyboard (and mouse) to propeller

sosaraujososaraujo Posts: 24
edited 2008-11-19 15:43 in Propeller 1
Hi,
We know we can to plug in a keyboard to the propeller via ps2.
What about a usb keyboard? or a mouse?
thank you in advance

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
El planteo de un problema es mas importante que su soluci

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-17 02:49
    There are some experimental routines to connect a USB keyboard or mouse to a Propeller. They're very large and complicated because the USB protocol is very complex. They were made to work by taking some short cuts in the USB protocol, so they're not a very good solution.

    It is possible to use a Vinculum or other USB host chip to interface to USB including a USB keyboard or mouse although they're much more useful to interface to a USB mass storage device like a "thumb drive".
  • sosaraujososaraujo Posts: 24
    edited 2008-11-17 03:08
    Thank you. It was very kind of you.
    Adrian

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    El planteo de un problema es mas importante que su soluci
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-17 03:17
    Here's a link to what has been done already: http://forums.parallax.com/showthread.php?p=675351
  • RaymanRayman Posts: 14,595
    edited 2008-11-17 03:19
    USB is pretty much a nightmare to work with...
  • AribaAriba Posts: 2,690
    edited 2008-11-17 04:04
    A longer discussion about this you will find here:
    http://forums.parallax.com/showthread.php?p=760011

    Andy
  • VIRANDVIRAND Posts: 656
    edited 2008-11-17 05:40
    Rayman said...
    USB is pretty much a nightmare to work with...

    I agree.
    It's so much easier and even much more efficient
    to design and make your own keyboards and mouses from scratch
    than to design anything for USB.
    But it's a good thing we can still get ps/2 ones.

    PC hardware rarely makes any reasonable logical sense and I believe that they
    are designed that way purely for the sake of proprietary hardware and planned obsolescence.

    Behold, What "great and awesome work of creation" hath BILL GATES wrought! devil.gif
    ewaste-worker-on-a-mountain-of-e-waste.jpg
    In just a couple of months, a mountain of half a billion analog TV's will overshadow this! cry.gif

    Post Edited (VIRAND) : 11/17/2008 5:52:49 AM GMT
  • BradCBradC Posts: 2,601
    edited 2008-11-17 05:54
    VIRAND said...
    Rayman said...
    USB is pretty much a nightmare to work with...

    I agree.
    It's so much easier and even much more efficient
    to design and make your own keyboards and mouses from scratch
    than to design anything for USB.

    I think that's probably a slight exaggeration. USB is pretty complex and has some oddities. Certainly a reliable host driver is not going to be *easy* to get working but I'm not saying it can't be done. It just hasn't been done on the propeller yet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • sosaraujososaraujo Posts: 24
    edited 2008-11-18 02:02
    I think we can also to choose for this MAX3421E @ www.maxim-ic.com/quick_view2.cfm/qv_pk/3639
    instead of Vinculum.
    3639.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Adrian Sosa Araujo.- San Luis, ARG
    El planteo de un problema es mas importante que su soluci
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-18 02:19
    The MAX3421E certainly will handle the very low level USB protocol information, but it still requires a lot of work by the microcontroller. There's no existing code to do this "properly" with the Propeller since the existing USB code takes shortcuts as mentioned. If you have a strong interest and need to use something like this part, please do and be sure to share your experience. If your interest is in using a USB keyboard and mouse with the Propeller, I'd suggest the Vinculum or GHI's USBwiz which also can act as host for USB HID devices like a keyboard and mouse.
  • sosaraujososaraujo Posts: 24
    edited 2008-11-18 02:38
    ok. Firstly I'll try with Vinculum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Adrian Sosa Araujo.- San Luis, ARG
    El planteo de un problema es mas importante que su soluci
  • Ron FrazierRon Frazier Posts: 11
    edited 2008-11-18 18:24
    I know a very easy way to connect a usb keyboard and mouse to the propeller.· I did it within an hour of getting my propeller demo board.· I wish I could say I invented some briliant circuit or program.· However, that's not the case.· I did what I did for lack of any other alternative and being too naive to know it couldn't be done.· Go to Best Buy and buy the Dynex Multimedia Keyboard, Model: DX-WKBD SKU: 8332397, which also includes an optical mouse.· If you get another product, the feature to look for is USB to PS2 connectivity.· This product includes two adapters.· One is for the keyboard and the other is for the mouse.· You plug the keyboard's USB plug·into its adapter and you plug the mouse's USB plug·into its adapter.· On the other side of the adapters are PS2 plugs.· You plug these into the demo board.· I did this, then programmed the chip with the various demos which come with the chip.· While I haven't used this in a real world application, I can verify that the keyboard demo prints scan codes on the screen when I press the keys.· I can also verify that the demos which use the mouse do, in fact, move the cursor on the screen in response to moving the mouse.· I cannot confirm the action of the buttons or click wheel, since the demos don't use those, but I would presume they work.· This should solve·the original poster's problem, at least for basic functions.· For those in the know about such things, I would love to know how these adapters work, whether we have to use the ones that came with the product, and·whether they can be bought separately.· I would also think this would be a great realm for experimentation with, potentially, other usb devices and sensors.· Anyone with additional knowledge on the subject, please share it.

    Sincerely,

    Ron
  • BradCBradC Posts: 2,601
    edited 2008-11-18 18:43
    Ron Frazier said...
    For those in the know about such things, I would love to know how these adapters work, whether we have to use the ones that came with the product, and whether they can be bought separately. I would also think this would be a great realm for experimentation with, potentially, other usb devices and sensors. Anyone with additional knowledge on the subject, please share it.

    Very easy. Those "adaptors" have precisely *zero* smarts in them. All they do is tickle a voltage level to the keyboard or mouse to tell it to use PS2 signalling on its data lines rather than USB. It's all in the ability of the chips in the keyboard/mouse to be able to use either protocol depending on a certain bit of signalling information.

    Generally you need to use the ones that came with the product. I have 3 or 4 lying around here and most of them seem to be specific in some way or another to the device they came with. Using the wrong one can cause anything from total failure through to unreliability.

    There is no protocol magic involved

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • RinksCustomsRinksCustoms Posts: 531
    edited 2008-11-18 18:50
    Some USB keyboards are PS/2 compatible and will support the PS/2 protocol easily, use either a PS/2 to USB connector or wire a USB connector into your prop project. Hint: If you buy a cheapo K/B & mouse and they include PS/2 to USB connectors, it's a goos sign that they support backward compatibility.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
    http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-11-18 22:27
    It use to be that all USB keyboards supported PS/2 as well since it reduced the number of versions the manufacturer had to make, but as more time passes and fewer new systems have PS/2 inputs, fewer and fewer USB keyboards have this compatibility still built into them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Marc GebauerMarc Gebauer Posts: 60
    edited 2008-11-19 15:43
    Here is an IC that came out in August that has built in Keyboard / Mouse support.


    http://ndap3-net.ebz.epson.co.jp/w/www/PDFS/epdoc_ic.nsf/vw/6005810B879FF462492574B2001F0450/$FILE/S1R72U01_E.pdf
    <above hyperlink did not work, but copy and paste does >

    www.digit-life.com/news.html?10/96/79

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Marc Gebauer) : 11/19/2008 3:49:06 PM GMT
Sign In or Register to comment.