C2-RS232-RS422-RS485-phan 3

Embed Size (px)

Citation preview

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    1/25

    Serial Communication

    EIA RS422 and RS485

    Recommended StandardThe purpose of this course note is to attempt to describe the main elements in SerialCommunication. This application note attempts to cover enough technical details ofRS422 and RS485.

    EIA- Electroonic Industries Association

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    2/25

    Introduction

    The purpose of this note is to describe the

    main elements of an RS-422 and RS-485

    system.

    This note attempts to cover enough technical

    details so that the system designer will have

    considered all the important aspects in the

    data system design.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    3/25

    Balanced Line Drivers

    In a balanced differentialsystem the voltage producedby the driver appears across apair of signal lines thattransmit only one signal. (2-6V)

    C: Signal Ground. It isnt usedby a balanced line receiver indetermining the logic state ofthe data line.

    ENABLE: (Tristate condition ofthe driver)

    RS-485 diver must haveENABLE control signal.

    RS-422 driver may have thissignal, but it is not alwaysrequired.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    4/25

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    5/25

    Schmitt Trigger using Op-Amp

    vout=A(v2v1)

    The comparator will switch when V+=0. Then

    The effect of using a Schmitt trigger

    (B) instead of a comparator (A).

    Typical hysteresis curve (Non-inverting)

    Non-inverting Schmitt trigger

    Inverting Schmitt trigger

    The difference between the trip points

    is the hysteresis H and is given as

    sss V

    R

    RVR

    RVR

    RH

    2

    1

    2

    1

    2

    1 2)(

    Let's say you detect a low-to-high transition at 2.5 V. A

    100 mV hysteresis would mean that the low-to-high

    transition is detected at 2.55 V and the high-to-low

    transition is detected at 2.45 V, a 100 mV difference.

    Vcc = Voltage Common Collector Bipolar

    Vee = Voltage Common Emitter BipolarVss = Voltage Common Source FET

    Vdd = Voltage Common Drain FET

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    6/25

    EIA Standard RS-422 Data Transmission Each generator can drive up

    to 10 receivers.

    The 2 signaling states of the lineare define as follows:

    When the A terminal of thedriver is negative with respectto the B terminal, the line is

    in a binary 1 (MARK or OFF)state.

    When the A terminal of the

    driver is positive with respectto the B terminal, the line is

    in a binary 0 (SPACE or ON)

    state. Like RS232, the data bits are

    transmitted in reverse order.

    The terminator is placed at the end of a transmission

    line or daisy chain bus, designed to match impedance and

    hence minimize signal reflections.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    7/25

    Figure shows the condition of the

    voltage of the balanced line for

    an RS-232 to RS-422 converter

    when the line is in the idle

    condition or OFF state.

    The A terminal is equivalent to

    the - designation.

    The B terminal is equivalent to

    the + designation.

    The same relationship alsoapplies for RS-485 systems.

    RS-422 can withstand a common

    mode voltage (Vcm) of 7 volts

    EIA Standard RS-422 Data Transmission

    DVM: Digital voltmeter

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    8/25

    As many as 32 driver/receiver pairs can share a multi drop network

    Many characteristics of the drivers and the receiver are the same as RS-

    422.

    The range of the common mode voltage Vcm that the driver and receiver

    can tolerate is expanded to +12 to -7 volts. The driver can be disconnected or tristated from the line.

    The signal ground line is also recommended in an RS-485 system

    EIA Standard RS-485 Data Transmission

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    9/25

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    10/25

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    11/25

    Tristate control of an RS-485 device

    using RTS

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    12/25

    Send data control of an RS-485 device

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    13/25

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    14/25

    Biasing an RS-485 Network

    In order to maintain the proper idle voltage state (all drivers are tristated),

    bias resistors are must be applied to force the data lines to the idle

    condition.

    Example: 10 node, RS-485 network with two 120

    termination resistors

    T i t t ti f

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    15/25

    Transient protection of

    RS-422 and RS-485 system

    Isolated RS-485 device

    RS-485 Device with signal ground

    connected to chassis ground

    Signal ground connection between two nodes

    with 100 resistor

    Isolated node with shunt protection to earth ground

    Isolated port with ungrounded shunt protection

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    16/25

    Surge Transient protection of

    RS-422 and RS-485 system

    Fused port protection

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    17/25

    SN65176B, SN75176B

    DIFFERENTIAL BUS TRANSCEIVERS

    The SN65176B and SN75176B differential bustransceivers are integrated circuits designed for

    bidirectional data communication on multipoint

    bus transmission lines.

    They are designed for balanced transmission

    lines and meet ANSI Standards TIA/EIA-422-B

    and TIA/EIA-485-A The receiver features a minimum input

    impedance of 12 k, an input sensitivity of 200

    mV, and a typical input hysteresis of 50 mV.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    18/25

    Full duplex

    SN75179B DIFFERENTIAL DRIVER AND

    RECEIVER PAIR

    The SN75179B is a differential driver and

    receiver pair designed for balancedtransmission-line applications and meets

    TIA/EIA-422-B, TIA/EIA-485-A. It is designed to

    improve the performance of full-duplex data

    communications over long bus lines.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    19/25

    Half duplex

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    20/25

    CONTROLLING THE DRIVER ENABLE

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    21/25

    CONVERT RS232 TO RS485

    Half duplex

    A MAX233 converts the RS-232 signals to TTL levels, and

    the TTL signals connect to an SN75176Bthat provides the

    RS-485 interface.

    The MAX220MAX249 family of line drivers/receivers is

    intended for all EIA/TIA-232E and V.28/V.24 communications

    interfaces, particularly applications where 12V is not

    available.

    MAX232

    MAX233

    V.24 is a specification for single-ended communications that includes the definition of

    connector pin allocations. It is used together with V.28 to define a specification for

    serial asynchronous or synchronous communications.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    22/25

    CONVERT RS232 TO RS485 Half duplex

    Popular chip MAX232 is used to convert RS232 signals from/to TTL level. MAX485 converts TTL level signals to RS485

    standard. RTSline is used to change transmission mode of MAX485. RTS signal is first converted to TTL level by MAX232 thenconnected to DEand RE/pins. 2 LEDs are used to indicate current state of the interface.

    LM78LXX Series

    Output voltages of 5.0V, 6.2V, 8.2V, 9.0V, 12V, 15V

    The MAX481, MAX483, MAX485, MAX487MAX491, and MAX1487

    are low-power transceivers for RS-485 and RS-422 communication.

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    23/25

    CONVERT RS232 TO RS485 Half duplex

    This is a small RS232 to RS485 converter project it use for convert RS232 signal level to RS485 level multidrop. It can use with 32 slave to communicate withPC and embedded systems board for long distance less than 1.2Km( 4000 feet).

    Specification

    - 9-12Vdc power supply

    - Small size only 2.8" X 1.45 "

    - Use for RS485 multidrop 2 wire connection.

    - Direct connect with PC on DB9 connecter.

    - Use RTS signal to control direction .

    - 32 Slaves (up to 256 slaves with some transceiver i.e. MAX3088)

    J1 and J2 use for jump R terminate(120) at the end of communication line or last slaver. The 75176 use for transceiver.RTS active (logic 0 or -3 to -15V) when we need to send data .

    Diode 1N4001 provides

    protection against reverse

    polarity connection of the

    supplyAdding a resistor to a line may limit

    damaging current flows that would

    otherwise result from short high-voltage

    transients, such as those caused by

    electrostatic discharge (ESD).

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    24/25

    Data Format and Protocols

    Information content passing through peer-to-peerconnection is packed in a very simple structure:

    and are bothconfigurable via software (device configurationparameters)

    Most common generic Handshakeare

    available/selectable with RS232 interface: Hardware (RTS-CTS)

    Software XON/XOFF

  • 8/13/2019 C2-RS232-RS422-RS485-phan 3

    25/25