Communication protocol in Embedded System | Synchronous & Asynchronous communication

Foolish Engineer
7 Sept 202010:44

Summary

TLDRIn this 'Foolish Engineer' video, we explore how embedded electronic systems communicate, focusing on various communication protocols. The video uses analogies to explain the importance of synchronization, speed, and language in data transmission between devices. It distinguishes between synchronous and asynchronous communication, illustrating these concepts with the help of a ball-tossing analogy. The video also touches on different protocols like SPI, I2C, UART, and CAN, providing a foundational understanding of how electronic devices exchange information.

Takeaways

  • 😀 Human communication is compared to how embedded electronic systems interact, highlighting the need for a common language or protocol.
  • 🔍 Communication in embedded systems involves components like sensors, microcontrollers, and displays that need to exchange information effectively.
  • 📱 An example given is the motion sensor in mobile phones that communicates with the microprocessor to respond to user gestures, like tilting the phone during a racing game.
  • 🤝 For proper communication, devices must synchronize their data transmission and reception speeds to ensure a proper handshake and no data loss.
  • 🗣️ Analogies are used to explain synchronous and asynchronous communication, comparing electronic processes to human interactions.
  • 🔄 Synchronous communication involves devices sharing the same clock pulses, eliminating the need for clock synchronization.
  • 🕒 Asynchronous communication does not require a shared clock; devices operate at predefined intervals, like throwing boxes every 2 seconds in the analogy.
  • 📦 In the synchronous analogy, 'boxes' represent data packets that are sent with attention and acknowledgment between the transmitter and receiver.
  • 📈 Asynchronous communication is characterized by a predefined baud rate, which dictates the speed of data packet transmission without continuous acknowledgment.
  • 🛠️ The video discusses various communication protocols, including SPI, I2C for synchronous, and UART, CAN for asynchronous, which are essential for different electronic systems.

Q & A

  • How do embedded electronic systems communicate with each other?

    -Embedded electronic systems communicate through various communication protocols, which are like languages that allow different components such as sensors, microcontrollers, and displays to share information.

  • What is the role of a motion sensor in a mobile phone while playing a racing game?

    -The motion sensor, specifically the accelerometer in a mobile phone, detects the tilt of the phone and provides data to the microprocessor, which then adjusts the car's direction on the screen accordingly.

  • What are the requirements for effective communication between electronic devices?

    -Effective communication requires that devices communicate at similar speeds, are synchronized, and have a mechanism for notifying the receiver that data is being sent and acknowledging its receipt.

  • What is the difference between synchronous and asynchronous communication protocols?

    -In synchronous communication, devices share the same clock pulses, whereas in asynchronous communication, devices do not share a clock and instead rely on predefined time intervals or baud rates for data transmission.

  • How does the analogy of throwing boxes between two people illustrate synchronous communication?

    -In the analogy, the person throwing the boxes (transmitter) grabs the attention of the receiver, waits for a response, and then throws the next box. This represents the synchronized clock pulses and the need for acknowledgement in synchronous communication.

  • What is the role of a clock signal in synchronous communication?

    -The clock signal in synchronous communication ensures that the transmitter and receiver are synchronized, allowing data to be sent and received at specific intervals, much like the shared understanding of when to throw and catch boxes in the analogy.

  • How does the asynchronous communication protocol handle the lack of clock synchronization?

    -Asynchronous communication protocols use an internal clock for each device and rely on a predefined baud rate to determine when to send and receive data, without the need for continuous clock synchronization.

  • What are some common synchronous communication protocols used in embedded systems?

    -Common synchronous communication protocols include SPI (Serial Peripheral Interface) and I2C (Inter-Integrated Circuit), which are used for high-speed communication between devices.

  • What are some common asynchronous communication protocols used in embedded systems?

    -Common asynchronous communication protocols include UART (Universal Asynchronous Receiver/Transmitter) and CAN (Controller Area Network), which are used for slower speed communication where clock synchronization is not required.

  • How does the transmitter know if the receiver has successfully received data in synchronous communication?

    -In synchronous communication, the receiver sends an acknowledgement bit after successfully receiving all data. If the transmitter does not receive this acknowledgement, it assumes the data was not received and may resend the data.

