Vous êtes sur la page 1sur 20

In the name of God

By: AVTAR SINGH MALHI Uni. Roll No:90510414053

NWIET, DHUDIKE. MOGA

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.

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 for performance and security.

Exampleprinter, keyboard, video game player, microwave oven etc.

Aircraft electronics Trains Medical systems

Microprocessor vs. Microcontroller


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 a single chip fix amount of on-chip ROM, RAM, I/O ports for applications in which cost, power and space are critical single-purpose

Microcontroller
A microcontroller is an entire computer manufactured on a single chip. They have a high concentration of on-chip facilities such as serial ports, parallel input/output ports, timers, counters, interrupt control, analogto-digital converters, random access memory, read only memory, etc. ExampleMotorolas 6811, Intels 8051,

The 8051 Microcontroller


The 8051 is the first microcontroller of the MCS-51 family introduced by Intel Corporation at the end of the 1970s.

The 8051 family characteristics:

4K Bytes ROM 128 Bytes RAM two timer/counters (16 bit) A serial port 4 general purpose parallel input/output port Interrupt controller The 8051 can address 64K of external data memory and 64K of External program memory.

On-chip ROM for program code

Timer/Counter

On-chip RAM

Timer 1 Timer 0

CPU
Serial Port

OSC

Bus Control

4 I/O Ports

P0 P1 P2 P3

TxD RxD

Address/Data

P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (INT0)P3.2 (INT1)P3.3 (T0)P3.4 (T1)P3.5 (WR)P3.6 (RD)P3.7 XTAL2 XTAL1 GND

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

8051 (8031)

40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21

Vcc P0.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 PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8)

Vccpin 40 Vcc provides supply voltage to the chip.The voltage source is +5V.

C2 XTAL2 30pF C1

GNDpin 20ground
30pF

XTAL1

XTAL1 and XTAL2pins 19,18. Using a crystal oscillator we can observe the frequency on the XTAL2 pin..

GND

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, the microcontroller will reset and all values in registers will be lost. All values of 8051 registers will be Reset.

EApin 31external access

There is no on-chip ROM in 8031 and 8032 . The /EA pin is connected to GND to indicate the code is stored externally. /PSEN ALE 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.

ALE, I/O port pins

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 and data 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.

The 8051 has four I/O ports Port 0 pins 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).

PROGRAMMING WITH THE USE OF KEIL 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.

Devices which are Interfaced with 8051 microcontroller


LED Seven Segment Display LCD Display Relay Switch Buzzer

A simple project using P89V51RD2


Here weve designed, built and programmed a digital Stop Watch that counts from 00:00:00 to 99:99:99 on a LCD( liquid crystal display).

Interfacing of 8051 microcontroller with lcd(liquid crystal display)

Program to display STOP WATCH on liquid crystal display (LCD).


#include<reg51.h> sbit 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 char hur[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<=3;c++) { P0=hur[c]; dat(); delay(); } P0=0x85; cmd(); delay(); for(a=0;a<=2;a++) { P0=min[a]; dat(); delay(); } P0=0x89; cmd(); delay(); for(b=0;b<=2;b++) {P0=sec[b]; dat(); delay(); } while(1)
{

{ } }

Vous aimerez peut-être aussi