SlideShare a Scribd company logo
1 of 27
Download to read offline
Serial
Communication
Mohamad Abd Elhay

Copyright © 2012 Embedded Systems
Committee
Serial Communication:
is the process of sending data one bit at a time,
sequentially, over a communication channel or
computer bus.

Parallel Communication:
where several bits are sent as a whole, on a link with
several parallel channels.
Copyright © 2012 Embedded Systems
Committee
serial connection requires fewer interconnecting
cables and hence occupies less space.
 the cost of cable and synchronization difficulties
make parallel communication impractical.

Copyright © 2012 Embedded Systems
Committee
• For serial communications to be accomplished
there must be a transmitter (TX), and a
receiver (RX).
• The TX is responsible for taking a byte (or
several bits of data) in parallel, and convert
them to a series of successive bits.
• The RX on the other side, collects the
successive bits to reform the data once again.

Copyright © 2012 Embedded Systems
Committee
A Serial Line.(HIGH=RED & LOW=WHITE)

Copyright © 2012 Embedded Systems
Committee
1-Simplex:
one way communication where all signals can flow in only
one direction.
Example Radio & TX.

2- half-duplex system
It provides for communication in both directions, but only one
direction at a time (not simultaneously).
Example walkie-talkie.

3-Full-duplex
allows communication in both directions.
Example Telephone.
Copyright © 2012 Embedded Systems
Committee
synchronous communication
Is transmission of data with the use of an external
clock signal.

Example:
Serial Peripheral Interface (SPI).

Inter-Integrated Circuit (I2C).
Copyright © 2012 Embedded Systems
Committee
Asynchronous communication
Is transmission of data without the use of an external
clock signal.

Example:
Universal asynchronous receiver/transmitter (UART).

Copyright © 2012 Embedded Systems
Committee
Serial Communication In Embedded Systems:
We use serial communication (UART-SPI-I2C) to interface
microcontroller with different devices such as :
1-Computer.
2-LCD.
3-EEROM.
4-Ultrasonic.
Also, serial communication used in embedded systems
networks such as:
1- Controller Area Networks (CAN)
2- Local Interconnect Networks (LIN)
Copyright © 2012 Embedded Systems
Committee
• Bit time:
– The time taken to transmit a bit/sec.
• Bit rate:
– The number of bits transmitted per second.
– Bit rate = 1 / Bit time.
• Baud Rate:
– The number of symbols signaled in a second.
– Baud rate = 1 symbol / sec.
• Symbol = bit or byte or number of bits or
bytes
Copyright © 2012 Embedded Systems
Committee
• When using a device has a set of 8 different
symbols.
• Each symbol represents 3 bits of useful data.
• If it transmits 300 bits per second, it gathers
each 3 bits in 1 symbol.
• So it transmits 100 symbol per second
– 300 bit per second (bit rate)
– 100 baud (baud rate)
Copyright © 2012 Embedded Systems
Committee
Copyright © 2012 Embedded Systems
Committee
 It also called Serial Communication Interface(SCI)
 full-duplex communication.
 Asynchronous communication.
 Compatible with PC .

 The Standard bit rates are:
100, 200, 300, 1200, 2400, 4800, 9600, 19200,

38400, 57600, 115200 bps.
Copyright © 2012 Embedded Systems
Committee
Copyright © 2012 Embedded Systems
Committee
• Frame : A frame is the unit of transmission in serial
communications.
• A frame contains:
– Start bit: To declare the start of transmission.
– Data bits: 4,5,6,7, or 8 bits of useful data bits.
– Parity bit : To check for transmission errors.
– Stop bit: To declare end of frame.

• Parity bit is used to check the integrity of a frame
and signal if an error occurred during
transmission.
Copyright © 2012 Embedded Systems
Committee
• Parity :
– Parity bit is an extra bit added to the end of a
frame.

• Even parity :
– The number of ‘1’ symbols inside a frame must
always be even.

• Odd parity :
– The number of ‘1’ symbols inside a frame must
always be odd.

Copyright © 2012 Embedded Systems
Committee
Frame structure:

Copyright © 2012 Embedded Systems
Committee
RS232 Data Interface
 PC serial interface.
 SPACE (0) will be between +3 to +15 volts.

 MARK (1) will be between -3 and -15 volts.

