RS232 to USB conversion

8,287

Solution 1

If hyperterm can't open the port, then something is more seriously wrong then the baud rate and other serial port configuration.

Even on a laptop with no visible physical COM ports, I'd be leery of letting any USB serial adapter think it is COM1 or COM2. Even COM3 and COM4 are suspect because they also had common legacy practice for their I/O addresses and IRQ assignments that might leak assumptions into poorly written programs. Personally, I reserve those four names for COM ports that are implemented by actual UARTS that are physically attached to the motherboard (either built-in or on the ISA or PCI buses).

Some things to try, in an order that should work:

  • Make sure you reconfigured the driver to change the assigned port to COM5 or above.
  • Unplug and plug the adapter into the USB port.
  • Make sure you put it in the same USB connector every time because many cheap adapters come without USB serial numbers causing Windows to use the specific USB port to distinguish it from other devices. This will haunt you with a laptop.

To check the port

At a command prompt, type mode COM5 where COM5 is the port you assigned. You will see one of three results. First, if the adapter is attached, configured, and working, you will get a dump of the COM port configuration:

C:...>mode com5

Status for device COM5:
-----------------------
    Baud:            19200
    Parity:          None
    Data Bits:       8
    Stop Bits:       1
    Timeout:         ON
    XON/XOFF:        OFF
    CTS handshaking: OFF
    DSR handshaking: OFF
    DSR sensitivity: OFF
    DTR circuit:     ON
    RTS circuit:     ON

C:...>

Second, if the adapter is connected, configured and happy, but some other program has the port in use, then you will get an error saying so:

C:...>mode com5
Device COM5 is not currently available.

C:...>mode com1

Third, if you don't have the right name of the port or the adapter is not as correctly configured as you think, you will get a less descriptive error:

C:...>mode com5
Illegal device name - COM5

C:...>mode com1

Actually getting the serial port itself configured for your device is a rather open-ended problem. You can safely try listening to the device at a variety of baud rates, set for 8-bit no parity. When you start to see data that make sense, then you probably have the baud rate set right and may only need to adjust the parity and word length for best results. Note that there exist devices that used different baud rates for send and receive, as well as requiring odd combinations of word length and stop bits. Your best source of configuration knowledge would be the manual for the device. Your second best might be to ask a second question here in the form of "does anyone know how to talk to an X".

Although it is conceivable that the Hyperterm shipped with Vista is less buggy than prior releases, I always recommend getting a decent terminal emulator to replace it if you need to use it regularly. (I debug a lot of embedded system projects with serial ports.) My recommendation is TeraTerm, which is free and open source. It does everything Hyperterm can do and more, and without the bugs. It also can talk to Telnet devices which is handy for configuring some routers or dealing with serial ports over ethernet.

Solution 2

You might have installed the wrong driver. There are two common chipsets used in Serial/RS232 to USB conversion.

Either the Prolific or FTDI. It seems you are currently using a Prolific driver, you might want to try a FTDI driver

Solution 3

The default "fail-safe" settings for RS232 ports are traditionally :

Baud Rate : 9600

Data Bits : 8

Parity : None

Stop Bits : 1

Flow Control : None

Start from these settings, and gradually improve things.

Share:
8,287
Moayad Mardini
Author by

Moayad Mardini

Updated on September 17, 2022

Comments

  • Moayad Mardini
    Moayad Mardini over 1 year

    I want to connect some old device (with a RS232 port) to my laptop which doesn't have serial ports. I bought an adapter which is made in China and comes with no drivers CD. After searching I downloaded a driver called "PL-2303 Vista Driver" that was installed successfully. I wanted to test the adapter using Hyperterminal which couldn't open the COM port that was created by the driver, and told me to check the driver's settings. Unfortunately there are many options to set (Bits per second, Data bits, Stop bits, ...etc.) which I don't know how to set properly to make sure if the adapter/driver is working or not.

    Any help with those settings or any tips to know where the problem is? Thanks.

  • Moayad Mardini
    Moayad Mardini over 14 years
    Thanks caliban, I've already tried those default settings, but Hyperterminal still can't open the port.
  • caliban
    caliban over 14 years
    it's a silly question, but are you sure you have set HyperTerm to use the correct COM port?
  • caliban
    caliban over 14 years
    Can you go to Device Manager and see if your USB-to-RS232 device has any problems (exclamation marks) or clues as to what COM port it is setting itself as?
  • Moayad Mardini
    Moayad Mardini over 14 years
    Yes, I'm sure Hyperterminal is using the correct port, and Device manager isn't complaining about it!
  • caliban
    caliban over 14 years
    Is your old device turned on and ready to accept connections over the serial interface?
  • Moayad Mardini
    Moayad Mardini over 14 years
    Sure. I use that device with other computers that have serial ports without problems.
  • caliban
    caliban over 14 years
    What COM port is HyperTerm set to use?
  • caliban
    caliban over 14 years
    Okay, now go to Device Manager and change your USB-to-RS232 serial to COM3 or COM4. And then ask HyperTerm to connect to the new COM port.
  • Moayad Mardini
    Moayad Mardini over 14 years
    Tried that, still not working, please check this screen-capture : i28.tinypic.com/29dzhvp.jpg Thanks!
  • hyperslug
    hyperslug over 14 years
    Cool, 1st time I've ever seen a COM22 port.
  • caliban
    caliban over 14 years
    Try updating your drivers. Latest ones found here on Prolific website : prolific.com.tw/eng/downloads.asp?ID=31