Shop OBEX P1 Docs P2 Docs Learn Events
Bs2 USB data to another USB device — Parallax Forums

Bs2 USB data to another USB device

Hi, I would like to send asci data (motor control commands) from a Bs2 USB to another USB device (stepper motor controller)
How do I do this? Both devices work fine connected to the host PC but how can I send data between the devices, or via the PC?
Thanks for any pointers.
Stuart

Comments

  • You can't do it. USB requires a host and one or more client devices. In your (and most) case, the PC acts as the host and the BS2 and stepper motor controller both act as clients. Clients can't send data directly to another client. Parallax used to sell a device they called the Memory Stick Datalogger based on a chip from FTDI (Vinculum). This device could act as a USB host and connect to some kinds of USB clients. It could accept serial data and control information from a BS2.

    See if your stepper motor controller can accept serial data at 5V in addition to USB. If so, maybe you can directly connect the BS2 to the controller and control it using an I/O pin and SERIAL statement rather than the USB port and DEBUG statement.
  • Hi Mike,

    Thanks for your fast reply. The stepper control board does have an RS-485 interface as well. I'll give that a try with a 232 to 485 adapter.

    Regards
    Stuart
  • Remember that the BS2 doesn't really handle RS232 voltage levels directly. Read the Basic Stamp Manual chapters on the SEROUT and SERIN statements for details. It supplies 5V/0V on transmit and (with the indicated series resistor) can accept RS232 signals 12V/-12V on receive. Ideally use an RS485 driver which interfaces with 5V logic levels like this one.
  • Yes good point Mike and thanks for the reminder. Reading the manual now as I am a bit rusty in the Serial data department.
Sign In or Register to comment.