Datasheet

Table Of Contents
ADuC7060/ADuC7061 Data Sheet
Rev. D | Page 26 of 108
Permanent Protection
Permanent protection can be set via FEEPRO, similar to how
keyed permanent protection is set, with the only difference
being that the software key used is 0xDEADDEAD. When the
FEEPRO write sequence is saved, only a mass erase sets the
software protection key back to 0xFFFFFFFF. This also erases
the entire user code space.
Sequence to Write the Software Protection Key and Set
Permanent Protection
1. Write in FEEPRO corresponding to the pages to be
protected.
2. Write the new (user-defined) 32-bit software protection
key in FEEADR (Bits[31:16]) and FEEDAT (Bits[15:0]).
3. Write 10 in FEEMOD (Bits[6:5]) and set FEEMOD (Bit 3).
4. Run the protect command (Code 0x0C) in FEECON.
To remove or modify the protection, the same sequence can be
used with a modified value of FEEPRO.
The previous sequence for writing the key and setting permanent
protection is illustrated in the following example, this protects
writing Page 4 and Page 5 of the Flash/EE:
Int a = FEESTA; // Ensure FEESTA
is cleared
FEEPRO = 0xFFFFFFFB; // Protect Page 4
and Page 5
FEEADR = 0x66BB; // 32-bit key
value (Bits[31:16])
FEEDAT = 0xAA55; // 32-bit key
value (Bits[15:0])
FEEMOD = 0x0048 // Lock security
sequence
FEECON = 0x0C; // Write key
command
while (FEESTA & 0x04){} // Wait for
command to finish
Command Sequence for Executing a Mass Erase
FEEDAT = 0x3CFF;
FEEADR = 0xFFC3;
FEEMOD = FEEMOD|0x8; //Erase key enable
FEECON = 0x06; //Mass erase command