Outlines

00:00

💬 Introduction to Embedded Systems Communication

This paragraph introduces the topic of how embedded electronic systems communicate with each other. The analogy of human communication using languages is drawn to explain the concept of communication protocols in embedded systems. The script describes how everyday electronic devices, such as mobile phones, use sensors and microcontrollers to share information. An example is given where a mobile phone's accelerometer communicates with the microprocessor to respond to the user's movements while playing a racing game. The paragraph sets the stage for a deeper exploration of communication requirements and protocols in embedded systems.

05:01

🔄 Synchronous Communication Protocols Explained

The second paragraph delves into synchronous communication protocols, where devices share the same clock pulses, eliminating the need for clock synchronization. An analogy is used where two individuals, Akshay and Parag, communicate by throwing and catching boxes, symbolizing the transfer of data packets. The process involves Akshay grabbing Parag's attention, throwing the box, and Parag acknowledging receipt after catching it. This cycle continues until all data is transferred. The electronic equivalent involves transmitters and receivers with shift registers and D flip flops, synchronized by a clock signal. The transmitter sends a closing bit after data transmission, and the receiver sends an acknowledgement bit upon successful data receipt. If no acknowledgement is received, the data is resent, illustrating the mechanism of synchronous communication.

10:03

⏲ Asynchronous Communication Protocols Overview

The final paragraph discusses asynchronous communication protocols, which, contrary to the name, still require a form of synchronization. The analogy continues with Akshay and Parag, but this time, they agree on a time interval for throwing boxes, representing the baud rate or transmission speed. Unlike synchronous communication, there is no direct acknowledgement of each box (data packet), and Akshay assumes Parag is catching all boxes as planned. In electronic terms, this means the transmitter and receiver operate on internal clock signals set to the same baud rate before communication begins. The paragraph concludes by mentioning various types of synchronous and asynchronous communication protocols, such as SPI, I2C, UART, and CAN, and invites viewers to ask questions or revisit the video for clarity.

Mindmap

Keywords

💡Embedded Electronic Systems

Embedded electronic systems refer to the integrated circuits and microcontrollers that are embedded within devices to perform specific functions. In the context of the video, these systems are the backbone of modern electronics, enabling devices to communicate and interact with each other. The video script uses the example of a mobile phone's motion sensor, which is part of an embedded system that allows the phone to respond to physical movements, illustrating how these systems facilitate communication between different components of a device.

💡Communication Protocols

Communication protocols are the set of rules that allow different devices to transmit and receive data in a structured and understandable way. The video emphasizes the importance of these protocols in embedded systems, drawing an analogy between human languages and the protocols that devices use to 'speak' to each other. The script explains that without a common protocol, devices cannot effectively share information, just as people cannot communicate if they do not speak the same language.

💡Sensors

Sensors are devices that detect and respond to some type of input from the external environment. In the video, the accelerometer in a mobile phone is highlighted as a sensor that detects motion and communicates this information to the phone's microprocessor. This example is used to demonstrate how sensors play a crucial role in the interaction between the physical world and the digital systems within devices.

💡Microprocessor

A microprocessor is a central processing unit that performs most of the processing inside an embedded system. The video script mentions the microprocessor in the context of a mobile phone, which receives data from sensors and processes it to perform tasks such as turning a car on a screen in response to the phone's tilt. This illustrates the microprocessor's role in interpreting and acting upon the data received from other components of the system.

💡Data Transmission

Data transmission is the process of sending data from one device to another. The video script discusses the need for synchronization and speed matching between devices to ensure that data is transmitted and received without loss. This concept is crucial for understanding how information flows within embedded systems and is integral to the video's theme of communication between electronic devices.

💡Synchronization

Synchronization in the context of embedded systems refers to the coordination between devices to ensure that data is sent and received at the right time. The video uses the analogy of two people talking to each other, where both must be available and attentive for communication to occur. In electronic terms, this means that a device must notify the receiver when it is sending data and that the receiver must acknowledge receipt of the data.

