Erase Mode - Hitachi H8/3048 Hardware Manual

Single-chip microcomputer
Table of Contents

Advertisement

CMP.B
BEQ
www.DataSheet4U.com
PVNG:
MOV.B
MOV.B
CMP.B
BEQ
INC.B
SHLL.W
BRA
PVOK:
MOV.W
MOV.B
MOV.B
MOV.B
. . . . . . . . . . . . . . . . . .
NGEND:
MOV.W
MOV.B
MOV.B
Programming error

18.7.4 Erase Mode

To erase the flash memory, follow the erasing algorithm shown in figure 18-16. This erasing
algorithm can erase data without subjecting the device to voltage stress or impairing the reliability
of programmed data.
To erase flash memory, before starting to erase, first place all memory data in all blocks to be
erased in the programmed state (program all memory data to H'00). If all memory data is not in
the programmed state, follow the sequence described later to program the memory data to zero.
To select the flash memory areas to be erased, first set the V
register (FLMCR), wait 5 to 10 µs, and set up erase block registers 1 and 2 (EBR1 and EBR2).
Next set the E bit in FLMCR, selecting erase mode. The erase time is the time during which the
E bit is set. To prevent overerasing, use a software timer to divide the erase time. Overerasing,
due to program runaway for example, can give memory cells a negative threshold voltage and
cause them to operate incorrectly. Before selecting erase mode, set up the watchdog timer so as to
prevent overerasing.
R3H,
R1H
PVOK
#40,
R5H
R5H,
@FLMCR:8 ;
#06,
R0L
NGEND
R0L
E4
PRGMS
#4000,
R5
R5H,
@FLMCR:8 ;
R5L,
@EBR*:8
R5L,
@FLMCR:8 ;
#4000,
R5
R5L,
@EBR*:8
R5L,
@FLMCR:8 ;
593
Compare programmed data with read data
;
;
Program-verify decision
;
Clear PV bit
Program-verify executed 6 times?
;
;
If program-verify executed 6 times, branch
to NGEND
Program-verify fail count + 1 → R0L
;
Double program loop counter value
;
;
Program again
;
Clear PV bit
;
Clear EBR*
Clear V
E bit
PP
One byte programmed
;
;
Clear EBR*
Clear V
E bit
PP
E bit in the flash memory control
PP

Advertisement

Table of Contents
loading

Table of Contents