asynchronous serial communication
Download
Report
Transcript asynchronous serial communication
BIRLA VISHWKARMA MAHAVIDYALAYA
ELECTRONICS & TELECOMMUNICATION
DEPARTMENT
BASICS OF SERIAL
COMMUNICATIONS
GUIDED BY :
PROF. HIREN PATEL
PRESENTING BY:
ABHISHEK SINGH
AMANDEEP JANGRA
ANJARIYA SHREY
ANKUR BUSA
130080112001
130080112004
130080112005
130080112011
CONTENT
•
SERIAL AND PARALLEL DATA TRANSFER
•
HALF, FULL-DUPLEX TRANSMISSION.
•
SYNCHRONOUS & ASYNCHRONOUS COMMUNICATION
•
START AND STOP BITS
•
DATA TRASFER RATE
•
RS232 STANDARDS
•
RS232 PINS
•
DATA COMMUNICATION CLASSIFICATON
•
EXAMINING OF RS232 HANDSHAKING SIGNALS
•
x86 PC COM PORTS
BASIC OF SERIAL COMMUNICATION
Serial versus Parallel Data Transfer
HALF AND FULL-DUPLEX TRANSMISSION
SYNCHRONOUS & ASYNCHRONOUS
COMMUNICATION
• SYNCHRONOUS METHOD
SYNCHRONOUS METHOD TRANSFER A BLOCK OF
DATA AT A TIME.
• ASYNCHRONOUS METHOD
ASYNCHRONOUS METHOD TRANSFERS A SINGLE
BYTE AT A TIME.
ASYNCHRONOUS SERIAL COMMUNICATION
WITH ASYNCHRONOUS COMMUNICATION, THE TRANSMITTER AND
RECEIVER DO NOT SHARE A COMMON CLOCK
Remove: Start, Stop, Parity Bits
Add: Start, Stop, Parity Bits
Transmitter
–
+
Receiver
Data
1 byte-wide Data
1 byte-wide Data
THE TRANSMITTER
The Receiver
SHIFTS THE PARALLEL
DATA ONTO THE SERIAL
LINE USING ITS OWN CLOCK
Extracts the data using its own
clock
ALSO ADDS THE START,
STOP AND PARITY CHECK
BITS
Converts the serial data back
to the parallel form after
stripping off the start, stop and
parity bits
ASYNCHRONOUS SERIAL COMMUNICATION
Start Bit
D0
Parity Bit
D1
D2
D3
D4
D5
D6
1 or 2 Stop Bits
D7
1 Asynchronous Byte
ASYNCHRONOUS TRANSMISSION IS EASY TO IMPLEMENT BUT LESS
EFFICIENT AS IT REQUIRES AN EXTRA 2-3 CONTROL BITS FOR EVERY 8
DATA BITS
THIS METHOD IS USUALLY USED FOR LOW VOLUME TRANSMISSION
SYNCHRONOUS SERIAL COMMUNICATION
• IN THE SYNCHRONOUS MODE, THE TRANSMITTER AND RECEIVER SHARE
A COMMON CLOCK
• THE TRANSMITTER TYPICALLY PROVIDES THE CLOCK AS A SEPARATE
SIGNAL IN ADDITION TO THE SERIAL DATA
Clock
Receiver
Transmitter
Data
1 byte-wide Data
THE TRANSMITTER
SHIFTS THE DATA ONTO THE
SERIAL LINE USING ITS OWN
CLOCK
PROVIDES THE CLOCK AS A
SEPARATE SIGNAL
NO START, STOP, OR PARITY
BITS ADDED TO DATA
1 byte-wide Data
THE RECEIVER
EXTRACTS THE DATA
USING THE CLOCK
PROVIDED BY THE
TRANSMITTER
CONVERTS THE SERIAL
DATA BACK TO THE
PARALLEL FORM
START AND STOP BITS
IN THE ASYNCHRONOUS METHOD, EACH CHARACTER IS PLACED
BETWEEN START AND STOP BITS. THIS IS CALLED FRAMING. IN
DATA FRAMING FOR ASYNCHRONOUS COMMUNICATIONS THE DATA
SUCH AS ASCII CHARACTERS ARE PACKED BETWEEN START AND
STOP BIT.
THE START BIT IS ALWAYS ONE BIT, BUT THE STOP BIT CAN BE ONE
OR TWO BITS.
DATA TRASFER RATE
THE RATE OF DATA TRANSFER IN SERIAL DATA COMMUNICATION
IS STATED IN bps. ANOTHER WIDELY TECHNOLOGY FOR bps IS BAUD
RATE.
THE DATA TRANSFER RATE OF A GIVEN COMPUTER SYSTEM
DEPENDS ON COMMUNICATION PORTS INCORPORATED INTO THAT
SYSTEM.
FOR E.G.
THE EARLY IBM PC COULD TRANSFER DATA @100-9600 bps.
WHERE AS IN PRESENT PC TRANSFERS @56K.
RS232 STANDARDS
TO ALLOW COMPATIBILITY AMONG DATA COMMUNICATIONS
EQUIPMENT MADE BY VARIOUS MANUFACTURES, AN INTERFACING
STANDARD CALLED RS232 WAS SET BY THE ELECTRONICS
INDUSTRIES ASSOCIATIONS (EIA) IN 1960.
RS232 IS ONE OF THE MOST WIDELY USED I/O INTERFACING
STANDARDS.
STANDARD WAS SET LONG BEFORE THE ADVENT OF TTL LOGIC
FAMILY HOWEVER ITS I/O LEVELS ARE NOT TTL COMPATIBLE.
IN RS232 A 1 IS REPRESENTED BY -3V TO -25V WHILE 0 BIT IS
+3V TO +25V.
MAX232 IS USED FOR CONVERT THE TTL LOGIC LEVEL TO THE
RS232 VOLTAGE LEVEL.
RS232 PINS
DB25 REFERS TO THE PLUG CONNECTOR (MALE) DB25S FOR THE
SOCKET CONNECTOR (FEMALE).
BECAUSE NOT ALL THE PINS WERE USED IN PC CABLES IBM
INTERDUCE DB-9 VERSON OF THE SERIAL I/O STANDARD WHICH
USES ONLY 9 PINS.
IT SHOWS PINS FOR RS232 FOR DB25 CONNECTOR
TYPICALLY, THE CONNECTOR IS “MALE” FOR
DTE EQUIPMENT AND “FEMALE” FOR DCE
EQUIPMENT.
DATA COMMUNICATION CLASSIFICATON
CURRENT TERMINOLOGY CLASSIFIES DATA COMMUNICATION
EQUIPMENT AS DTE (DATA TERMINAL EQUIPMENT) OR DCE (DATA
COMMUNICATION QUIPMENT). DTE REFERS TO THE TERMINAL
AND COMPUTERS THAT SENDS AND RECEVIE DATA WHILE DCE
REFERS TO COMMUNICATION EQUIPMENTS SUCH AS MODEMS
DATA RESPONSIBLE FOR TRANSFERRING THE DATA.
THE SIMPLEST CONNECTION BETWEEN PC AND
MICROCONTROLLER REQUIRES MINIUM OF 3 PINS, TX, RX AND
GRND
EXAMINING OF RS232 HANDSHAKING SIGNALS
TO ENSURE FAST AND REALIABLE DATA TRANSMISSION
BETWEEN TWO DEVICES THE DATA TRANSFER MUST BE
COORDINATED.
RS232 CONNECTOR ARE USED FOR HANDSHAKING SIGNALS
THEY CAN BE BYPASSED BECAUSE THEY ARE NOT SUPPORTED BY
THE AVR UART CHIP.
DTR (DATA TERMINAL READY).
DSR (DATA SET READY).
RTS (REQUEST TO SEND).
CTS (CLEAR TO SEND).
DCD (DATA CARRIER DETECT).
RI (RING INDICATOR).
DTR AND DSR ARE USED BY PC AND MODEM INDICATE THAT THEY
ARE ALIVE AND WELL, IT IS RTS AND CTS THAT ACTUALLY
CONTROLS THE FLOW OF DATA. WHEN THE PC WANTS TO SENDS
DATA IT ASSERT RTS, AND INRESPONSE THE MODEM IF IT IS READY
TO ACCEPT THE DATA, SENDS BACK CTS.
x86 PC COM PORTS
THE x86 PCs USED TO HAVE TWO COM PORTS.
BOTH COM PORTS WERE RS232 TYPE CONNECTORS.
COM PORTS WERE DESIGNED AS COM 1 AND COM 2.
RECENTLY ONE OF THESE HAS BEEN REPLACE WITH THE USB
PORT, AND COM 1 IS THE ONLY SERIAL PORT AVAILABLE.
IN ABSENCE OF COM PORT, WE CAN USE COM TO USB
CONVERTER MODULE.