Datasheet
ADuC7033
Rev. B | Page 28 of 140
Command Sequence for Executing a Mass Erase
Giving the significance of the mass erase command, a specific
code sequence must be executed to initiate this operation.
1. Set Bit 3 in FEExMOD.
2. Write 0xFFC3 in FEExADR
3. Write 0x3CFF in FEExDAT
4. Run the Mass Erase Command 0x06 in FEExCON
To run the mass erase command via FEE0CON, write
protection on the lower 64 kB must be disabled, that is,
FEE1HID/FEE1PRO are set to 0xFFFFFFFF. This is
accomplished by first removing the protection or erasing
the lower 64 kB first.
Sequence Example
The command sequence for executing a mass erase is illustrated in the following example:
Int a = FEExSTA; // Ensure FEExSTA is cleared
FEExMOD = 0x08;
FEExADR = 0xFFC3;
FEExDAT = 0x3CFF;
FEExCON = 0x06; // Mass erase command
while (FEExSTA & 0x04){} // Wait for command to finish
FEE0STA and FEE1STA Registers
Name: FEE0STA and FEE1STA
Address: 0xFFFF0E00 and 0xFFFF0E80
Default Value: 0x20
Access: Read only
Function: These 8-bit read-only registers can be read by user code and reflect the current status of the Flash/EE memory
controllers.
Table 14. FEE0STA and FEE1STA MMR Bit Designations
Bit Description
1
7 to 4 Not Used. These bits are not used and always read as 0.
3 Flash/EE Memory Interrupt Status Bit.
Set automatically when an interrupt occurs, that is, when a command is complete and the Flash/EE memory interrupt enable
bit in the FEExMOD register is set.
Cleared automatically when the FEExSTA register is read by user code.
2 Flash/EE Memory Controller Busy.
Set automatically when the Flash/EE memory controller is busy.
Cleared automatically when the controller is not busy.
1 Command Fail.
Set automatically when a command written to FEExCON completes unsuccessfully.
Cleared automatically when the FEExSTA register is read by user code.
0 Command Successful.
Set automatically by MCU when a command is completed successfully.
Cleared automatically when the FEE0STA register is read by user code.
1
x is 0 or 1 to designate Flash/EE memory Block0 or Block1.