Lapis ML610Q111 User Manual page 369

Table of Contents

Advertisement

Figure 23-4 shows a sample program of
LEA
MOV
MOV
MOV
MOV
(Set the erase start block address in R9)
SB
;
ST
ST
;
MOV
ST
;
ST
;
MOV
ST
NOP
NOP
;
RB
;
Note:
− Be sure to set the NOP instruction twice or more, following the block erase start instruction.
− Use it with high-speed clock oscillation (HSCLK) enabled in the frequency control register (FCON1), and with HSCLK
selected as system clock.
− During sector erase, the CPU is in a wait state for max.100ms. Clear the WDT counter in a proper timing, because the
peripheral circuits continue to work. As the WDT counter cannot be cleared while erasing, set the WDT overflow period
125ms or longer.
− Writing "1" to one of FPRT0 to FPRT3 disables the subsequent block erases in the segment 2 0000H to 0FFFH.
FEUL610Q111
erase.
block
offset FLASHAH
R0,
#0FAH
R1,
#0F5H
R4,
#(offset FLASHACP)&0FFH
R5,
#(offset FLASHACP)>>8
:
:
FSELF
R0,
[ER4]
R1,
[ER4]
R2,
#02H
R2,
FLASHSEG
R9 ,
[EA]
R2,
#01H
R2,
FLASHCON
FSELF
Figure 23-4
; EA <- FLASHAH address
; Flash acceptor enable data
; Flash acceptor enable data
; ER4 <- FLASHACP address
; Enables the flash rewrite function
; Enable flash acceptor
; Enable flash acceptor
; Setting data for the segment
; Set the segment
; Set block address
; Setting data for block erase
; Start block erase
; * Always set
; * Always set
; Disables the flash rewrite function
Sample Program of Block Erase
ML610Q111/ML610Q112 User's Manual
Chapter 23 Data Flash Memory
23-16

Advertisement

Table of Contents
loading

Related Products for Lapis ML610Q111

This manual is also suitable for:

Ml610q112

Table of Contents