English
Language : 

MC9S12KG128 Datasheet, PDF (124/600 Pages) Freescale Semiconductor, Inc – Microcontrollers
Chapter 3 2 Kbyte EEPROM Module (EETS2KV1)
To change the EEPROM protection that will be loaded on reset, the upper sector of EEPROM must first
be unprotected, then the EEPROM protect byte located at address 0x07FD must be written to.
A protected EEPROM sector is disabled by the EPDIS bit while the size of the protected sector is defined
by the EP bits in the EPROT register.
Trying to alter any of the protected areas will result in a protect violation error and PVIOL flag will be set
in the ESTAT register. A mass erase of a whole EEPROM block is only possible when protection is fully
disabled by setting the EPOPEN and EPDIS bits. An attempt to mass erase an EEPROM block while
protection is enabled will set the PVIOL flag in the ESTAT register.
Table 3-5. EPROT Field Descriptions
Field
Description
7
EPOPEN
6:4
NV[6:4]
3
EPDIS
2:0
EP[2:0]
Opens EEPROM for Program or Erase
0 The whole EEPROM array is protected. In this case, the EPDIS and EP bits within the protection register are
ignored.
1 The EEPROM sectors not protected are enabled for program or erase.
Nonvolatile Flag Bits — These three bits are available to the user as nonvolatile flags.
EEPROM Protection Address Range Disable — The EPDIS bit determines whether there is a protected area
in the space of the EEPROM address map.
0 Protection enabled
1 Protection disabled
EEPROM Protection Address Size — The EP[2:0] bits determine the size of the protected sector. Refer to
Table 3-6.
Table 3-6. EEPROM Address Range Protection
EP[2:0]
000
001
010
011
100
101
110
111
Protected
Address Range
0x07C0-0x07FF
0x0780-0x07FF
0x0740-0x07FF
0x0700-0x07FF
0x06C0-0x07FF
0x0680-0x07FF
0x0640-0x07FF
0x0600-0x07FF
Protected Size
64 bytes
128 bytes
192 bytes
256 bytes
320 bytes
384 bytes
448 bytes
512 bytes
3.3.2.6 EEPROM Status Register (ESTAT)
The ESTAT register defines the EEPROM state machine command status and EEPROM array access,
protection and erase verify status.
MC9S12KG128 Data Sheet, Rev. 1.15
124
Freescale Semiconductor