Professional Documents
Culture Documents
Systems
Paper Code: AEIE 702
PART 1
THE 8051
MICROCONTROLLERS
Objectives
Table
Some Embedded Products
Using Microcontrollers
The 8051 has a total of four I/O ports, each 8 bits wide.
Although the 8051 can have a maximum of 64K bytes of on-chip ROM,
many manufacturers have put only 4K bytes on the chip.
This has led to many versions of the 8051 with different speeds and
amounts of on-chip ROM marketed by more than half a dozen
manufacturers.
Presently, different types of microcontroller are manufactured by different
semiconductor companies like Zilog, Motorola, Texas Instruments, Dallas
Semiconductors, Phillips, Siemens, Atmel, Microchip, Analog Device etc.
n-bit the n refers to the data bus width of the CPU, and is
the maximum width of data it can handle at a time
PCs with 64-bit microprocessors are becoming common
Over 55% of all processors sold per year are 8-bit processors,
which comes to over 3 billion of them per year!*
8-bit microcontrollers are sufficient and cost-effective for many
embedded applications
More and more advanced features and peripherals are added
to 8-bit processors by various vendors
8-bit MCUs are well-suited for low-power applications that use
batteries
10
8052 microcontroller
11
8031 microcontroller
12
13
The 8051 is available in different memory types, such as UVEPROM, flash, and NV-RAM, all of which have different part
numbers.
The UV-EPROM version of the 8051 is the 8751.
The flash ROM version is marketed by many companies
including Atmel Corp. and Dallas Semiconductor.
The Atmel Flash 8051 is called AT89C51, while Dallas
Semiconductor calls theirs DS89C4xO (DS89C420/430/440).
The NV-RAM version of the 8051 made by Dallas
Semiconductor is called DS5000.
There is also an OTP (one-time programmable) version of the
8051 made by various manufacturers.
14
15
Fetch operationretrieves an
instruction from the location in
code memory pointed to by the
program
counter
(PC)
Execute operationexecutes
the instruction that was fetched
during the fetch operation. In
addition to executing the
instruction, the CPU also adds
the appropriate number to the
PC to point it to the next
instruction to be fetched.
Program
Counter
(PC)
Code Memory
F
e
t
c
h
CPU
To other
peripherals
16
Lower 128 bytes: Register Banks, Bitaddressable area and General purpose RAM
General Purpose
RAM (80 bytes)
(scratch-pad area)
Bit-addressable
Area (16 bytes)
Register Banks
(8 bytes per
bank; 4 banks)
17
Example
# Problem
I.
II.
III.
What would be the address of bit 5 (bit 0 being LSB) of internal RAM
location 2AH?
Indicate the location of the bit having bit address 2FH.
Where is the bit E7H?
# Solution
i.
ii.
iii.
18
19
20
Shows the status of arithmetic and logical operations using multiple bits
such as Carry
Selects the Register Bank (Bank 0 - Bank 3)
It is the only register through which the status of the of operations
performed by the CPU is reflected.
21
22
Stack pointer (SP): It points the address of system stack where the last storage operation
has taken place.
Parallel I/O Port RegistersP0, P1, P2 and P3: Each of four ports has its own register,
designated as the name of the concerned ports (P0, P1, P2 and P3). The system
communicates with these ports through these registers.
23
POP byte
;increment stack
;move byte
;move from stack
;decrement
pointer,
on stack
to byte,
stack pointer
Exchange instructions
XCH a, byte
XCHD a, byte
24
dest source
Addressing modes
mov DPTR,#7521h
25
Addressing modes:
Register Addressing
Register Addressing either source or destination is one of CPU
register
MOV R0,A
MOV A,R7
ADD A,R4
ADD A,R7
MOV DPTR,#25F5H
MOV R5,DPL
MOV R4,DPH
27
; dptr 9000h
; a M[9000]
28
;a M[4005]
29
mov a, #5
movc a, @a + PC
Nop
;a M[1008]
Table Lookup
MOVC only can read internal code memory