💡Synchronous Communication

Synchronous communication is a type of data transmission where the sender and receiver share the same clock signal. This allows them to be in sync with each other, which is essential for the accurate transfer of data. The video script uses the analogy of two people throwing and catching boxes, where they coordinate their actions based on a shared understanding of timing, to explain how synchronous communication works in embedded systems.

💡Asynchronous Communication

Asynchronous communication is a method of data transmission where the sender and receiver do not share a clock signal. Instead, they rely on predefined time intervals or start/stop bits to synchronize their communication. The video script contrasts this with synchronous communication by describing a scenario where one person throws boxes at regular intervals without waiting for acknowledgement, assuming the other person is receiving them.

💡Baud Rate

Baud rate refers to the speed of data transmission, measured in bauds (or symbols) per second. In the video, baud rate is explained as the agreed-upon interval between data transmissions in asynchronous communication. The script mentions setting a baud rate, such as 9600, which means the transmitter sends data packets at a rate of 9600 symbols per second, illustrating how baud rate is a key parameter in configuring communication between devices.

💡SPI, I2C, UART, CAN

These acronyms represent different communication protocols used in embedded systems: SPI (Serial Peripheral Interface), I2C (Inter-Integrated Circuit), UART (Universal Asynchronous Receiver/Transmitter), and CAN (Controller Area Network). The video script mentions these protocols as examples of both synchronous and asynchronous communication methods used in electronic devices. Each protocol has its own set of rules and is suited to different types of communication needs within embedded systems.

Highlights

Embedded electronic systems communicate using different communication protocols.

Electronic devices in daily life consist of chips, sensors, and microcontrollers that share information.

An example of system communication is a mobile phone's motion sensor affecting the screen display.

The accelerometer in mobile phones senses motion and provides data to the microprocessor.

Communication requirements include a common language and similar data transmission speeds.

Synchronization is necessary for proper communication between devices.

Synchronous communication protocols involve devices sharing the same clock pulses.

Asynchronous communication protocols do not require clock synchronization.

An analogy for synchronous communication is throwing and catching boxes with a shared clock.

In synchronous communication, data is shifted between a transmitter and receiver with clock synchronization.

Asynchronous communication is like throwing boxes at timed intervals without acknowledgement.

The baud rate in asynchronous communication is analogous to the timing of box throws.

SPI and I2C are examples of synchronous communication protocols.

UART and CAN are examples of asynchronous communication protocols.

The video explains various communication protocols with practical analogies for better understanding.

The importance of proper communication for the functioning of embedded systems is emphasized.

Transcripts

play00:00

hey guys welcome to another video from

play00:03

foolish engineer

play00:04

in this video we'll check out how do

play00:07

embedded electronic systems

play00:09

talk with each other we'll see

play00:13

different communication protocols and

play00:15

the analogies

play00:17

so let's go for right

play00:24

[Music]

play00:28

we human beings communicate with each

play00:31

other

play00:32

to share our thoughts and feelings to

play00:34

talking

play00:35

or many other mediums if we are talking

play00:39

we use certain languages like english

play00:42

hindi

play00:43

german japanese many more just like that

play00:47

there are different communication

play00:48

protocols in the embedded system

play00:51

if you see electronic devices in our

play00:53

day-to-day life

play00:55

it consists of small chips sensors

play00:58

and microcontrollers

play01:01

actually we are surrounded by all of

play01:03

this

play01:04

but have you ever wondered how do they

play01:07

share information

play01:10

for example you are playing a racing

play01:12

game on your mobile phone

play01:14

when you tilt your mobile left or right

play01:17

while playing

play01:18

your car also turns on the screen

play01:21

this happens because of the motion

play01:24

sensor

play01:24

and there is an accelerometer in our

play01:27

mobile phones

play01:29

the accelerometer is a sensor which

play01:32

senses the motion

play01:33

and provides the information accordingly

play01:35

so this sensor gives the data

play01:38

to the microprocessor of our mobile

play01:40

phone

play01:41

so this sensor gives the data when we

play01:44

tilt a mobile phone

play01:46

