Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I have an electronic device (commercially available, which someone else made), which essentially consists of a series of photoelectric cells, going through a black box of electronics, and through to a serial port plug.

In our old computer system, this connected to the serial port, and software onboard would detect when each photoelectric cell was activated.

Now our computers don't have serial ports, so we got a serial to USB adaptor to connect the device to the PC. However, with this setup the software fails to detect the activation of the photoelectric cells.

My question is: Are there any major caveats with using serial to USB adaptors? How do they work? Can they fail to provide correct conversion? Are all different types the same?

share|improve this question
3  
Did you try using PCI, PCI-e or ExpressCard (internally PCI-E) adapters? They are more expensive, but with them you get a real UART chip directly connected to a real bus which should be no different form a UART integrated on a motherboard. –  AndrejaKo Dec 26 '11 at 19:08

3 Answers 3

Yes, there are all sorts of pitfalls with serial to USB converters. Many just implement the minimum necessary for simple serial comms (i.e. Rx, Tx, maybe handshaking) and not any of the other pins.
Also the timing may be affected since USB adds another layer on top of things, so if the device requires precise timing it may not work properly with a cable.

The voltages in a cheap cable may not be RS232 levels either, (e.g. +/- 12V or similar) rather 0V and 5V (USB voltage)

This page discusses some of the problems in more detail.

To fix this you would need to know a bit about how the device works - e.g. what signals the device makes use of, etc. Then you need to find a compatible converter - either look at the specs (if given) or you could ask the vendor whether their cable will be suitable for whatever it is your device needs.

Either that or get a new USB based device.. :-)

share|improve this answer

If your "electronic device" has a name and/or a webpage then telling us it may help us help you.


Not all Serial-USB converters are the same.

IF your photocell system used standard RS232 serial communications AND did not rely on "hardware flow control" (RTS/CTS) then it should work correctly in most cases.

As it does NOT work correctly, you need to determine how it differs from the most simple version of RS232 use.

Several main possibilities are worth looking at. There are others.

Voltage levels:

  • Your device may use non standard RS232 levels. Correct levels are in the order of -12V/+12V but it could eg use 0 / +5V and still work with some (nit all) serial ports.

Break signalling:

  • Some systems that use a serial port do not use the actual TXD/RXD serial system at all but use what is sometimes referred to as "break signalling". A break occurs when the data TX line is held i the non-normally-idle state for a longer than usual period. It is possible to transmit data using this method. This non standard and a poor use of the system but some equipment uses it. Some USB-serial converters do not support break signalling.

A discussion of "break" is given i this useful RS232 tutorial in section 1.4.1 & 1.4.2.
Summarising from there:

  • 1.4.1 In RS232-C, a value of 1 is called a Mark and a value of 0 is called a Space. When a communication line is idle, the line is said to be “Marking”, or transmitting continuous 1 values.

    1.4.2 RS232-C also specifies a signal called a Break, which is caused by sending continuous Spacing values (no Start or Stop bits). When there is no electricity present on the data circuit, the line is considered to be sending Break.

    The Break signal must be of a duration longer than the time it takes to send a complete byte plus Start, Stop and Parity bits. Most UARTs can distinguish between a Framing Error and a Break, but if the UART cannot do this, the Framing Error detection can be used to identify Breaks.

The PICAXE microcontroller development system uses break-signalling with all the hassles that go with it and discussions of how these are overcome will be useful in solving your problems IF your problem IS break signalling

Here is a typical PICAXE break signalling discussion

Hardware flow control madness:

It may be that some of the hardware control signals used by your original system are not being dealt with properly by the converter. Below I've provided some comment and a link to a comprehensive reference BUT the easy was around this is to examine the non-data lines on your interface in the original mode (serial-serial) and with the USB-serial interface in place and see if there are any differences. It is often possible to "loop back" or hard wire signals that are not properly being handled.


RS232 implements various means of determining if the transmitter and receiver are ready to send or received data or allowed to send or receive data. These use lines such as RTS, CTS, and maybe CD, DSR, DTR, and in really nasty cases SCD, RI and more.

This utterly superb but massively overwhelming RS232 tutorial discusses these issues in depth with many excellent diagrams, pin descriptions etc.

From here: http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html

share|improve this answer
    
@break signalling: my Wisp648 uses this to get out of the transparent "pass through" mode. So far I have not had any problems with this feature using either prolfic or ftdi usb-to-serial chips with their associated drivers (do not use the windows built-in drivers). –  Wouter van Ooijen Dec 26 '11 at 18:00

Have you tried the converter on something else? Did the driver install properly? See what comm port the device is set to in "Device Manager" and if there are any conflicts. I've used several of these and they all worked fine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.