Professional Documents
Culture Documents
SYNOPSIS
REPORT
ON
EMBEDDED SYSTEM
Submitted in the partial fulfillment of the requirement for the award of degree of
Bachelors of Technology
In
Submitted to
Mr. SHASHI RANA
Name of the Student: Hiteshwar Dutt
Name of the Training Guide:
Dapinder Lalotra
University Roll Number: 2010ECA1721
INFOWIZ is an ISO 9001:2008 certified company. It has been working from more
than 5 years in the field of IT and Web Development and has been providing its
clients with its exceptional quality and Web Design, Development and SEO
service.Infowizs clients ranges from individuals to professionals and small, medium
and large scaled Businesses. In 2008, Info wiz entered into IT outsourcing and
partnered successfully with many offshore Web and SEO companies of
US,UK,France,Ireland,Canada and
Australia etc to provide them quality and timely services. INFOWIZ does not boost
itself of being the best Development Company but automatically enjoys reputable
position among top Web Development companies because Info wiz timely deliver and
quality work. Employees of Info wiz dont claim for something they cant deliver.
Before taking a project from a client, employee asks Info wiz for all their needs and
requirements. After that skilled of employee and team of professionals analyze the
need and come up with a plan as how they can work to completely satisfy those
requirements of our clients. Then they work step by step keeping their client informed
about the progress and complete the project in time giving complete contentment to
them .From concept building to implementation of any project, their team manages
projects efficiently up to its completion. Their tactful strategy and dedication toward
quality work has given us to the recognition they enjoy and that is why their clients
only come back to them whenever they require any kind of web related solutions.
They do not only emphasize on formulating an attractive solution to their clients, but
they believe in providing a workable solution. INFOWIZ offers research based Search
Engine Marketing product that help to achieve greater insights to your online
business. Their Research & Development arm offers SEO tools for SEM
professionals.
2
ACKNOWLEDGEMENT
Success is a sweet fruit, which everyone want to strives to taste. To achieve this goal,
one has to put in physical and mental efforts. Each time I write this report, gain strong
appreciation for the following fact: I could not do it without the help of many talented
and dedicated people. So I wish to express my appreciation for those whose help has
been most valuable.
Firstly, I would like to express our gratitude and appreciation to Mr.Harjit Singh
(head of company), who explained us everything about training process as the
company and made us familiar with the company staff. We are equally grateful to Er.
Sunil kumar (instructor),who shorted out many of our problems regarding the training
and gave us the proper material to work with.
We are also grateful to(training and placement officer)for arranging the
six week training for us and providing us with all necessary information about the
same.
Finally I would like to say thanks to all the people of the company for their kind
operation.
ABSTRACT
The usual reason for embedding a computer is to interact with the
environment, often by monitoring and controlling external machinery. Many
embedded systems have substantially
different design constraints than desktop computing applications. No single
characterization applies to the diverse spectrum of embedded systems. Some
combination of cost pressure, long life-cycle, real-time requirements, reliability
requirements, and design culture dysfunction can make it difficult to be successful
applying traditional computer design methodologies and tools to embedded
applications there is currently little tool support for expanding embedded computer
design to the scope of holistic embedded system design. Knowing the strengths and
weaknesses of current approaches can set expectations appropriately, identify risk
areas to tool adopters, and suggest ways in which tool builders can meet industrial
needs?
Many embedded systems have requirements that differ significantly
both in details and in scope from desktop computers. The demands of the specific
application and the interface with external equipment may dominate the system
design. Long life-cycles and in some cases extreme cost sensitivity require more
attention to optimization based on these goals rather than maximizing the
computational throughput.
Recent interest in hardware/software co design is a step in the right
direction, as it permits tradeoffs between hardware and software that are critical for
more cost-effective embedded systems.
Introduction:-
We are living in the Embedded World. You are surrounded with many embedded
products and your daily life largely depends on the proper functioning of these gadgets.
Television, Radio, CD player of your living room, Washing Machine or Microwave
Oven in your kitchen, Card readers, Access Controllers, Palm devices of your work space
enable you to do many of your tasks very effectively. Apart from all these, many
controllers embedded in your car take care of car operations between the bumpers and
most of the times you tend to ignore all these controllers.
Theoretically, an embedded controller is a combination of a piece of microprocessor
based hardware and the suitable software to undertake a specific task.
These days designers have many choices in microprocessors/ microcontrollers.
Especially, in 8 bit and 32 bit, the available variety really may overwhelm even an
experienced designer. Selecting a right microprocessor may turn out as a most difficult
first step and it is getting complicated as new devices continue to pop-up very often.
In the 8 bit segment, the most popular and used architecture is Intel's 8031. Market
acceptance of this particular family has driven many semiconductor manufacturers to
develop something new based on this particular architecture. Even after 25 years of
existence, semiconductor manufacturers still come out with some kind of device using
this 8031 core.
EMBEDDED SYSTEM
Any electronic system that uses a CPU chip, but that is not a general-purpose
workstation, desktop or laptop computer is known as embedded system. Such systems
generally use microprocessors; microcontroller or they may use custom-designed
chips or both. They are used in automobiles, planes, trains, space vehicles, machine
tools, cameras, consumer and office appliances, cell phones, PDAs and other
handhelds as well as robots and toys. The uses are endless, and billions of
microprocessors are shipped every year for a myriad of applications. In embedded
systems, the software is permanently set into a read-only memory such as a ROM or
flash memory chip, in contrast to a general-purpose computer that loads its programs
into RAM each time.
o EMBEDDED SYSTEM APPLICATIONS: Consumer electronics, e.g., cameras, cell phones etc
Consumer products, e.g. washers, microwave ovens etc.
Automobiles (anti-lock braking, engine control etc.)
Industrial process controller &defence applications.
Computer/Comm. products, e.g. printers, FAX machines etc.
Medical Equipments.
ATMs
Aircrafts
There are two types of Microcontroller architecture designed for embedded system
development. These are:
guarantee performance may be possible. On the other hand, many events may be a
periodic, in which case the maximum event arrival rate must be estimated in order to
accommodate worst case situations. Most embedded systems have a significant
reactive component.
Design challenge:
Worst case design analyses without undue pessimism in the face of hardware
with statistical performance characteristics (e.g., cache memory).
Design challenges:
Packaging and integration of digital, analog, and power circuits to reduce size.
Safe and reliable
Some systems have obvious risks associated with failure. In mission-critical
o History of 8051
Quantity
1) ROM
4K bytes
2) RAM
128 bytes
3) Timer
4) I/O pins
32
5) Serial port
6) Interrupt sources
11
o 8051
ARCHITECTURE
OVERVIEW
The 8051 family is one of the most common microcontroller architectures used
worldwide. 8051 based microcontrollers are offered in hundreds of variants from
many different silicon manufacturers 7.
The 8051 is based on an 8-bit CISC core with Harvard architecture. It's an 8-bit CPU,
optimized for control applications with extensive Boolean processing (single-bit logic
capabilities), 64K program and data memory address space and various on-chip
peripherals.
Whether it's low power operation, higher frequency performance, expanded on-chip
RAM, or an application-specific requirement, there's a version of the 8051
microcontroller that's right for the job. When it's time to upgrade product features and
functionality, the 8051 architecture puts you on the first step of a smooth and costeffective upgrade path - to the enhanced performance of the 151 and 251
microcontrollers.
12
There are four ports P0, P1, P2 and P3 each use 8 pins, making them 8-bit ports.
All the ports upon RESET are configured as output, ready to be used as output ports.
To use any of these ports as an input port, it must be programmed.
14
Port 0:- Port 0 occupies a total of 8 pins (pins 32-39) .It can be used for input
or output. To use the pins of port 0 as both input and output ports, each pin
must be connected externally to a 10K ohm pull-up resistor. This is due to the
fact that P0 is an open drain, unlike P1, P2, and P3.Open drain is a term used
for MOS chips in the same way that open collector is used for TTL chips.
With external pull-up resistors connected upon reset, port 0 is configured as an
output port. For example, the following code will continuously send out to
port 0 the alternating values 55H and AAH
Port 0 as input: - With resistors connected to port 0, in order to make it an
input, the port must be programmed by writing 1 to all the bits. In the
following code, port 0 is configured first as an input port by writing 1's to it,
and then data is received from the port and sent to P1.
Dual role of port 2:- In systems based on the 8751, 8951, and DS5000, P2 is
used as simple I/O. However, in 8031-based systems, port 2 must be used
along with P0 to provide the 16-bit address for the external memory. As
shown in pin configuration 8051, port 2 is also designed as A8-A15, indicating
the dual function. Since an 8031 is capable of accessing 64K bytes of external
memory, it needs a path for the 16 bits of the address. While P0 provides the
lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of the
address. In other words, when 8031 is connected to external memory, P2 is
used for the upper 8 bits of the 16 bit address, and it cannot be used for I/O.
Port 3:- port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as
input or output. P3 does not need any pull-up resistors, the same as P1 and P2
did not. Although port 3 is configured as an output port upon reset. Port 3 has
16
PORT 3
Function
pin
1) P3.0
RxD
10
2) P3.1
TxD
11
3) P3.2
___
12
Int0
4) P3.3
___
13
Int1
5) P3.4
T0
14
6) P3.5
T1
15
7) P3.6
___
16
WR
8) P3.7
___
17
RD
P3.0 and P3.1 are used for the RxD and TxD serial communications signals. Bits P3.2
and P3.3 are set aside for external interrupts. Bits P3.4 and P3.5 are used for timers 0
and 1. Finally P3.6 and P3.7 are used to provide the WR and RD signals of external
memories connected in 8031 based systems.
ALE/PROG :- Address Latch Enable is an output pulse for latching the low
byte of the address during accesses to external memory. This pin is also the
program pulse input (PROG) during Flash programming. In normal operation,
ALE is emitted at a constant rate of 1/ 6 the oscillator frequency and may be
used for external timing or clocking purposes. Note, however, that one ALE
pulse is skipped during each access to external data memory. If desired, ALE
operation can be disabled by setting bit 0 of SFR location 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the
17
pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
PSEN :- Program Store Enable is the read strobe to external program memory.
When the AT89S8252 is executing code from external program memory,
PSEN is activated twice each machine cycle, except that two PSEN activations
are skipped during each access to external data memory.
EA/VPP:-External Access Enable. EA must be strapped to GND in order to
enable the device to fetch code from external program memory locations
starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is
programmed, EA will be internally latched on reset. EA should be strapped to
VCC for internal program executions. This pin also receives the 12-volt
programming enable voltage (VPP) during Flash programming when 12-volt
programming is selected.
XTAL1:- Input to the inverting oscillator amplifier and input to the internal
clock operating circuit.
XTAL2 :-Output from the inverting oscillator amplifier.
There are two types of programming language used for microcontroller programming:
1) LED Interfacing
#include<reg51.h>
void delay(unsigned int time);
void main(void)
0{
While(1)
{
P2=0xff;
delay(20);
P2=0x55;
}
}
void delay(unsigned int time)
{
Unsigned intI,j;
For(i=0;i<time;i++)
For(j=0;j<=1275;j++);
}
21
The function of each of the connections is shown in the table below: Pins 1 & 2 are the power supply lines, VSS & VDD. The VDD pin should be
connected to the positive supply & VSS to the 0V supply or ground.
Although the LCD module data sheets specify 5V D.C. supply (at only a few
milliamps), supplies of 6V & 4.5V both work well, and even 3V is sufficient for some
modules. Consequently, these modules can be effectively and economically powered
by batteries.
Pin 3 is a control pin, VEE, which is used to alter the contrast of the display.
Ideally, these pin should be connected to a variable voltage supply. A preset
potentiometer connected between the power supply lines, with its wiper
connected to the contrast pin is suitable in many cases, but be aware that some
modules may require a negative potential; as low as 7V in some cases. For
absolute simplicity, connecting this pin to 0V will often suffice. Ideally, these
pin should be connected to a variable voltage supply. A preset potentiometer
connected between the power supply lines, with its wiper connected to the
contrast pin is suitable in many cases, but be aware that some modules may
require a negative potential; as low as in some cases. For absolute simplicity,
connecting this pin to
22
Pin
is NAME
FUNCTION
register select
(RS) line. Pin
no.
1
Vss
Ground
Vdd
+ve supply
Vee
contrast
RS
Register select
R/W
Read/Write
Enable
D0
Data Bit 0
D1
Data Bit 1
D2
Data Bit 2
10
D3
Data Bit 3
11
D4
Data Bit 4
12
D5
Data Bit 5
13
D6
Data Bit 6
14
D7
Data Bit 7
Three command control inputs. When this line is low, data bytes transferred to the
display are treated as commands, and data bytes read from the display indicate its
status. By setting the RS line high, character data can be transferred to and from the
module.
Pin 5 is (R/W) line. This line is pulled low in order to write commands or
character data to the module, or pulled high to read character data or status
information from its registers.
Pin 6 is Enable (E) line. This input is used to initiate the actual transfer of
commands or character data between the module and the data lines. When
writing to the display, data is transferred only on the high to low transition of
this signal. However, when reading from the display, data will become
23
available shortly after the low to high transition and remain available until the
signal falls low again.
Pins 7 to 14 are the eight data bus lines (D0 to D7). Data can be transferred to
and from the display, either as a single 8-bit byte or as two 4-bit nibbles. In
the latter case, only the upper four data lines (D4 to D7) are used. This $-bit
mode is beneficial when using a microcontroller, as fewer I/O lines are
required.
24
void main()
{
lcd_cmd(0x38); //init. LCD 2 lines, 5x7 matrix
msdelay(50);
lcd_cmd(0x0E); //Display On, Cursor On
msdelay(50);
lcd_cmd(0x01); //Clear LCD
msdelay(50);
lcd_cmd(0x06); //Shift Cursor Right
msdelay(50);
lcd_cmd(0x80); //Line 1,Position 0
msdelay(50);
lcd_data('G'); //Display Letter N
msdelay(50);
lcd_data('A');
msdelay(50);
lcd_data('U');
msdelay(50);
lcd_data('R');
msdelay(50);
25
lcd_data('A');
msdelay(50);
lcd_data('V);
msdelay(50);
}
voidlcd_cmd(unsigned char value)
{
ldata = value; //Put Value on Lcd Port
rs = 0;
rw = 0;
en = 1; //strobe the enable pin
msdelay(1);
en = 0;
}
voidlcd_data(unsigned char value)
{
ldata = value; //Put Value on Lcd Port
rs = 1;
rw = 0;
en = 1; //strobe the enable pin
msdelay(1);
en = 0;}
voidmsdelay(unsigned int time)
{
inti,j;
for(i=0;i<=time;i++)
for(j=0;j<=1275;j++);
}
26
#include<reg51.h>
sbitrs=P3^0;
sbitrw=P3^1;
sbit en=P3^2;
sfrldata=0x90;
voidlcom(unsigned char value);
voidldat(unsigned char value);
delay(50);
lcom(0x01);
TMOD=0X20;
TH1=0XFD;
TCON=0X00;
SCON=0X50;
TR1=1;
while(1)
{
while(RI==0);
mybyte=SBUF;
ldat(mybyte);
}
RI=0;
}
delay(5);
en=0;
28
}
void delay(unsigned int time)
{
unsignedintk,j;
for(k=0;k<time;k++)
for(j=0;j<=1275;j++);
}
29
void compare()
{
if(m == 0X0F)
m = 0X09;
if(m == 0X1F)
m = 0X19;
if(m == 0X2F)
m = 0X29;
if(m == 0X3F)
m = 0X39;
if(m == 0X4F)
m = 0X49;
if(m == 0X5F)
30
m = 0X59;
if(m == 0X6F)
m = 0X69;
if(m == 0X7F)
m = 0X79;
if(m == 0X8F)
m = 0X89;
if(m == 0XFF)
m = 0X99;
if(m == ~0X01)
m = 0X99;
}
voidmsdelay(unsigned int time)
{
inti,j;
for(i=0;i<=time;i++)
for(j=0;j<=1275;j++);
}
31
PIC MICROCONTROLLER
PIC is a family of modified Harvard architecture microcontrollers made by Microchip
Technology, derived from the PIC1650 originally developed by General Instrument's
Microelectronics Division. The name PIC initially referred to "Peripheral Interface
Controller".
PICs are popular with both industrial developers and hobbyists alike due to their low
cost, wide availability, large user base, extensive collection of application notes,
availability of low cost or free development tools, and serial programming (and reprogramming with flash memory) capability. They are also commonly used in
educational programming as they often come with the easy to use 'pic logicator'
software.
History
32
In 1985, General Instrument spun off their microelectronics division and the new
ownership cancelled almost everything board peripherals (serial communication
modules, UARTs, motor control kernels, etc.) and program memory from 256 words
to 64k words and more (a "word" is one assembly language instruction, varying from
12, 14 or 16 bits depending on the specific PIC micro family).
PIC and PICmicro are registered trademarks of Microchip Technology. It is generally
thought that PIC stands for Peripheral Interface Controller,
and PIC1650 devices was "Programmable Interface Controller". The acronym was
quickly replaced with "Programmable Intelligent Computer".
PIN DIAGRAM(18f4520)
33
FEATURES
34
35
36