Presentation Title : 8051 Microcontroller
Course Title : Microprocessor and Assembly Languages
Course Code : CSE 3105
Presenting To : Presenting By :
Dr. Shaheena Sultana Sajid Hossain Khan
Professor and Chair ID: 0692210005101007
Dept. of CSE CSE 18
Notre Dame University Bangladesh Spring 2024
1
Our
Today’s
Topics
Introduction Features of 8051
1 2
Microcontroller
Pin
vs
Microprocessor 3 configuration 4
Architecture Application
5 6
2
The 8051 microcontroller is a very popular 8-bit microcontroller
introduced by Intel in the year 1981.
Initially, it came out as an N-type metal-oxide-semiconductor
(NMOS) based microcontroller, but later versions were based on
complementary metal-oxide-semiconductor(CMOS) technology.
These microcontrollers were named 80C51, where C in the name tells
that it is based on CMOS technology.
It is an 8-bit microcontroller which means the data bus is 8-bit.
Therefore, it can process 8 bits at a time.
3
Microprocessors
CPU for Computers
No RAM, ROM, I/O on CPU chip itself
Example: Intel's x86, Motorola’s 680x0
4
What is Microcontroller?
Micro Controller
Very Small A mechanism that controls
the operation of a machine
5
Microcontroller
• A smaller computer
• On-chip RAM, ROM, I/O ports...
• Example: Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and
PIC
6
7
8
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 Fix amount of on-chip
amount of ROM, RAM and ROM, RAM, I/O ports
I/O ports.
Expansive Not Expansive
9
The necessary tools for a Microprocessor/controller
CPU: Central Processing Unit
1
I/O: Input /Output 2
10
Bus: Address bus & Data bus
3
Memory: RAM & ROM 4
Timer
5
11
Interrupt
6
Serial Port 7
Parallel Port
8
12
Features
8 bit microcontroller originally
developed by Intel in 1980
High-performance CMOS
Technology
40 pin DIP IC
14
Features
Address bus is of 16 bit & data
bus is of 8 bit
4K bytes internal ROM
(Program memory)
128 bytes internal RAM
(Data memory)
15
Features
It has four 8 bit ports, total 32
I/O lines
Two 16-bit timers (T0 & T1)
Serial interface Communication
16
Features
64K external code & data
memory space
Internal memory consists of
on-chip ROM and on-chip
data RAM.
8051 implements a separate
memory space for programs (code)
and data.
17
8051 Family
The 8051 is a subset of the 8052
The 8031 is a ROM-less
17
18
ARCHITECTURE
19
20
8051
Pin diagram:-
21
22
XTAL2 and XTAL1 (18 and 19 pins)
The 8051 has an on-chip oscillator but requires an external
clock to run it
A quartz crystal oscillator is connected to inputs XTAL1
(pin19) and XTAL2 (pin18)
The quartz crystal oscillator also needs two capacitors of
30 pF value
23
RST (Pin 9)
RESET pin is an input and is active high (normally low)
Upon applying a high pulse to this pin, the
microcontroller will reset and terminate all activities
This is often referred to as a power-on reset
Activating a power-on reset will cause all values in the
registers to be lost
24
EA (pin 31) : external access
EA “external access’’, is an input pin and must be
connected to Vcc or GND
The 8051 family members all come with on-chip ROM to
store programs and also have an external code and data
memory.
Normally EA pin is connected to Vcc
EA pin must be connected to GND to indicate that the code
or data is stored externally.
25
PSEN (Pin 29)
PSEN, “program store enable’’, is an output pin
This pin is connected to the OE pin of the external memory.
For External Code Memory, PSEN = 0
For External Data Memory, PSEN = 1
26
27
I/O Port Pins
• The four 8-bit I/O ports P0, P1, P2 and P3 each uses 8
pins.
• All the ports upon RESET are configured as output, ready
to be used as input ports by the external device.
28
Port 0
Port 0 is also designated as AD0-AD7.
When connecting an 8051 to an external
memory, port 0 provides both address and
data.
The 8051 multiplexes address and data
through port 0 to save pins.
ALE indicates if P0 has address or data.
When ALE=0, it provides data D0-D7
When ALE=1, it has address A0-A7
29
Port 1 and Port 2
In 8051-based systems with no external
memory connection:
Both P1 and P2 are used as simple I/O.
In 8051-based systems with external memory
connections:
Port 2 must be used along with P0 to provide
the 16-bit address for the external memory.
P0 provides the lower 8 bits via A0 – A7.
P2 is used for the upper 8 bits of the 16-bit
address, designated as A8 – A15, and it
cannot be used for I/O.
30
Port 3
31
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.
32
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: EA must be externally
held low to enable the device to fetch code from external program memory
locations. If EA* Is held high, the device executes from internal program
memory. This pin also receives the programming supply voltage Vpp
during Flash programming. (applies for 89c5x MCU's)
33
Registers
A
R0
DPTR DPH DPL
R1
R2 PC PC
R3
R4 Some 8051 16-bit Register
R5
R6
R7
Some 8-bitt Registers of the 8051
34
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
RS1 RS0 Space in RAM
0 0 Bank0 00h-07h
0 1 Bank1 08h-0Fh
1 0 Bank2 10h-17h
1 1 Bank3 18h-1Fh
35
8051 ROM
36
8051 RAM with
addresses
37
8051 Peripheral
1. Timers
2. Serial Port
3. Interrupts
38
Advantage Disadvantage
1 Widely Used and 1 Limited Processing Power
Supported
2 Robust Peripheral Integration
2 Outdated Architecture
3 Low Power Consumption 3 Complex Instruction Set
39
Application
40
LED INTERFACING
41
7 SEGMENT INTERFACING
42
APPLICATION OF 8051
Automobile.
Rail Transport.
Industrial Processing.
Remote sensing.
Robotics.
Consumer electronics.
Security(e-commerce and smart cards).
Medical.
Defense application.
43
Project
44
Water Level Controller using
8051 Microcontroller
Water Level Controller using 8051
Microcontroller project will help in automatically
controlling the water motor by sensing the water
level in a tank. Here explains you how to detect and
control the water level in an overhead tank or any
other container. This system monitors the water
level of the tank and automatically switches ON the
motor whenever tank is empty.
The motor is switched OFF when the overhead tank
or container is FULL. Here, the water level of the
tank is indicated on LCD (Liquid crystal Display).
Using this system, we can avoid the overflow of the
water.
45
Thank you for your time and attention.
46