Copyright © 2012 Embedded Systems
Committee
Microcontroller O/P voltages:
o0 v for logic 0.
o5v for logic 1.
MAX232
Is an IC that converts signals
from an RS-232 serial port to
signals suitable for use in TTL
compatible digital logic circuits
Copyright © 2012 Embedded Systems
Committee
Copyright © 2012 Embedded Systems
Committee
Hyper Terminal from Start > Programs > Accessories >
Communications

Copyright © 2012 Embedded Systems
Committee
UCSRA: USART Control and Status Register A
Bit No
7
Name RXC

6
5
TXC UDRE

4
FE

3
DOR

2
PE

1
0
U2X MPCM

RXC this bit is set when the USART has completed receiving a byte
from the host
UDRE this bit set when UDR emty.
UCSRB: USART Control and Status Register B
Bit No
7
6
5
4
3
2
1
0
Name RXCIE TXCIE UDRIE RXEN TXEN UCSZ2 RXB8 TXB8

RXCIE: Receive Complete Interrupt Enable
TXCIE: Transmit Complete Interrupt Enable
RXEN: Receiver Enable
TXEN: Transmitter Enable
UCSZ2: USART Character Copyright © 2012 Embedded Systems
Size
Committee
UCSRC: USART Control And Status Register C
Bit No
7
6
5
Name URSEL UMSEL UPM1

4
UPM0

3
2
1
USBS UCSZ1 UCSZ0

0

URSEL: USART register select.
The UCSRC and the UBRRH register shares same address so to determine which register user
want to write is decided with the 7th(last) bit of data if its 1 then the data is written to UCSRC
else it goes to UBRRH.

USART Mode Select
USBS
0
1

Stop Bit(s)
1 BIT
2 BIT

USBS: USART Stop Bit Select
UMSEL
0
1

Mode
Asynchronous
Synchronous

UCSZ2
0
0
0

UCSZ1
0
0
1

UCSZ0
0
1
0

Character Size
5Bit
6Bit
7Bit

0

1

1

8Bit

1
1
1
1

0
0
1
1

0
1
0
1

Reserved
Reserved
Reserved
9Bit

Copyright © 2012 Embedded Systems
Committee
UDR: Data Register
UBRR: USART Baud Rate Register:

Copyright © 2012 Embedded Systems
Committee
void MCL_UART_Init(void)
void MCL_UART_SendByte(unsigned char byte)
void MCL_UART_StartSendArray(unsigned char length, unsigned char * array)
void MCL_UART_StartReceving(void)
void MCL_UART_GetReceivedData(unsigned char length, unsigned char * arr_rx)
int Compare (unsigned char * arr_rx,unsigned char length)
//equal=1 //not equal=0

Copyright © 2012 Embedded Systems
Committee
References

• ESC Training Team

Copyright © 2012 Embedded Systems
Committee
info@escommittee.net

Copyright © 2012 Embedded Systems
Committee

More Related Content

What's hot

UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTSai_praneeth
 
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SUNODH GARLAPATI
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolAditya Porwal
 
Challenges in Using UVM at SoC Level
Challenges in Using UVM at SoC LevelChallenges in Using UVM at SoC Level
Challenges in Using UVM at SoC LevelDVClub
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23Techvilla
 
Jtag presentation
Jtag presentationJtag presentation
Jtag presentationklinetik
 
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
 

What's hot (20)

Uart
UartUart
Uart
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPT
 
Serial Data Communication
Serial Data CommunicationSerial Data Communication
Serial Data Communication
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
 
I2C
I2CI2C
I2C
 
UART
UARTUART
UART
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
Communication protocols
Communication protocolsCommunication protocols
Communication protocols
 
Challenges in Using UVM at SoC Level
Challenges in Using UVM at SoC LevelChallenges in Using UVM at SoC Level
Challenges in Using UVM at SoC Level
 
I2C introduction
I2C introductionI2C introduction
I2C introduction
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
I2C
I2CI2C
I2C
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Jtag presentation
Jtag presentationJtag presentation
Jtag presentation
 
Unit 3 mpmc
Unit 3 mpmcUnit 3 mpmc
Unit 3 mpmc
 
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
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
 

Viewers also liked

Viewers also liked (20)

Uart
UartUart
Uart
 
Uart
UartUart
Uart
 
8251 USART
8251 USART8251 USART
8251 USART
 
คณิต
คณิตคณิต
คณิต
 
Matlab workshop
Matlab workshopMatlab workshop
Matlab workshop
 
Montras com livros
Montras com livrosMontras com livros
Montras com livros
 
Sp soft profile (15-may-2012)
Sp soft profile (15-may-2012)Sp soft profile (15-may-2012)
Sp soft profile (15-may-2012)
 
