Академический Документы
Профессиональный Документы
Культура Документы
com
www.5starnotes.com
www.5starnotes.com
Basics of serial communication
www.5starnotes.com
www.5starnotes.com
(PARALLEL) (SERIAL)
SERIAL TO PARALLEL
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
CLK
DATA
www.5starnotes.com
www.5starnotes.com
ASYNCHRONOUS TRANSMISSION
Start and stop bits
www.5starnotes.com
www.5starnotes.com
SYNCHRONOUS
BLOCK OF DATA TRANSMITTED ALONG WITH SYNC
INFORMATION
HIGH SPEED TRANSMISSION
ASYNCHRONOUS
CHARACTER CARRIES INFORMATION WITH START AND
STOP BITS
WHEN NO DATA IS TRANSMITTED RECEIVER STAYS AT
LOGIC 1 CALLED MARK ; LOGIC 0 CALLED SPACE
TRANSMISSION STARTS WITH ONE START BIT AND
ONE OR MORE STOP BITS . THIS IS FRAMING
www.5starnotes.com
www.5starnotes.com
Serial Interfaces: RS-232
www.5starnotes.com
www.5starnotes.com
TTL to RS-232
www.5starnotes.com
www.5starnotes.com
Types of equipment
DTE Data Terminal Equipment
Originally applied to CRT terminals or other input devices
Today, DTE mainly applies to a computer
DCE Data Communication Equipment
Originally applied to modems or similar communications
equipment
Still applies today
A modem is a device that converts a digital signal (e.g. from
an RS232 interface) to an analogue signal for transmission
over a traditional telephone line (MODEM: MOdulator-
DEModulator)
www.5starnotes.com
www.5starnotes.com
VOLTAGE VOLTAGE
LEVEL LEVEL
+3V TO +15 V -3V TO -15 V
LOGIC 0 LOGIC 1
www.5starnotes.com
www.5starnotes.com
TO MAKE RS 232 COMPATIBLE WITH TTL LOGIC ,
VOLTAGE TRANSLATORS CALLED LINE DRIVERS & LINE RECEIVERS
ARE USED
VOLTAGE TRANSLATORS
LINE DRIVERS LINE RECEIVERS
MC1488 CONVERTS MC1489 CONVERTS
LOGIC 1 -9V -9VLOGIC 1(+3.4V)
LOGIC 0+9V +9VLOGIC 0(0.2V)
www.5starnotes.com
www.5starnotes.com
RS232 pins
www.5starnotes.com
www.5starnotes.com
Data
signals
Contro
l
signals
SIGNALS
OF RS232
Timing
signals
ground
s
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
11 bitswww.5starnotes.com
required to send a single character (10 if one stop
bits are used)
Bit rate (bits/sec): actual rate at which bits are transmitted
Baud rate: rate at which the signalling elements, used to
represent bits, are transmitted
www.5starnotes.com
www.5starnotes.com
TX RX
2 2
DTE
MICRO 3
RX TX DCE
3
COMPUTER MODEM
GND
7 7
www.5starnotes.com
www.5starnotes.com
TX TX
2 2
DTE 3
RX RX DTE
3
GND
7 7
www.5starnotes.com
www.5starnotes.com
Typical System Connections
LOOP-
BACK used to test
CONNEC- hardware
TIONS
NULL
MODEM
Used for
COMMUNI
communica 7 7
-CATION
-tion
www.5starnotes.com
www.5starnotes.com
SERIAL INTERFACES : 8251A USART
The functions and requirement for SERIAL I/O are,
Input port & Output port for interfacing
DATA TX MPU converts parallel to serial
DATA RX MPU converts serial to parallel
Synchronization between MPU and slow peripheral
www.5starnotes.com
www.5starnotes.com
28 pin DIP
Enhanced version of
8251
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com Interfaces 8251 with MPU
READ/WRITE Determines functions acc.
CONTROL LOGIC To control word
Monitors data flow
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
PIN DESCRIPTION PIN DESCRIPTION
GND GROUND
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
C/D CONTROL / DATA
LOGIC 0 data buffer is addressed
LOGIC 1 control register or status
register is addressed
CONTROL REGISTER - ->WR
STATUS REGISTER -- > RD
RESET Reset
LOGIC 1 forces 8251 to RESET and enters
into idle mode
CLK - clock
REFERS TO SYSTEM CLOCK
Necessary for communication with the processor
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
www.5starnotes.com
REGISTERS
CONTROL REGISTER
16 BIT REGISTER
first byte MODE INSTRUCTION ( WORD )
second byte COMMAND INSTRUCTION ( WORD )
Register can be accessed when C/D is HIGH and WR is
LOW
STATUS REGISTER
Input register that checks the READY status of the
peripheral
Register can be accessed when C/D is HIGH and RD is
LOW
DATA REGISTER
8 BIT bidirectional register addressed as input or
output
Register can be accessed when C/D is LOW
www.5starnotes.com
www.5starnotes.com
INPUT SIGNAL :
TXC - TRANSMITTER CLOCK
CONTROLS THE RATE AT WHICH BITS ARE
TRANSMITTED BY USART
CLOCK FREQ 1/16/64 TIMES THE BAUD
www.5starnotes.com
www.5starnotes.com
OUTPUT SIGNAL :
TXD - TRANSMIT DATA
SERIAL BITS ARE TRANSMITTED ON
THIS LINE
TxRDY TRANSMITTER READY
LOGIC 1 BUFFER EMPTY; USART
READY TO ACCEPT
TO INTERRUPT MPU or INDICATE
STATUS
TxE TRANSMITTER EMPTY
LOGIC 1 OUTPUT REGISTER IS
EMPTY
LOGIC 0 - BYTE IS TRANSFERRED
FROM BUFFER TO REG.
www.5starnotes.com
www.5starnotes.com
7 6 5 4 3 2 1 0 Mode register
www.5starnotes.com
www.5starnotes.com
Status Register
www.5starnotes.com
www.5starnotes.com
COMMAND
MODE WORD STATUS WORD
WORD
SPECIFIES PROVIDES
CHARACTERISTI INFORMATION
CS ENABLES DATA REGARDING
TRANSMISSION REGISTER
BAUD, PARITY OR RECEPTION STATUS AND
NUMBER OF TRANSMISSION
STOP BITS ERRORS
www.5starnotes.com
www.5starnotes.com
OPERATION FLOW
www.5starnotes.com