
ML51/ML54/ML56
Sep. 01, 2020
Page
353
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
volatile unsigned char code Data_Flash[128] _at_ 0x0200;
Main (void)
{
TA = 0Xaa;
//CHPCON is TA protected
TA = 0x55;
CHPCON |= 0x01;
//IAPEN = 1, enable IAP mode
TA = 0Xaa;
//IAPUEN is TA protected
TA = 0x55;
IAPUEN |= 0x01;
//APUEN = 1, enable APROM update
IAPCN = PAGE_ERASE_AP;
//Erase page 200h~27Fh
IAPAH = 0x02;
IAPAL = 0x00;
IAPFD = 0Xff;
TA = 0Xaa;
//IAPTRG is TA protected
TA = 0x55;
IAPTRG |= 0x01;
//write ‘1’ to IAPGO to trigger IAP process
IAPCN = BYTE_PROGRAM_AP;
// Program 201h with 55h
IAPAH = 0x02;
IAPAL = 0x01;
IAPFD = 0x55;
TA = 0Xaa;
TA = 0x55;
IAPTRG |= 0x01;
//write ‘1’ to IAPGO to trigger IAP process
TA = 0Xaa;
//IAPUEN is TA protected
TA = 0x55;
IAPUEN &= ~0x01;
//APUEN = 0, disable APROM update
TA = 0Xaa;
//CHPCON is TA protected
TA = 0x55;
CHPCON &= ~0x01;
//IAPEN = 0, disable IAP mode
P0 = Data_Flash[1];
//Read content of address 200h+1
while(1);
}
In-System-Programming (ISP)
6.3.1.5
The Flash Memory supports both hardware programming and In-Application-Programming (IAP). If the
product is just under development or the end product needs firmware updating in the hand of an end
user, the hardware programming mode will make repeated programming difficult and inconvenient. In-
System-Programming (ISP) makes it easy and possible. ISP performs Flash Memory updating without
removing the microcontroller from the system. It allows a device to be re-programmed under software
control. Furthermore, the capability to update the application firmware makes wide range of
applications possible.
User can develop a custom Boot Code that resides in LDROM. The maximum size of LDROM is 4K
Byte. User developed Boot Code can be re-programmed by parallel writer or In-Circuit-Programming
(ICP) tool.