Kbox 101 1000 slide
Kbox 101 1000 slideKbox 101 1000 slide
Kbox 101 1000 slide
 
Mo ta du an
Mo ta du anMo ta du an
Mo ta du an
 
Bigalytics
BigalyticsBigalytics
Bigalytics
 
Pdhpe slideshow
Pdhpe slideshowPdhpe slideshow
Pdhpe slideshow
 
Fractales (1)
Fractales (1)Fractales (1)
Fractales (1)
 
Engaging Activities
Engaging ActivitiesEngaging Activities
Engaging Activities
 
Office 2010 migration
Office 2010 migrationOffice 2010 migration
Office 2010 migration
 
แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์
 
Day1
Day1Day1
Day1
 
Pr i ncess!!!
Pr i ncess!!!Pr i ncess!!!
Pr i ncess!!!
 
ไทย
ไทยไทย
ไทย
 
Regulamento concursoleituraconcelho ourem_aeco
Regulamento concursoleituraconcelho ourem_aecoRegulamento concursoleituraconcelho ourem_aeco
Regulamento concursoleituraconcelho ourem_aeco
 
สังคม
สังคมสังคม
สังคม
 

Similar to Uart

serial-200505101453.pdf
serial-200505101453.pdfserial-200505101453.pdf
serial-200505101453.pdfKiranG731731
 
Serial Communication
Serial CommunicationSerial Communication
Serial CommunicationUshaRani289
 
UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )Tarun Khaneja
 
8251 08 Serial
8251 08 Serial8251 08 Serial
8251 08 SerialAisu
 
Networking devices
Networking devicesNetworking devices
Networking devicesfrestoadi
 
Serial Communication Interface with Error Detection
Serial Communication Interface with Error DetectionSerial Communication Interface with Error Detection
Serial Communication Interface with Error Detectioniosrjce
 
networking devices -161021181705452555
networking   devices -161021181705452555networking   devices -161021181705452555
networking devices -161021181705452555mercyzyada1999
 
Hands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP TroubleshootingHands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP TroubleshootingLiving Online
 
Serial Port Device Driver
Serial Port Device DriverSerial Port Device Driver
Serial Port Device DriverEmblogic
 
Introduction To Telecom
Introduction To TelecomIntroduction To Telecom
Introduction To Telecomhumannetwork
 
Aspects Stratégiques des Réseaux
Aspects Stratégiques des RéseauxAspects Stratégiques des Réseaux
Aspects Stratégiques des RéseauxEric Vyncke
 
EXIDE PPT TEMPLATE.pptx
EXIDE PPT TEMPLATE.pptxEXIDE PPT TEMPLATE.pptx
EXIDE PPT TEMPLATE.pptxNaveenK365392
 
Universal Asynchronous Receive and transmit IP core
Universal Asynchronous Receive and transmit IP coreUniversal Asynchronous Receive and transmit IP core
Universal Asynchronous Receive and transmit IP coreAneesh Raveendran
 
Atm( Asynchronous Transfer mode )
Atm( Asynchronous Transfer mode )Atm( Asynchronous Transfer mode )
Atm( Asynchronous Transfer mode )Ali Usman
 
Computer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realyComputer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realyDeepak John
 
Rs 232 & usb ieee1394 communication
Rs 232 & usb  ieee1394 communicationRs 232 & usb  ieee1394 communication
Rs 232 & usb ieee1394 communicationVijay Kumar
 

Similar to Uart (20)

serial-200505101453.pdf
serial-200505101453.pdfserial-200505101453.pdf
serial-200505101453.pdf
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )
 
8251 08 Serial
8251 08 Serial8251 08 Serial
8251 08 Serial
 
Networking devices
Networking devicesNetworking devices
Networking devices
 
Serial Communication Interface with Error Detection
Serial Communication Interface with Error DetectionSerial Communication Interface with Error Detection
Serial Communication Interface with Error Detection
 
M010617376
M010617376M010617376
M010617376
 
networking devices -161021181705452555
networking   devices -161021181705452555networking   devices -161021181705452555
networking devices -161021181705452555
 
Hands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP TroubleshootingHands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP Troubleshooting
 
Project_intership
Project_intershipProject_intership
Project_intership
 
Project_intership
Project_intershipProject_intership
Project_intership
 
Serial Port Device Driver
Serial Port Device DriverSerial Port Device Driver
Serial Port Device Driver
 
