~~NOCACHE~~ ====== lamaPLC Communication: RS-232 ====== {{ :com:rs232_1.png?150|lamaPLC Communication: RS-232}} In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a **DTE** (data terminal equipment) such as a computer terminal, and a **DCE** (data circuit-terminating equipment or data communication equipment), such as a modem. The standard defines the electrical characteristics and timing of signals, the meaning of signals, and the physical size and pinout of connectors. \\ \\ The current version of the standard is TIA232-F Interface Between Data Terminal Equipment and Data Circuit-Terminating Equipment Employing Serial Binary Data Interchange, issued in 1997. The //RS-232// standard had been commonly used in computer serial ports and is still widely used in industrial communication devices. \\ \\ A serial port complying with the //RS-232// standard was once a standard feature of many types of computers. Personal computers used them for connections not only to modems, but also to printers, computer mice, data storage, uninterruptible power supplies, and other peripheral devices. \\ \\ Compared with later interfaces such as [[com:basic_rs422|RS-422]], [[com:basic_rs485|RS-485]] and [[com:basic_ethernet|Ethernet]], //RS-232// has lower transmission speed, shorter maximum cable length, larger voltage swing, larger standard connectors, no multipoint capability and limited multidrop capability. In modern personal computers, USB has displaced //RS-232// from most of its peripheral interface roles. Thanks to their simplicity and past ubiquity, however, //RS-232// interfaces are still used—particularly in industrial machines, networking equipment, and scientific instruments where a short-range, point-to-point, low-speed wired data connection is fully adequate. \\ ===== Advantages and disadvantages of RS 232 ===== ==== advantages ==== * cheap * widespread ==== disadvantages ==== * multiple body potentials: devices with significantly different potentials often have to be connected; in this case, significant voltage (difference) may occur on the GND wire. In these cases, it is worth adding opto to the communication. * sensitive to noise: This problem can be significantly reduced by shielding the common GND at both ends of the wire. * can be used for short distances: Typically (as recommended) it can be used up to 15 m, but with a shielded cable (and in a disturbance-free environment) it can be extended up to 30 m. With a low-capacity cable, you can try to reach up to 100 meters (see baud rate). A classic solution is to convert RS-232 to RS422 (and then convert it back on the other side), so the distance can be increased to 1200 m; its official name: V.35 interface. * slow ===== Comparison of RS-232, RS-422,  RS-485 ===== ^ ^[[com:basic_rs232|RS-232]]^RS-423^[[com:basic_rs422|RS-422]]^[[com:basic_rs485|RS-485]]| ^Operating mode|asynchronous transmission|asynchronous transmission|synchronous transmission|synchronous transmission| ^Number of drives and receivers\\ per line|1 drive\\ 1 receiver (point-to-point)|1 drive\\ 10 receivers (point-to-point)|1 drive\\ 10 receivers (point-to-point)|32 stations per segment| ^Data transfer method|half-duplex,\\ full-duplex|half-duplex|half duplex|half duplex| ^Data transmission|p2p|multi-drop \\ (broadcast)|multi-drop\\ (broadcast)|multipoint| ^Max. cable length|15 m|1200 m|1200 m|1200 m| ^Max. data transfer\\ 12 m\\ 1200 m|\\ 20 kbps\\ (1 kbps)|\\ 100 kbps\\ 1 kbps|\\ 10 Mbps\\ 100 kbps|\\ 35 Mbps\\ 100 kbps| ^Max. slew rate|30 V/μs|adjustable|n.a.|n.a.| ^Receiver input\\ resistance|3..7 kΩ|≧ 4 kΩ|≧ 4 kΩ|≧ 12 kΩ| ^Drive Load-\\ Impedance|3..7 kΩ|≧ 450 Ω|100 Ω|54 Ω| ^Receiver "dead band"|±3 V|±200 mV|±200 mV|±200 mV| ^Receiver voltage level|±15 V|±12 V|±10 V|--7..12 V| ^Drive output\\ voltage max.|±25 V|±14 V|±12 V|--9..14 V| ^Drive output\\ voltage min. (with load)|±5 V|±3.6 V|±2.0 V|±1.5 V| ^Drive output\\ short circuit current limit|500 mA\\ to Vdc or Ground|150 mA to Ground|150 mA to Ground|150 mA to Ground\\ 250 mA to Vdc| ^Receiver Hysteresis|1.15 V|50 mV|50 mV|50 mV| ==== Signal rate of RSs ==== The transmission rate / distance ratio depends significantly on the quality of the used wire and the number of line amplifiers (repeaters). The curves below show typical values only. {{ :com:rs_signal_rate.png |Signal rate of RSs}} ==== Maximum data transmission distance ==== The values below can be achieved with UTP CAT-5 cable - 55 pF/m. |< 100% >| |maximum baudrate| 2,400|4,800|9,600|19,200|57,600|115,200| |maximum distance|900 m|300 m|152 m|15 m|5 m|< 2 m| ===== Data signal states ===== {{ :com:rs232_signallevel.png |RS-232 Data signal states}} * Data signal (TXD) Space, voltage level +3V - +15V Logic 0 signal, control signal (RTS, DTR): ON * Data signal (TXD) Mark, voltage level -3V - -15V Logic 1 signal, control signal (RTS, DTR): OFF * Dead band, voltage level -3V - +3V According to the standard, a dead band is included in RS-232 communication, this is the +3V - -3V range. The task of this is to absorb noise, the actual signals are only produced by the voltage levels that move out of this band. The voltage moving in the positive direction is a logical "0" signal, called creates a space, and in the negative direction it generates a logical "1", mark. The voltage level can range up to 15V in both directions, but most devices typically communicate with a voltage of +/- 5V. ===== Port-pin assignment ===== |< 100% >| ^designation\\ EIA-TIA^designation\\ CCITT^designation\\ DIN^connector\\ 9-pin^connector\\ 25-pin| ^DCD\\ (Data Carrier Detect)|1090|M5|1|8| ^RXD (Receive Data)|104|D2|2|3| ^TXD (Transmit Data)|103|D1|3|2| ^DTR (Data Terminal Ready)|1082|S1.2|4|20| ^GND (Ground)|102|E2|5|7| ^DSR (Data Set Ready)|107|M1|6|6| ^RTS (Request To Send)|105|S2|7|4| ^CTS (Clear To Send)|106|M2|8|5| ^RI (Ring Indicator)|125|M3|9|22| ==== Connector types, with leg assignment ==== |< 100% >| |{{ :com:d9_father.png |D9 connector}}|{{ :com:d25_father.png|D25 connector}}| |{{ :com:d9_mother.png |D9 connector}}|{{ :com:d25_mother.png|D25 connector}}| The - perhaps the second - most common RS-232 communication device is the null modem. This wire is typically used to connect two stations capable of full communication. If the two stations do not ask for different handshakes, there is no problem, because the **"minimum" rs232 functionality (2,3,5)** described in the next point can still be provided. {{ :com:rs232_3.png |RS-232 null modem}} ===== Sources ===== Wikipedia ([[https://en.wikipedia.org/wiki/RS-232|here]]) \\ ===== RS-232 topics on lamaPLC ===== {{topic>rs-232}} {{tag>bus communication rs-232 rs basic}} \\ This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}