0% found this document useful (0 votes)
24 views12 pages

S19-Serial Communication of 8051

Serial communication using the 8051 microcontroller can occur through either synchronous or asynchronous methods using special IC chips like the UART and USART. Asynchronous communication requires framing data with start and stop bits. The SCON and TMOD registers must be configured to set the baud rate and serial communication mode. Programming the 8051 for serial data transfer involves loading these registers and monitoring the TI flag to indicate when transmission is complete.

Uploaded by

Mourya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views12 pages

S19-Serial Communication of 8051

Serial communication using the 8051 microcontroller can occur through either synchronous or asynchronous methods using special IC chips like the UART and USART. Asynchronous communication requires framing data with start and stop bits. The SCON and TMOD registers must be configured to set the baud rate and serial communication mode. Programming the 8051 for serial data transfer involves loading these registers and monitoring the TI flag to indicate when transmission is complete.

Uploaded by

Mourya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

SERIAL

COMMUNICATION OF
8051
SERIAL VS. PARALLEL COMMUNICATION

2
SYNCHRONOUS VS. ASYNCHRONOUS

Serial data communication uses two methods


1. Synchronous
2. Asynchronous

There are special IC chips made by many manufacturers for serial communications.
3. UART- universal asynchronous receiver-transmitter.
4. USART- universal synchronous - asynchronous receiver-transmitter
3
FRAMING (ASYNCHRONOUS )

4
5
6
7
SCON REGISTER

8
DOUBLING THE BAUD RATE

THERE ARE TWO WAYS TO INCREASE THE BAUD RATE OF DATA


TRANSFER IN 8051.
1. USE A HIGHER FREQUENCY CRYSTAL.
2. CHANGE A D7-BIT TO 1 IN THE PCON REGISTER

PCON REGISTER: ( BYTE ADDRESSABLE)

9
10
PROGRAMMING 8051 TO TRANSFER DATA
SERIALLY
In programming 8051 to transfer character bytes serially, the following steps must be taken
1.The TMOD register is loaded with the value 20H , indicating the use of Timer 1 in mode 2(8-bit auto reload) to set the
baud rate
2.The TH1 is loaded with one of the values to set the baud rate for serial data transfer( assuming XTAL= 11.0592 MHz).
3.The SCON register is loaded with the value 50H indicating serial mode 1, where an 8-bit data is framed with start & stop
bits.
4.TR1 is SET to 1 to start Timer 1.
5.TI is cleared when transmission is complete.
6.The character byte to be transferred serially is written into SBUF register.
7.TI is monitored for transmission .
8.To transfer the next character go to step 5

11
EXAMPLE PROGRAM FOR SERIAL
COMMUNICATION
ORG 0H
MOV TMOD,#00100000B------(20H)
MOV TH1,#-3
MOV SCON,#01010000B-------(50H)
SETB TR1
AGAIN:MOV A,# ” “
ACALL TRANSFER
MOV A,# ”K“
ACALL TRANSFER
MOV A,# ”L“
ACALL TRANSFER
MOV A,# ”U“
ACALL TRANSFER
MOV A,# ” “
ACALL TRANSFER
TRANSFER: MOV SBUF,A
HERE: JNB TI, HERE
CLR TI
RET
SJMP AGAIN
END

12

You might also like