Introduction To Telecom
Introduction To TelecomIntroduction To Telecom
Introduction To Telecom
 
Wan notes
Wan notesWan notes
Wan notes
 
Aspects Stratégiques des Réseaux
Aspects Stratégiques des RéseauxAspects Stratégiques des Réseaux
Aspects Stratégiques des Réseaux
 
EXIDE PPT TEMPLATE.pptx
EXIDE PPT TEMPLATE.pptxEXIDE PPT TEMPLATE.pptx
EXIDE PPT TEMPLATE.pptx
 
Universal Asynchronous Receive and transmit IP core
Universal Asynchronous Receive and transmit IP coreUniversal Asynchronous Receive and transmit IP core
Universal Asynchronous Receive and transmit IP core
 
Atm( Asynchronous Transfer mode )
Atm( Asynchronous Transfer mode )Atm( Asynchronous Transfer mode )
Atm( Asynchronous Transfer mode )
 
Computer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realyComputer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realy
 
Rs 232 & usb ieee1394 communication
Rs 232 & usb  ieee1394 communicationRs 232 & usb  ieee1394 communication
Rs 232 & usb ieee1394 communication
 

More from محمدعبد الحى (14)

Iso26262 component reuse_webinar
Iso26262 component reuse_webinarIso26262 component reuse_webinar
Iso26262 component reuse_webinar
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
Can bus
Can busCan bus
Can bus
 
Lin bus
Lin busLin bus
Lin bus
 
Embedded Systems in Automotive
Embedded Systems in Automotive Embedded Systems in Automotive
Embedded Systems in Automotive
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
CPU Architecture
CPU ArchitectureCPU Architecture
CPU Architecture
 
8 bit microcontroller
8 bit microcontroller8 bit microcontroller
8 bit microcontroller
 
Timers
TimersTimers
Timers
 
Interrupts
InterruptsInterrupts
Interrupts
 
Sw testing
Sw testingSw testing
Sw testing
 
Rtos
RtosRtos
Rtos
 
Dio
DioDio
Dio
 
Micro controller
Micro controllerMicro controller
Micro controller
 

