1.microcontrollers For An Embedded System - 8051 Architecture
1.microcontrollers For An Embedded System - 8051 Architecture
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
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…..
Examples
8051 Microcontroller 20
8051 Microcontroller
• Intel introduced 8051, referred as MCS- 51, in
1981.
8051 Microcontroller 21
Suresh.P.Nair , HOD - ECE , RCET
Features of 8051
8 bit Processor for Serial Communication
8051 Microcontroller 23
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
8051 Microcontroller 27
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
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