SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
Prashant Ahire
 

Tendances (20)

8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing Modes
 
8086 modes
8086 modes8086 modes
8086 modes
 
Rs 232 interface
Rs 232 interfaceRs 232 interface
Rs 232 interface
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
Introduction to Embedded Systems and its Applications
Introduction to Embedded Systems and its ApplicationsIntroduction to Embedded Systems and its Applications
Introduction to Embedded Systems and its Applications
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
Asynchronous data transfer
Asynchronous data transferAsynchronous data transfer
Asynchronous data transfer
 
IEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesIEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and Services
 
Adc interfacing
Adc interfacingAdc interfacing
Adc interfacing
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
8254 PIT
8254 PIT8254 PIT
8254 PIT
 
Math Co-processor 8087
Math Co-processor 8087Math Co-processor 8087
Math Co-processor 8087
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
Memory Organization in 80386
Memory Organization in 80386 Memory Organization in 80386
Memory Organization in 80386
 

Similaire à Seminar on serial communication

8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1
vijaydeepakg
 
Serial Io
Serial IoSerial Io
Serial Io
Aisu
 

Similaire à Seminar on serial communication (20)

12 mt06ped019
12 mt06ped019 12 mt06ped019
12 mt06ped019
 
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
 
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)
 
Uart 16550
Uart 16550Uart 16550
Uart 16550
 
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
 

Plus de 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
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

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.