0% found this document useful (0 votes)
34 views19 pages

1.microcontrollers For An Embedded System - 8051 Architecture

The document discusses the 8051 microcontroller, its architecture, features and applications. The 8051 microcontroller has on-chip RAM, ROM, I/O ports, timers and serial communication capabilities. It is an 8-bit microcontroller widely used in embedded systems due to its low cost and versatility.

Uploaded by

JERWIN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views19 pages

1.microcontrollers For An Embedded System - 8051 Architecture

The document discusses the 8051 microcontroller, its architecture, features and applications. The 8051 microcontroller has on-chip RAM, ROM, I/O ports, timers and serial communication capabilities. It is an 8-bit microcontroller widely used in embedded systems due to its low cost and versatility.

Uploaded by

JERWIN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

ET3491 EMBEDDED SYSTEMS

AND IOT DESIGN

UNIT I 8051 MICROCONTROLLER

Microcontrollers for an Embedded System – 8051


Architecture – Addressing Modes – Instruction Set –
Program and Data Memory – Stacks – Interrupts –
Timers/Counters – Serial Ports – Programming.
Microcontrollers for an Embedded System

• Microcontrollers and embedded processors


• Overview of the 8051 family
• 8051 Architecture
Cont ……
• General-purpose microprocessors:

– Must add RAM, ROM, I/O ports, and timers


externally to make them functional
– Make the system bulkier and much more
expensive
– Have the advantage of versatility on the amount
of RAM, ROM, and I/O ports

General-purpose microprocessors
• CPU
• External RAM, ROM, I/O
• (No internal RAM, ROM, I/O ports in the CPU)

8051 Microcontroller 6
Suresh.P.Nair , HOD - ECE , RCET
Microcontroller
• The fixed amount of on-chip ROM, RAM, and
number of I/O ports makes them ideal for many
applications in which cost and space are critical
• In many applications, the space it takes, the
power it consumes, and the price per unit are
much more critical considerations than the
computing power
• An embedded product uses a microprocessor(or
microcontroller) to do one task and one task only
• There is only one application software that is
typically burned into ROM

Cont ……
• A PC, in contrast with the embedded system, can be
used for any number of applications
• It has RAM memory and an operating system that
loads a variety of applications into RAM and lets the
CPU run them
• A PC contains or is connected to various embedded
products
• Each one peripheral has a microcontroller inside it
that performs only one task
Microcontroller
• A smaller computer on a CHIP
• On-chip RAM, ROM, I/O Ports, Timer, Serial
Controller…
• Example: Motorola’s 6811, Intel’s 8051, Atmel 32

8051 Microcontroller 9
Suresh.P.Nair , HOD - ECE , RCET

Microprocessor vs. Microcontroller


Microprocessor Microcontroller
• CPU is stand-alone, RAM, • CPU, RAM, ROM, I/O and
ROM, I/O, timer are separate timer are all on a single chip

• Designer can decide on the • Fixed amount of on-chip ROM,


amount of ROM, RAM and I/O RAM, I/O ports
ports.
• Not Expansive
• Expansive
• Single-purpose
• Versatility
• Special Purpose.
• General-purpose
10
Suresh.P.Nair , HOD - ECE , RCET
Some embedded products using
microcontrollers
• 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, lighting control, paging, camera, pinball
machines, toys, exercise equipment
• Office
– Telephones, computers, security systems, fax machines,
microwave, copier, laser printer, color printer, paging
• Auto
– Trip computer, engine control, air bag, ABS, instrumentation,
security system, transmission control, entertainment, climate
control, cellular phone, keyless entry

x86 PC Embedded Applications


• Many manufactures of general-purpose
• microprocessors have targeted their microprocessor
for the high end of the embedded market
• There are times that a microcontroller is
inadequate for the task
• When a company targets a generalpurpose
microprocessor for the embedded market, it
optimizes the processor used for embedded
systems
• Very often the terms embedded processor and
microcontroller are used interchangeably
Cont…
• One of the most critical needs of an embedded system
is to decrease power consumption and space
• In high-performance embedded processors, the trend is
to integrate more functions on the CPU chip and let
designer decide which features he/she wants to use
• In many cases using x86 PCs for the high-end
embedded applications
• Saves money and shortens development time
– A vast library of software already written
– Windows is a widely used and well understood platform

Choosing a Microcontroller
• 8-bit microcontrollers
– Motorola’s 6811
– Intel’s 8051
– Zilog’s Z8
– Microchip’s PIC
• There are also 16-bit and 32-bit microcontrollers
made by various chip makers
Criteria for Choosing a Microcontroller
• Meeting the computing needs of the task at hand
efficiently 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 higherperformance or lower
power-consumption versions
– Cost per unit

