SlideShare a Scribd company logo
1 of 18
Serial vs. Parallel Data Transfer
Sender Receiver Sender Receiver
Serial Transfer Parallel Transfer
D0-D7D0
Other control lines
Other control lines
Serial Communication
How to transfer data?
Sender:
 The byte of data must be converted to serial bits using a
parallel-in-serial-out shift register.
 The bit is transmitted over a single data line.
Receiver
 The receiver must be a serial-in-parallel-out shift register to
receive the serial data and pack them into a byte.
11101000001011
‘A’
register
8-bit
character
register8 1
parallel-in
serial-out
serial-in
parallel-out
Synchronous vs. Asynchronous
Serial communication uses two methods:
In synchronous communication, data is sent in blocks
of bytes.
In asynchronous communication, data is sent in bytes.
byte byte byte byte 01011111 01010101sender
receiver
bytesender
receiver
start bitstop bit
bytebyte
stop bit start bit
UART & USART
It is possible to write software to use both methods,
but the programs can be tedious and long.
Special IC chips are made for serial communication:
USART (universal synchronous-asynchronous receiver-
transmitter)
UART (universal asynchronous receiver-transmitter)
The 8051 chip has a built-in UART.
Half-duplex
Asynchronous mode only
DETECTION OF CHARACTER IN
ASYNCHRONOUS MODE
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
In some systems in order to maintain data
integrity, the parity bit is included in the data
frame.
In an odd-parity bit system the total number of bits,
including the parity bit, is odd.
UART chips allow programming of the parity bit for
odd-, even-, and no-parity options.
FRAMING:
PC Baud Rates
PC supports several
baud rates.
Hyperterminal
supports baud rates
much higher than the
ones list in the Table.
110 bps
150
300
600
1200
2400
4800
9600 (default)
19200
Note: Baud rates supported by
486/Pentium IBM PC BIOS.
Baud Rates in the 8051
The 8051 transfers and receives data serially at
many different baud rates by using UART.
baud rate is defined as the number of signal
changes per second
Signal change for each roll over of timer 1
XTAL
oscillator
÷ 12
÷ 32
By UART
Machine cycle
frequency
28800 Hz
To timer 1
To set the
Baud rate
921.6 kHz
11.0592 MHz
Timer 1
AUTO RELOAD MODE OF
TIMER
XTAL
Oscillator
1/12
C/T = 0
TL
TH
TF
TR
Registers Used in Serial
Transfer Circuit
SBUF (Serial data buffer)
SCON (Serial control register)
SBUF Register
Serial data register: SBUF
MOV SBUF,#’A’ ;put char ‘A’ to transmit
MOV SBUF,A ;send data from A
MOV A,SUBF ;receive and copy to A
An 8-bit register
It provides framing
Set the usage mode for two timers
 For a byte of data to be transferred via the TxD line, it must
be placed in the SBUF.
 SBUF holds the byte of data when it is received by the 8051;s
RxD line.
SCON Register
REN Receive enable Bit
TI Transmit interrupt flag.
RI Receive interrupt flag.
SM2 = TB8 = TB8 = Use for Mode 2 & 3 Only
D0D7
SM0 SM1 SM2 REN TB8 RB8 TI RI
SM0 SM1 MODE
0 0 0: Shift Register Mode
0 1 1: Standard 8 – Bit UART Mode
1 0 2: Multi processing with fixed baud
1 1 3: Multi processing with variable baud
Transfer Data with the TI flag
• During the transfer of the stop bit, the 8051 raises
the TI flag, indicating that the last character was
transmitted and it is ready to transfer the next
character.
• By monitoring the TI flag, we know whether or not
the 8051 is ready to transfer another byte.
– We will not overloading the SBUF register.
– If we write another byte into the SBUF before TI is raised,
the untransmitted portion of the previous byte will be
lost.
• After SBUF is loaded with a new byte, the TI flag
bit must be cleared by the programmer.
Receive Data with the RI flag
• The stop bit is received. During receiving the stop
bit, the 8051 make RI=1, indicating that an entire
character was been received and must be picked
up before it gets overwritten by an incoming
character.
• By monitoring the RI flag, we know whether or not
the 8051 has received a character byte.
– If we fail to copy SBUF into a safe place, we risk the loss of
the received byte.
• After SBUF is copied into a safe place, the RI flag
bit must be cleared by the programmer.
TxD and RxD pins in the 8051
In 8051, the data is received from or transmitted to
RxD: received data (Pin 10, P3.0)
TxD: transmitted data (Pin 11, P3.1)
TxD and RxD of the 8051 are TTL compatible.
The 8051 requires a line driver to make them RS232
compatible.
One such line driver is the MAX232 chip.
Seminar on serial communication

