ade7166 Analog Devices, Inc., ade7166 Datasheet - Page 106

no-image

ade7166

Manufacturer Part Number
ade7166
Description
Single-phase Energy Measurement Ic With 8052 Mcu, Rtc, And Lcd Driver
Manufacturer
Analog Devices, Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ade7166ASTZF16
Manufacturer:
VHK
Quantity:
2
Part Number:
ade7166ASTZF16
Manufacturer:
Analog Devices Inc
Quantity:
10 000
Part Number:
ade7166ASTZF16-RL
Manufacturer:
KOA
Quantity:
50 000
Part Number:
ade7166ASTZF16-RL
Manufacturer:
Analog Devices Inc
Quantity:
10 000
Part Number:
ade7166ASTZF8
Manufacturer:
Analog Devices Inc
Quantity:
10 000
Part Number:
ade7166ASTZF8-RL
Manufacturer:
Analog Devices Inc
Quantity:
10 000
ADE7566/ADE7569/ADE7166/ADE7169
Table 98. Flash Read Protection SFR (PROTR, 0xBF)
Bit
7 to 0
Table 99. Flash Low Byte Address SFR (EADRL, 0xC6)
Bit
7 to 0
Table 100. Flash High Byte Address SFR (EADRH, 0xC7)
Bit
7 to 0
Flash Functions
Sample 8052 code is provided in this section to demonstrate
how to use the flash functions. For these examples, the byte of
flash memory 0x3C00 is accessed.
Write Byte
Write 0xF3 into flash memory byte 0x3C00.
MOV EDATA,#F3h
MOV EADRH,#3Ch
MOV EADRL,#00h
MOV FLSHKY,#3Bh
key.
MOV ECON,#01h ; Write byte
Erase Page
Erase the page containing flash memory byte 0x3C00.
MOV EADRh,#3Ch
byte address
MOV EADRL,#00h
MOV FLSHKY,#3Bh
key.
MOV ECON,#02h ; Erase Page
Mnemonic
PROTR
Mnemonic
EADRL
Mnemonic
EADRH
Default
0xFF
Default
0
Default
0
; Data to be written
; Setup byte address
; Write flash security
; Select page through
; Write flash security
Description
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 Memory section). Clearing the bits enables the protection.
PROTR.7
Page 28 to
Page 31
Description
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 Memory section). Clearing the bits enables
the protection.
EADRL.7
Page 23
Description
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 Memory section). Clearing the bits enables
the protection.
EADRH.7
Page 31
EADRH.6
Page 30
PROTR.6
Page 24 to
Page 27
EADRL.6
Page 22
Rev. A | Page 106 of 144
EADRH.5
Page 29
PROTR.5
Page 20 to
Page 23
EADRL.5
Page 21
Erase All
Erase all of the 16 kB flash memory.
MOV FLSHKY,#3Bh
key.
MOV ECON,#03h ; Erase all
Read Byte
Read flash memory byte 0x3C00.
MOV EADRH,#3Ch
MOV EADRL,#00h
MOV FLSHKY,#3Bh
key.
MOV ECON,#04h
; Data is ready in EDATA register
Erase Page and Write Byte
Erase the page containing flash memory byte 0x3C00 and then
write 0xF3 to that address. Note that the other 511 bytes in this
page are erased.
MOV EDATA,#F3h
MOV EADRH,#3Ch
MOV EADRL,#00h
MOV FLSHKY,#3Bh
key.
MOV ECON,#05h ; Erase page and then write
byte
EADRH.4
Page 28
PROTR.4
Page 16 to
Page 19
EADRL.4
Page 20
EADRH.3
Page 27
PROTR.3
Page 12 to
Page 15
EADRL.3
Page 19
EADRH.2
Page 26
PROTR.2
EADRL.2
Page 8 to
Page 11
Page 18
; Write flash security
; Setup byte address
; Write flash security
; Read byte
; Data to be written
; Setup byte address
; Write flash security
EADRH.1
Page 25
PROTR.1
EADRL.1
Page 17
Page 4 to
Page 7
EADRH.0
Page 24
PROTR.0
Page 0 to
Page 3
EADRL.0
Page 16

Related parts for ade7166