S3F84B8_UM_REV 1.00
19 EMBEDDED FLASH MEMORY INTERFACE
19-6
Sector Erase Procedure in User Program Mode
To erase sector in User Program mode, follow these steps:
1. Set Flash Memory User Programming Enable Register (FMUSR) to “10100101B”.
2. Set Flash Memory Sector Address Registers (FMSECH and FMSECL).
3. Set Flash Memory Control Register (FMCON) to “10100001B”.
4. Set Flash Memory User Programming Enable Register (FMUSR) to “00000000B”.
SB1
Start
; Select Bank1
; User Programimg Mode Enable
; Set Sector Base Address
; User Prgramming Mode Disable
; Mode Select & Start Erase
FMCON #10100001B
; Select Bank0
FMUSR #00H
SB0
Finish One Sector Erase
FMSECH High Address of Sector
FMSECL Low Address of Sector
FMUSR #0A5H
Figure 19-7 Sector Erase Flowchart in User Program Mode
NOTE:
1. If you erase a sector selected by Flash Memory Sector Address Registers (FMSECH and FMSECL), FMUSR should be
enabled just before starting the sector erase operation. To erase a sector, Flash Operation Start Bit of FMCON register is
written from stop operation ‘0’ to start operation ‘1’. This bit will be cleared automatically just after the erase operation is
completed. In other words, when S3F84B8 is in a condition where Flash Memory User Programming Enable Bit is enabled
and sector erase is started, the erase operation will start at the selected sector. The Flash Operation Start Bit of FMCON
register will be cleared automatically thereafter.
2. If you disable FMUSR before the sector erase operation, the Flash Operation Start Bit (FMCON.0 bit) remains ‘high’. This
specifies erase or hard lock start operation. FMCON.0 bit is not cleared even though the next instruction is executed.
Therefore, you should be careful while setting FMUSR for sector erase. It should not have any effect on other flash
sectors.