Cont….
• Availability of software development tools, such as
compilers, assemblers, and debuggers
• Wide availability and reliable sources of the
microcontroller
• The 8051 family has the largest number of diversified
(multiple source) suppliers
– Intel (original)
– Atmel
– Philips/Signetics
– AMD
– Infineon (formerly Siemens)
– Matra
– Dallas Semiconductor/Maxim
OVERVIEW OF 8051 FAMILY
8051 Microcontroller:
• Intel introduced 8051, referred as MCS- 51, in 1981
– The 8051 is an 8-bit processor
• The CPU can work on only 8 bits of data at a time
The 8051 had
• 128 bytes of RAM
• 4K bytes of on-chip ROM
• Two timers
• One serial port
• Four I/O ports, each 8 bits wide
• 6 interrupt sources
– The 8051 became widely popular after allowing other
manufactures to make and market any flavor of the
8051, but remaining code-compatible
8051 MICROCONTROLLER BLOCK DIAGRAM
CONT…..

• The 8051 is a subset of the 8052


• The 8031 is a ROM-less 8051
• Add external ROM to it
• You lose two ports, and leave only 2 ports for I/O operations

Examples

8051 Microcontroller 20
8051 Microcontroller
• Intel introduced 8051, referred as MCS- 51, in
1981.

• The 8051 is an 8-bit microcontroller

– The CPU can work on only 8 bits of data at a time

8051 Microcontroller 21
Suresh.P.Nair , HOD - ECE , RCET

Features of 8051
 8 bit Processor for Serial Communication

 16 bit Address bus  5 Vector Interrupts ( 2


External, 3 Internal -
 4KB Internal ROM Timer0,Timer1,Serial)

 128 Bytes Internal RAM  On Chip Clock Oscillator

 Four 8 BIT I/O PORTS

 Two 16 Bit timers/Counters

 On Chip Full Duplex UART


8051 Microcontroller 22
Pin Diagram

8051 Microcontroller 23

Pin Description Summary


PIN TYPE NAME AND FUNCTION
Vss I Ground: 0 V reference.
Vcc I Power Supply: This is the power supply voltage for normal,
idle, and power-down operation.
P0.0 - P0.7 I/O Port 0: Port 0 is an open-drain, bi-directional I/O port. Port
0 is also the multiplexed low-order address and data
bus during accesses to external program and data
memory.
P1.0 - P1.7 I/O Port 1: Port I is an 8-bit bi-directional I/O port.

P2.0 - P2.7 I/O Port 2: Port 2 is an 8-bit bidirectional I/O. Port 2 emits the
high order address byte during fetches from external
program memory and during accesses to external data
memory that use 16 bit addresses.
P3.0 - P3.7 I/O Port 3: Port 3 is an 8 bit bidirectional I/O port. Port 3 also
serves special features as explained. 24
Pin Description Summary
PIN TYPE NAME AND FUNCTION
RST I Reset: A high on this pin for two machine cycles while the
oscillator is running, resets the device.
ALE O Address Latch Enable: Output pulse for latching the low byte
of the address during an access to external memory.
PSEN* O Program Store Enable: The read strobe to external program
memory. When executing code from the 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 I External Access Enable/Programming Supply Voltage: Vpp
pin also receives the programming supply voltage Vpp
during Flash programming. (applies for 89c5x MCU's)

25

• Pin 31 (EA/VPP):
Pin diagram
EA = 0 External memory
EA = 1 Internal memory
VPP:
During Flash Programming, this Pin receives 12V Programming
Enable Voltage.

• Pin 30 (ALE/PROG):
ALE = 0 Data
ALE = 1 Address

PROG - During Flash Programming, this pin acts as program


pulse input.
8051 Microcontroller 26
Pin 29 (PSEN):
Pin diagram

Pin 29 is the Program Store Enable Pin (PSEN). Using this


pins, external Program Memory can be read.

PSEN = 1 internal ROM


PSEN = 0 external ROM

8051 Microcontroller 27

Detailed Block Diagram

8051 Microcontroller 28
Suresh.P.Nair , HOD - ECE , RCET
Program Status Word [PSW]

C AC F0 RS1 RS0 OV F1 P
Carry Parity
Auxiliary Carry User Flag 1

User Flag 0 Register Bank Select Overflow

P = 0 ----> If no.of ones in result are even


P = 1 ----> If no.of ones in result are odd

8051 Microcontroller 29
Suresh.P.Nair , HOD - ECE , RCET

Register selection
RS1 RS2 Bank Selected
0 0 Bank0
0 1 Bank1
1 0 Bank2
1 1 Bank3

8051 Microcontroller 30
8051 Register Banks with address

8051 Microcontroller 32
Special Function Registers [SFR]

8051 Microcontroller 33
Suresh.P.Nair , HOD - ECE , RCET

Special Function Registers [SFR]


Special Function Registers [SFR]

You might also like