More Related Content

What's hot

I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolAnkur Soni
 
Strowger Switching System
Strowger Switching SystemStrowger Switching System
Strowger Switching SystemGourab Ghosh
 
Frequency-Shift Keying
Frequency-Shift KeyingFrequency-Shift Keying
Frequency-Shift KeyingJessie Rama
 
Satellite data network communication
Satellite data network communicationSatellite data network communication
Satellite data network communicationBowla
 
Transmission impairments(presentation)
Transmission impairments(presentation)Transmission impairments(presentation)
Transmission impairments(presentation)Vivek Kumar
 
Computer network switching
Computer network switchingComputer network switching
Computer network switchingShivani Godha
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel CodingDr. Sanjay M. Gulhane
 
Digital modulation techniques...
Digital modulation techniques...Digital modulation techniques...
Digital modulation techniques...Nidhi Baranwal
 
Asynchronous Transfer Mode ATM
Asynchronous Transfer Mode  ATMAsynchronous Transfer Mode  ATM
Asynchronous Transfer Mode ATMMadhumita Tamhane
 
Digital Modulation Techniques ppt
Digital Modulation Techniques pptDigital Modulation Techniques ppt
Digital Modulation Techniques pptPankaj Singh
 

What's hot (20)

Switching
SwitchingSwitching
Switching
 
WLAN
WLANWLAN
WLAN
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
Stop And Wait
Stop And WaitStop And Wait
Stop And Wait
 
GSM Technology
GSM TechnologyGSM Technology
GSM Technology
 
Strowger Switching System
Strowger Switching SystemStrowger Switching System
Strowger Switching System
 
3G System
3G System3G System
3G System
 
Frequency-Shift Keying
Frequency-Shift KeyingFrequency-Shift Keying
Frequency-Shift Keying
 
Serial Data Communication
Serial Data CommunicationSerial Data Communication
Serial Data Communication
 
Satellite data network communication
Satellite data network communicationSatellite data network communication
Satellite data network communication
 
Transmission impairments(presentation)
Transmission impairments(presentation)Transmission impairments(presentation)
Transmission impairments(presentation)
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
 
Uart
UartUart
Uart
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
Digital modulation techniques...
Digital modulation techniques...Digital modulation techniques...
Digital modulation techniques...
 
Asynchronous Transfer Mode ATM
Asynchronous Transfer Mode  ATMAsynchronous Transfer Mode  ATM
Asynchronous Transfer Mode ATM
 
WCDMA
WCDMAWCDMA
WCDMA
 
GPRS
GPRSGPRS
GPRS
 
Digital Modulation Techniques ppt
Digital Modulation Techniques pptDigital Modulation Techniques ppt
Digital Modulation Techniques ppt
 
Ppt seminar noc
Ppt seminar nocPpt seminar noc
Ppt seminar noc
 

Similar to Seminar on serial communication

8051 serialp port
8051 serialp port8051 serialp port
8051 serialp portTeju Kotti
 
Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....ANKUSH445845
 
8051 microcontroller notes continuous
8051 microcontroller notes continuous 8051 microcontroller notes continuous
8051 microcontroller notes continuous THANDAIAH PRABU
 
serial-200505101453.pdf
serial-200505101453.pdfserial-200505101453.pdf
serial-200505101453.pdfKiranG731731
 
Serial Communication
Serial CommunicationSerial Communication
Serial CommunicationUshaRani289
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingBhargav Kakadiya
 
8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1 vijaydeepakg
 