to the microprocessor of our mobile

play01:48

phone

play01:50

it analyzes this data and it turns our

play01:52

vehicle

play01:53

while playing this is just a small task

play01:58

and to complete that it needs some

play02:00

communication

play02:01

to get things working so the sensor

play02:05

microprocessor and display of the mobile

play02:08

phone

play02:08

need to talk with each other

play02:12

that's where the communication comes

play02:14

into picture and we are going to check

play02:16

that now

play02:19

well there are certain requirements for

play02:21

communication

play02:24

for example two people need to talk in

play02:27

same language to understand each other

play02:32

now assuming both are talking in the

play02:35

same language

play02:36

say english but while talking

play02:39

one is talking very fast and in a

play02:42

different accent

play02:43

due to that the other guy is not able to

play02:46

understand

play02:47

what he is talking about so

play02:50

the guy who is talking needs to talk in

play02:53

a speed

play02:54

where this guy will understand

play02:57

if we talk in electronic terms the speed

play02:59

of data transmission

play03:00

and reception of both devices should be

play03:03

similar

play03:04

so that the devices will have a proper

play03:07

handshake

play03:08

and no loss of data

play03:11

there will be another scenario as well

play03:14

where a guy

play03:15

is speaking but the other guy with whom

play03:18

he is talking to

play03:19

is not listening at all

play03:22

well in this case as well there is no

play03:25

proper communication between two people

play03:30

to avoid this both people need to be

play03:33

available for each other

play03:35

one must speak and other must listen

play03:38

carefully

play03:40

so in electronic terms we call it

play03:44

synchronization

play03:46

when a device sends data to a system it

play03:48

needs to notify the receiver

play03:50

that it is sending some data then it

play03:53

should send the data

play03:54

and after the reception of full data

play03:56

stream the system

play03:58

needs to provide an acknowledgement

play04:00

notifying that it has

play04:02

received all of the data

play04:06

there are two types of communication

play04:08

protocols in electronic embedded system

play04:11

one is synchronous communication

play04:12

protocol

play04:14

and secondly it's asynchronous

play04:15

communication protocol

play04:18

in synchronous communication protocol

play04:20

the devices which are communicating with

play04:23

each other

play04:24

share the same clock pulses and in a

play04:26

synchronous communication

play04:28

protocol there is no need of clock

play04:30

synchronization

play04:32

let's see an easy analogy of synchronous

play04:35

communication

play04:37

let's imagine there are two people

play04:39

standing in front of

play04:40

each other but there is a ball between

play04:43

both of them

play04:45

this guy whose name is akshay needs to

play04:48

deliver some boxes to the other guy

play04:50

who is standing at the other side of the

play04:52

wall whose name is parag

play04:56

both of them are unable to see each

play04:58

other because of this wall

play05:00

so akshay will throw the boxes and parag

play05:03

needs to catch them

play05:06

in order to do so both should know each

play05:09

other's

play05:09

status now what will akshay do

play05:13

initially he'll call paraga and grab his

play05:15

attention saying

play05:16

i'm sending the first box to you

play05:20

now assuming akshay got parag's

play05:22

attention he will throw first box

play05:24

and wait for barak to catch it manaksha

play05:28

throws the box

play05:29

barak catches it as soon as he catches

play05:32

the box

play05:33

he will let akshay know that i caught

play05:35

the box

play05:36

now you can throw the next box and

play05:39

actually understand

play05:40

and he will throw this second box and

play05:44

this cycle keeps on repeating

play05:46

until akshay delivers all of his boxes

play05:50

now let's see this analogy in electronic

play05:53

terms

play05:55

daksa is our transmitter parag is our

play05:58

receiver

play05:59

the boxes are nothing but the packets of

play06:02

data

play06:02

which needs to be analyzed by the

play06:04

receiver

play06:06

each data storage equipment has a shift

play06:09

register

play06:10

the interval where each process is being

play06:12

completed

play06:13

it's synchronized with clock signal

play06:17

there are d flip flops as the

play06:19

transmitter and receiver side

play06:22

the data in the transmitter is shifted

play06:25

