0% found this document useful (0 votes)
9 views35 pages

Lecture - 3 CSE DC

Uploaded by

tacom63824
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views35 pages

Lecture - 3 CSE DC

Uploaded by

tacom63824
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Lecture #3

RS232 & RS485 protocols

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

Transmission Terminology Signals &


Analog vs. Digital
RS23
2
WHAT IS 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 computer’s serial
port
(know as COM or Comm port).
RS-232 SIGNALS
• Architecturally RS-232 is a bi-
directional point to point link. (serial port - PC side)

 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).
RS-232 Signals..
• Common 25 pin D-shell connector pinout used for
asynchronous data communications.

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.

 The standard SLAVE-1


MASTER
specifies up to 32
drivers and 32
receivers can share
a multidrop network
SLAVE-2
 Terminator SLAVE-3

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:

• The quality of the signal being transmitted

• The characteristics of the transmission medium

• Data transmission occurs between a transmitter and a


receiver over some transmission medium.
• Guided media – physical path
• twisted pair, coaxial cable, optical fiber
• Unguided (wireless) media
• Air, water , vacuum
TRANSMISSION TERMINOLOGY
• Direct link
• Transmission path from transmitter to receiver with no intermediate
devices
(other than amplifiers)
• Point to point
• Direct link between the only two devices sharing the medium (Note:
can apply to unguided media)
• Multipoint
• More than two devices share the same medium
• Simplex
• Signal transmitted in one direction
• e.g. cable television
• Half-duplex
• Both stations may transmit, but one at a time
• e.g. police radio
• Full-duplex
• Both stations
• e.g. may transmit simultaneously
telephone
23
ANALOG VS. DIGITAL
• Analog signal
• Signal intensity varies in a smooth, continuous, fashion over
time
– no breaks
• Digital signal
• Signal intensity maintains constant level for some period of
time and then abruptly changes to another constant level –
discrete signals
24 PERIODIC SIGNAL
Sine
25
(periodic continuous
Wave
signal)
• Peak amplitude (A)
• Maximum strength of signal
• Typically measured in volts
• Frequency (f)
• Rate at which signal repeats
• Period (T) is time to repeat T = 1 / f
• Hertz (Hz) or cycles per second
• Phase ()
• Relative position in time within a single period
Varying Sine Waves
26
s(t) = A sin(2ft
+)
WAVELENGTH ()

• Distance occupied by a single cycle


or
Distance between two points of corresponding phase of two
consecutive cycles
• Signal with velocity v, then wavelength is
 = vT or f = v

• Consider signal travelling at speed of light


v = c = 3 x 108 m/s
28
FREQUENCY DOMAIN CONCEPTS
• Signals are made up of many frequencies
• Components are sine waves
• Fourier analysis can show any signal is made up of
components at various frequencies
• Each component is a sinusoid
• Can plot frequency domain functions
29

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

You might also like