AN2400 Freescale Semiconductor / Motorola, AN2400 Datasheet - Page 25

no-image

AN2400

Manufacturer Part Number
AN2400
Description
HCS12 NVM Guidelines
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
AN2400/D
Flash Memory
7
6
5
4
3
2
1
0
FPOPEN
NV6
FPHDIS
FPHS1
FPHS0
FPLDIS
FPLS1
FPLS0
Figure 20. Flash Protection Register (FPROT)
The Flash Protection Register for each Flash block is loaded from the
appropriate Flash memory bytes during a reset sequence,
Table 4. Flash
Protection and Security Memory Locations for MC9S12DP256
lists these
for the MC9S12DP256. The erased state of these Flash memory bytes is $FF,
which corresponds to Flash protection disabled.
The FPOPEN bit in the FPROT register determines whether the entire Flash
block is protected. When the FPOPEN bit is erased, the remainder of the bits
in the register determine the state of protection and the size of each protected
block. In its programmed state the entire Flash block is protected and the state
of the remaining bits within the FPROT register is irrelevant.
The FPHDIS and FPLDIS bits determine the protection state of the upper and
lower areas within each Flash block respectively. The erased state of these bits
allows erasure and programming of the two protected areas and renders the
state of the FPHS[1:0] and FPLS[1:0] bits immaterial. When either of these bits
is programmed, the FPHS[1:0] and FPLS[1:0] bits determine the size of the
upper and lower protected areas.
Table 5. Flash Protection High Bits
and
Table 6. Flash Protection Low Bits
summarize the combinations of the
FPHS[1:0] and FPLS[1:0] bits and the size of the protected area selected by
each for a 64k byte Flash block.
On some microcontrollers, the FPHDIS, FPHS[1:0], FPLDIS and FPLS[1:0] bits
do have an effect on the selection of the protected Flash areas when FPOPEN
= 0. This allows upper or lower areas to be unprotected while the rest of the
Flash is protected. This feature allows a small area of Flash to remain
unprotected when using Flash to emulate EEPROM. Refer to the relevant
Flash Block Guide for details.
Trying to program or erase any of the protected areas will result in a protection
violation error and bit PVIOL will be set in the Flash Status Register FSTAT. A
mass erase of an entire block is only possible if the protection for that block is
fully disabled, i.e. FOPEN = 1, or FPHDIS = 1 and FPLDIS = 1.
NOTE:
The Flash protection memory locations are located within the upper protected
block of Flash Block 0. Therefore if the upper protected block of Flash Block 0
is protected, or if the whole of Flash Block 0 is protected, then the Flash
protection memory locations themselves are protected and can no longer be
changed.
MOTOROLA
HCS12 NVM Guidelines
25
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2400