Академический Документы
Профессиональный Документы
Культура Документы
Serial Communication
Virendra Singh
Associate Professor
Computer Architecture and Dependable Systems Lab
Department of Electrical Engineering
Indian Institute of Technology Bombay
http://www.ee.iitb.ac.in/~viren/
E-mail: viren@ee.iitb.ac.in
EE-309: Microprocessors
Lecture
13
(18
Aug
2014)
CADSL
8051
Pin
Diagram
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
RST
(RXD)P3.0
(TXD)P3.1
(INT0)P3.2
(INT1)P3.3
(T0)P3.4
(T1)P3.5
(WR)P3.6
(RD)P3.7
XTAL2
XTAL1
GND
19 Aug 2014
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
EE-309@IITB
8051
(8031)
(8751)
(8951)
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
Vcc
P0.0(AD0
)P0.1(AD1)
P0.2(AD2
)P0.3(AD3)
P0.4(AD4)
P0.5(AD5)
P0.6(AD6)
P0.7(AD7)
EA/VPP
ALE/PROG
PSEN
P2.7(A15)
P2.6(A14
)P2.5(A13
)P2.4(A12
)P2.3(A11)
P2.2(A10)
P2.1(A9)
P2.0(A8)
CADSL
Data
Communication
19 Aug 2014
EE-309@IITB
CADSL
8051 and PC
The
8051
module
connects
to
PC
by
using
RS232.
RS232
is
a
protocol
which
supports
half-duplex,
synchronous/asynchronous,
serial
communicaLon.
We
discuss
these
terms
in
following
secLons.
RS232
PC
COM 1 port
19 Aug 2014
8051
MAX232
EE-309@IITB
UART
CADSL
Serial
The
data
is
sent
one
bit
at
a
Lme
(slow)
Long
distance
(rarely
distorLon)
cheap
The
data
can
be
transferred
on
the
telephone
line
(by
using
modem.)
19 Aug 2014
EE-309@IITB
CADSL
Parallel Transfer
Serial Transfer
Sender
Receiver
Sender
D0
Receiver
D7
19 Aug 2014
EE-309@IITB
CADSL
Parallel Transfer
Serial Transfer
D0
Sender
D0-D7
Receiver
Sender
Receiver
19 Aug 2014
EE-309@IITB
CADSL
Serial
Communication
19 Aug 2014
EE-309@IITB
CADSL
Serial Communication
How
to
transfer
data?
Sender:
The
byte
of
data
must
be
converted
to
serial
bits
using
a
parallel-in-serial-out
shiV
register.
The
bit
is
transmiWed
over
a
single
data
line.
Receiver
The
receiver
must
be
a
serial-in-parallel-out
shiV
register
to
receive
the
serial
data
and
pack
them
into
a
byte.
8
register
11101000001011
1
parallel-in serialout
19 Aug 2014
EE-309@IITB
register
8-bit character
serial-in parallelout
9
CADSL
Transmitter
Receiver
Data
1 byte-wide Data
1 byte-wide Data
The Transmitter
Shifts the parallel data onto
the serial line using its own
clock
Also adds the start, stop and
parity check bits
19 Aug 2014
The Receiver
Extracts the data using its own
clock
Converts the serial data back to
the parallel form after stripping off
the start, stop and parity bits
EE-309@IITB
10
CADSL
Receiver
Transmitter
Data
1 byte-wide Data
1 byte-wide Data
The Transmitter
Shifts the data onto the serial
line using its own clock
The Receiver
Extracts the data using the
clock provided by the
transmitter
EE-309@IITB
11
CADSL
byte
byte
byte
0101111101010101
preamble
sender
receiver
19 Aug 2014
byte
byte
stop bit
EE-309@IITB
receiver
start bit
12
CADSL
EE-309@IITB
13
CADSL
19 Aug 2014
EE-309@IITB
14
CADSL
19 Aug 2014
EE-309@IITB
15
CADSL
Framing
Framing:
Each
character
is
placed
in
between
start
and
stop
bits
Framing
ASCII
A
(41H)
Time (D0 first)
mark
stop
bit
D7
start
mark
bit
D0
goes out first
19 Aug 2014
EE-309@IITB
16
CADSL
Framing
We
have
a
total
of
10
bits
for
each
character:
8-bits
for
the
ASCII
code
2-bits
for
the
start
and
stop
bits
25%
overhead
EE-309@IITB
17
CADSL
19 Aug 2014
EE-309@IITB
18
CADSL
19 Aug 2014
EE-309@IITB
19
CADSL
stop stop
mark
bit bit
00
11
10
01
10
00
11
11
start
mark
bit
8-bit character
19 Aug 2014
EE-309@IITB
20
CADSL
19 Aug 2014
EE-309@IITB
21
CADSL
RS232 Standard
RS232
is
an
interfacing
standard
which
is
set
by
the
Electronics
Industries
AssociaLon
(EIA)
in
1960.
RS232
is
the
most
widely
used
serial
I/O
interfacing
standard.
RS232A
(1963),
RS232B
(1965)
and
RS232C
(1969),
now
is
RS232E
EE-309@IITB
22
CADSL
EE-309@IITB
RS 232 Voltage
25V
logic 0
3V
-3V
undefined
logic 1
-25V
23
CADSL
MAX232
MAX232
IC
chips
are
commonly
referred
to
as
line
drivers.
RS232
PC
COM 1 port
TTL voltage
level
19 Aug 2014
8051
MAX232
RS232 voltage
level
EE-309@IITB
UART
TTL voltage
level
24
CADSL
13
14
25
19 Aug 2014
Pin
1
2
3
4
5
6
7
8
9/10
11
12
13
Descrip0on
ProtecLve
ground
TransmiWed
data
(TxD)
Received
data
(RxD)
Request
to
send
(RTS)
Clear
to
send
(CTS)
Data
set
ready
(DSR)
Signal
ground
(GND)
Data
carrier
detect
(DCD)
Reserved
for
data
tesLng
Unassigned
Secondary
data
carrier
detect
Secondary
clear
to
send
EE-309@IITB
25
CADSL
13
14
25
19 Aug 2014
Pin
14
15
16
Descrip0on
Secondary
transmiWed
data
Transmit
signal
element
Lming
Secondary
received
data
17
18
19
20
21
22
23
24
25
EE-309@IITB
26
CADSL
EE-309@IITB
27
CADSL
Thank You
19 Aug 2014
EE-309@IITB
28
CADSL