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

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
Note that after the PROTKY has been activated by a reset, any
further changes to the protection require the new 8-bit protection
key to be written to the PROTKY SFR prior to issuing the ECON
command. The PROTKY SFR is cleared automatically when the
ECON 0x8 command is issued and, therefore, the user must
ensure that the correct value is written to the PROTKY SFR
each time the protection scheme is changed.
The most significant bit of 0xF7FF is used to enable the lock
mechanism for the watchdog (see the Watchdog Timer section
for more information).
The following code provides an example of how the write/erase
protection can be enabled on the first page and the PROTKY set
to 0xA3. Note that to active the following protection, the part
requires a reset.
; enable write/erase protection on the first
page only
MOV EDATA, #0FEH
MOV EADRL, #0F0H
MOV FLSHKY, #3BH
; clear bit WP 0
; write address to F7F0h
; enable flash access
0xF7EB
0xF7FF
0xF7EF
0xF600
WDOG
LOCK
92–95
60–63
28–31
WP
119
WP
111
WP
WP
15
RP
RP
RP
7
120–123
88–91
56–59
24–27
WP
118
WP
110
WP
WP
RP
RP
RP
RP
14
6
Figure 91. Flash Protection in Page124
116–119
84–87
52–55
20–23
WP
117
WP
109
WP
WP
RP
RP
RP
RP
13
5
PROTECTION KEY
Rev. 0 | Page 104 of 148
112–115
80–83
48–51
16–19
WP
116
WP
108
WP
WP
RP
RP
RP
RP
12
4
108–111
76–79
44–47
12–15
WP
123
WP
115
WP
107
WP
WP
RP
RP
RP
RP
11
3
104–107
72–75
40–43
8–11
WP
122
WP
114
WP
106
WP
WP
RP
RP
RP
RP
10
MOV ECON, #08H
command
;enable write/erase protection on last page
(this is required for any protection to be
activated)
MOV EDATA, #0F7H
MOV EADRL, #0FFH
MOV FLSHKY, #3BH
MOV ECON, #08H
command
;set up PROTKY to A3h
MOV EDATA, #0A3H
MOV EADRL, #0EBH
MOV FLSHKY, #3BH
MOV ECON, #08H
command
Note that after the PROTKY is changed to 0xA3, as shown in
the preceding example code, all future modifications of the pro-
tection scheme require that the PROTKY SFR to be set to 0xA3
prior to issuing the ECON protection command.
2
100–103
68–71
36–39
WP
121
WP
113
WP
105
WP
WP
4–7
RP
RP
RP
RP
9
1
64–67
32–35
96–99
120
WP
112
104
WP
0–3
WP
WP
WP
RP
RP
RP
RP
8
0
PROTKY
;issue protection
; clear bit WP123
; write address to F7FFh
; enable flash access
;issue protection
; set PROTKY to A3h
; write address to F7EBh
; enable flash access
; issue protection

Related parts for ADE5166_08