0
\$\begingroup\$

I have bought a RS232 inclinometer and a FTDI USB to RS232 cable.

The inclinometer spec sheets states:

  • RS232 full duplex communiction
  • Supply voltage 4.9 - 15V
  • Wires:
    • Red: +ve
    • Blue: ground
    • Yellow: RS232 Tx
    • Green: RS232 Rx

The USB cable specs:

  • Supply voltage 5V
  • Wires:
    • Black: Ground
    • Brown: CTS#
    • Red: Power
    • Orange: TXD
    • Yellow: RXD
    • Green: RTS#

I have connected them as follows:

  USB cable        Inclinometer
     Red    < - >    Red  
   Black    < - >    Blue
  Orange    < - >    Yellow
  Yellow    < - >    Green

When I plug in the USB cable and try to access the inclinometer, I get only a blank screen. I have tried using the terminal (screen /dev/tty.usbserial 9600), I have tried CoolTerm and I have tried the inclinometer software provided by the manufacturer. All methods just show me a blank screen, without data.

How can I troubleshoot this issue?

\$\endgroup\$
3
\$\begingroup\$

TX and RX (transmitter and receiver) in UART/RX232 are usually denoted from each device's point of view. It means one needs to connect TX wire to RX at the other side and RX to TX at other side. According to your description, you are connecting both RX together and both TX together, which is wrong.

Usually you can double-check in datasheet/specsheet if particular pin or wire is described as output or input. The FTDI manual mentions that orange (TXD) wire being output and yelow (RXD) input. I do not see any similar explicit info in the inclinometer's datasheet, but in the absolute majority of cases TX wire is output and RX input. And it is usually no good idea to connect two outputs together.

\$\endgroup\$
  • \$\begingroup\$ It was just that, I swapped my TX and RX and tested it in the manufacturers software: everything worked. \$\endgroup\$ – Saaru Lindestøkke Mar 7 '17 at 19:23
5
\$\begingroup\$

How can I troubleshoot this issue?

In addition to needing to swap TxD and RxD at one of the two ends of the RS232 connection, as kindly mentioned by other members, I found 2 more potential issues which you need to take into account:

  • You said:

    USB cable Inclinometer
    Red < - > Red

    That shows you expect to power the inclinometer from 5V supplied from the FTDI cable. However, note that the document you linked from FTDI shows that the default voltage provided on the FTDI red wire is 0V. You don't mention measuring the actual voltage provided by your FTDI cable. Considering this info from FTDI, I recommend you do measure that voltage:

    excerpt from FTDI datasheet

    If necessary, based the schematic diagram near the end of the datasheet, it looks like the voltage provided on that wire can be changed. However also note that, based on the current limitations mentioned in the datasheet, the 5V would not provided directly from the USB port. Definitely something for further investigation.

  • You said:

    I have tried using the terminal (screen /dev/tty.usbserial 9600), I have tried CoolTerm and I have tried the inclinometer software provided by the manufacturer.

    However, note this point in the inclinometer document which you linked:

    except from inclinometer datasheet

    You would have to type very quickly, to leave <100 ms between characters! This suggests that manually-typed commands to the inclinometer will be ignored, as a person would probably leave gaps >100 ms between characters. Therefore you either need to script your test commands using terminal software (ensuring that you don't exceed that inter-character gap time) or else use the manufacturer's software.

    I realise you mention that you have already used the manufacturer's software. My point is that, unless you took special precautions not to exceed that inter-character gap time, your tests manually typing commands into CoolTerm and a standard terminal are expected to fail anyway. Therefore don't waste your time and analysis on those 2 results at this stage (or else, if you do continue to use them, ensure that you don't exceed that maximum time between characters). Don't treat your results as failures with 3 different software packages for the same underlying reason - that may not be true, as explained in this point, and may confuse your analysis of future test results.

Techniques to consider:

  • Disconnect the inclinometer, short the RS232 TxD and RxD wires on the FTDI cable (i.e. connect a data-only loopback). Setup your terminal software for no handshaking (so it doesn't care that CTS# is disconnected) and no local echo. Then, when you type, you should see each character which you type displayed on the screen as it is received. Double check that this echoing stops when you disconnect the loopback connection. If that all works as described, it confirms correct operation of the FTDI cable for data.

  • Use a multimeter to measure the voltage between the red & black wires from the FTDI adapter, as mentioned above. If this voltage is not 5V then you need to fix that (either by adapting that cable, or using a different USB-serial cable) in order to supply power to the inclinometer.

  • Although the inclinometer datasheet states that the default RS232 data rate is 38.4kbps, any changes made to that are persistent. It isn't clear to me whether the default for the device is to output continuous data. However I would make sure that the device has a suitable power supply (which may not be the FTDI cable, depending on the results of your voltage testing) and use a 'scope to look at the RS232 TxD pin.

    If there is data being output, measure the bit width to check whether the data rate really is 38.4kbps. If it isn't that value, then obviously configure the host software to match the data rate which the device is actually using.

\$\endgroup\$
  • 1
    \$\begingroup\$ Thanks for the elaborate answer! My issue was with the TX/RX swap, so I picked the answer of @Martin as they addressed that directly. However, for future RS232 troubles I'll certainly refer to your suggested techniques. \$\endgroup\$ – Saaru Lindestøkke Mar 7 '17 at 19:24
0
\$\begingroup\$

It appears you have TX and RX reversed. TX of one device is connect to RX of the other.

enter image description here

I manufactured and supported a serial device. 99.9% of the problems were with Windows. Most often the device driver and the port settings.

This device is a bit more complex than your typical serial device. And there are lots of problems with the simple devices.

To minimize the various issues, you'd be best off getting the device up and running with the manufactures software running on Windows. Their software will get the device in to a known state.

Do you know the COM port number? This can be found in device manager under ports COM and LPT.

If there is no USB driver list in Ports COM and LPT then the driver is not installed.

What baud is the terminal set to? 38400?

Is the device in binary or ASCII?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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