Shop OBEX P1 Docs P2 Docs Learn Events
output to usb — Parallax Forums

output to usb

BladeRunner731BladeRunner731 Posts: 2
edited 2006-06-07 23:21 in BASIC Stamp
This may not be possible. I was wondering if I could set up a BASIC Stamp II's outputs to send data through a usb adapter to a pc. In comparison, I would like the outputs to act like a plug and play keyboard, outputing data in the form of text, just like a keyboard does.
I apologize if this is a silly question, I don't know much about stamps.

Thanks.

Comments

  • Ken GraceyKen Gracey Posts: 7,387
    edited 2006-06-05 02:39
    BladeRunner731:

    It sounds like you only need the USB2SER to do this job. Install the FTDI Virtual COM port drivers and you should be set to go.

    Ken Gracey
    Parallax, Inc.
  • HarborHarbor Posts: 73
    edited 2006-06-05 05:54
    Ken, it's been years since I've looked at the keyboard protocol, but wouldn't BladeRunner have to do quite a bit of coding to emulate the behavior of the keyboard? Substituting key codes for characters when sending the data for example?

    Of course, if you just want to send text data to a PC from a Stamp, BladeRunner, then don't think in terms of a keyboard. Keyboards don't send text, they send keystrokes encoded a particular way and the PC driver software decides what character was intended.
  • stamptrolstamptrol Posts: 1,731
    edited 2006-06-05 13:06
    Hi folks,

    Some recent research I have done for a similar project suggests that we must be very specific in describing "USB to serial conversion".

    For instance, the Parallax USB2SER device really works well in letting a PC/laptop without a traditional 9-pin serial interface convert a USB host port to serial to program a stamp or use the debug screen, etc.

    However, the conversion of an existing serial connection into a USB is very nearly impossible at the microcontroller level. There is a lot of processing going on to generate the USB "host" style connection. USB simply doesn't work like serial (either 232 or 485) in terms of just matching signal levels and signal names.

    But, if someone has cobbled one together, I'd be one of the first to buy it!

    Cheers,

    Tom Sisk
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-06-05 13:48
    If I understand what you're trying to do, then yes, you can have the BS2 send serial data into a PC's USB connection. You'll have to do some programming on the PC side to read the "serial port" (the BS2 USB connection will look to the pc like a 'serial port') and then do something with the data -- use SendKeys to send it to another program, for instance.

    I don't think you can get the BS2 to 'look like' a USB keyboard, though, if that's what you had in mind.
  • Jason-WIJason-WI Posts: 35
    edited 2006-06-07 01:55
    You could hack a cheap usb keyboard and use the stamp to control the characters you need to send. Adding relays in parallel with the keyboard switch matrix for the characters you want to send should be easy. Use the stamp to control the relays.

    Jason

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    He who dies with the most toys wins!
  • FranklinFranklin Posts: 4,747
    edited 2006-06-07 23:21
    http://www.nutsvolts.com/toc_Pages/jun06toc.htm has an article on creating a pic based usb device that be a starting point for your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.