ML610Q111/ML610Q112 User’s Manual
Chapter 23 Data Flash Memory
FEUL610Q111
23-16
Figure 23-4 shows a sample program of
block
erase.
LEA
offset FLASHAH
; EA <- FLASHAH address
MOV
R0,
#0FAH
; Flash acceptor enable data
MOV
R1,
#0F5H
; Flash acceptor enable data
MOV
R4,
#(offset FLASHACP)&0FFH
MOV
R5,
#(offset FLASHACP)>>8
; ER4 <- FLASHACP address
:
(Set the erase start block address in R9)
:
SB
FSELF
; Enables the flash rewrite function
;
ST
R0,
[ER4]
; Enable flash acceptor
ST
R1,
[ER4]
; Enable flash acceptor
;
MOV
R2,
#02H
; Setting data for the segment
ST
R2,
FLASHSEG
; Set the segment
;
ST
R9 ,
[EA]
; Set block address
;
MOV
R2,
#01H
; Setting data for block erase
ST
R2,
FLASHCON
; Start block erase
NOP
; * Always set
NOP
; * Always set
;
RB
FSELF
; Disables the flash rewrite function
;
Figure 23-4
Sample Program of Block Erase
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.
Summary of Contents for ML610Q111
Page 1: ...ML610Q111 ML610Q112 User s Manual Issue Date Nov 16 2016 FEUL610Q111 05 ...
Page 14: ...Chapter 1 Overview ...
Page 26: ...Chapter 2 CPU and Memory Space ...
Page 34: ...Chapter 3 Reset Function ...
Page 38: ...Chapter 4 MCU Control Function ...
Page 53: ...Chapter 5 Interrupts INTs ...
Page 81: ...Chapter 6 Clock Generation Circuit ...
Page 95: ...Chapter 7 Time Base Counter ...
Page 103: ...Chapter 8 Timers ...
Page 145: ...Chapter 9 Watchdog Timer ...
Page 153: ...Chapter 10 PWM ...
Page 199: ...Chapter 11 Synchronous Serial Port ...
Page 212: ...Chapter 12 UART ...
Page 240: ...Chapter 13 I2 C Bus Interface Master ...
Page 254: ...Chapter 14 I2 C Bus Interface Slave ...
Page 269: ...Chapter 15 Port A ...
Page 279: ...Chapter 16 Port B ...
Page 291: ...Chapter 17 Port C ...
Page 303: ...Chapter 18 Port D ...
Page 312: ...Chapter 19 Port AB Interrupts ...
Page 317: ...Chapter 20 Successive Approximation Type A D Converter ...
Page 335: ...Chapter 21 Voltage Level Supervisor ...
Page 342: ...Chapter 22 Analog Comparator ...
Page 353: ...Chapter 23 Data Flash Memory ...
Page 373: ...Chapter 24 On chip Debug ...
Page 375: ...Appendixes ...
Page 393: ...Appendix E ...
Page 398: ...Revision History ...