Datasheet

Chapter 4 Memory
MC9S08DZ128 Series Data Sheet, Rev. 1
80 Freescale Semiconductor
4.6.11.4 FLASH and EEPROM Protection Register (FPROT and NVPROT)
The FPROT register defines which FLASH and EEPROM sectors are protected against program and erase
operations.
During the reset sequence, the FPROT register is loaded from the nonvolatile location NVPROT. To
change the protection that will be loaded during the reset sequence, the sector containing NVPROT must
be unprotected and erased, then NVPROT can be reprogrammed.
FPROT bits are readable at any time and writable as long as the size of the protected region is being
increased. Any write to FPROT that attempts to decrease the size of the protected memory will be ignored.
Trying to alter data in any protected area will result in a protection violation error and the FPVIOL flag
will be set in the FSTAT register. Mass erase is not possible if any one of the sectors is protected.
Figure 4-17. FLASH and EEPROM Protection Register (FPROT)
76543210
R
EPS FPS FPOP
W
Reset FFFFFFFF
Table 4-18. FPROT Register Field Descriptions
Field Description
7:6
EPS
EEPROM Protect Select Bits — This 2-bit field determines the protected EEPROM locations that cannot be
erased or programmed. See Table 4-19.
5:1
FPS
FLASH Protect Select Bits — With FPOP set, this 5-bit field determines the protected FLASH locations that
cannot be erased or programmed. SeeTable 4-20.
0
FPOP
FLASH Protection Open
0 Flash is fully protected.
1 Flash protected address range determined by FPS bits.
Table 4-19. EEPROM Block Protection
EPS Protected Address Range Protected Size
0x3 No protection 0 bytes
0x2 3FF0 - 3FFF 32 bytes
0x1 3FE0 - 3FFF 64 bytes
0x0 3FC0–3FFF 128 bytes