18
Introduction to microprocessor 8051 B.V.S.RAGHAVA 12MT06PED005

12 mt06ped005

Embed Size (px)

Citation preview

Introduction

to

microprocessor 8051

B.V.S.RAGHAVA

12MT06PED005

Why do we need to learn

Microprocessors/controllers?

• The microprocessor is the core of computer systems.

• Nowadays many communication, digitalentertainment, portable devices, are controlled bythem.

• A designer should know what types of componentshe needs, ways to reduce production costs andproduct reliable.

Criteria for Choosing a Microcontroller

• Meeting the computing needs of the task at handefficiently and cost effectively

▫ Speed

▫ Packaging

▫ Power consumption

▫ The amount of RAM and ROM on chip

▫ The number of I/O pins and the timer on chip

▫ How easy to upgrade to higher performance or lowerpower-consumption versions

▫ Cost per unit

• CPU for Computers

• No RAM, ROM, I/O on CPU chip itself

• Example:Intel’s x86, Motorola’s 680x0

CPU

General-Purpose Micro-processor

RAM ROM I/O Port

Timer

Serial COM Port

Data Bus

Address Bus

General-Purpose Microprocessor System

Many chips on mother’s board

General-purpose microprocessor

RAMROM

I/O Port

Timer

Serial COM Port

CPU

• A smaller computer• On-chip RAM, ROM, I/O ports,timers etc

• Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X

A single chip

Microcontroller

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

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

Microprocessor vs. Microcontroller

Microcontroller Applications

• Home▫ Appliances, intercom, telephones, security systems, garage door

openers, answering machines, fax machines, home computers, TVs,cable TV tuner, VCR, camcorder, remote controls, video games,cellular phones, musical instruments, sewing machines, lightingcontrol, paging, camera, pinball machines, toys, exercise equipmentetc.

• Office▫ Telephones, computers, security systems, fax machines, microwave,

copier, laser printer, color printer, paging etc.

• Auto▫ Trip computer, engine control, air bag, ABS, instrumentation,

security system, transmission control, entertainment, climatecontrol, cellular phone, keyless entry

7

Feature 8051 8052 8031

ROM (program space in bytes) 4K 8K 0K

RAM (bytes) 128 256 128

Timers 2 3 2

I/O pins 32 32 32

Serial port 1 1 1

Interrupt sources 6 8 6

Comparison of the 8051 Family Members

3 FAMILY MEMBERS

8051 Features

• 64KB Program Memory address space

• 64KB Data Memory address space

• 4K bytes of on-chip Program Memory

• 128 bytes of on-chip Data RAM

• 32 bidirectional and individually addressable 1/0 lines

• Two 16-bit timer/counters

• On-chip clock oscillator

9

PIN DIAGRAM:

Input/output Ports (I/O Ports)

8051 microcontrollers have 4 I/O ports each

comprising 8 bits which can be configured as inputs

or outputs.

Pin configuration, i.e. whether it is to be configured

as an input or an output, depends on its logic state.

Port 0

The P0 port is characterized by two functions. If

external memory is used then the lower address

byte (addresses A0-A7) is applied on it.

Otherwise, all bits of this port are configured as

inputs/outputs.

Port 1

P1 is a true I/O port, because it doesn't have any

alternative functions as is the case with P0, but

can be configured as general I/O only.

It has a pull-up resistor built-in and is completely

compatible with TTL circuits.

Port 2

P2 acts similarly to P0 when external memory is used. Pins

of this port occupy addresses intended for external memory

chip.

This time it is about the higher address byte with addresses

A8-A15.

When no memory is added, this port can be used as a

general input/output port showing features similar to P1.

Get a byte from P2 and send it to P1.

Port 3

All port pins can be used as general I/O, but they also have

an alternative function.

In order to use these alternative functions, a logic one (1)

must be applied to appropriate bit of the P3 register.

In terms of hardware, this port is similar to P0, with the

difference that its pins have a pull-up resistor built-in.

Port 3 • Port 3 can be used as input oroutput.

• Port 3 has the additionalfunction of providing someextremely important signals