Professional Documents
Culture Documents
SessIon 5, 6, 7
SessIon 5, 6, 7
SessIon 5, 6, 7
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
and 0’s.
Parallel communication
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:
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
}
////////////////////////////////////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:
DHT11
DS18B20
Ultrasonic Sensor
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.
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: