Synchronous vs. Asynchronous
Synchronous vs. Asynchronous
Synchronous vs. Asynchronous
Asynchronous
Synchronous
One-way communication Receiver and transmitter must have their clocking synchronized, . Requiring a constant stream of transmission Request for data is made, time is given for the request to be carried out, and data is read.
Asynchronous
- Utilizes start and stop bit to communicate the beginning and end of data words to the receiver - No need for devices to be synchronized
Data Word
Start Bit
Signals the start of transmission of the data bits Transition from logic 1 to logic 0
Data Bits
Generally 8 data bits (not including parity bit) Transmitted and received least significant bit first
Stop Bit
Signals the end of a data word Logic 1
Parity Bit
Can be added to the transmitted data to check for and display an error message when a bit is lost during transmission Comes in two forms
Odd Parity
Sum of the 1s in the frame will be odd
The logical state (1 or 0) of the parity bit is selected to fulfill this condition
Even Parity
Sum of the 1s in a frame will be even
Number of 1s checked against the parity bit to determine if any bits were lost during transmission
Data Word
In this example:
1 start bit, 1 stop bit, 1 parity bit, 8 data bits, 11 bits per word, 300 baud rate
Bit Time = 1/(Baud rate) = 1/300 = 3.33 msec Character Time = (total bits in word) x (bit time) = 11 x 3.33 = 36.6 msec Data Bit Rate (including parity) = (data bits in word)/(character time)= 9/3.33 = 270
What is RS232
RS-232 Signals RS-232 Line Driver RS-232 Speed RS-232 SW settings
What is RS-485
RS-485 Line Driver RS-485 Network RS-485 Half-duplex RS-485 Full-duplex RS-485 and DL devices
RS-232 vs RS-485
RS-232
RS-232 is a popular communications interface for connecting modems and data acquisition devices (i.e. GPS receivers, electronic balances, data loggers, ...) to computers. RS-232 can be plugged straight into the computers serial port (know as COM or Comm port).
RS-232 Signals
Architecturally RS-232 is a bi-directional point to point link.
Two independent channels are established for two-way (full-duplex) communications. RS-232 can also carry additional signals used for flow control (RTS, CTS) and modem control (DCD, DTR, DSR, RI).
Three major wires for the Serial interface: Transmit ( Pin 2) Receive Ground ( Pin 3) Pin 7 (25 pin connector) Pin 5 (9 pin connector)
Tx
Computer
Tx
Device
Rx
Gnd
Rx
Gnd Transmit connects to Receive
RS232 is well-established standard, developed by the EIA (Electronics Industry Association) in 1960s Originally intended as an electrical specification to connect computer terminals to modems
DTE
DCE
DCE
DTE
RS-232C
Telephone network
RS-232C
1s and 0s in RS-232C
A 1 is called a mark
A 0 is called a space
The idle state for an RS-232C line is a 1 (mark)
Idle state is called marking the line
Idle state TD 0 1
Start bit 0 0 0 0 1
Idle state
RS-232C Connectors
The original standard specified a 25-pin connector Today, a 9-pin connector is more common E.g.,
DB9P Note: P = pin Sometimes called a male connector The mate for this is a DP25S, or socket connector the female
RS-232C Connectors
Pin 1 DB25P DB25S Pin 1
Pin 1
DB9P
DB9S
Pin 1
Where is pin 1?
DB9P
Common 25 pin D-shell connector pinout used for asynchronous data communications.
Pin 1 2 3 4 5 6 7 8 20 22 Signal PGND Protective Ground TXD Transmit Data RXD Receive Data RTS Ready To Send CTS Clear To Send DSR Data Set Ready SG Signal Ground CD Carrier Detect DTR Data Terminal Ready RI Ring Indicator
Each signal appears on the interface connector as a voltage with reference to a signal ground. The idle state (MARK) has the signal level negative with respect to common whereas the active state (SPACE) has the signal level positive with respect to the same reference.
RS-232 Speed
How fast can RS-232 be?
The maximum speed, according to the standard, is 20kbit/s. However, modern equipment can operate much faster than this. (i.e. Lynx can reach 115200 baud.) The length of the cable also plays a part in maximum speed. The longer the cable and the slower the speed at which you can obtain accurate results. A large wire capacitance and inductance limits the maximum length of the cable and/or the maximum speed;
Moreover higher is the capacitance of the cable higher is the interference between two adjacent signal wire.
50 feet (15m) @ max baudrate is commonly quoted as the maximum distance.
Computer and device must have the same settings for Baud Rate Parity
Stop bits
Baud Rate - data transmitted in bits/second Parity - Check against faulty data transfer. If used, 8 (typically) data bits sent plus parity bit. Responsibility of device to check parity Stop Bits - denotes end a data string. Use 2 stop bits with SR510. (Recommended)
Each ASCII character requires about 12 bits to be transmitted or about 833s for character.
DTR - Data Terminal Ready - (pin 20) Set high by computer to tell instrument that Computer is ready to receive data.
What is RS-485
RS-485 is a EIA standard interface which is very common in the data acquisition world
RS-485 provides balanced transmission line which also can be shared in Multidrop mode.
It allows high data rates communications over long distances in real world environments. RS-485 was designed for greater distance and higher baudrates than RS-232.
According to the standard, 100kbit/s is the maximum speed and distance up to 4000 feet (1200 meters) can be achieved.
RS-485 Network
RS-485 provides Half-Duplex, Multidrop communications over a single twisted pair cable.
The standard specifies up to 32 drivers and 32 receivers can share a multidrop network
Terminator resistors avoid reflected signal
RS-485 Half-duplex
Data logic uses Half-Duplex configurations for Data Collecting and Master/Slave layouts. Usually we talk about Multidrop network (i.e. MX4000,DPS9000)
TX ENABLE RX
Slave 1
TX ENABLE RX
Slave 2
485GND
Master
TX ENABLE RX
Slave N
RS-485 Full-duplex
Potentially RS-485 interface can also use 4-wires to comunicate in multidrop mode but...
TX ENABLE
TX485+ TX485TX
RX485+ RX485485GND
ENABLE RX
RX
RS-232 vs RS-485
The architectural difference between RS-232 and RS-485 is that 232 is a bi-directional point to point link, whereas 485 is a single channel bus. Electrically, each 232 signal uses a single wire with symmetric voltages about a common ground wire. 485 uses two wires to carry the single signal differentially. The main difference is that only one device on a 485 bus can transmit at a time, however there is no similar limitation in the transmission for RS232 since it has a peer-to-peer link .
RS-232 vs RS-485
RS-232 RS-485
Mode of Operation Total Number of Drivers and Receivers on One Line Maximum Cable Length Maximum Data Rate @Max length Driver Output Signal Level (Loaded Min.) Loaded Driver Output Signal Level (Unloaded Max) Unloaded Driver Load Impedance Max. Driver Current in High Z State Power On Max. Driver Current in High Z State Power Off Slew Rate (Max.) Receiver Input Voltage Range Receiver Input Sensitivity Receiver Input Resistance
SINGLE-ENDED 1 DRIVER 1 RECEIVER 50 FEET 20kb/s +/-5V to +/-15V +/-25V 3k to 7k N/A +/-6mA @ +/-2v 30V/S +/-15V +/-3V 3k to 7k
DIFFERENTIAL 32 DRIVER 32 RECEIVER 4000 FEET 100kb/s +/-1.5V +/-6V 54 N/A +/-100uA N/A -7V to +12V +/-200mV 12k