Datasheet
ADE7116/ADE7156/ADE7166/ADE7169/ADE7566/ADE7569
Rev. B | Page 111 of 152
Table 106. Flash Write/Erase Protection 0 SFR (PROTB0, Address 0xBD)
Bit Mnemonic Default Description
[7:0] PROTB0 0xFF
This SFR is used to write the write/erase protection bits for Page 0 to Page 7 of the flash memory
(see the Protecting the Flash section). Clearing the bits enables the protection.
PROTB0.7 PROTB0.6 PROTB0.5 PROTB0.4 PROTB0.3 PROTB0.2 PROTB0.1 PROTB0.0
Page 7 Page 6 Page 5 Page 4 Page 3 Page 2 Page 1 Page 0
Table 107. Flash Write/Erase Protection 1 SFR (PROTB1, Address 0xBE)
Bit Mnemonic Default Description
[7:0] PROTB1 0xFF
This SFR is used to write the write/erase protection bits for Page 8 to Page 15 of the flash memory
(see the Protecting the Flash section). Clearing the bits enables the protection.
PROTB1.7 PROTB1.6 PROTB1.5 PROTB1.4 PROTB1.3 PROTB1.2 PROTB1.1 PROTB1.0
Page 15 Page 14 Page 13 Page 12 Page 11 Page 10 Page 9 Page 8
Table 108. Flash Read Protection SFR (PROTR, Address 0xBF)
Bit Mnemonic Default Description
[7:0] PROTR 0xFF
This SFR is used to write the read protection bits for Page 0 to Page 31 of the flash memory
(see the Protecting the Flash section). Clearing the bits enables the protection.
PROTR.7 PROTR.6 PROTR.5 PROTR.4 PROTR.3 PROTR.2 PROTR.1 PROTR.0
Page 28 to
Page 31
Page 24 to
Page 27
Page 20 to
Page 23
Page 16 to
Page 19
Page 12 to
Page 15
Page 8 to
Page 11
Page 4 to
Page 7
Page 0 to
Page 3
Table 109. Flash Low Byte Address SFR (EADRL, Address 0xC6)
Bit Mnemonic Default Description
[7:0] EADRL 0
Flash pointer low byte address. This SFR is also used to write the write/erase protection bits for Page 16
to Page 23 of the flash memory (see the Protecting the Flash section). Clearing the bits enables the
protection.
EADRL.7 EADRL.6 EADRL.5 EADRL.4 EADRL.3 EADRL.2 EADRL.1 EADRL.0
Page 23 Page 22 Page 21 Page 20 Page 19 Page 18 Page 17 Page 16
Table 110. Flash High Byte Address SFR (EADRH, Address 0xC7)
Bit Mnemonic Default Description
[7:0] EADRH 0
Flash Pointer High Byte Address. This SFR is also used to write the write/erase protection bits for Page 24
to Page 31 of the flash memory (see the Protecting the Flash section). Clearing the bits enables the
protection.
EADRH.7 EADRH.6 EADRH.5 EADRH.4 EADRH.3 EADRH.2 EADRH.1 EADRH.0
Page 31 Page 30 Page 29 Page 28 Page 27 Page 26 Page 25 Page 24
Flash Functions
The following sample 8052 code is provided to demonstrate
how to use the flash functions. For these examples, Flash
Memory Byte 0x3C00 is accessed.
Write By te
Write 0xF3 into flash memory byte 0x3C00.
MOV EDATA,#F3h ; Data to be written
MOV EADRH,#3Ch ; Set up byte address
MOV EADRL,#00h
MOV FLSHKY,#3Bh ; Write Flash security
key.
MOV ECON,#01h ; Write Byte
Erase Page
Erase the page containing Flash Memory Byte 0x3C00.
MOV EADRH,#3Ch ; Select page through
byte address
MOV EADRL,#00h
MOV FLSHKY,#3Bh ; Write Flash security
key.
MOV ECON,#02h ; Erase Page