Data Type ID Troublshooting V4

Embed Size (px)

Citation preview

  • 8/7/2019 Data Type ID Troublshooting V4

    1/15

    Data Type Identificationand

    Troubleshooting Guide

  • 8/7/2019 Data Type ID Troublshooting V4

    2/15

    CONNECTIONS THAT WORK!Connecting two devices using data sounds simple, but nearly every day we help a customer get afiber converter or other device working by helping correct the data cabling connections. This

    document is intended to help you troubleshoot and correct such problems.

    Why all of the confusion?Usually inputs are connected to outputs and outputs to inputs. People don't realize that there aretwo types of data ports, Data Terminal Equipment (DTE) and Data Communication Equipment(DCE), and that the signal names are the same, but the signal flow is opposite! The pin labeledTx can be input and Rx the output. This was originally in the RS232 world of connecting acomputer or terminal DTE to a modem DCE.

    The two port types are complementary; the outputsignals on a DTE port are inputsto a DCE portand outputsignals on a DCE port are inputsto a DTE port. The signal names match each otherand connect pin for pin. Signal flow is in the direction of the arrows. (See table below.)

    Table 1

    Data Terminal Equipment(DTE)

    Data Communication Equipment(DCE)

    DB25 DE9 DE9 DB25Pin # Mnemonic Signal Name Direction Signal Name Mnemonic Pin #8 1 CD Carrier Detect Carrier Detect CD 1 8

    3 2 RD Receive Data Receive Data RD 2 32 3 TD Transmit Data Transmit Data TD 3 2

    20 4 DTR Data Terminal Ready Data Terminal Ready DTR 4 207 5 SG Signal Ground Signal Ground SG 5 7

    6 6 DSR Data Set Ready Data Set Ready DSR 6 64 7 RTS Request To Send Request To Send RTS 7 45 8 CTS Clear To Send Clear To Send CTS 8 5

    22 9 RI Ring Indicator Ring Indicator RI 9 22

    This document is not intended to be an engineering lesson in communications, but helpful ingetting your data operational. I will give hints in identifying, connecting, and field testing simpleRS232, RS422, and RS485 communication links.

    Table 1 shows common RS232 signal flow. Yours may be different as there are manyimplementations of RS232, depending upon needs for the situation.

  • 8/7/2019 Data Type ID Troublshooting V4

    3/15

    RS232

    RS232 is one of the simplest but most limited data types; it has poor noise immunity, limiteddistance on copper, and, in most common implementations, is one device to one device. It is notrecommended for more than 25 feet of copper.

    Identification:I am only indicating 3-wire RS232, the most common when used for PTZ control that has a Tx,Rx, and common.

    The output, Tx, will be 3 to 25 VDC (most common is 5 to 12 VDC) referenced to ground,also known as common, when there is no data being transmitted. This data state is known as aMARK. During active communications this lead will swing from its state to a + state, a SPACE,same voltage levels. The remaining lead will be the input, Rx.

    Connections:The device, controller, or camera, Tx to our input, IN, Rx to our output, OUT, and common to ourGround, G.

    Testing:Check your Terminal program and serial port by jumpering pin 2 to 3. The screen should echoany keys entered with the jumper in place and there should be no echo with the jumper removed.

    Figure 1

    Laptop Withterminal program

    Example: Hyper Terminal

    DE 9Pin

    32

    5

    Connect the data to the fiber transceiver and connect the two transceivers with a fiber jumper.Power both transceivers and check for a loop and sync LED, if present on the model. Jumper thein and out of the far, not connected to the PC, and your keystrokes should echo to the screen. Ifan RD LED is present, it should flash with the data; the far end unit will flash, indicating that it isreceiving data from the near end, even with the wire jumper removed but the near end, with thePC connected, should flash only with the jumper in place looping the data back.

  • 8/7/2019 Data Type ID Troublshooting V4

    4/15

    Figure 2

    Laptop Withterminal program

    Example: Hyper Terminal

    DE 9Pin

    325

    IN+ -

    OUT+ - G

    Fiber TranscieverData Set for RS232

    IN+ -

    OUT+ - G

    Fiber TranscieverData Set for RS232

    Troubleshooting:If the preceding did not work:

    Check that you have properly set the data switches for RS232.

    Check that you have properly identified the output pins on the cable from the PC; if you havea null modem cable, pins 2 and 3 will be swapped.

    Check the Voltage as explained in the Identification section.

    Check that the sync and loop LEDs are lit on the fiber transceivers.

    Check that the RD LED flashes at the far end and, when jumpered, the near end RD flashes.

    Verify that Hyper Terminal will still echo keystrokes with a jumper between pins 2 and 3.

    If you do not have a PC available, you can still test the link with a 9V battery and a meter.

    Figure 3

    IN

    + -

    OUT

    + - G

    Fiber Transciever

    Data Set for RS232

    IN

    + -

    OUT

    + - G

    Fiber Transciever

    Data Set for RS232

    9 VBattery

    + VDC

    Common -

    DC Volts +Red

    Black

    + -

    IN

    + -

    OUT

    + - G

    Fiber Transciever

    Data Set for RS232

    IN

    + -

    OUT

    + - G

    Fiber Transciever

    Data Set for RS232

    9 V

    Battery

    - VDC

    Common -

    DC Volts + Red

    Black

    +-

    Connect the 9V battery + terminal to the in + terminal on the transmitter and the battery to the Gterminal. At the Rx end, the out + terminal should now read a positive voltage to G. Reverse the

    battery and the polarity on the out + terminal should now be negative. Repeat these tests withthe battery and meter on the opposite ends to prove the reverse direction. NOTE: This batterytest will only work on DC coupled RS232 ports, which is the case on most Optelecom-NKFRS232 data ports.

  • 8/7/2019 Data Type ID Troublshooting V4

    5/15

    RS422

    RS422 has improved noise immunity and the advantage is that your copper may now be 1200meters, almost 4000 feet. Additionally, RS422 supports multiple receivers, up to 10, so that onecontroller can control multiple addressable cameras. Most systems I am aware of limit you to

    eight per RS422 link. While RS422 is more forgiving than RS485, a ground is stronglyrecommended for proper operation.

    Figure 4

    -

    +

    -

    +

    -

    +

    -

    +TerminationResistor onlast unit only

    Camera

    Camera

    Camera

    Controller

    Identification:RS422 is quite different from RS232. The polarity between the data pair designates the MARKand SPACE; you do not reference to ground. If the + lead is positive referenced to the lead,you have a MARK and when the + lead is negative to the lead you have a SPACE, like RS232when there is no data, the equipment will be in the MARK condition.

    To identify the + and leads when no data is being transmitted, the + lead will be +2 to +6 V tothe lead.

    NOTE: Some manufacturers designate the leads as A and B. Use the method above todetermine the + and leads as there is inconsistency between manufacturers as to which, A orB, is the positive lead.

    Testing:Verifying the RS422 link operation requires very little. A flashlight AAA, AA, C, or D cell and adigital Voltmeter are all that you need. Connect the Voltmeter to the output pair, red lead to + andblack to . At the input end of the link, connect the flashlight cell to the input + and to the input. The meter should read +2 to +6 VDC. Reverse the flashlight cell + to the input and tothe + input. The meter at the far end should now read 2 to 6 VDC. Check the reverse directionin the same manner by moving the flashlight cell and meter to the opposite ends.Note: When there is no input it is normal for the + lead to be +2 to +6 V to the lead at the outputon most equipment.

  • 8/7/2019 Data Type ID Troublshooting V4

    6/15

    Figure 5

    IN+ -

    OUT+ - G

    Fiber TranscieverData Set for RS422

    IN+ -

    OUT+ - G

    Fiber TranscieverData Set for RS422

    FlashlightCell

    AA,C or D

    + VDC

    Common -

    DC Volts + Red

    Black

    + -

    IN+ -

    OUT+ - G

    Fiber TranscieverData Set for RS422

    IN+ -

    OUT+ - G

    Fiber TranscieverData Set for RS422

    FlashlightCell

    AA,C or D

    - VDC

    Common -

    DC Volts + Red

    Black

    +-

    Termination:Each copper pair should be terminated. Terminations are always done at the receive end. Onshort copper runs, termination is less important. Noise immunity is improved on longer runs withproper termination. Figure 6 shows a simple point-to-point, single direction link.

    Figure 6

    Termination

    Resistor-

    +

    -

    +

    Figure 7Unidirectional RS422

    Controller

    Termination

    Resistor

    Fiber Rx

    Termination

    Resistor

    CameraFiber Tx

    -

    +

    -

    +

    -

    +

    -

    +

    The fiber link, shown in Figure 7, now has two copper pairs, each pair requiring termination.

  • 8/7/2019 Data Type ID Troublshooting V4

    7/15

    Figure 8

    TerminationResistor onlast unit only

    -

    +

    Controller

    -

    +

    -

    +

    -

    +

    Termination

    Resistor

    CameraFiber Tx

    TerminationResistor

    CameraFiber Tx

    TerminationResistor

    CameraFiber Tx

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    Fiber Rx

    Fiber Rx

    Fiber Rx

    Figure 8 shows one controller for three cameras. Notice that there is one copper pair on thecontroller side with one termination, but on the camera side there is a copper pair associated witheach camera that requires a termination.

    Figure 9

    TerminationResistor-

    +

    -

    +

    Controller

    TerminationResistor

    Fiber Tx

    -

    +

    -

    +

    TerminationResistor-

    +

    -

    +

    TerminationResistor

    Fiber Tx

    -

    +

    -

    +

    Camera

    Figure 9 shows one controller in a bidirectional data configuration. There are now two copperpairs on each side of the fiber with one termination on each pair. As there can be only one talker,this becomes a point-to-point installation. Some manufacturers do provide external equipment toallow multiple talkers on a pair by connecting only one to the buss at a time on a first come, firstserved basis.

    Troubleshooting:Generally, most problems with RS422 are caused by improper connections or switch settings.Once you have confirmed the link operation with the flashlight cell and meter, recheck yourconnections. If you use a pre-made RJ type cable and cut it to make two RJ plug-to-bare-wire,verify the pin number and color on each piece as often the pre-made cables will either swap pairsor pin order. You may have the red on pin 4 on one end and on pin 5 on the other. Anotherproblem that took a tech a long time to find was a bad crimp. The tech removed the plug to checkit had continuity; however, when the plug was inserted the way the wire laid, one of theconnections was open.

  • 8/7/2019 Data Type ID Troublshooting V4

    8/15

    RS485

    There are two implementations of bidirectional RS485: the more common 4-wire and 2-wire.Many manufacturers let you select which you would prefer, 4- or 2-wire. 4-wire RS485 is verysimilar to RS422 in many respects. The main differences are that RS485 allows multiple talkersas well as multiple listeners and the tri-state, or high impedance, mode. This ability to tri-state iswhat allows for multiple data talkers on the same pair. When the transmitter has no data, insteadof driving the data lines into a MARK or SPACE condition, it goes into high impedance so thatanother data transmitter may drive the lines. Each transmitter has a receiver that monitors thelines and, by various methods, software or hardware will not enable its associated transmitterwhile the data lines are active. The RS485 standard allows for up to 32 devices on a buss, butthis number may be extended with a repeater up to the limits of the software.

    NOTE: While I have not shown a ground connection, RS485 requires a ground at each

    device for proper operation.

    The least understood issue associated with building robust RS485 networks is proper grounding.Even though there are a number of good references on the topic, grounding seems to bemisunderstood by many people.

    RS485 uses a twisted pair for the communication; a third wire for grounding is stronglyrecommended to avoid problems caused by a Voltage potential existing between the devicegrounds in the network. It's also needed so that the electric current that travels through the bus(from one particular driver) finds a way to return to its source.

    Signals A and B are complementary, but this doesn't mean that one signal is a current return forthe other. RS485 is not a current loop. The drivers and receivers must share a common ground;this is why two-wire network is a misnomer when applied to RS485.

    So you need at least three wires. Two are required for the differential voltage with the appropriatetermination. A third one is required for the ground, which can be implemented connecting eachdevices digital ground with a ground bus through a 100 Ohm resistor, Figure 10A. Someapplication notes suggest that another 100 Ohm resistor be used to connect digital ground withphysical ground, Figure 10B.

  • 8/7/2019 Data Type ID Troublshooting V4

    9/15

    Figure 10A

    TerminationResistor-

    +

    -

    +

    Figure 10B

    TerminationResistor-

    +

    -

    +

    Figure 10C

    TerminationResistor-

    +

    -

    +

    Earth ground potentials from circuit to circuit can vary several Volts under normal conditions;

    however, during electrical activity (lightning, etc.), potentials between grounds in different parts ofa building can momentarily reach tens or hundreds of Volts depending on the geometry of theelectric fields.

    The common mode voltage allowable between drivers and receivers on an RS485 network is +12to 7V. This setup provides 7V of protection from each rail (assuming a 5V system). If the earthground system in Figure 10C (without common grounding) only varies a few volts under normalconditions, then the network will function well.

  • 8/7/2019 Data Type ID Troublshooting V4

    10/15

    The problem comes when a voltage transient appears on the earth ground circuit, which mighthappen because ESD is discharged into the earth ground near a node. Or it may happenbecause lightning strikes nearby (perhaps half a mile away). Whatever the cause, VoltageGround Potential Differences (VGPD) between earth grounds on a network will occur on a dailyor weekly basis.

    When the common mode voltage on a node drifts beyond the allowable Vcm of +12 to 7V, thenode is no longer guaranteed to function. In fact, the drivers and receivers in the node may besubject to damage.

    The best method for controlling VGPD is to simply run a third wire for 2-wire implementations or afifth wire for 4-wire networks for the purpose of referencing local signal grounds.

  • 8/7/2019 Data Type ID Troublshooting V4

    11/15

    Please see EIA Standard RS-485 (1983), Appendix A.3 Optional Grounding Arrangements,Section A.3.1 Signal Reference that states: "Proper operation of the generator and receivercircuits requires the presence of a signal return path between the circuit grounds of theequipment at each end of the interconnection. The circuit reference may be established by a thirdconductor connecting the common leads of devices or it may be provided by connections in eachusing equipment to an earth reference."

    RS485 is a 3-wire circuit. Besides the A/B, youll need to make sure your signal ground (C) isshared at both ends. The EIA/RS485 spec covers this in great detail; so should any app notefrom an RS485 chip vendor. Worst case, follow the EIA/RS485 recommendation and put a 100Ohm 1 Watt resistor from each device to a shared ground wire.

    The logic ground of all devices on the same copper network must reference the same ground.There are a couple of options to consider:

    Option #1

    Connect the ground to a solid earth ground on all devices. If the grounding system is good, alldevices will be referenced to the same ground. Note that the typical PC follows this practice.

    In some older buildings, the earth ground could vary by several volts within the building. In thiscase option #2 is recommended.

    Option #2

    Use the GND position on each device to tie all devices to the same potential. It is notrecommended that the shield be used as the ground wire.

    Where it is not possible to get all controllers referenced to the same ground, use an isolatedRS485 repeater between devices that are located at different ground potentials. Isolatedrepeaters are also an excellent way to clean up signals and extend distances in noisyenvironments.

    Identification:The positive lead is again identified with a meter; however, due to the tri-state condition, the bussis not being driven. You will only see a small voltage difference between the + and leads (lessthan 200 mV, 0.20 Volts). If you see a greater Voltage, the RS485 line is active and no othertransmitter will be allowed to talk.

    A and B are "standard" but not really. Some vendors "A" may be your "B". The same istrue of +/ labels or data/not-data labels. This is because EIA/RS-485 talks about logicalbinary "0" and "1", not about voltage levels. The SN75176B labels the A/B pins assuming0v = "1" and 5v = "0". This is NOT what the AT89C51 is doing! So try swapping A/B so yourA goes to their B. You cannot hurt the chips; this is one of the EIA/RS-485 benefits. If youare not aware of this "detail", your design will be running the data line inverted fromeveryone else.

  • 8/7/2019 Data Type ID Troublshooting V4

    12/15

    Figure 11

    -

    +

    TerminationResistor on

    last unit only

    Camera

    Camera

    Camera

    Controller

    TerminationResistor-

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    Figure 11 shows a typical 4-wire connection. Each pair is terminated at the receiver that is mostdistant from the transmitters.

  • 8/7/2019 Data Type ID Troublshooting V4

    13/15

    Figure 12

    -

    +

    TerminationResistor onlast unit only

    Fiber Rx

    Fiber Rx

    Fiber Rx

    Controller

    TerminationResistor-

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    TerminationResistor-

    +

    -

    +

    TerminationResistor

    Fiber Tx

    -

    +

    -

    +

    Camera

    TerminationResistor-

    +

    -

    +

    Termination

    Resistor

    Fiber Tx

    -

    +

    -

    +

    Camera

    TerminationResistor-

    +

    -

    +

    TerminationResistor

    Fiber Tx

    -

    +

    -

    +

    Camera

    Figure 12 shows the fiber extension of the copper circuit in Figure 11. Again, each copper pair isterminated.

  • 8/7/2019 Data Type ID Troublshooting V4

    14/15

    Figure 13

    -+

    -+

    -+

    -+TerminationResistor on

    each end only

    TerminationResistor on

    each end only

    Camera

    Camera

    CameraController

    Figure 13 shows the same circuit as Figure 12, but by using 2-wire RS485. Two-wire RS485 ishalf-duplex, meaning that only one end may talk at a time. If the camera must talk back to thecontroller, it must wait until the controller is finished and the timeout, selected by the cameramanufacturer, is over.

    Figure 14

    -+

    -+

    -+

    -+TerminationResistor on

    each end only

    TerminationResistor on

    each end only

    -+

    -+

    -+

    -+

    -+

    -+

    Fiber Tx

    Fiber Tx

    Fiber Tx Camera

    Camera

    Camera

    Controller

    Fiber Rx

    Fiber Rx

    Fiber Rx

    Figure 14 shows the fiber extended version of Figure 13. It may seem a bit different intermination, but it is not. The most distant receiver on the buss is terminated in each case. Itlooks a bit odd due to the fact that each copper pair has a receiver at each end.

  • 8/7/2019 Data Type ID Troublshooting V4

    15/15

    TroubleshootingThe operation of the fiber converters is intended to be straightforward. However, you mayexperience difficulty getting your devices to communicate on the first try. The sections below areintended to assist you in troubleshooting the cause of your problem.

    Loopback TestOne method for testing a converter is to connect it in a loopback configuration and use a terminalemulation program (such as ProComm Plus or Windows Hyper-Terminal) to send and receivemessages. This allows the computer to receive the same message that it transmitted. This is aneffective test of the converter, the external power supply, and the dipswitch settings. Simplyconnect power to the converter, wire RX+ to TX+ and RX to TX on the terminal strip. Thentransmit a message and compare it to the message that is received. If they match, the converteris operating properly.

    Note that this test will not work when configured for RS485 2-wire.

    Ground LoopsGround loops occur when a voltage potential exists between the ground reference of the

    transmitting device and the ground reference of the receiving device. This potential difference cancreate current flow, which could interfere with communication and damage the converter. Groundloops can be avoided by connecting the shield ground of the RS422/485 cable on one end only.

    TerminationLong RS422/485 lines may exhibit some ringing in the signals, which a receiver could interpret asdata. Also, in systems where multiple transmitters are used, data lines are allowed to float whenall transmitters are in their tri-state modes, creating additional spurious noise. These problemscan be eliminated by switching a 120 ohm resistor across the receiver and transmitter terminals(TX+ and TX) and (RX and RX+). The fiber converters have optional terminating resistors(built-in) that may be switched in. When only one transmitter exists on the network, the RXresistor should be connected on the receiver furthest from the transmitter. When using 2-wirecommunications, switch in both resistors.

    Proper CablingRS422 and RS485 should use a shielded communications cable whose wires are twisted intopairs. The twisted wire pairs reduce noise by causing any electromagnetic noise to be common toboth wires. The differential receiver will cancel this noise.

    A recommend wire is Belden 9503, 9513 or 9553 or equivalent. With the shield grounded at one

    end only and both conductors of the 3rd

    pair being used as the signal ground.