ADE5166_08 AD [Analog Devices], ADE5166_08 Datasheet - Page 78

no-image

ADE5166_08

Manufacturer Part Number
ADE5166_08
Description
Single-Phase Energy Measurement IC with 8052 MCU, RTC, and LCD Driver
Manufacturer
AD [Analog Devices]
Datasheet
ADE5166/ADE5169
General-Purpose RAM
General-purpose RAM resides in Memory Location 0x00
through Memory Location 0xFF. It contains the register banks.
Address 0x80 through Address 0xFF of general-purpose RAM
are shared with the SFRs. The mode of addressing determines
which memory space is accessed, as shown in Figure 79.
Both direct and indirect addressing can be used to access general-
purpose RAM from 0x00 through 0x7F, but indirect addressing
must be used to access general-purpose RAM with addresses in
the range from 0x80 through 0xFF because they share the same
address space with the SFRs.
The 8052 core also has the means to access individual bits of
certain addresses in the general-purpose RAM and special
function memory spaces. The individual bits of general-purpose
RAM, Address 0x20 to Address 0x2F, can be accessed through
Bit Address 0x00 to Bit Address 0x7F. The benefit of bit addressing
is that the individual bits can be accessed quickly, without the
need for bit masking, which takes more code memory and
execution time. The bit addresses for general-purpose RAM
Address 0x20 through Address 0x2F can be seen in Figure 80.
BITS IN PSW
SELECTED
Figure 79. General-Purpose RAM and SFR Memory Address Overlap
BANKS
VIA
0xFF
0x7F
0x80
0x00
Figure 78. Lower 128 Bytes of Internal Data Memory
11
10
01
00
INDIRECT ADDRESSING
DIRECT AND INDIRECT
ACCESSIBLE BY
ACCESSIBLE BY
GENERAL-PURPOSE RAM
SPECIAL FUNCTION REGISTERS (SFRs)
ADDRESSING
0x30
0x20
0x18
0x10
0x08
0x 00
ONLY
0x7F
0x2F
0x1F
0x0F
0x17
0x07
DIRECT ADDRESSING
ACCESSIBLE BY
ONLY
BIT-ADDRESSABLE
(BIT ADDRESSES)
FOUR BANKS OF EIGHT
REGISTERS R0 TO R7
GENERAL-PURPOSE
AREA
RESET VALUE OF
STACK POINTER
Rev. 0 | Page 78 of 148
Bit addressing can be used for instructions that involve Boolean
variable manipulation and program branching (see the Instruction
Set section).
Special Function Registers (SFRs)
Special function registers are registers that affect the function
of the 8051 core or its peripherals. These registers are located
in RAM at Address 0x80 through Address 0xFF. They are
accessible only through direct addressing, as shown in Figure 79.
The individual bits of some of the SFRs can be accessed for use
in Boolean and program branching instructions. These SFRs are
labeled as bit addressable, and the bit addresses are given in
Table 14.
Extended Internal RAM (XRAM)
The ADE5166/ADE5169 provide 2 kB of extended on-chip
RAM. No external RAM is supported. This RAM is located in
Address 0x00 through Address 0x7FF in the extended RAM
space. To select the extended RAM memory space, the extended
indirect addressing modes are used.
Code Memory
Code and data memory is stored in the 62 kB flash memory
space. No external code memory is supported. To access code
memory, code indirect addressing is used.
ADDRESSING MODES
The 8052 core provides several addressing modes. The address-
ing mode determines how the core interprets the memory location
or data value specified in assembly language code. There are six
addressing modes, as shown in Table 66.
Figure 80. Bit Addressable Area of General-Purpose RAM
ADDRESS
Figure 81. Extended Internal RAM (XRAM) Space
0x2D
0x2C
0x2B
0x2A
0x2F
0x2E
0x29
0x28
0x27
0x26
0x25
0x24
0x23
0x22
0x21
0x20
BYTE
0x7FF
0x00
7F
77
6F
67
5F
57
4F
47
3F
37
2F
27
1F
17
0F
07
7E
6E
5E
4E
3E
2E
1E
0E
76
66
56
46
36
26
16
06
EXTENDED INTERNAL
BIT ADDRESSES (HEXA)
7D
6D
5D
4D
3D
2D
1D
0D
75
65
55
45
35
25
15
05
RAM (XRAM)
2kB OF
7C
6C
5C
4C
3C
2C
1C
0C
74
64
54
44
34
24
14
04
7B
6B
5B
4B
3B
2B
1B
0B
73
63
53
43
33
23
13
03
7A
6A
5A
4A
3A
2A
1A
0A
72
62
52
42
32
22
12
02
79
71
69
61
59
51
49
41
39
31
29
21
19
11
09
01
78
70
68
60
58
50
48
40
38
30
28
20
18
10
08
00

Related parts for ADE5166_08