Lecture - 3 CSE DC
Lecture - 3 CSE DC
Instructor:
Dr. Rounakul Islam
AGENDA
What is RS232
• Signals, Line Driver, Speed & SW settings
What is RS-485
• Line Driver, Network, Half-duplex, Full-duplex & DL devices
RS-232 vs RS-458
Pi Signal
n PGND Protective Ground
1 TXD Transmit Data
2 RXD Receive Data
3 RTS Ready To Send
4 CTS Clear To Send
5 DSR Data Set
6 Ready SG Signal (serial port - PC side)
7 Ground CD Carrier
8 Detect
20 DTR Data Terminal
22 Ready RI Ring
Indicator
RS-232 LINE DRIVER
• Unbalanced Line Drivers
• 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 respest 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 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.
RS-232 SW SETTINGS
• One byte of async data has:
• Start Bit = 1 (always)
• Data Bits = 8 (or 7)
• Stop bits = 1 (or 2)
• Parity = NONE (or EVEN or ODD)
+
25
-
2
5
RS48
5
WHAT IS RS-485
• 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.
• How fast can RS-485 be?
• 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 LINE DRIVER
• Balanced Line Drivers
• Voltage produced by the driver appears across a pair of signal
wires that transmit only one signal. Both wires are driven
opposite.
• RS-485 driver has always the “Enable” direction control signal.
• Differential system provides noise immunity, because much of
the common mode signal can be rejected by the receiver. So
ground shifts and induced noise signals can be nullified.
RS-485 NETWORK
• RS-485 provides Half-Duplex, Multidrop communications over a
single twisted pair cable.
resistors avoid
reflected signal
RS-485 Half-
duplex
• Datalogic uses Half-Duplex configurations for Data Collecting
and Master/Slave layouts.
TX
ENABLE
Slave 1
RX
RTX485 TX
+
RTX485
TX - ENABLE
Slave 2
ENABLE
RX
RX
TX
485GND
ENABLE
Slave N
RX
Master
RS-485 FULL-DUPLEX
• Potentially RS-485 interface can also use 4-wires to communicate in
multidrop
mode.
TX485+
TX485-
TX TX
ENABLE ENABLE
RX485+
RX RX
RX485-
485GND
Other device
Scanner
RS-232 VS RS-
485
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 big difference to the software is that only one device on a
485 bus can transmit at a time, whilst there is not similar
limitation on RS232 because is a peer-to-peer link .
RS-232 VS RS-485
DATA FORMAT AND PROTOCOLS
• Information content passing through peer-to-peer
connection
• is packed in a very simple structure:
• <Header-string> <Code identifier
><INFO-FIELD><Terminator- string>
• <Header-string> and <Terminator-
string> are both configurable
• via software (device configuration
parameters)
• Most common generic Handshake are
available/selectable with RS232 interface:
• Hardware (RTS-CTS)
• Software XON/XOFF
DATA
TRANSMISSION
DATA TRANSMISSION
• The successful transmission of data depends on two factors:
Addition of
Frequency
Component
s (T = 1/f)
30
SPECTRUM & BANDWIDTH
• Spectrum
• Range of frequencies contained in a signal
• e.g. f and 3f on previous slide
• Absolute bandwidth
• Width of the spectrum
• e.g. 2f
• Effective bandwidth (or just “bandwidth”)
• Narrow band of frequencies containing most of the energy in
the signal
31
DATA RATE AND BANDWIDTH
• Any transmission system can carry only a limited band of
frequencies
• Limits the data rate that can be carried
• Square waves have infinite components
• Infinite bandwidth
• Most energy in first few components
• Limiting bandwidth creates distortions
32
DATA, SIGNALS, AND
• Data TRANSMISSION
• Entities that convey information
• Signals
• Electric or electromagnetic representations of data
• Signaling
• Physical propagation of signal along medium
• Transmission
• Communication of data by propagation and processing of
signals
DIGITAL DATA & SIGNALS
• Text (character strings)
• Coded into sequence of bits
• IRA – International Reference Alphabet (ASCII)
• 7-bit code with parity bit
• Image
• Coded into pixels with number of bits per pixel
• May then be compressed
• Advantages
• Cheaper
• Less susceptible to noise interference
• Disadvantages
• Suffer more from attenuation (strength
loss)
34 ANALOG SIGNALS
35 DIGITAL SIGNALS