English
Language : 

MC9S12KG128_10 Datasheet, PDF (111/606 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers
Chapter 2 128 Kbyte ECC Flash Module (S12FTS128K1ECCV1)
2. Writing the sector erase command if the address written in the command write sequence was in a
protected area of the Flash memory.
3. Writing the mass erase command while any Flash protection is enabled.
If the PVIOL flag is set in the FSTAT register, the user must clear the PVIOL flag before starting another
command write sequence (see Section 2.3.2.7, “Flash Status Register (FSTAT)”).
2.5 Operating Modes
2.5.1 Wait Mode
If a command is active (CCIF = 0) when the MCU enters wait mode, the active command and any buffered
command will be completed.
The Flash module can recover the MCU from wait mode if the CBEIF and CCIF interrupts are enabled
(Section 2.8, “Interrupts”).
2.5.2 Stop Mode
If a command is active (CCIF = 0) when the MCU enters stop mode, the operation will be aborted and, if
the operation is program or erase, the Flash array data being programmed or erased may be corrupted and
the CCIF and ACCERR flags will be set. If active, the high voltage circuitry to the Flash memory will
immediately be switched off when entering stop mode. Upon exit from stop mode, the CBEIF flag is set
and any buffered command will not be launched. The ACCERR flag must be cleared before starting a
command write sequence (see Section 2.4.1.2, “Command Write Sequence”).
NOTE
As active commands are immediately aborted when the MCU enters stop
mode, it is strongly recommended that the user does not use the STOP
instruction during program or erase operations.
2.5.3 Background Debug Mode
In background debug mode (BDM), the FPROT register is writable. If the MCU is unsecured, then all
Flash commands listed in Table 2-20 can be executed.
2.6 Flash Module Security
The Flash module provides the necessary security information to the MCU. After each reset, the Flash
module determines the security state of the MCU as defined in Section 2.3.2.2, “Flash Security Register
(FSEC)”.
The contents of the Flash security byte at 0xFF0F in the Flash configuration field must be changed directly
by programming 0xFF0F when the MCU is unsecured and the higher address sector is unprotected. If the
MC9S12KG128 Data Sheet, Rev. 1.16
Freescale Semiconductor
111