Anda di halaman 1dari 28

Chapter 3

8051/8031 Family Architecture

Lesson 2
8051 Family MCUs
Memory

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Internal and External Memory

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Internal memory
8-bit address Internal RAM Memory
16-bit address Internal ROM Program
memory
SFRs are separate and have 8-bit address
each in separate space from internal RAM
External memory
16-bit address Data Memory
16-bit address Program memory
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Internal Memory Harvard


Architecture
EA
1

Internal Program
Memory (4kB)
addresses used when
EA = 1

Internal Data Memory


128 B 8051
256 B 8052
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

External Data Memory Architecture


8051 special feature
Address

External RAM

Separate
64 kB data
Memory

64 kB separate address spaces for data


memory
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Internal/External Program Memory


Architecture

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Program Memory Architecture


Address

Internal ROM

For address 0000H-0FFFH


and EA = 1 (External disable)
Address
External ROM
For address 0000H-0FFFH
when EA = 0 (External Enable )
Address

Program,
constants
and stored
tables
Memory

External ROM

For address 1000H-FFFFH and


EA = 0 or 1
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Expansion to external memory


and ports

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

Expanded Mode used for interfacing


External Data Memory and Ports
and
External Program memory

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

10

An-A15
ALE
A15
A14
A13
A12
A11
A10
A9
A8
Port P2
Option

2011

Expansion Mode Interfacing


PSEN

AD7
AD6
AD5
AD4
AD3
AD2
AD1
AD0
Port P0
Options

Program
memory

A0-A15
Latch

Address
Decoder

CS
CS

AD0Expansion to Ports
AD15
and Memory
Microcontrollers-... 2nd Ed. Raj Kamal
Pearson Education

RD

Data
11
memory

On-Chip/Off-Chip Memory
Addresses

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

12

SFRs 80H-FFH

2011

Used for IO and internal devices


Control and Status
CPU Registers
Not the part of Internal RAM

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

13

On-Chip SFR and Memory Addresses


P0,.., P3,
8051/52
Address Space
80H-FFH

IO and internal
Devices SFRs
System SFRs

SBUF,
SCON,
TCON,
TMOD,
TL0,TH0,
TH1,TL1

A, B,
DPTR,
PCON,
PSW, SP,
IE, IP

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

14

Memory Access by Direct Address


80H-FFH
IO and internal devices
Control and Status
Registers
SP and DPTR, IP,IE,...
00H-7FH
Internal RAM
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

8-bit
addresses
00H to
FFH

15

Memory Access by Indirect


Address
80H-FFH
Additional Internal
RAM 8052
00H-7FH
Internal RAM 8051
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

8-bit
addresses
00H to
FFH

16

On-Chip Memory Architecture


Internal Data Memory RAM
8051

Byte Address

30H-7FH Internal RAM 30H-

7FH
20H-2FH
18H-1FH
10H-17H
08H-0FH
00H-07H
2011

Internal RAM 20H-2FH

Register Bank 3
Register Bank 2
Register Bank 1
Register Bank 0
Microcontrollers-... 2nd Ed. Raj Kamal
Pearson Education

Each bit also


addressable
Bit addresses
8-bit each 00H
-7FH
Data Memory
Internal RAM
as the
Register
Banks
17

Register Banks of 8 registers each


Each Byte at the register Ri (R0 orR1)
in a register-bank can be used as
pointer to an 8-bit indirect addressing
Each Byte at the register R0, .., R7
(Rn) can be used for a variable with 3
bits in instruction defining n and RS0
and RS1 at PSW defining the bank 0, 1, 2,
or 3.
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

18

Off-Chip Memory Addresses


8051

2011

0000HFFFFH

External RAM Data Memory

0000HFFFFH

External ROM Program


Memory when EA = 0

1000HFFFFH

External ROM Program


Memory when EA = 0 or 1
Microcontrollers-... 2nd Ed. Raj Kamal
Pearson Education

19

External RAM in 8051

0000H-00FFH
01FFHFFFFH

page0 external RAM,


indirect addressable by
R0 or R1 or by indirect
16-bit address
Indirect 16-bit address

Off-Chip Data Memory Architecture

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

20

Program Memory Architecture


Initial 3-byte
0000H-0002H
instruction for branch
0003HISRs of maximum 8 bytes
0032H,
each
0053HUser Program, constants,
005BH
stored tables
005CHFFFFH
ROM in 8051
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

21

On-Chip/Off-Chip Memory
Addresses in extended 8051

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

22

Extended 8051

External
ROM

FFFFFFH
010000H

Internal 0000H-0FFFH
ROM
ECODE

External FFFFH
ROM

SFR

80H-FFH

External FFFFFFH
RAM

00H-7FH

External FFFFH
RAM

Internal
RAM
2011

1000H

010000H

Extended XDATA

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

1000H

23

FFFFFFH

Philips 8051MX
ROM

810000H
80FFFFH

Unified Internal
and External
Addresses
Princeton
Architecture

800000H
7FFFFFH
010000H

RAM

00FFFFH
000000H

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

24

Philips 8051MX

External
ROM

FFFFFFH
810000H

Internal 0000H-0FFFH
External 80FFFFH
ROM
ROM
ECODE
800000H
Extended XDATA
7FFF00H
External
7FFFFFH
RAM 010000H
SFR
7FFF80H

Internal 7FFF7FH
RAM
2011

External 00FFFFH
RAM
000000H

7FFF00H
Microcontrollers-... 2nd Ed. Raj Kamal
Pearson Education

25

Summary

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

26

We learnt
SFRs and memory

SFRs
Internal RAM with bit addressable RAM
and four register banks
External RAM - Harvard Architecture
Internal Program Memory - Harvard
Architecture
External Program Memory - Harvard
Architecture
2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

27

We learnt
memory

Extended Memory in Extended 8051


version
Unified Memory space in 8051MX

2011

Microcontrollers-... 2nd Ed. Raj Kamal


Pearson Education

28

Anda mungkin juga menyukai