Using USB to simulate COM port

Greets to all!

The project is to use an Arduino to act as a ASCII command translator between a PC and a ham radio. In the real setup, the PC has a COM port (DB9) which ties to the radio via a DB25.

On the PC, 2 programs need to talk to the radio, and I need to ‘translate’ for one of them. I can use the new SoftwareSerial library as all comms are done “1-at-a-time”.

The target radio is not here, so I’d like to use a terminal program to simulate the response from the radio. I have the logging software accessing COM1 now and can see output via a serial sniffer.

My development PC does not have a physical RS-232 Com port (I’ll be using a MAX232 for the real hookup), so I’d like to use 2 USB ports to get live data from to test the code.

SO: The question is: If I take a USB cable and break out one end to get to the pins, and tie Rx/Tx to Arduino pins controlled by SoftwareSerial - how do I get a USB port on the PC to talk to THAT USB connection? When you hook up a ‘normal’ USB device, the PC see’s it right away and there is a ‘boo-boop’ sound (from Windows) to announce it.

What do I need to do on the Arduino side to make the PC recognize my USB connection and put it on a specific port?

=Alan R

USB isn't the same as RS232. Besides the serial transmision there are all sorts of control protocols going on. If you're creating a serial stream using softwareSerial that's just a small step towards getting a USB type setup.

To carry out the usb bus negotiations you really need something like one of the ftdi chips.

It would be far simpler, however, to simply use the arduino USB connection that you already have. Maybe implementing an instruction structure that tells the arduino which device you're trying to talk to.

Harrzack: My development PC does not have a physical RS-232 Com port (I'll be using a MAX232 for the real hookup), so I'd like to use 2 USB ports to get live data from to test the code.

Can you post a simple diagram of how you want things to be connected as I can't envisage what you have in mind.

As @KenF has said you can't directly connect a USB cable to a serial connection - they are completely different. You need a USB to TTL adapter. There are various types and are sometimes known as FTDI cables because FTDI make the chip that does the conversion.

...R

If I take a USB cable and break out one end to get to the pins, and tie Rx/Tx to Arduino pins controlled by SoftwareSerial - how do I get a USB port on the PC to talk to THAT USB connection?

To make that type of connection, use a USB to RS232 (TTL) serial adapter, such as http://www.pololu.com/product/391

Robin2: There are various types and are sometimes known as FTDI cables because FTDI make the chip that does the conversion.

FTDI make a chip that does the conversion. Only one of many brands. May actually be dropping in market share just now. :o