2. Why do we need to learn
Microprocessors/controllers?
• The microprocessor is the core of computer systems.
• Nowadays many communication, digital
entertainment, portable devices, are controlled by
them.
• A designer should know what types of components
he needs, ways to reduce production costs and
product reliable.
3. 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 higher performance or lower
power-consumption versions
▫ Cost per unit
4. General-purpose microprocessor
• CPU for Computers
• No RAM, ROM, I/O on CPU chip itself
• Example:Intel’s x86, Motorola’s 680x0
CPU
General-
Purpose
Micro-processor
Many chips on mother’s board
RAM ROM I/O
Port
Time
r
Seria
l
COM
Port
Data
Bus
Address Bus
General-Purpose Microprocessor System
5. Microcontroller
• 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
RAM
ROM
I/O
Port
Time
r
Seria
l
COM
Port
CP
U
A single chip
Microcontroller
6. 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
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
7. 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, lighting
control, paging, camera, pinball machines, toys, exercise equipment
etc.
• 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, climate
control, cellular phone, keyless entry
7
8. Comparison of the 8051 Family Members
3 FAMILY MEMBERS
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
9. 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
11. 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.
12. 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.
13. 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.
14. 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.
16. 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.
17. Port 3 • Port 3 can be used as input or
output.
• Port 3 has the additional
function of providing some
extremely important signals