Serial communication in 8051 microcontroller
Serial communication in 8051 microcontrollerSerial communication in 8051 microcontroller
Serial communication in 8051 microcontrollerIshwarNirale2
 
8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptxmaheswariM7
 
AN INTRODUCTION TO SERIAL PORT INTERFACING
AN INTRODUCTION TO SERIAL PORT INTERFACINGAN INTRODUCTION TO SERIAL PORT INTERFACING
AN INTRODUCTION TO SERIAL PORT INTERFACINGTotal Project Solutions
 
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfSPonmalar1
 
Serial communication
Serial communicationSerial communication
Serial communicationVikas Dongre
 
Micro c lab8(serial communication)
Micro c lab8(serial communication)Micro c lab8(serial communication)
Micro c lab8(serial communication)Mashood
 
Universal Serial Communication Interface
Universal Serial Communication InterfaceUniversal Serial Communication Interface
Universal Serial Communication InterfaceSandesh Agrawal
 
Serial Io
Serial IoSerial Io
Serial IoAisu
 
Lecture 10 (serial communication)
Lecture 10 (serial communication)Lecture 10 (serial communication)
Lecture 10 (serial communication)cairo university
 

Similar to Seminar on serial communication (20)

12 mt06ped019
12 mt06ped019 12 mt06ped019
12 mt06ped019
 
8051 serialp port
8051 serialp port8051 serialp port
8051 serialp port
 
Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....
 
8051 microcontroller notes continuous
8051 microcontroller notes continuous 8051 microcontroller notes continuous
8051 microcontroller notes continuous
 
8051 serial communication-UART
8051 serial communication-UART8051 serial communication-UART
8051 serial communication-UART
 
serial-200505101453.pdf
serial-200505101453.pdfserial-200505101453.pdf
serial-200505101453.pdf
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacing
 
8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1
 
Serial communication in 8051 microcontroller
Serial communication in 8051 microcontrollerSerial communication in 8051 microcontroller
Serial communication in 8051 microcontroller
 
8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
AN INTRODUCTION TO SERIAL PORT INTERFACING
AN INTRODUCTION TO SERIAL PORT INTERFACINGAN INTRODUCTION TO SERIAL PORT INTERFACING
AN INTRODUCTION TO SERIAL PORT INTERFACING
 
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdf
 
Serial data transfer
Serial data transferSerial data transfer
Serial data transfer
 
Serial communication
Serial communicationSerial communication
Serial communication
 
Micro c lab8(serial communication)
Micro c lab8(serial communication)Micro c lab8(serial communication)
Micro c lab8(serial communication)
 
Universal Serial Communication Interface
Universal Serial Communication InterfaceUniversal Serial Communication Interface
Universal Serial Communication Interface
 
Serial Io
Serial IoSerial Io
Serial Io
 
Lecture 10 (serial communication)
Lecture 10 (serial communication)Lecture 10 (serial communication)
Lecture 10 (serial communication)
 

More from Samarth Patel

More from Samarth Patel (8)

daad
daaddaad
daad
 
Gmat handbook
Gmat handbookGmat handbook
Gmat handbook
 
Plc tutorial
Plc tutorialPlc tutorial
Plc tutorial
 
Basic plc
Basic plcBasic plc
Basic plc
 
Week10 ben-control
Week10 ben-controlWeek10 ben-control
Week10 ben-control
 
7 serial port
7 serial port7 serial port
7 serial port
 
Length measurement
Length measurementLength measurement
Length measurement
 
Voltammetry
VoltammetryVoltammetry
Voltammetry
 