Recently uploaded

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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 WorkerThousandEyes
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Uart

  • 1. Serial Communication Mohamad Abd Elhay Copyright © 2012 Embedded Systems Committee
  • 2. Serial Communication: is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. Parallel Communication: where several bits are sent as a whole, on a link with several parallel channels. Copyright © 2012 Embedded Systems Committee
  • 3. serial connection requires fewer interconnecting cables and hence occupies less space.  the cost of cable and synchronization difficulties make parallel communication impractical. Copyright © 2012 Embedded Systems Committee
  • 4. • For serial communications to be accomplished there must be a transmitter (TX), and a receiver (RX). • The TX is responsible for taking a byte (or several bits of data) in parallel, and convert them to a series of successive bits. • The RX on the other side, collects the successive bits to reform the data once again. Copyright © 2012 Embedded Systems Committee
  • 5. A Serial Line.(HIGH=RED & LOW=WHITE) Copyright © 2012 Embedded Systems Committee
  • 6. 1-Simplex: one way communication where all signals can flow in only one direction. Example Radio & TX. 2- half-duplex system It provides for communication in both directions, but only one direction at a time (not simultaneously). Example walkie-talkie. 3-Full-duplex allows communication in both directions. Example Telephone. Copyright © 2012 Embedded Systems Committee
  • 7. synchronous communication Is transmission of data with the use of an external clock signal. Example: Serial Peripheral Interface (SPI).  Inter-Integrated Circuit (I2C). Copyright © 2012 Embedded Systems Committee
  • 8. Asynchronous communication Is transmission of data without the use of an external clock signal. Example: Universal asynchronous receiver/transmitter (UART). Copyright © 2012 Embedded Systems Committee
  • 9. Serial Communication In Embedded Systems: We use serial communication (UART-SPI-I2C) to interface microcontroller with different devices such as : 1-Computer. 2-LCD. 3-EEROM. 4-Ultrasonic. Also, serial communication used in embedded systems networks such as: 1- Controller Area Networks (CAN) 2- Local Interconnect Networks (LIN) Copyright © 2012 Embedded Systems Committee
  • 10. • Bit time: – The time taken to transmit a bit/sec. • Bit rate: – The number of bits transmitted per second. – Bit rate = 1 / Bit time. • Baud Rate: – The number of symbols signaled in a second. – Baud rate = 1 symbol / sec. • Symbol = bit or byte or number of bits or bytes Copyright © 2012 Embedded Systems Committee
  • 11. • When using a device has a set of 8 different symbols. • Each symbol represents 3 bits of useful data. • If it transmits 300 bits per second, it gathers each 3 bits in 1 symbol. • So it transmits 100 symbol per second – 300 bit per second (bit rate) – 100 baud (baud rate) Copyright © 2012 Embedded Systems Committee
  • 12. Copyright © 2012 Embedded Systems Committee
  • 13.  It also called Serial Communication Interface(SCI)  full-duplex communication.  Asynchronous communication.  Compatible with PC .  The Standard bit rates are: 100, 200, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 bps. Copyright © 2012 Embedded Systems Committee
  • 14. Copyright © 2012 Embedded Systems Committee
  • 15. • Frame : A frame is the unit of transmission in serial communications. • A frame contains: – Start bit: To declare the start of transmission. – Data bits: 4,5,6,7, or 8 bits of useful data bits. – Parity bit : To check for transmission errors. – Stop bit: To declare end of frame. • Parity bit is used to check the integrity of a frame and signal if an error occurred during transmission. Copyright © 2012 Embedded Systems Committee
  • 16. • Parity : – Parity bit is an extra bit added to the end of a frame. • Even parity : – The number of ‘1’ symbols inside a frame must always be even. • Odd parity : – The number of ‘1’ symbols inside a frame must always be odd. Copyright © 2012 Embedded Systems Committee
  • 17. Frame structure: Copyright © 2012 Embedded Systems Committee
  • 18. RS232 Data Interface  PC serial interface.  SPACE (0) will be between +3 to +15 volts.  MARK (1) will be between -3 and -15 volts. Copyright © 2012 Embedded Systems Committee
  • 19. Microcontroller O/P voltages: o0 v for logic 0. o5v for logic 1. MAX232 Is an IC that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits Copyright © 2012 Embedded Systems Committee
  • 20. Copyright © 2012 Embedded Systems Committee
  • 21. Hyper Terminal from Start > Programs > Accessories > Communications Copyright © 2012 Embedded Systems Committee
  • 22. UCSRA: USART Control and Status Register A Bit No 7 Name RXC 6 5 TXC UDRE 4 FE 3 DOR 2 PE 1 0 U2X MPCM RXC this bit is set when the USART has completed receiving a byte from the host UDRE this bit set when UDR emty. UCSRB: USART Control and Status Register B Bit No 7 6 5 4 3 2 1 0 Name RXCIE TXCIE UDRIE RXEN TXEN UCSZ2 RXB8 TXB8 RXCIE: Receive Complete Interrupt Enable TXCIE: Transmit Complete Interrupt Enable RXEN: Receiver Enable TXEN: Transmitter Enable UCSZ2: USART Character Copyright © 2012 Embedded Systems Size Committee
  • 23. UCSRC: USART Control And Status Register C Bit No 7 6 5 Name URSEL UMSEL UPM1 4 UPM0 3 2 1 USBS UCSZ1 UCSZ0 0 URSEL: USART register select. The UCSRC and the UBRRH register shares same address so to determine which register user want to write is decided with the 7th(last) bit of data if its 1 then the data is written to UCSRC else it goes to UBRRH. USART Mode Select USBS 0 1 Stop Bit(s) 1 BIT 2 BIT USBS: USART Stop Bit Select UMSEL 0 1 Mode Asynchronous Synchronous UCSZ2 0 0 0 UCSZ1 0 0 1 UCSZ0 0 1 0 Character Size 5Bit 6Bit 7Bit 0 1 1 8Bit 1 1 1 1 0 0 1 1 0 1 0 1 Reserved Reserved Reserved 9Bit Copyright © 2012 Embedded Systems Committee
  • 24. UDR: Data Register UBRR: USART Baud Rate Register: Copyright © 2012 Embedded Systems Committee
  • 25. void MCL_UART_Init(void) void MCL_UART_SendByte(unsigned char byte) void MCL_UART_StartSendArray(unsigned char length, unsigned char * array) void MCL_UART_StartReceving(void) void MCL_UART_GetReceivedData(unsigned char length, unsigned char * arr_rx) int Compare (unsigned char * arr_rx,unsigned char length) //equal=1 //not equal=0 Copyright © 2012 Embedded Systems Committee
  • 26. References • ESC Training Team Copyright © 2012 Embedded Systems Committee
  • 27. info@escommittee.net Copyright © 2012 Embedded Systems Committee