Shop OBEX P1 Docs P2 Docs Learn Events
Serial Communications over USB cable??? — Parallax Forums

Serial Communications over USB cable???

Tom-n-TonyTom-n-Tony Posts: 12
edited 2008-09-03 03:06 in BASIC Stamp
I'm realatively new at this and I have a question about a project that I'm working on.· I have a Boe-Bot with a Ping sensor and I downloaded the Ping))Dar program - it's pretty cool.· I'd like to extend the program so that the radar picture is in an Internet Explorer window instead of the debug window.· I'm dividing this program into several steps with the first being to establish communications between the BS2 stamp and an external program (VB or Java, I haven't decided yet).· I've reviewed the SEROUT section of the PBASIC Syntax Guide, but it is referencing serial cables and my BOE is USB connected.·

Does anyone have any advice on how to communicate serial information via a USB cable?

Any advice is welcomed!

Thanks,
Tom

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-30 15:15
    You don't say how you program your Boe-Bot from your PC. Presumably you have some kind of USB to serial adapter, either between the PC and the Boe-Bot or you have a USB Board of Education as part of your Boe-Bot and you plug your computer's USB cable into the Boe-Bot.

    You can use the programming port for serial data communications with your PC. It works with the DEBUG / DEBUGIN statements and can be used with SEROUT / SERIN by specifying I/O pin #16 (see the manual for a description of this). The only caveats:

    1) If the PC transmits to the Stamp, everything transmitted will be echoed back to the PC and you have to program the PC to take that into account.

    2) When you open or close the PC serial port from your PC program, it will reset the Stamp. You have to program the Stamp to take that into account.
  • Tom-n-TonyTom-n-Tony Posts: 12
    edited 2008-09-02 23:02
    Mike,
    Thanks for the input. I have a USB Boe-Bot so I don't have a serial adapter. I've looked through the Basic Stamp module (version 2.2) regarding the SERIN/SEROUT command and I don't see references regarding how to make them work with a USB cable. They show diagrams of a DB9 and DB25 connector (where PIN's make sence to me), but nothing regarding communication over the USB cable. I must confess, I haven't played with it yet so I'll give it a go, I was just looking for someone to indicate if it is possible and point out any gotcha's I'm likely to encounter.

    Thanks,
    Tom
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-03 03:06
    Hello,

    To the PC the USB connection is a serial port. You would communicate the same as if it were a DB-9 cable connected. The USB driver for the hardware makes this possible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.