SlideShare a Scribd company logo
1
Unit 5: 8051 Serial Port Programming
Part 2
Subject: Processor Architecture & Interfacing
(SPPU, Pune 2015 Course of Information Technology)
Class: SEIT Semester: II
Prepared By,
Ms. K. D. Patil, Assistant Professor
Department of Information Technology
(NBA accredited)
Sanjivani College of Engineering, Kopargaon-423603.
Maharashtra, India.
(An Autonomous Institute, Affiliated with SPPU, Pune.)
NAAC ‘A’ Grade Accredited, ISO 9001:2015 certified
Contents
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
2
 Part 1
 Basics of Communication
 Serial Vs Parallel communication
 Synchronous Vs Asynchronous communication
 Data Framing in Asynchronous Serial Communication
 Baud Rate
 Part 2
 Special Function Registers
 Operating modes of Serial Communication
 Doubling Baud Rate in 8051
 Part 3
 Importance of TI Flag
 Importance of RI Flag
 Examples
Special Function Registers
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
3
 SBUF (Serial Buffer) Register
 Byte addressable
 SCON (Serial Control) Register
 Bit addressable
 PCON (Power Control) Register
 Byte addressable
SBUF (Serial Buffer) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
4
 Byte Addressable
 SBUF is an 8-bit register used solely for serial communication
 For a byte data to be transferred via the TxD line, it must be placed in the
SBUF register
 The moment a byte is written into SBUF, it is framed with the start and stop
bits and transferred serially via the TxD line
 SBUF holds the byte of data when it is received by 8051 RxD line
 When the bits are received serially via RxD, the 8051 de-frames it by
eliminating the stop and start bits, making a byte out of the data received,
and then placing it in SBUF
 Example:
MOV SBUF, # ’B’ ; load SBUF=42, ASCII for ‘B’
MOV SBUF, A ; copy accumulator into SBUF
MOV A, SBUF ; copy SBUF into accumulator
SCON (Serial Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
5
 SCON is an 8-bit register used to program the start bit, stop bit, and
data bits of data framing, among other things
 Bit addressable
SM0 SM1 SM2 REN TB0 RB0 TI RI
SMO SCON.7 Serial port mode specifier
SM1 SCON.6 Serial port mode specifier
SM2 SCON.5 Used for Multiprocessor Communication
REN SCON.4 Set/cleared by software to enable/disable reception
TB8 SCON.3 Not Widely used
RB8 SCON.2 Not Widely used
TI SCON.1 Transmit interrupt flag. Set by the Hardware at beginning of
stop bit mode 1. Cleared by software
RI SCON.0 Receive interrupt flag. Set by the Hardware halfway through
stop bit mode 1. Cleared by software
SCON (Serial Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
6
 SM0 (SCON.7), SM1(SCON.6)
 They determine the framing of data by specifying the
number of bits per character, and the start and stop
bits
SM0 SM1 Serial Modes
0 0 Serial Mode 0
0 1 Serial Mode 1, 8 Bit data, 1 stop
Bit, 1 start bit
1 0 Serial Mode 2
1 1 Serial Mode 3
Note: Only mode 1 is of our Interest
Serial Modes
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
7
 Serial Mode 1
 Out of 4, only mode 1 is of our interest
 Other 3 modes are rarely used
 Asynchronous (single character at a time)
 Data framing is of 8 bits, 1 stop bit, 1 start bit which
makes it compatible with the COM port of IBM compatible
PCs
 Allows baud rate to be variable and is set by Timer 1 of
8051
 For each character, a total of 10 bits are transferred
where, First bit is start bit, followed by 8 data bits, and
finally 1 stop bit
Serial Modes
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
8
 Serial Mode 0
 Synchronous (Transfers block of character at a time)
 Data transferred on RxD
 Clock on TxD
 Clock is fixed at oscillator frequency
 Serial Mode 2
 Asynchronous (single character at a time)
 Data framing is of 11 bits, 1 stop bit, 1 start bit, 8 data bits
(programmable 9 data bits)
 On transmission TB8 bit of SCON is 9th Bit
 9th Bit may be used for Data or Parity Bit
 Baud rate may be 1/32 or 1/64 of oscillator frequency
 Serial Mode 3
 Same as Serial mode 2 with programmable baud rate
SCON (Serial Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
9
 SM2 (SCON.5)
 This enables the multiprocessing capability of the 8051
 For us, SM2 = 0 as 8051 will not be used in
multiprocessor environment
 REN (SCON.4)
 receive enable
 When REN = 1 (High), it allows 8051 to receive data
on RxD pin
 When REN = 0 (low), the receiver is disable
 Can be used to block any serial data reception
SCON (Serial Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
10
 TB8 (SCON.3)
 Transfer Bit
 Used for Serial modes 2 and 3
 For us, TB8 = 0 as we are using Serial Mode 1 for
programming
 RB8 (SCON.2)
 receive Bit
 Used for Serial modes 2 and 3
 In Serial Mode 1, this bit gets the copy of stop Bit when an
8 bit data is received
 For us, RB8 = 0
SCON (Serial Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
11
 TI (SCON.1)
 transmit interrupt
 When 8051 finishes the transfer of 8-bit character
 It raises TI flag to indicate that it is ready to transfer
another byte
 TI bit is raised at the beginning of the stop bit
 RI (SCON.0)
 When 8051 receives data serially via RxD, it gets rid of
the start and stop bits and places the byte in SBUF register
 It raises the RI flag bit to indicate that a byte has been
received and should be picked up before it is lost
 RI is raised halfway through the stop bit
Doubling Baud Rate in 8051
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
12
 There are two ways to increase the baud rate of
data transfer
 To use a higher frequency crystal
 This is not feasible as System crystal is fixed
 New Crystal Frequency may not be compatible with IBM PC
serial COM’s port baud rate
 To change a bit in the PCON register
PCON (Power Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
13
 It is an 8-bit register
 Byte addressable
 SMOD (Serial mode) bit
 used serial communication
 When 8051 is powered up, SMOD is zero
 We can set it to high by software and the double the baud
rate
SMOD ---- ---- ---- GF1 GF0 PD IDL
D7 D6 D5 D4 D3 D2 D1 D0
PCON (Power Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
14
 Following set of sequence can be used to set high D7
of PCON
MOV A,PCON ;place a copy of PCON in ACC
SETB ACC.7 ;make D7=1
MOV PCON,A ;now SMOD=1 without
;changing any other bits
Note: PCON is byte addressable so cannot directly set
bit D7 to high
PCON (Power Control) Register
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
15
 GF1 and GF0 Bits
 Both are general purpose flag bits
 PD (Power Down) Bit
 Setting this bit activates Power down operation
 Available only in CMOS
 IDL (Idle mode) Bit
 Setting this bit activates Idle mode operation
 Available only in CMOS
Doubling Baud Rate in 8051
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
16
 Considering, XTAL = 11.0592 MHz
 For SMOD = 0
 Machine cycle freq. = 11.0592 MHz / 12 = 921.6 kHz
 Timer 1 frequency to set Baud Rate = 921.6 kHz / 32 = 28800 Hz
 For SMOD = 1
 Machine cycle freq. = 11.0592 MHz / 12 = 921.6 kHz
 Timer 1 frequency to set Baud Rate = 921.6 kHz / 16 = 57,600 Hz
Doubling Baud Rate in 8051
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
17
 Baud Rate Comparison for SMOD = 0 and SMOD = 1
TH1
(Decimal)
TH1
(Hex)
Baud Rate
(SMOD = 0)
Baud Rate
(SMOD = 1)
-3 FD 9600 19200
-6 FA 4800 9600
-12 F4 2400 4800
-24 E8 1200 2400
Reference
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
18
 “The 8051 Microcontroller and Embedded Systems
using Assembly and C” , Muhammad Ali Mazidi,
Janice Gillispie Mazidi, Rolin D. McKinlay, Second
Edition, Pearson publication
Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani
COE, Kopargaon
19

More Related Content

What's hot

Implementation of Universal Asynchronous Receiver and Transmitter
Implementation of Universal Asynchronous Receiver and TransmitterImplementation of Universal Asynchronous Receiver and Transmitter
Implementation of Universal Asynchronous Receiver and Transmitter
IJERA Editor
 
Software Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGASoftware Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGA
IRJET Journal
 
Adc lab
Adc labAdc lab
Adc lab
xyxz
 
Identifying PCIe 3.0 Dynamic Equalization Problems
Identifying PCIe 3.0 Dynamic Equalization ProblemsIdentifying PCIe 3.0 Dynamic Equalization Problems
Identifying PCIe 3.0 Dynamic Equalization Problems
teledynelecroy
 
Serial1
Serial1Serial1
Serial1
anishgoel
 
IEEE_Peer_Reviewed_Paper_1
IEEE_Peer_Reviewed_Paper_1IEEE_Peer_Reviewed_Paper_1
IEEE_Peer_Reviewed_Paper_1Saad Mahboob
 
ADS Workshop on PCI Express(r)
ADS Workshop on PCI Express(r)ADS Workshop on PCI Express(r)
ADS Workshop on PCI Express(r)
Colin Warwick
 
IEEE 1588 Timing for Mobile Backhaul_Webinar
IEEE 1588 Timing for Mobile Backhaul_WebinarIEEE 1588 Timing for Mobile Backhaul_Webinar
IEEE 1588 Timing for Mobile Backhaul_WebinarSymmetricomSYMM
 
Ff34970973
Ff34970973Ff34970973
Ff34970973
IJERA Editor
 
4 ijaems nov-2015-4-fsk demodulator- case study of pll application
4 ijaems nov-2015-4-fsk demodulator- case study of pll application4 ijaems nov-2015-4-fsk demodulator- case study of pll application
4 ijaems nov-2015-4-fsk demodulator- case study of pll application
INFOGAIN PUBLICATION
 
Implementation of gps signal acquisition and tracking in fpga
Implementation of gps signal acquisition and tracking in fpgaImplementation of gps signal acquisition and tracking in fpga
Implementation of gps signal acquisition and tracking in fpga
eSAT Publishing House
 
FPGA Implementation of BIST in OFDM Transceivers
FPGA Implementation of BIST in OFDM TransceiversFPGA Implementation of BIST in OFDM Transceivers
FPGA Implementation of BIST in OFDM Transceivers
IRJET Journal
 
An Effective Design and Verification Methodology for Digital PLL
An Effective Design and Verification Methodology for Digital PLLAn Effective Design and Verification Methodology for Digital PLL
An Effective Design and Verification Methodology for Digital PLL
QuEST Global (erstwhile NeST Software)
 
Performance Evaluation of IEEE STD 802.16d Transceiver
Performance Evaluation of IEEE STD 802.16d TransceiverPerformance Evaluation of IEEE STD 802.16d Transceiver
Performance Evaluation of IEEE STD 802.16d Transceiver
IOSR Journals
 
Bm044394397
Bm044394397Bm044394397
Bm044394397
IJERA Editor
 
IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...
IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...
IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...
IRJET Journal
 
iaetsd Software defined am transmitter using vhdl
iaetsd Software defined am transmitter using vhdliaetsd Software defined am transmitter using vhdl
iaetsd Software defined am transmitter using vhdl
Iaetsd Iaetsd
 
IoT in LTE
IoT in LTEIoT in LTE
IoT in LTE
Neha Katyal
 
Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...
Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...
Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...
Sucharita Saha
 

What's hot (20)

Implementation of Universal Asynchronous Receiver and Transmitter
Implementation of Universal Asynchronous Receiver and TransmitterImplementation of Universal Asynchronous Receiver and Transmitter
Implementation of Universal Asynchronous Receiver and Transmitter
 
Software Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGASoftware Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGA
 
Adc lab
Adc labAdc lab
Adc lab
 
Identifying PCIe 3.0 Dynamic Equalization Problems
Identifying PCIe 3.0 Dynamic Equalization ProblemsIdentifying PCIe 3.0 Dynamic Equalization Problems
Identifying PCIe 3.0 Dynamic Equalization Problems
 
Serial1
Serial1Serial1
Serial1
 
IEEE_Peer_Reviewed_Paper_1
IEEE_Peer_Reviewed_Paper_1IEEE_Peer_Reviewed_Paper_1
IEEE_Peer_Reviewed_Paper_1
 
ADS Workshop on PCI Express(r)
ADS Workshop on PCI Express(r)ADS Workshop on PCI Express(r)
ADS Workshop on PCI Express(r)
 
IEEE 1588 Timing for Mobile Backhaul_Webinar
IEEE 1588 Timing for Mobile Backhaul_WebinarIEEE 1588 Timing for Mobile Backhaul_Webinar
IEEE 1588 Timing for Mobile Backhaul_Webinar
 
Ff34970973
Ff34970973Ff34970973
Ff34970973
 
4 ijaems nov-2015-4-fsk demodulator- case study of pll application
4 ijaems nov-2015-4-fsk demodulator- case study of pll application4 ijaems nov-2015-4-fsk demodulator- case study of pll application
4 ijaems nov-2015-4-fsk demodulator- case study of pll application
 
Implementation of gps signal acquisition and tracking in fpga
Implementation of gps signal acquisition and tracking in fpgaImplementation of gps signal acquisition and tracking in fpga
Implementation of gps signal acquisition and tracking in fpga
 
FPGA Implementation of BIST in OFDM Transceivers
FPGA Implementation of BIST in OFDM TransceiversFPGA Implementation of BIST in OFDM Transceivers
FPGA Implementation of BIST in OFDM Transceivers
 
An Effective Design and Verification Methodology for Digital PLL
An Effective Design and Verification Methodology for Digital PLLAn Effective Design and Verification Methodology for Digital PLL
An Effective Design and Verification Methodology for Digital PLL
 
Performance Evaluation of IEEE STD 802.16d Transceiver
Performance Evaluation of IEEE STD 802.16d TransceiverPerformance Evaluation of IEEE STD 802.16d Transceiver
Performance Evaluation of IEEE STD 802.16d Transceiver
 
Time Synchronisation
Time SynchronisationTime Synchronisation
Time Synchronisation
 
Bm044394397
Bm044394397Bm044394397
Bm044394397
 
IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...
IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...
IRJET- A Study on PRN Code Generation and Properties of C/A Code in GPS based...
 
iaetsd Software defined am transmitter using vhdl
iaetsd Software defined am transmitter using vhdliaetsd Software defined am transmitter using vhdl
iaetsd Software defined am transmitter using vhdl
 
IoT in LTE
IoT in LTEIoT in LTE
IoT in LTE
 
Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...
Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...
Design And Simulation of Modulation Schemes used for FPGA Based Software Defi...
 

Similar to SE PAI Unit 5_Serial Port Programming in 8051 microcontroller_Part 2

Unit 5_Interrupt programming in 8051 micro controller - part 2
Unit 5_Interrupt programming in 8051 micro controller - part 2Unit 5_Interrupt programming in 8051 micro controller - part 2
Unit 5_Interrupt programming in 8051 micro controller - part 2
KanchanPatil34
 
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
KanchanPatil34
 
Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"
surabhii007
 
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDLAREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
IAEME Publication
 
Seminar on serial communication
Seminar on serial communicationSeminar on serial communication
Seminar on serial communicationSamarth Patel
 
8051 serialp port
8051 serialp port8051 serialp port
8051 serialp port
Teju Kotti
 
8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1 vijaydeepakg
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 
Basic Study on the WT12 Family of Bluetooth Devices
Basic Study on the WT12 Family of Bluetooth DevicesBasic Study on the WT12 Family of Bluetooth Devices
Basic Study on the WT12 Family of Bluetooth Devices
Premier Farnell
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Coding
CodingCoding
Sereial com. ppt
Sereial com. pptSereial com. ppt
Sereial com. pptgaurav5345
 
8051 microcontroller
8051 microcontroller8051 microcontroller
Synchronization in SDH network
Synchronization in SDH networkSynchronization in SDH network
Synchronization in SDH network
asifmatin
 
8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx
maheswariM7
 
Serial communication in 8051 microcontroller
Serial communication in 8051 microcontrollerSerial communication in 8051 microcontroller
Serial communication in 8051 microcontroller
IshwarNirale2
 
Unit 5_interrupt programming_Part 1
Unit 5_interrupt programming_Part 1Unit 5_interrupt programming_Part 1
Unit 5_interrupt programming_Part 1
KanchanPatil34
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communicationcanh phan
 

Similar to SE PAI Unit 5_Serial Port Programming in 8051 microcontroller_Part 2 (20)

Unit 5_Interrupt programming in 8051 micro controller - part 2
Unit 5_Interrupt programming in 8051 micro controller - part 2Unit 5_Interrupt programming in 8051 micro controller - part 2
Unit 5_Interrupt programming in 8051 micro controller - part 2
 
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
 
12 mt06ped019
12 mt06ped019 12 mt06ped019
12 mt06ped019
 
Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"Presentation On: "Micro-controller 8051 & Embedded System"
Presentation On: "Micro-controller 8051 & Embedded System"
 
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDLAREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
 
Seminar on serial communication
Seminar on serial communicationSeminar on serial communication
Seminar on serial communication
 
8051 serialp port
8051 serialp port8051 serialp port
8051 serialp port
 
8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
Basic Study on the WT12 Family of Bluetooth Devices
Basic Study on the WT12 Family of Bluetooth DevicesBasic Study on the WT12 Family of Bluetooth Devices
Basic Study on the WT12 Family of Bluetooth Devices
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Coding
CodingCoding
Coding
 
0.pptx
0.pptx0.pptx
0.pptx
 
Sereial com. ppt
Sereial com. pptSereial com. ppt
Sereial com. ppt
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Synchronization in SDH network
Synchronization in SDH networkSynchronization in SDH network
Synchronization in SDH network
 
8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx
 
Serial communication in 8051 microcontroller
Serial communication in 8051 microcontrollerSerial communication in 8051 microcontroller
Serial communication in 8051 microcontroller
 
Unit 5_interrupt programming_Part 1
Unit 5_interrupt programming_Part 1Unit 5_interrupt programming_Part 1
Unit 5_interrupt programming_Part 1
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communication
 

More from KanchanPatil34

Unit 2_2 Binary Tree as ADT_General Tree.pdf
Unit 2_2 Binary Tree as ADT_General Tree.pdfUnit 2_2 Binary Tree as ADT_General Tree.pdf
Unit 2_2 Binary Tree as ADT_General Tree.pdf
KanchanPatil34
 
Unit 2_1 Tree.pdf
Unit 2_1 Tree.pdfUnit 2_1 Tree.pdf
Unit 2_1 Tree.pdf
KanchanPatil34
 
Unit 2_3 Binary Tree Traversals.pdf
Unit 2_3 Binary Tree Traversals.pdfUnit 2_3 Binary Tree Traversals.pdf
Unit 2_3 Binary Tree Traversals.pdf
KanchanPatil34
 
Unit 1_SLL and DLL.pdf
Unit 1_SLL and DLL.pdfUnit 1_SLL and DLL.pdf
Unit 1_SLL and DLL.pdf
KanchanPatil34
 
Unit 1_Stack and Queue using Linked Organization.pdf
Unit 1_Stack and Queue using Linked Organization.pdfUnit 1_Stack and Queue using Linked Organization.pdf
Unit 1_Stack and Queue using Linked Organization.pdf
KanchanPatil34
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 Microporcessor
KanchanPatil34
 
PAI Unit 3 Multitasking in 80386
PAI Unit 3 Multitasking in 80386PAI Unit 3 Multitasking in 80386
PAI Unit 3 Multitasking in 80386
KanchanPatil34
 
PAI Unit 2 Segmentation in 80386 microprocessor
PAI Unit 2 Segmentation in 80386 microprocessorPAI Unit 2 Segmentation in 80386 microprocessor
PAI Unit 2 Segmentation in 80386 microprocessor
KanchanPatil34
 
PAI Unit 2 Protection in 80386 segmentation
PAI Unit 2 Protection in 80386 segmentationPAI Unit 2 Protection in 80386 segmentation
PAI Unit 2 Protection in 80386 segmentation
KanchanPatil34
 
SE PAI Unit 2_Data Structures in 80386 segmentation
SE PAI Unit 2_Data Structures in 80386 segmentationSE PAI Unit 2_Data Structures in 80386 segmentation
SE PAI Unit 2_Data Structures in 80386 segmentation
KanchanPatil34
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
KanchanPatil34
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
KanchanPatil34
 
SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051
KanchanPatil34
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
KanchanPatil34
 
Unit 3 se pai_ivt and idt
Unit 3 se pai_ivt and idtUnit 3 se pai_ivt and idt
Unit 3 se pai_ivt and idt
KanchanPatil34
 
Unit 2 se pai_registers in 80386
Unit 2 se pai_registers in 80386Unit 2 se pai_registers in 80386
Unit 2 se pai_registers in 80386
KanchanPatil34
 
Unit i se pai_dos function calls
Unit i se pai_dos function callsUnit i se pai_dos function calls
Unit i se pai_dos function calls
KanchanPatil34
 
DELD Unit V cpld_fpga
DELD Unit V cpld_fpgaDELD Unit V cpld_fpga
DELD Unit V cpld_fpga
KanchanPatil34
 
DELD Unit IV ring and twisted ring counter
DELD Unit IV ring and twisted ring counterDELD Unit IV ring and twisted ring counter
DELD Unit IV ring and twisted ring counter
KanchanPatil34
 
DELD Unit IV operation modes of shift register
DELD Unit IV operation modes of shift registerDELD Unit IV operation modes of shift register
DELD Unit IV operation modes of shift register
KanchanPatil34
 

More from KanchanPatil34 (20)

Unit 2_2 Binary Tree as ADT_General Tree.pdf
Unit 2_2 Binary Tree as ADT_General Tree.pdfUnit 2_2 Binary Tree as ADT_General Tree.pdf
Unit 2_2 Binary Tree as ADT_General Tree.pdf
 
Unit 2_1 Tree.pdf
Unit 2_1 Tree.pdfUnit 2_1 Tree.pdf
Unit 2_1 Tree.pdf
 
Unit 2_3 Binary Tree Traversals.pdf
Unit 2_3 Binary Tree Traversals.pdfUnit 2_3 Binary Tree Traversals.pdf
Unit 2_3 Binary Tree Traversals.pdf
 
Unit 1_SLL and DLL.pdf
Unit 1_SLL and DLL.pdfUnit 1_SLL and DLL.pdf
Unit 1_SLL and DLL.pdf
 
Unit 1_Stack and Queue using Linked Organization.pdf
Unit 1_Stack and Queue using Linked Organization.pdfUnit 1_Stack and Queue using Linked Organization.pdf
Unit 1_Stack and Queue using Linked Organization.pdf
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 Microporcessor
 
PAI Unit 3 Multitasking in 80386
PAI Unit 3 Multitasking in 80386PAI Unit 3 Multitasking in 80386
PAI Unit 3 Multitasking in 80386
 
PAI Unit 2 Segmentation in 80386 microprocessor
PAI Unit 2 Segmentation in 80386 microprocessorPAI Unit 2 Segmentation in 80386 microprocessor
PAI Unit 2 Segmentation in 80386 microprocessor
 
PAI Unit 2 Protection in 80386 segmentation
PAI Unit 2 Protection in 80386 segmentationPAI Unit 2 Protection in 80386 segmentation
PAI Unit 2 Protection in 80386 segmentation
 
SE PAI Unit 2_Data Structures in 80386 segmentation
SE PAI Unit 2_Data Structures in 80386 segmentationSE PAI Unit 2_Data Structures in 80386 segmentation
SE PAI Unit 2_Data Structures in 80386 segmentation
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
 
SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
Unit 3 se pai_ivt and idt
Unit 3 se pai_ivt and idtUnit 3 se pai_ivt and idt
Unit 3 se pai_ivt and idt
 
Unit 2 se pai_registers in 80386
Unit 2 se pai_registers in 80386Unit 2 se pai_registers in 80386
Unit 2 se pai_registers in 80386
 
Unit i se pai_dos function calls
Unit i se pai_dos function callsUnit i se pai_dos function calls
Unit i se pai_dos function calls
 
DELD Unit V cpld_fpga
DELD Unit V cpld_fpgaDELD Unit V cpld_fpga
DELD Unit V cpld_fpga
 
DELD Unit IV ring and twisted ring counter
DELD Unit IV ring and twisted ring counterDELD Unit IV ring and twisted ring counter
DELD Unit IV ring and twisted ring counter
 
DELD Unit IV operation modes of shift register
DELD Unit IV operation modes of shift registerDELD Unit IV operation modes of shift register
DELD Unit IV operation modes of shift register
 

Recently uploaded

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 

Recently uploaded (20)

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 

SE PAI Unit 5_Serial Port Programming in 8051 microcontroller_Part 2

  • 1. 1 Unit 5: 8051 Serial Port Programming Part 2 Subject: Processor Architecture & Interfacing (SPPU, Pune 2015 Course of Information Technology) Class: SEIT Semester: II Prepared By, Ms. K. D. Patil, Assistant Professor Department of Information Technology (NBA accredited) Sanjivani College of Engineering, Kopargaon-423603. Maharashtra, India. (An Autonomous Institute, Affiliated with SPPU, Pune.) NAAC ‘A’ Grade Accredited, ISO 9001:2015 certified
  • 2. Contents Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 2  Part 1  Basics of Communication  Serial Vs Parallel communication  Synchronous Vs Asynchronous communication  Data Framing in Asynchronous Serial Communication  Baud Rate  Part 2  Special Function Registers  Operating modes of Serial Communication  Doubling Baud Rate in 8051  Part 3  Importance of TI Flag  Importance of RI Flag  Examples
  • 3. Special Function Registers Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 3  SBUF (Serial Buffer) Register  Byte addressable  SCON (Serial Control) Register  Bit addressable  PCON (Power Control) Register  Byte addressable
  • 4. SBUF (Serial Buffer) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 4  Byte Addressable  SBUF is an 8-bit register used solely for serial communication  For a byte data to be transferred via the TxD line, it must be placed in the SBUF register  The moment a byte is written into SBUF, it is framed with the start and stop bits and transferred serially via the TxD line  SBUF holds the byte of data when it is received by 8051 RxD line  When the bits are received serially via RxD, the 8051 de-frames it by eliminating the stop and start bits, making a byte out of the data received, and then placing it in SBUF  Example: MOV SBUF, # ’B’ ; load SBUF=42, ASCII for ‘B’ MOV SBUF, A ; copy accumulator into SBUF MOV A, SBUF ; copy SBUF into accumulator
  • 5. SCON (Serial Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 5  SCON is an 8-bit register used to program the start bit, stop bit, and data bits of data framing, among other things  Bit addressable SM0 SM1 SM2 REN TB0 RB0 TI RI SMO SCON.7 Serial port mode specifier SM1 SCON.6 Serial port mode specifier SM2 SCON.5 Used for Multiprocessor Communication REN SCON.4 Set/cleared by software to enable/disable reception TB8 SCON.3 Not Widely used RB8 SCON.2 Not Widely used TI SCON.1 Transmit interrupt flag. Set by the Hardware at beginning of stop bit mode 1. Cleared by software RI SCON.0 Receive interrupt flag. Set by the Hardware halfway through stop bit mode 1. Cleared by software
  • 6. SCON (Serial Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 6  SM0 (SCON.7), SM1(SCON.6)  They determine the framing of data by specifying the number of bits per character, and the start and stop bits SM0 SM1 Serial Modes 0 0 Serial Mode 0 0 1 Serial Mode 1, 8 Bit data, 1 stop Bit, 1 start bit 1 0 Serial Mode 2 1 1 Serial Mode 3 Note: Only mode 1 is of our Interest
  • 7. Serial Modes Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 7  Serial Mode 1  Out of 4, only mode 1 is of our interest  Other 3 modes are rarely used  Asynchronous (single character at a time)  Data framing is of 8 bits, 1 stop bit, 1 start bit which makes it compatible with the COM port of IBM compatible PCs  Allows baud rate to be variable and is set by Timer 1 of 8051  For each character, a total of 10 bits are transferred where, First bit is start bit, followed by 8 data bits, and finally 1 stop bit
  • 8. Serial Modes Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 8  Serial Mode 0  Synchronous (Transfers block of character at a time)  Data transferred on RxD  Clock on TxD  Clock is fixed at oscillator frequency  Serial Mode 2  Asynchronous (single character at a time)  Data framing is of 11 bits, 1 stop bit, 1 start bit, 8 data bits (programmable 9 data bits)  On transmission TB8 bit of SCON is 9th Bit  9th Bit may be used for Data or Parity Bit  Baud rate may be 1/32 or 1/64 of oscillator frequency  Serial Mode 3  Same as Serial mode 2 with programmable baud rate
  • 9. SCON (Serial Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 9  SM2 (SCON.5)  This enables the multiprocessing capability of the 8051  For us, SM2 = 0 as 8051 will not be used in multiprocessor environment  REN (SCON.4)  receive enable  When REN = 1 (High), it allows 8051 to receive data on RxD pin  When REN = 0 (low), the receiver is disable  Can be used to block any serial data reception
  • 10. SCON (Serial Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 10  TB8 (SCON.3)  Transfer Bit  Used for Serial modes 2 and 3  For us, TB8 = 0 as we are using Serial Mode 1 for programming  RB8 (SCON.2)  receive Bit  Used for Serial modes 2 and 3  In Serial Mode 1, this bit gets the copy of stop Bit when an 8 bit data is received  For us, RB8 = 0
  • 11. SCON (Serial Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 11  TI (SCON.1)  transmit interrupt  When 8051 finishes the transfer of 8-bit character  It raises TI flag to indicate that it is ready to transfer another byte  TI bit is raised at the beginning of the stop bit  RI (SCON.0)  When 8051 receives data serially via RxD, it gets rid of the start and stop bits and places the byte in SBUF register  It raises the RI flag bit to indicate that a byte has been received and should be picked up before it is lost  RI is raised halfway through the stop bit
  • 12. Doubling Baud Rate in 8051 Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 12  There are two ways to increase the baud rate of data transfer  To use a higher frequency crystal  This is not feasible as System crystal is fixed  New Crystal Frequency may not be compatible with IBM PC serial COM’s port baud rate  To change a bit in the PCON register
  • 13. PCON (Power Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 13  It is an 8-bit register  Byte addressable  SMOD (Serial mode) bit  used serial communication  When 8051 is powered up, SMOD is zero  We can set it to high by software and the double the baud rate SMOD ---- ---- ---- GF1 GF0 PD IDL D7 D6 D5 D4 D3 D2 D1 D0
  • 14. PCON (Power Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 14  Following set of sequence can be used to set high D7 of PCON MOV A,PCON ;place a copy of PCON in ACC SETB ACC.7 ;make D7=1 MOV PCON,A ;now SMOD=1 without ;changing any other bits Note: PCON is byte addressable so cannot directly set bit D7 to high
  • 15. PCON (Power Control) Register Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 15  GF1 and GF0 Bits  Both are general purpose flag bits  PD (Power Down) Bit  Setting this bit activates Power down operation  Available only in CMOS  IDL (Idle mode) Bit  Setting this bit activates Idle mode operation  Available only in CMOS
  • 16. Doubling Baud Rate in 8051 Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 16  Considering, XTAL = 11.0592 MHz  For SMOD = 0  Machine cycle freq. = 11.0592 MHz / 12 = 921.6 kHz  Timer 1 frequency to set Baud Rate = 921.6 kHz / 32 = 28800 Hz  For SMOD = 1  Machine cycle freq. = 11.0592 MHz / 12 = 921.6 kHz  Timer 1 frequency to set Baud Rate = 921.6 kHz / 16 = 57,600 Hz
  • 17. Doubling Baud Rate in 8051 Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 17  Baud Rate Comparison for SMOD = 0 and SMOD = 1 TH1 (Decimal) TH1 (Hex) Baud Rate (SMOD = 0) Baud Rate (SMOD = 1) -3 FD 9600 19200 -6 FA 4800 9600 -12 F4 2400 4800 -24 E8 1200 2400
  • 18. Reference Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 18  “The 8051 Microcontroller and Embedded Systems using Assembly and C” , Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin D. McKinlay, Second Edition, Pearson publication
  • 19. Prepared By: Ms. K. D. Patil, Dept. of Information Technology, Sanjivani COE, Kopargaon 19