1346 A Single Chip Microcomputer

Post on 29-Nov-2014

3.430 views 2 download

description

visit: www.techbed.blogspot.com

Transcript of 1346 A Single Chip Microcomputer

Study of 8051 – A Single Chip Micro Computer

A Micro controller is a ‘complete computer’ on a single chip…

CPU/Microprocessor

Memory/ Hard Disk/RAM

I/O Ports/ I/O Devices

Micro controller Vs Micro processor

8051 8085

ROM/27C512

RAM/6264

I/O Ports/8255

Micro controller Vs Micro processor A complete computer RAM, ROM, I/O ports

on chip itself Application specific Fixed amount of

ROM,RAM,I/O ports available

Cheap and takes up less space

A CPU only RAM, ROM, I/O ports

are provided externally General purpose use Flexibility to choose

ROM,RAM,I/O ports to be connected

Costly & Bulky as compared to a micro controller

Micro controller & Embedded Processors

Embedded Processors are used for complex systems that require high performance and processing capability. For e.g. Air Traffic monitoring and control, communication systems on spacecrafts etc.

Overview of 8051 family

Feature 8051 8052 8031

ROM 4K 8K 0K

RAM 128 bytes 256 bytes 128 bytes

I/O pins 32 32 32

Timers 2 3 2

Serial Port 1 1 1

Interrupts 6 8 6

Block Diagram of 8051

8-bit Controller Data Bus (8 bits) Address Bus (16-

bits) 5V Power Supply 0 – 24MHz

CPU RAM ROM

I/O

PORTSTIMERS

SERIAL PORT

Architecture of 8051

CPU

On-chip RAM (128 bytes)

On-chip ROM for program code(4K)

4 I/O Ports

Timer 0

Serial PortOSC

External interrupts

Timer 1

Timer/Counter

Bus Control

TxD RxDP0 P1 P2 P3

Address/Data

Counter Inputs

Interrupt Control

1234567891011121314151617181920

4039383736353433323130292827262524232221

P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.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/VPPALE/PROG

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)

Pin Diagram of 8051

Port 1

Port 3

Port 2

Port 0

Application Development using 8051 (Development Tools)1. Keil Software

2. Universal Programmer/ Flash Magic

3. Soldering kit

4. Multi-meter

5. CAD Tools (ORCAD etc.)

Application Development using 8051 (Development Steps)1. Connecting Power Supply and Crystal

2. Connecting RESET circuit

3. I/O interfacing with 8051

4. Writing Application Software

5. Burning the program in 8051 ROM

Vcc +5V

U1

AT89C51

91819

20

29

30

31

40

12345678

2122232425262728

1011121314151617

3938373635343332

RSTXTAL2XTAL1

GND

PSEN

ALE/PROG

EA/VPP

VCC

P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7

P2.0/A8P2.1/A9

P2.2/A10P2.3/A11P2.4/A12P2.5/A13P2.6/A14P2.7/A15

P3.0/RXDP3.1/TXD

P3.2/INTOP3.3/INT1

P3.4/TOP3.5/T1

P3.6/WRP3.7/RD

P0.0/AD0P0.1/AD1P0.2/AD2P0.3/AD3P0.4/AD4P0.5/AD5P0.6/AD6P0.7/AD7

C133pF C2 33pF

GND

11.0592 MHz

Connecting Power Supply and Crystal

AT89C51

Vcc +5V

U1

AT89C51

91819

20

29

30

31

40

12345678

2122232425262728

1011121314151617

3938373635343332

RSTXTAL2XTAL1

GND

PSEN

ALE/PROG

EA/VPP

VCC

P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7

P2.0/A8P2.1/A9

P2.2/A10P2.3/A11P2.4/A12P2.5/A13P2.6/A14P2.7/A15

P3.0/RXDP3.1/TXD

P3.2/INTOP3.3/INT1

P3.4/TOP3.5/T1

P3.6/WRP3.7/RD

P0.0/AD0P0.1/AD1P0.2/AD2P0.3/AD3P0.4/AD4P0.5/AD5P0.6/AD6P0.7/AD7

+ C310uF, 16V

R110K

GND

Connecting RESET circuit

Writing application Software

A LED Blinking program

ORG 0H

START: SETB P3.7

SETB P3.6

ACALL DELAY

CLR P3.7

CLR P3.6

ACALL DELAY

JMP START

DELAY: MOV R5, #11

H3: MOV R4, #248

H2: MOV R3, #255

H1: DJNZ R3, H1

DJNZ R4, H2

DJNZ R5, H3

RET

END

Burning the program in 8051 ROM

•Use a Universal Programmer to program 8051

•Use a PC based programming software like Flash Magic