View Full Version : Serial Communications over USB cable???
08-30-2008, 10:02 PM
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!
08-30-2008, 10:15 PM
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.
09-03-2008, 06:02 AM
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.
09-03-2008, 10:06 AM
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.