from transmitter

play06:27

and its output is connected to the input

play06:30

of the receiver now the transmitter

play06:34

notifies the receiver

play06:35

that it is about to send the data and

play06:38

receiver

play06:39

prepares for it after that

play06:42

the data stream of ones and zeros is

play06:45

shifted from

play06:46

transmitter to the receiver in each

play06:49

interval of clock pulse

play06:52

after transmission of full data the

play06:54

transmitter sends a closing bit

play06:57

to notify the receiver that it has sent

play06:59

all of the information

play07:02

if the receiver gets the data the

play07:05

receiver sends an

play07:06

acknowledgement bit saying it has

play07:08

received

play07:09

all of the data and the communication

play07:12

was successful

play07:14

but if the transmitter doesn't receive

play07:16

any acknowledgement

play07:17

the transmitter will understand that the

play07:19

receiver did not get the packet of data

play07:22

and it will send the same data stream to

play07:24

the receiver again

play07:27

this cycle keeps on repeating and that's

play07:30

how

play07:30

the synchronous communication takes

play07:32

place

play07:35

now we will see the asynchronous

play07:37

communication protocol

play07:40

well asynchronous doesn't mean that

play07:42

there is no synchronization

play07:44

between transmitter and receiver

play07:47

let's see the analogy of a synchronous

play07:49

communication

play07:51

so there are our two guides standing in

play07:54

front of each other

play07:56

and there is a wall just like earlier

play07:59

case

play08:00

akshay needs to deliver the boxes to

play08:02

parak

play08:03

so in this case initially akshay will

play08:06

grab barak's attention

play08:08

and mutually they will decide that

play08:10

akshay will throw a box

play08:12

after 2 seconds that means

play08:15

akshay will throw the first box then

play08:18

he'll wait for the 2 second

play08:21

and then he'll throw the second box

play08:23

again

play08:25

he'll wait for the two seconds and after

play08:27

that akshay will throw the third box

play08:30

and it keeps going on

play08:33

remember parag is not giving any

play08:35

acknowledgement regarding the delivery

play08:37

of boxes

play08:39

and akshay assumes that parag is

play08:41

catching all of his boxes

play08:44

so he throws boxes until all of the

play08:46

boxes gets delivered

play08:50

if we compare it with two electronic

play08:52

terms akshay and paraga transmit and

play08:54

receiver

play08:56

boxes are the data packets now

play09:00

two seconds which they have decided is

play09:02

the baud rate of communication

play09:06

we can say it is the transmission speed

play09:08

of the data packet

play09:09

sent by the transmitter the transmitter

play09:13

and receiver has d flip flop

play09:16

there is no sharing of the clock between

play09:18

transmitter

play09:19

and receiver but both of them has

play09:21

internal clock signals

play09:23

which are generated by their timers

play09:27

before the communication we configure

play09:29

same baud rate for the transmitter

play09:31

and receiver which we have seen many

play09:34

times

play09:34

when we use arduino ide we set the baud

play09:38

rate of the communication

play09:41

for example 9600 that means

play09:44

9600 bauds per second is the rate of

play09:47

data transmission

play09:51

and that's how a synchronous

play09:52

communication works

play09:56

well there are multiple types of

play09:58

synchronous communication protocol and

play10:00

asynchronous communication protocol in

play10:02

synchronous communication

play10:04

there are spi i2c and many more

play10:08

and in asynchronous communication

play10:10

protocol there are uart

play10:12

and can we'll see about

play10:16

all of these communication protocols one

play10:19

by one

play10:21

i hope you got something from this if

play10:24

you haven't

play10:24

you can watch the video again still if

play10:26

you don't

play10:27

you can ask your doubts in the comment

play10:29

box below hit the like button if you

play10:31

like this video

play10:32

subscribe to my channel and finally

play10:35

thanks for watching

Rate This

5.0 / 5 (0 votes)

相关标签
Embedded SystemsCommunication ProtocolsElectronic DevicesSensorsMicrocontrollersData TransmissionSynchronousAsynchronousTechnical EducationEngineering
您是否需要英文摘要?