Post on 14-Apr-2018
7/30/2019 Embedded System (2)
1/20
By: AVTAR SINGH MALHI
Uni. Roll No:90510414053
NWIET, DHUDIKE. MOGA
In the name of God
7/30/2019 Embedded System (2)
2/20
Embedded system means the processor is embedded
into that application.
An embedded product uses a microprocessor or
microcontroller to do one task only. In an embedded system, there is only one application
software that is typically burned into ROM.
7/30/2019 Embedded System (2)
3/20
Perform a single task
Usually not general purpose.
Increasingly high performance.
Power, cost and reliability. HW-SW systems
Software is used for more features and flexibility
Hardware (processors, memory etc. are used forperformance and security.
7/30/2019 Embedded System (2)
4/20
Exampleprinter, keyboard, video game player,
microwave oven etc.
Aircraft electronics
Trains
Medical systems
7/30/2019 Embedded System (2)
5/20
Microprocessor vs. M icrocontrol ler
Microprocessor
CPU is stand-alone,
RAM, ROM,I/O,timer are separate
Designer can
decide on the
amount of ROM,
RAM and I/O ports.
Expansive
General-purpose
Microcontroller
CPU, RAM, ROM, I/O
and timer are all on asingle chip
fix amount of on-chip
ROM, RAM, I/O ports
for applications in which
cost, power and space
are critical
single-purpose
7/30/2019 Embedded System (2)
6/20
Microcontroller
A microcontroller is an entirecomputer manufactured on a singlechip.
They have a high concentration ofon-chip facilities such as serial ports,parallel input/output ports, timers,counters, interrupt control, analog-to-digital converters, random accessmemory, read only memory, etc.
ExampleMotorolas 6811, Intels 8051,
7/30/2019 Embedded System (2)
7/20
The 8051 M icrocontrol ler
The 8051 is the first microcontroller of the MCS-51 familyintroduced by Intel Corporation at the end of the 1970s.
The 8051 family characteristics:4K Bytes ROM128 Bytes RAMtwo timer/counters (16 bit)
A serial port4 general purpose parallel input/output portInterrupt controller
The 8051 can address 64K of external data memory and64K of External program memory.
7/30/2019 Embedded System (2)
8/20
CPU
On-chip
RAM
On-chip
ROM for
program
code
4 I/O Ports
Timer 0
Serial
PortOSC
Timer 1
Timer/Counter
Bus
Control
TxD RxDP0 P1 P2 P3
Address/Data
7/30/2019 Embedded System (2)
9/20
1234567
891011121314
151617181920
40393837363534
33323130292827
262524232221
P1.0P1.1P1.2P1.3P1.4P1.5P1.6
P1.7RST
(RXD)P3.0(TXD)P3.1
(T0)P3.4
(T1)P3.5
XTAL2XTAL1
GND
(INT0)P3.2(INT1)P3.3
(RD)P3.7(WR)P3.6
VccP0.0(AD0)P0.1(AD1)P0.2(AD2)P0.3(AD3)P0.4(AD4)P0.5(AD5)
P0.6(AD6)P0.7(AD7)EA
ALE
PSENP2.7(A15)P2.6(A14)
P2.5(A13)P2.4(A12)P2.3(A11)P2.2(A10)P2.1(A9)P2.0(A8)
8051
(8031)
7/30/2019 Embedded System (2)
10/20
o Vccpin 40Vcc provides supply voltage
to the chip.The voltage source
is +5V.
o GNDpin 20ground
o XTAL1 and XTAL2pins
19,18. Using a crystaloscillator we can observe the
frequency on the XTAL2 pin..
C2
30pF
C1
30pF
XTAL2
XTAL1
GND
7/30/2019 Embedded System (2)
11/20
RSTpin 9reset It is an input pin and is active highnormally low.
The high pulse must be high at least 2.
It is a power-on reset.
Upon applying a high pulse to RST, themicrocontroller will reset and all values in registers
will be lost.
All values of 8051 registers will be Reset.
7/30/2019 Embedded System (2)
12/20
EApin 31external access There is no on-chip ROM in 8031 and 8032 .
The /EA pin is connected to GND to indicate the code isstored externally.
/PSENALE are used for external ROM.
For 8051, /EA pin is connected to Vcc.
/ means active low.
/PSENpin 29program store enable This is an output pin and is connected to the OE pin of the
ROM.
7/30/2019 Embedded System (2)
13/20
ALEpin 30address latch enable
It is an output pin and is active high.
8051 port 0 provides both address and data.
The ALE pin is used for de-multiplexing the address anddata by connecting to the G pin of the 74LS373 latch.
I/O port pins
The four ports P0, P1, P2, and P3.
Each port uses 8 pins.
All I/O pins are bi-directional.
ALE, I /O port pins
7/30/2019 Embedded System (2)
14/20
The 8051 has four I/O ports Port 0pins 32-39P0P0.0P0.7 Port 1pins 1-8 P1P1.0P1.7 Port 2pins 21-28P2P2.0P2.7 Port 3pins 10-17P3P3.0P3.7 Each port has 8 pins. These 8 bits form a byte.
Each port can be used as input or output (bi-direction).
7/30/2019 Embedded System (2)
15/20
PROGRAMMING WITH THE
USE OF KEI L SOFTWARE
Write a program in embedded C language.
Execute it.
View the output of program on peripheral devices as
provided in Keil software.
Now burn the program on AT89C52 using flash magic
burner.
Now apply the chip with hardware.
7/30/2019 Embedded System (2)
16/20
LED
Seven Segment Display
LCD Display
Relay
Switch
Buzzer
Devices which are Interfaced
with 8051 microcontroller
7/30/2019 Embedded System (2)
17/20
A simple project using P89V51RD2
Here weve designed, built and programmed a digitalStop Watch that counts from 00:00:00 to 99:99:99on a LCD( liquid crystal display).
7/30/2019 Embedded System (2)
18/20
Interfacing of 8051 microcontroller with lcd(liquid crystal display)
7/30/2019 Embedded System (2)
19/20
Program to display STOP WATCH on liquid crystal display (LCD).#includesbit rs=P1^0; sbit e=P1^1; sbit sw1=P1^2; sbit sw2=P1^3;
unsigned char min[3]="Min"; unsigned char sec[3]="Sec";unsigned charhur[4]="Hour";void dat(); void delay(); void cmd(); void main(){ int g,h,i,j,k,l,a,b,c;P0=0x38; cmd(); delay();P0=0x0c; cmd(); delay();
P0=0x01; cmd(); delay();P0=0x06; cmd(); delay();P0=0x80; cmd(); delay();for(c=0;c
7/30/2019 Embedded System (2)
20/20