ML51/ML54/ML56
Sep. 01, 2020
Page
341
of 719
Rev 2.00
ML
51
/ML
54
/ML
5
6 S
E
RI
E
S
TECHNI
CA
L
RE
F
E
R
E
NC
E
M
A
NU
A
L
ML51/M
L54
/M
L56
Series
Tec
hnical Reference
Manual
6.3 Flash Memory Control
6.3.1
In-application-programming (IAP)
Unlike RAM’s real-time operation, to update Flash data often takes long time. Furthermore, it is a quite
complex timing procedure to erase, program, or read Flash data. The ML51/ML54/ML56 Series
carried out the Flash operation with convenient mechanism to help user re-programming the Flash
content by In-Application-Programming (IAP). IAP is an in-circuit electrical erasure and programming
method through software.
After IAP enabling by setting IAPEN (CHPCON.0 with TA protected) and setting the enable bit in
IAPUEN that allows the target block to be updated, user can easily fill the 16-bit target address in
IAPAH and IAPAL, data in IAPFD, and command in IAPCN. Then the IAP is ready to begin by setting
a triggering bit IAPGO (IAPTRG.0). Note that IAPTRG is also TA protected. At this moment, the CPU
holds the Program Counter and the built-in IAP automation takes over to control the internal charge-
pump for high voltage and the detail signal timing. The erase and program time is internally controlled
disregard of the operating voltage and frequency. Nominally, a page-erase time is 5 ms and a byte-
program time is 23.5 μs. After IAP action completed, the Program Counter continues to run the
following instructions. The IAPGO bit will be automatically cleared. An IAP failure flag, IAPFF
(CHPCON.6), can be check whether the previous IAP operation was successful or not. Through this
progress, user can easily erase, program, and verify the Flash Memory by just taking care of pure
software.
The following registers are related to IAP processing.
CONFIG2
7
6
5
4
3
2
1
0
CBODEN
CBOV[2:0]
BOIAP
CBORST
-
-
R/W
R/W
R/W
R/W
-
-
Factory default value: 1111 1111b
Bit
Name
Description
[3]
BOIAP
Brown-Out Inhibiting IAP
This bit decide whether IAP erasing or programming is inhibited by brown-out status. This bit
is valid only when brown-out detection is enabled.
1 = IAP erasing or programming is inhibited if V
DD
is lower than V
BOD
.
0 = IAP erasing or programming is allowed under any workable V
DD
.