You are on page 1of 27

12K502 Microcontroller and plc

1
Topic for Learning through evocation

2
Topic for Learning through evocation

3
SO1 – Basic of serial communication

Serial data communication


uses two methods
1. Synchronous method transfers a block of data at a time

Synchronous
data transfer
4
Analogy
SO1 – Basic of serial communication

Serial data communication


uses two methods
2. Asynchronous method transfers a single byte at a time

5
Analogy Asynchronous data
transfer
SO2 - Function Three SFR register used in serial port operation

SBUF Register to hold data

Serial data transmission Serial data reception


I I
n n
t t
e e
r 8-bit r
8-bit
n Parallel TxD Pin RxD Pin Parallel n
a
SBUF SBUF a
l Write only Read only l
B B
u u
6
s s
SO2 - Function Three SFR register used in serial port operation

SCON
Register

SM0 & SM1 – To select mode of operation

7
SO2 - Function Three SFR register used in serial port operation

SCON
Register

SM2 - Enable Multiprocessor Communication Mode

REN - Set to Enable Serial Data reception

TB8 - 9th Data Bit Sent in Mode 2,3

RB8 - 9th Data Bit Received in Mode 2,3

TI - Set when Stop bit Txed

8 RI - Set when a Character received


SO2 - Function Three SFR register used in serial port operation

PCON Register

SMOD - Baud rate is twice as much higher by setting this bit.

9
SO2 - Function Three SFR register used in serial port operation

10
FA1

1. The transmission of each key press from the keyboard to the computer
is the example for
a) Asynchronous mode
b) Synchronous mode
c) Full duplex mode
d) Shift register mode
 
2. The multiprocessor communication is enabled by setting the high logic
to the bit
a)SM0 of SCON
b)SM1 of SCON
c)SM2 of SCON
d)REN

11
SO3 - Demonstrate the four mode of operation of serial port

Mode 0: Shift Register

12
SO3 - Demonstrate the four mode of operation of serial port

Mode 0: Shift Register


Data transmit

Data receive

13
SO3 - Demonstrate the four mode of operation of serial port

Mode 1: 8-bit UART (Variable Baud


Rate)

Video

14
SO3 - Demonstrate the four mode of operation of serial port
Mode 1: 8-bit UART (Variable Baud Rate)

Data transmit

Data receive

15
SO3 - Demonstrate the four mode of operation of serial port

Mode 2: 9-bit UART

16
SO3 - Demonstrate the four mode of operation of serial port

Mode 2: 9-bit UART


Data transmit

Data receive

17
SO3 - Demonstrate the four mode of operation of serial port

Mode 3: 9-bit UART


(Multiprocessor communication) Slave 2

Slave 1

Slave 3

Slave 4
Master

18
SO3 - Demonstrate the four mode of operation of serial port
Mode 3: 9-bit UART
(Multiprocessor communication)

Master identifies target slave the slave by sending address

19
SO3 - Demonstrate the four mode of operation of serial port
Mode 3: 9-bit UART
(Multiprocessor communication)

Master send data to identified slave

20
FA2

1. The shift register mode transmit and receive data through RxD in
a) Simplex
b) Half Duplex
c) Full duplex
d) Parallel
 
 
2. End of the data transmission in 8-bit UART mode is by setting the bit
a) TI of SCON
b) RI of SCON
c) REN of SCON
d) SM2 of SCON

21
Draw the Mind Map

22
Mind Map

23
Summarize the topic

24
Summary
 Basic of serial communication:
i. Synchronous (Block of data)
ii. Asynchronous (Single byte of character)
 Three SFR registers
i. SBUF
ii. SCON
iii. PCON
 Four Mode of operation
i. Mode 0: Shift register
ii. Mode 1: 8-bit UART
iii. Mode 2: 9-bit UART
iv. Mode 3: 9 Bit UART

25
Stimulating questions

1.How will you communicate over telephone line?


2.How does product price recognize during purchase in
shop?

26
References:
(Books/Periodicals/Journals)
References
1.KENNETH J. AYALA,THE 8051 MICROCONTROLLER
Architecture,Programming and Applications,Second Edition
Penram International Publishing,page 54. 
2.Frank D. Petruzella. Programmable Logic Controllers, Tata
McGraw-Hill Publishing Company Ltd, New Delhi, 2010.
3.Embedded Controller Hand book, Intel Corporation, USA,
1991.
4.Microcontroller Hand Book, Intel, 1984.

27

You might also like