SessIon 5, 6, 7

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

Serial communication

with Arduino & 8051

Presented By:
Siddhanta Borah
Session 5

Presented By:
Siddhanta Borah
Application of Serial Communication
Serial communication

Embedded electronics is all about interlinking circuits (processors or other integrated circuits)
to create a symbiotic system. In order for those individual circuits to swap their information,
they must share a common communication protocol. Hundreds of communication protocols
have been defined to achieve this data exchange, and, in general, each can be separated
into one of two categories:

1) parallel or

2) serial.
Parallel Vs Serial

Parallel interfaces transfer multiple bits at the same time. They

usually require buses of data -transmitting across eight, sixteen,

or more wires. Data is transferred in huge, crashing waves of 1’s

and 0’s.
Parallel communication

An 8-bit data bus,


controlled by a clock,
transmitting a byte every
clock pulse. 9 wires are
used.
Serial communication

Serial interfaces stream


their data, one single bit at
a time. These interfaces
can operate on as little as
one wire, usually
nevermore than four.
Baud rate

The baud rate specifies how fast data is sent over a serial
line. It’s usually expressed in units of bits-persecond (bps). If
you invert the baud rate, you can find out just how long it
takes to transmit a single bit. This value determines how
long the transmitter holds a serial line high/low or at what
period the receiving device samples itsline.
Task 8:

Design a home automation system using


Arduino
Task 9: (HW)

Design a wireless notice board using


Arduino & 16x2 LCD
Task 10 (CW):

Design a weather monitoring system using


WSN/IoT
Serial Communication
Interrupt of 8051
Application of Serial Communication
What is serial communication?

Serial
communication

Parallel
communication
How does the serial communication of 8051
works ?

Generate the
Baud Rate

Data
framing

Access data
from SBUF
8051 UART Programming
Baudrate /Data transmission rate
The data transmission rate is measured in bits per second (bps). In the binary system, it is also called a Baud rate
(number of signal changes per second). Standard baud rates supported are 1200, 2400, 4800, 19200, 38400, 57600,
and 115200. Normally most of the time 9600 bps is used when speed is not a big issue.
How to Set the Baud rate of 8051?
How to Set the Baud rate of 8051?
How to do data framing?
How to do data framing?
Programming steps to enable serial communication
of 8051?
Serial communication-8051-Experiment

Simulation
///////////////////////////////////// Function to initialize serial communication
void initialize_serial()

{
TMOD=0x20; //use Timer 1, 8 bit ,auto reload
TH1=0xFD; //9600 baudrate

SCON=0x50; //// To enable the Serial communication


TR1=1; //start timer
TI=1;

}
////////////////////////////////////Function to transmit data_
void transmit(unsigned char cmd)
{
while(TI==0);
SBUF=cmd;
TI=0;
Header file
}
///////////////////////////////////// Function to initialize serial communication
void initialize_serial()
{
TMOD=0x20; //use Timer 1, 8 bit ,auto reload
TH1=0xFD; //9600 baudrate
SCON=0x50; //// To enable the Serial communication
TR1=1; //start timer
TI=0;
RI=0;
}
////////////////////////////////////Function to transmit data_
void transmit(unsigned char cmd)
{
while(TI==0);
SBUF=cmd;
TI=0;
}
////////////////////////////////////// Function to Receive data serially
void receive()
{
while(RI==0);
cmd=SBUF;
RI=0;
}
Session 6

Presented By:
Siddhanta Borah
Task 11:

Design a home automation system using


8051
Task 12: (HW)

Design a weather monitoring system using


8051
8051 Timer
What is the use of TIMER?
What is the use of TIMER?

DHT11
DS18B20

Ultrasonic Sensor
What is the use of TIMER?

➢ Timer is used to create exact time delay during operation

➢ Timer can be used as a counter to count an event


Protocols of DHT11
What is the use of TIMER?

Simulation+Video Demostration
TIMER of 8051
Different Modes of Timers

M1 M0 Mode
0 0 13-bit timer mode.

0 1 16-bit timer mode.

1 0 8-bit auto reload mode.

1 1 Spilt mode.
How to program Timers in 8051
Example 1: How much delay will be generated if Timer 1 loaded with FFF2 H.
(XTAL=11.0592MHz)
Solution:
How to program Timers in 8051
Example 1: What value need to load with TH1 to get a time delay of 20ms.
(XTAL=11.0592MHz)
Solution:
How to program Timers in 8051
Example 1: What value need to load with TH1 to get a time delay of 30us.
(XTAL=11.0592MHz)
Solution:
Task 13:

Design a System to monitor temperature and


humidity using 8051 controller
Task 14:

Development of an embedded based smart system for


safe transport of raw materials to Tea production
unit
44
Video Demostration
THANK YOU

You might also like