128
S.T
MICROPROCESSORS
SERIAL COMMUNICATION STANDARDS
AND MICROCONTROLLERS
LJNTU-HYDERABANN
Q1. WNhat are the
differences between parallel and serial data communication, and why is
communication preferred for long-distance data transterr seria
OR
What are the key differences between simplex, half-duplex, and full-duplex
in serial data. systems, and how do synchronous and asynchronous transmissione
in terms of data structure and timing?
communicatiifotenr
Answer:
Serial data communication is a method of data where bits are sent sequentially
wire or pair of wires. This is in contrast to paralleltransferring
communication, where multiple bits are sent
over asingle
Over multiple wires. Here's amore detailed
Parallel vs. Serial Communication
explanation: sirnultaneously
Parallel Communication
Within Microcomputers
Inside a microcomputer or a microcontroller, data transfer typically
that multiple bits of data are transmitted occurS in parallel form. This rmes
simultaneously across multiple data lines. For instance, an 8-bit
communication would use 8 separate wires to send 8bits at the same time. parallel
Advantages
Parallel communication is very fast because all the bits of a data word
are sent simultaneously.
Disadvantages
Over long distances, parallel communication becomes
which can be bulky and expensive. Additionally, parallel impractical because it requires a large number of wires
(crosstalik) between the wires. lines can suffer from signal degradation and interference
Serial Communication
Conversion from Parallel to Serial
To send data over long distances
process involves sending one bit at a time efficiently, parallel data is converted into serial form. This
over a single wire or a pair of wires. conversion
Types of Serial Communication
Simplex
This type of transmission allows
transmitting data from Mount St. Helensdata to besent in only one direction.
or a commercial radio station Examples include an earthquake sensor
Haif-Dupiex broadcasting signals.
In this mode, communication
can occur
example is a two-way radio system, where one in both directions between two systems, but not simultaneously. An
off during transmission. party talkS while the other listens, with the
receiver circuitry turned
Full-Duplex
Here, both systems can send and
receive data simultaneously, similar to a
Synchronous Vs Asynchronous Transmission normal phone conversation.
Serial datä can be transmitted either
synchronously or asynchronously
Synchronous Transmission
Data is sent in blocks at a
hit pattems. This method requires constant rate. Each block's start and end are
the sender and receiver to be identified with specific bytes ot
transmission. synchronized, ensuring data integrity over the
Asynchronous Transmission
Each data character is sent individually,
identified by start bit and one or two stop
similar to typing on a keyboard, whereaeach
to be sent at any time, bits. This allows data
character is
WARNINC- Xerox/Photocogying of this book is a RIMINAL independently recognized.
act. Anyone found guilty is LIABLE to tace
EGAL araceedings.
UNIT-3: Communication Interface 133
Whenthe USART is utilized in asynchronous mode, one typical applicationis to connect to PC serial ports
ASIIgthe p-232 protocol. The RS-232 protocol is aserial Icommunication standard that specifies electrical signal
paperties and timing, as well as connection physieal size and pinout. However, it is crucial to note that a driver
r q u r e d
to interface with RS-232 voltage levels, as direct connection to RS-232 signats is not compatible with
s Intterface Controller microcontroller. This
driver serves aS an intemediary, ensuringthat the voitage
P e r a p h e r a l
the are c o i p a t i b l e
and the commumication is
stable.
The transmissiON and reception pins are under the controi of the USART, which enables it to transmnit arnd
ave dat, These teatures can be enabled independently, allowing for more flexihle communication configurations.
the serial port is activated, the
USARTtakes controi of both pins, preventig them fronn heing used
neral-purpose put output. This dedicated control ensures that the commuiication process is efhcient and
other \/O processes.
intertere with
Draw the internal architecture of uSART 8251 and explain its different status and
and controi formats neatty. modes
OR
Draw the 8251 USART architecture and explain the operation of each biock of it.
Aug.-22(R18),Csa)
OR
Provide an explanation of how the 8251 USART Wworks and draw a block diagram of
it.
Answer:
S31 USART Block Diagram
Data bus Transmit
D, - D, buffer buffer
TxD
p-s)
Reset
CLK Read/ Write
C/D control TxRDY
RD
Tran_mit TxEMPTY
logic buffer TxC (cioce
WR
CS
Receive
DSR buffer RxR
DTR Modem
CTS control RxRDY
Receive
RTS RxC
control
’ SYNDET/BRKDT
Internal bus
Figure (1}: Block diagram of 8251A USART
Íhe 8251 USART (Universal Synchronous/Asynchronous Receiver/Transmitter) is a progranmable
ittsRunication interface device. The block diagram ofFthe 8251 USART as illustrated in figure (l) consists of five
INn sections:
Data Bus Buffer
2
Receiver Section
3
Transmitter Section
4
Modem Control
5.
Read/Write Control Logic
SPECTRUM ALL-IN-ONE JoURNAL FOR ENGINEERING STUDENTS
134 MICROPROCESSORS AND MICROCONTROLLERS JNTU-HYDERABADI
1. Data Bus Buffer Function : Accepts parallel data
processor and converts to serial datafrom the
The data bus bufter is a component that transmission.
before
includes a bidirectionaB bus capable of
operating in three different states. Operation
Data Exchange: The transfer of data
between the internal bus of the 8251 and Data is first received by the transmitter
the system bus is dependent on the state o! buffer register.
the RD and WR signals. tt is then transferred to the output buft
When RiD is set to 0 (low), the data from the where franing and serialization
8251 data bus is transferred to the system before being transrmitted via the TxD
bus using the data lines D, - D,.
4. Modem Control
When the WR signal is at a low level (0),
the data from the system bus is transferred RTS and CTS : The modern control section i.
to the internal bus of the8251 using the data responsible for generating the RTS
lines D,- D, (Request to
Send) sighal and receiving the CTS (Clear to
Receiver Section
The receiver section consists of three main
Send) signal.
components: the receiver buffer register, receiver General Purpose I/0:Provides general-purpose
control logic, and input register. This is ilustrated output labeled DTR, (Data Terminal Ready) and
in figure (2).
general-purpose input labeled DSR (Data Set
Receiver
buffer Input RxD
Ready).
register
register 5. Read/Write Control Logic
Control K-RxC This cóntrol block contains RD (Read), WR
logic RxRDY (Write), C/D-(Contro/Data), CTS (Clear to
Figure (2): Receiver Section Send), CLK (Clock) and RESET, controls.
Function : This section accepts serial data Function : Controls data and control signal
through the RxD pin and converts it into parallel reception based on CS (Chip Select) and CD
data.
(Control/Data) signals.
Operation
Low Level on RxD Line:Indicates that the CS (Chip Select): The 8251 is enabled when CS
8251 is in asynchronous mode and ready to is low.
accept data. CID (ControVData)
High Level on RxD Line: Indicates
either a noise pulse or that the receiver If CS and C/D = 0, data is received by the
was enabled in the middle of a character 8251.
transmission.
3. If CS and C/D = 1, control signals art
Transmitter Section
The transmitter consists of three main
received by the 8251.
components: transmitter buffer register, output Further, this block comprises of two 8-bit data
register, and transmit control logic. This is butfer registers, one 16-bit control word register
illustrated in figure (3). (consisting of an 8-bit mode word register ad
an 8-bit command
word register), and one 8-bit
TxD
status register.
Output Q8.
Transmitter |register TxC
Draw the pin configuration of the 825IA
buffer USART and write the function of each p
register
Control TxRDY concisely.
Answer :
logic TxEMPTY
The pin diagram of 825 1A
Figure (3): Transmitter Section in figure (!). USART is illustra
WARNING: Xerox/Photocopying of this book is a CRIMINAL act. Anyone found
guilty is LIABLE to face
LEGAL proceedings.
Figure (1) is asimple diagram illustrating the
interfacing.
T/T, out TxD
RxD T/T, in USART
1C
MAX232 R/R, in RxD
TxD R,/R out
RS232
Interfacing RS-232
Figure (1): USART
Explanation
receiving data
NCrocontroller USART: Handles the serial communication logic, sending and
MAX232 Transceiver : ( Converts the voltagelevels between the microcontroller (TTL levels) and the RS.
232 device (higher voltage levels).
RS-232 Device: Receives and sends data over serial communication.
3.3 IEEE-488, 20MA CURRENT LOOP
Q13. What is IEEE-488 in serial communication standards? Explain.
Answer:
IEEE-488 in Serial Communication Standards
IEEE-488, aiso known as General Purpose Interface Bus (GPIB) or HP-1B, is a digital, 8-bit parallet
communications interface that was originally developed by Hewlett-Packard in the 1960s for connecting and
controlling multiple devices, such as computers; instruments,and other electronic devices.
Origins and Development
Initially developed by Hewlett-Packard (HP) to connect their electronic test equipment.
Standardized by the Institute of Electrical and Electronics Engineers (IEEE)in 1975 as IEEE-488.
Adopted widely in the scientific and indu_trial communities due to its robustness and flexibility.
Physical and Electrical Characteristics
Uses a 24-pin connector for the physical interface.
Supports up to 15 devices on a single bus, including controllers and instruments.
Allows for a maximum cable length of 20 meters (with limitations on
cable lengths between individual
devices to maintain signal integrity).
Data Transfer and Control
Operates in a parallel mode, transferring 8 bits of data simultaneously.
Includes additional lines for handshaking and control,
coordination. ensuring reliable data transmission and device
Data
transfer rates can range from hundreds of kilobytes per
depending on the implementation and configuration. second to several megabytes per second,
Communication Protocol
Devices on the bus communicate using a master-slave
configuration, where one device (the controller)
manages communication with the other devices (the instruments).
The protocol supports both unidirectional and bidirectional
data transfer, depending on the device capabilities.
Commands and data are sent over the bus using a predefined set
between devices from different manufacturers. of standard protocols, ensuring compatibiliy
WARNING: Xerox/Photocopying of this book is a CRIMINAL act. Anyone
found guilty is LIABLE to faceIEGAL Droceadings.
UNIT-3: Communication Interface 141
s14.
Mention the applications of IEEE-488 and 20mÁ Current Loop
lte its advantages and limitations. current
Definition: In a 20mA current loop system, a
one of the
AnSWer: of 20 milliamps (mA) is used to represent
current
4pplicatiohs binary states (usually a logical '1', while no
represents the other state (usually
widely used in automated test equipment (ATE) {OmA) or a low current
sYtems for controlling instruments and coliecting a logical '0).
data. Usage: Widely used in industrial automation and control
Common in laboratory environments for systems due to its simplicity and robustness.
connecting measurement instruments like Advantages
oscilloscopes, multimeters, and signal generators. Excellent noise immúnity, as the current signal
Jtilized in industrial settings for process control is less susceptible to electrical interference
and monitoring. compared to voltage signals.
svSntages and Limitations
Càpability to transmit data over long distances
Advantages: without significant loss of signal integrity.
Robust and reliable communication interface. Example: A simple 20mA current loop system could
Well-established standard with extensive support consist of acurrent source, a transimitter, a receiver,
and documentation. and aload resistor. When the transmitter sends a logical
Flexibility in connecting a variety of devices. '1, it closes the loop allowing 20mA of current to flow.
When it sends a logical '0, the loop is opened, and no
Limitations current flows.
Parallel communication can be slower and
60mA Current Loop
more cumbersome compared to modern serial
interfaces. Definition: In a 60mA current loop system, a current
of 60 milliamps (mA) is used to represent one of the
Physical limitations on the number of devices and
cable length.
binary. states (usually a logical '1'), while no .current
(OnA).or a low current represents the other state (usually
Q15.) What are 20mA and 60mA current a logical '0').
loops, and how are they used in serial
communication? Usage: Less common than the 20mnA loop but used in
Answer :
similar environments requiring robust and long-distance
data transmission.
1UmA and 60mA Current Loops in Serial Advantages
Communication Standards
Higher current can provide better noise immunity
Basically, 20mA and 60mA current loops are and stronger signal integrity over even longer
Rhiable and robust methods for serial communication, distances.
Particularly suited for environments where noise
iMunity and long-distance transmission are crucial. Exampie: Similar to the 20mA loop, but with components
Mle they may not match the speed of modern digital designed to handle the higher current. The principle
Meriaces, their simplicity and effectiveness continue remains the same, with the transmiter controlling the
current flow to represent data.
Wmake them valuable in specific applications.These
urTent loop systems are particularly useful in industrial Applications
ad telecommunication environments. Industrial Automation : Current loops are used
Basic Concept to connect sensors, actuators, and controllers in
Acurrent loop system uses a current signal (rather automated systems.
han a voltage signal) to transmit data. Telecommunications : Utilized in older teleco
he current flow in the loop represents binary mmunication systems to transmit data over
data (1s and Os),, typically with aspecified current telephone lines.
level for each state. Data Acquisition : Employed in systems where
Ommon current. levels for these systems are data needs to be collected from remote sensors
20mA and 60mA. and transmitted to a central controller.
SPECTRUM ALL-IN-ONE 10URNL POR ENGINEERING STUDENTS
MICROPROCESSORS AND MICROCONTROLLERS LJNTU-HYDERABA
Firmware Development: Write
Advantages and Limitations firmwareor software that will contoland
Advaatages communication. ensuring it adheres
standards and protocols.
High noise immunity, making them ideal for
electricalty noisy environments. Building the Prototype : Assemble he
Capability to cover long istances without
components and integrate them with
he hartv
software to create the initial prototype. irtrea
significant signal degradation. Testing and Evaluation :Perform
Simple and reliable interface for connecting
multiple devices.
testing of the prototype, including futhnoertoiemnga
tests, perfornance tests, and stress tests,
Limtattons it meets the desired criteria.
Limited data transfer rates compared to modern Tteration and Improvement : Based
digital communication standards. testing results, make necessary modifmayicatiots a
Requires specific components capable of handling
improvements design. This
to the
multiple iterations of prototyping and te invohe
the curent leveis, which can add complexity to
Tools and Equipment
the system design.
Microcontrollers and Development Rat)
PRoOVPIN AND : Commonly used to implement and t
serial communication protocols (e.g, An
0. What is prototyping in serial Raspberry Pi).
Gomnication standards, and wty is it Oscilloscopes and Logic Analyzers: Essentil
nportat in the developmet process? analyzing and debugging serial communigte
MSwer: signals.
Protutyping in Serial Communication Standards Serial Comimunication Software : Tooh
Prototyping in serial communication standards sending, receiving, and analyzing serial da(:
terminal software, protocol analyzers).
refers to the process of creating a preliminary model Applications
or jworking version of a system that utilizes serial
communication. This prototype allows engineers and Embedded Systems Development : Prototyping
developers to test,evaluate, and refine the system before crucial in developing embedded systems that rely a
ful-scale production or deployment. serial communication for interfacing with sensons
actuators, and other devices.
of Prototyping
Industrial Automation: Used to create andtes
Tstagnd Validaton: Prototyping allowsfor communication systems for industrial equipmeni ad
the testing ofserial communication protocols and control systems.
hardware to ensure they function correctly and Consumer Electronics: Essential for develop
meet the required specifications. communication protocols in devices like smartphoe
Nentlcatlen of lisues : It helps in identifying computers, and peripherals.
and troubleshooting potential problems in the Benefits of Prototyping
çommunication proces, such as signal integrity Risk Reduction : Helps identify and mitigate risks
issues, timing problems, or protocol mismatches. in the development process.
Deslga Reinemeat s Provides an opportunity Cost Eficiency : Reduces the Hkelihood of costy dey
to refine and optimize the design based on real erors and rework in later stages.
world testing and feedback. iterati
Improved Design Quality : Allows for reliade
Stuy a Pretotyping improvement, leading to a more robust and
Conceptil Desiga : Define the objectives and final product.
requirements of the serial communication system. Challenges in Prototyping
Determinetheprotocols and standards to be used Complexity : Designing and testing prototypes
(e.g, RS-232, RS-48S, USB, etc.). communication can be complex andtime-
consumig
t
Clreutt Deslgn: Design the circuitry required Resource Requirements : Requires specialized
for serial communication, inchding transceivers, equipment, and expertise. necess
connectors, and any necessary interfacing Iteration Needs Multiple
: iterations may be
to achieve the desired performance andreliability.
components.
WARNING: XeraxtPhotocopying of this beek is a CRIMINAL act. Anyone found guity is LIABLE te facs LEGAL procaedil