Chapter 27 512 Kbyte Flash Module (S12XFTX512K4V2)
MC9S12XDP512 Data Sheet, Rev. 2.17
1118
Freescale Semiconductor
27.3.2.5
Flash Protection Register (FPROT)
The FPROT register defines which Flash sectors are protected against program or erase operations.
All bits in the FPROT register are readable and writable with restrictions (see
Section 27.3.2.5.1, “Flash
Protection Restrictions”
) except for RNV[6] which is only readable.
During the reset sequence, the FPROT register is loaded from the Flash Configuration Field at global
address 0x7F_FF0D. To change the Flash protection that will be loaded during the reset sequence, the
upper sector of the Flash memory must be unprotected, then the Flash Protect/Security byte located as
described in
Table 27-1
must be reprogrammed.
Tryingto alterdata inany protectedareain the Flashmemory willresultin a protectionviolationerror and
the PVIOL flag will be set in the FSTAT register. The mass erase of a Flash block is not possible if any of
the Flash sectors contained in the Flash block are protected.
10
11
Flash Block 2
Flash Block 3
7
6
5
4
3
2
1
0
R
FPOPEN
RNV6
FPHDIS
FPHS
FPLDIS
FPLS
W
Reset
F
F
F
F
F
F
F
F
= Unimplemented or Reserved
Figure 27-10. Flash Protection Register (FPROT)
Table 27-11. FPROT Field Descriptions
Field
Description
7
FPOPEN
Flash Protection Open
— The FPOPEN bit determines the protection function for program or erase as shown
in
Table 27-12
.
0 The FPHDIS and FPLDIS bits define unprotected address ranges as specified by the corresponding
FPHS[1:0] and FPLS[1:0] bits. For an MCU without an EEPROM module, the FPOPEN clear state allows the
main part of the Flash block to be protected while a small address range can remain unprotected for EEPROM
emulation.
1 The FPHDIS and FPLDIS bits enable protection for the address range specified by the corresponding
FPHS[1:0] and FPLS[1:0] bits.
6
RNV6
Reserved Nonvolatile Bit
— The RNV[6] bit should remain in the erased state for future enhancements.
5
FPHDIS
Flash Protection Higher Address Range Disable
— The FPHDIS bit determines whether there is a
protected/unprotected area in a specific region of the Flash memory ending with global address 0x7F_FFFF.
0 Protection/Unprotection enabled.
1 Protection/Unprotection disabled.
4–3
FPHS[1:0]
Flash Protection Higher Address Size
— The FPHS[1:0] bits determine the size of the protected/unprotected
area as shown in
Table 27-13
. The FPHS[1:0] bits can only be written to while the FPHDIS bit is set.
Table 27-10. Flash Register Bank Selects
BKSEL[1:0]
Selected Block