ade7169f16 Analog Devices, Inc., ade7169f16 Datasheet - Page 101

no-image

ade7169f16

Manufacturer Part Number
ade7169f16
Description
Single-phase Energy Measurement Ic With 8052 Mcu, Rtc And Lcd Driver
Manufacturer
Analog Devices, Inc.
Datasheet
Preliminary Technical Data
Remark: The read protection does not prevent MOVC
commands to be executed within the code.
There is an additional layer of protection offered by a protection
security key. The user can setup a protection security key so
that the protection scheme cannot be changed without this key.
Once the protection key has been configured, it may not be
modified.
Enabling Flash Protection by Code
The protection byts in the Flash can be programmed using
Flash controller command and programming ECON to 0x08.
The EADRH, EADRL, PROTB1 and PROTB0 bytes are used in
this case to store the data to be written to the 32 bits of write
protection. Note that the EADRH and EADRL registers are not
used as data pointers here, but to store write protection data.
The sequence for writing the protection bits is:
PROTR
PROTKY
PROTB1
PROTB0
EADRH
EADRL
1.
2.
3.
Set up the EADRH, EADRL, PROTB1 and PROTB0
registers with the write/erase protection bits. When
erased, the protection bits default to 1, like any other
bit of Flash memory. The default protection setting is
for no protection. To enable protection, write a 0 to
the bits corresponding to the pages that should be
protected.
Set up the PROTR register with the read protection
bits. Note that every read protection bit protects four
pages. To enable the read protection bit, write a 0 to
the bits that should be read protected.
To enable the protection key, write to the PROTKY
register. If enabled, the protection key will be required
to modify the protection scheme. The protection key,
flash memory address 0x3FFA defaults to FFH so if
the PROTKY register is not written to, it will remain
0xFFH. If the protection key is written to, the
PROTKY register must be written with this value
every time the protection functionality is accessed.
0x3FFD
0x3FFC
0x3FFE
0x3FFB
0x3FFF
0x3FFA
0x3FF9
0x3E00
Figure 68: Flash Protection in Page 31
31-28
WP
WP
WP
WP
RP
31
23
15
7
27-24
WP
WP
WP
WP
RP
PROTECTION KEY
30
22
14
6
23-20
WP
WP
WP
WP
RP
29
21
13
5
19-16
WP
WP
WP
WP
RP
28
20
12
4
15-12
WP
WP
WP
WP
RP
27
19
11
3
11-8
WP
WP
WP
WP
RP
26
18
10
2
WP
WP
WP
WP
RP
7-4
25
17
9
1
Rev. PrD | Page 101 of 140
WP
WP
WP
WP
3-0
RP
24
16
9
0
To enable read and write/erase protection for the last page only,
use the following 8051 code. Writing the flash protection
command to the ECON register initiates programming the
protection bits in the flash.
; enable write/erase protection on the last page only
MOV EADRH, #07FH
MOV EADRL, #0FFH
MOV PROTB1, #FFH
MOV PROTB0, #FFH
; enable read protection on the last four pages only
MOV PROTR, #07FH
; set up a protection key of 0A3H. This command can be
; omitted to use the default protection key of 0xFF
MOV PROTKY, #0A3H
; write the flash key to the FLSHKY register to enable flash
; access. The flash access key is not configurable.
MOV FLSHKY, #3BH
; write flash protection command to the ECON register
MOV ECON, #08H
Enabling Flash Protection by emulator
commands
Another way to set the Flash protection bytes is to use some
reserved emulator commands available only in download mode.
These commands write directly to the SFRs and can be used to
duplicate the operation mentioned in the Enabling Flash
Protection by Code paragraph. Once these Flash bytes are
written, the part can exit emulation mode by reset and the
protections will be effective. This method can be used in
production and implemented after downloading the program.
The commands used for this operation are an extension of the
commands listed in the application note uC004 –
Understanding the Serial Download Protocol:
- Command with ASCII code ‘I’ or 0x49 write the data into R0
- Command with ASCII code ‘F’ or 0x46 write R0 into the SFR
address defined in the data of this command
Omitting the protocol defined in uC004, the sequence to load
protections are similar to the sequence presented mentioned in
the Enabling Flash Protection by Code paragraph.except that
two emulator commands are necessary to replace one assembly
4.
5.
Note that once the protection key is configured, it
cannot be modified.
Run the protection command by writing 08H to the
ECON register.
Reset the chip to activate the new protection.
ADE7169F16

Related parts for ade7169f16