Recently uploaded

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Seminar on serial communication

  • 1.
  • 2. Serial vs. Parallel Data Transfer Sender Receiver Sender Receiver Serial Transfer Parallel Transfer D0-D7D0 Other control lines Other control lines
  • 3. Serial Communication How to transfer data? Sender:  The byte of data must be converted to serial bits using a parallel-in-serial-out shift register.  The bit is transmitted over a single data line. Receiver  The receiver must be a serial-in-parallel-out shift register to receive the serial data and pack them into a byte. 11101000001011 ‘A’ register 8-bit character register8 1 parallel-in serial-out serial-in parallel-out
  • 4. Synchronous vs. Asynchronous Serial communication uses two methods: In synchronous communication, data is sent in blocks of bytes. In asynchronous communication, data is sent in bytes. byte byte byte byte 01011111 01010101sender receiver bytesender receiver start bitstop bit bytebyte stop bit start bit
  • 5.
  • 6. UART & USART It is possible to write software to use both methods, but the programs can be tedious and long. Special IC chips are made for serial communication: USART (universal synchronous-asynchronous receiver- transmitter) UART (universal asynchronous receiver-transmitter) The 8051 chip has a built-in UART. Half-duplex Asynchronous mode only
  • 7. DETECTION OF CHARACTER IN ASYNCHRONOUS MODE FRAMING:
  • 8. 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 In some systems in order to maintain data integrity, the parity bit is included in the data frame. In an odd-parity bit system the total number of bits, including the parity bit, is odd. UART chips allow programming of the parity bit for odd-, even-, and no-parity options. FRAMING:
  • 9. PC Baud Rates PC supports several baud rates. Hyperterminal supports baud rates much higher than the ones list in the Table. 110 bps 150 300 600 1200 2400 4800 9600 (default) 19200 Note: Baud rates supported by 486/Pentium IBM PC BIOS.
  • 10. Baud Rates in the 8051 The 8051 transfers and receives data serially at many different baud rates by using UART. baud rate is defined as the number of signal changes per second Signal change for each roll over of timer 1 XTAL oscillator ÷ 12 ÷ 32 By UART Machine cycle frequency 28800 Hz To timer 1 To set the Baud rate 921.6 kHz 11.0592 MHz Timer 1
  • 11. AUTO RELOAD MODE OF TIMER XTAL Oscillator 1/12 C/T = 0 TL TH TF TR
  • 12. Registers Used in Serial Transfer Circuit SBUF (Serial data buffer) SCON (Serial control register)
  • 13. SBUF Register Serial data register: SBUF MOV SBUF,#’A’ ;put char ‘A’ to transmit MOV SBUF,A ;send data from A MOV A,SUBF ;receive and copy to A An 8-bit register It provides framing Set the usage mode for two timers  For a byte of data to be transferred via the TxD line, it must be placed in the SBUF.  SBUF holds the byte of data when it is received by the 8051;s RxD line.
  • 14. SCON Register REN Receive enable Bit TI Transmit interrupt flag. RI Receive interrupt flag. SM2 = TB8 = TB8 = Use for Mode 2 & 3 Only D0D7 SM0 SM1 SM2 REN TB8 RB8 TI RI SM0 SM1 MODE 0 0 0: Shift Register Mode 0 1 1: Standard 8 – Bit UART Mode 1 0 2: Multi processing with fixed baud 1 1 3: Multi processing with variable baud
  • 15. Transfer Data with the TI flag • During the transfer of the stop bit, the 8051 raises the TI flag, indicating that the last character was transmitted and it is ready to transfer the next character. • By monitoring the TI flag, we know whether or not the 8051 is ready to transfer another byte. – We will not overloading the SBUF register. – If we write another byte into the SBUF before TI is raised, the untransmitted portion of the previous byte will be lost. • After SBUF is loaded with a new byte, the TI flag bit must be cleared by the programmer.
  • 16. Receive Data with the RI flag • The stop bit is received. During receiving the stop bit, the 8051 make RI=1, indicating that an entire character was been received and must be picked up before it gets overwritten by an incoming character. • By monitoring the RI flag, we know whether or not the 8051 has received a character byte. – If we fail to copy SBUF into a safe place, we risk the loss of the received byte. • After SBUF is copied into a safe place, the RI flag bit must be cleared by the programmer.
  • 17. TxD and RxD pins in the 8051 In 8051, the data is received from or transmitted to RxD: received data (Pin 10, P3.0) TxD: transmitted data (Pin 11, P3.1) TxD and RxD of the 8051 are TTL compatible. The 8051 requires a line driver to make them RS232 compatible. One such line driver is the MAX232 chip.