You are on page 1of 10

A

Major Training synopsis


On :

Microcontroller and Interfacing

A dissertation submitted for the partial fulfillment of the degree of


Bachelor Of Engineering under 4YDC to
Rajiv Gandhi Proudyogiki Vishwavidhyalaya

Department of
“Electronics and Communication”
B.E. 4th Year

Session 2010- 2011

Submitted To: Submitted By: -


Mr. Sankalp Rajora Nupur Jain (0821EC071023)
Mr. Vijay Verma
Synopsis

Serial No. Topic


I Introduction to Microcontroller
8051
II Abstract

III Flowchart
IV Algorithm
V Problem Statement
VI Solution domain

VII Future Enhancement and its


Approach
VIII Application

I. Introduction
A microcontroller is actually has more features than microprocessors. Besides the
processor it also has I/O ports, internal timers/counters, internal RAM and ROM.
Microcontrollers are programmed using assembly and high level languages. Assembly
languages are controller specific and machine friendly but the program written in
assembly languages are quite lengthy. At the same time, high level languages such as C
and Java are also being used to program microcontrollers. High level languages are user
friendly and eliminate redundancy from the programs written in assembly languages.

Micro-controllers are useful to the extent that they communicate with other devices, such
as sensors, motors, switches, keypads, displays, memory and even other micro-
controllers.

Many interface methods have been developed over the years to solve the complex
problem of balancing circuit design criteria such as features, cost, size, weight, power
consumption, reliability, availability, manufacturability.

Many interface methods have been developed over the years to solve the complex
problem of balancing circuit design criteria such as features, cost, size, weight, power
consumption, reliability, availability, manufacturability.

Many microcontroller designs typically mix multiple interfacing methods. In a very


simplistic form, a micro-controller system can be viewed as a system that reads from
(monitors) inputs, performs processing and writes to ( controls ) outputs.

It is a device in which CPU, input-output ports, memory, timer, counter all are mounted
on a single chip. We are using 8051 family of microcontroller.

II. Abstract
The concept of serial communication is the process of sending data one bit at a time,
sequentially, over a communication channel or computer bus. This is in contrast to
parallel communication, where several bits are sent as a whole, on a link with several
parallel channels. Serial communication is used for all long-haul communication and
most computer networks, where the cost of cable and synchronization difficulties make
parallel communication impractical.

In this communication bit by bit transfer take place. For example, if we send HELLO
from the transmitter end the transfer take place bit by bit like first ‘h’ will be transfer then
‘e’ and so on and this values will be stored in DPTR register and its value will be
incremented with each bit. Thus in this way serial communication is being performed.

One of the 8051’s many powerful features is it’s integrated UART, otherwise known as a
serial port. The fact that the 8051 has an integrated serial port means that you may very
easily read and write values to the serial port. It is a full-duplex port, thus being able to
transmit and receive data simultaneously and at different baud rates.

When using UART, all the programmer has to do is to simply select serial port mode and
baud rate. When it's done, serial data transmit is nothing but writing to the SBUF register,
while data receive represents reading the same register. The microcontroller takes care of
not making any error during data transmission.

Serial port must be configured prior to being used. In other words, it is necessary to determine how many
bits is contained in one serial “word”, baud rate and synchronization clock source. The whole process is in
control of the bits of the SCON register (Serial Control).

Serial Port Control (SCON) Register

• SM0 - Serial port mode bit 0 is used for serial port mode selection.
• SM1 - Serial port mode bit 1.
• SM2 - Serial port mode 2 bit, also known as multiprocessor communication
enable bit. When set, it enables multiprocessor communication in mode 2 and 3,
and eventually mode 1. It should be cleared in mode 0.
• REN - Reception Enable bit enables serial reception when set. When cleared,
serial reception is disabled.
• TB8 - Transmitter bit 8. Since all registers are 8-bit wide, this bit solves the
problem of transmiting the 9th bit in modes 2 and 3. It is set to transmit a logic 1
in the 9th bit.
• RB8 - Receiver bit 8 or the 9th bit received in modes 2 and 3. Cleared by
hardware if 9th bit received is a logic 0. Set by hardware if 9th bit received is a
logic 1.
• TI - Transmit Interrupt flag is automatically set at the moment the last bit of one
byte is sent. It's a signal to the processor that the line is available for a new byte
transmite. It must be cleared from within the software.
• RI - Receive Interrupt flag is automatically set upon one byte receive

III. Flowchart
Start

Carry out initialization


including setting special register
such as SCON TMOD etc

If RI
is
0?

Read out SBUF data and


put it back

Display on LCD

If
TI is
0?

END

IV. Algorithm
Once the Serial Port has been properly configured, the serial port is ready to be used to
send data and receive data.

To write a byte to the serial port one must simply write the value to the SBUF (99h) SFR.
For example, if you wanted to send the letter "A" to the serial port, it could be
accomplished as easily as:

MOV SBUF,#A

Upon execution of the above instruction the 8051 will begin transmitting the character
via the serial port. Obviously transmission is not instantaneous--it takes a measureable
amount of time to transmit. And since the 8051 does not have a serial output buffer we
need to be sure that a character is completely transmitted before we try to transmit the
next character.

The 8051 lets us know when it is done transmitting a character by setting the TI bit in
SCON. When this bit is set we know that the last character has been transmitted and that
we may send the next character, if any. Consider the following code segment:

CLR TI ;Be sure the bit is initially clear


MOV SBUF,#A ;Send the letter A to the serial port
JNB TI,WAIT ;Pause until the TI bit is set.

The above three instructions will successfully transmit a character and wait for the TI bit
to be set before continuing. Thus the 8051 will pause on the JNB instruction until the TI
bit is set by the 8051 upon successful transmission of the character.

V. Problem Statement
Now-a-days, computer systems and electronic devices are the advancing technologies.
Microcontrollers are the best one as it just has to be only programmed and the device
starts working accordingly. We don’t have to make much change in the circuit. The
information in the device is not limited ,as we need to transmit and communicate with
other devise as well. Hence, to communicate with other devices, we need to have
interfacing between both the devices.

VI. Solution Domain


To design and build a computer-controlled device, you need skills in both circuit design
and software programming. The good news is that a couple of recent advances have
simplified the tasks involved. One is the introduction of microcontrollers themselves,
since they contain all of the elements of a computer on a single chip.
1. Define the task, i.e., serial communication with 8051
2. Write the control program for serial communication and burn on microcontroller
3. Design and connect the circuits for transmitter and receiver.
4. Test and debug

• Hardware specification:

 Trainer Kit
 Burning Kit
 Microcontroller
 LCD

• Software specification:

 Proload
 Keil
VII. APPLICATION

 It is used in robot communication.


 PC to PC communication.
 Pc to other devices.

Advantages:

1. Serial communication can span longer distances than parallel communication.


2. This communication is economical because in this we use less number of wires.
3. It is easy to establish and maintain connection.

Disadvantages:

1. It takes longer time to transmit data, as bit by bit transfer take place.
2. It is difficult to maintain synchronization in this communication.

You might also like