Megawin Technology Co., Ltd.
MG87FE/L52
IFMT (ISP Flash Mode Table)
Name
IFMT
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
Reserved
Mode Selection
B7~B3 : Reserved
Mode Selection :
B2
0
B1
0
B0
Mode
0
1
0
1
0
1
Standby
0
0
AP-memory read
0
1
AP-memory program
0
1
AP-memory page erase
IAPLB write
1
0
1
0
IAPLB read
IAPLB (IAP Flash Mode Table)
Name
IAPLB
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
Data
B7~B0 : The IAPLB determines the IAP-memory lower boundary. Since a Flash page has 512
bytes, the IAPLB must be an even number.
To read IAPLB, MCU need to define the IMFT for mode selection on IAPLB Read and set
ISPCR.ISPEN. And then write 0x46h & 0xB9h sequentially into SCMD. The IAPLB content is
available in IFD. If write IAPLB, MCU will put new IAPLB setting value in IFD firstly. And then
select IMFT, enable ISPCR.ISPEN and then set SCMD. The IAPLB content has already finished
the updated sequence.
The range of the IAP-memory is determined by IAPLB and the ISP start-address was listed
below.
IAP lower boundary = IAPLB x 256, and
IAP higher boundary = ISP start address – 1.
For example, if IAPLB=0x12 and ISP start address is 0x1C00, then the IAP-memory range was
located at 0x1200 ~ 0x1BFF.
Additional attention point, the IAP low boundary address must not be higher than ISP start
address.
34
Preliminary ver 1.3
Date: 2009-JAN-20