28 ISP and IAP
The flash memory of CMT2380F17 is partitioned into AP-memory, IAP-memory and ISP-memory.
AP-memory is used to store user's application program; IAP-memory is used to store the non-volatile
application data; and, ISP-memory is used to store the boot loader program for In-System Programming.
When MCU is running in ISP region, MCU could modify the AP and IAP memory for software upgraded. If
MCU is running in AP region, software could only modify the IAP memory for storage data updated.。
28.1 CMT2380F17 Flash Memory Configuration
There are total 16K bytes of Flash Memory in CMT2380F17 and Figure 28–1 shows the device flash
configuration of MG82F6D17. The ISP-memory can be configured as disabled or up to 7.5K bytes space by
hardware option setting with 0.5KB step. The flash size of IAP memory is located between the IAP low
boundary and IAP high boundary. The IAP low boundary is defined by the value of IAPLB register. The IAP
high boundary is associated with ISP start address which decides ISP memory size by hardware option. The
IAPLB register value is configured by hardware option or AP software programming. All of the AP, IAP and ISP
memory are shared the total 16K bytes flash memory.
Note:
(1) ISP Start Address:
0x2200 if ISP Size = 7.5KB
0x2400 if ISP Size = 7KB
....................................
0x3000 if ISP Size = 4KB
....................................
0x3C00 if ISP Size = 1KB
0x3E00 if ISP Size = 0.5KB
(2) IAP Size :
IAPLB = IAP Low Boundary (ROM High-Byte address)
IAP Start Address = {IAPLB, 00H}
IAP Size = ISP Start Address – IAP Start Address
Set LAPLB = Change IAP Size
(3) If ISP is enabled:
IAP High Boundary = ISP Start Address – 1
IAP Low Boundary = ISP Start Address – IAP Size
(4) If ISP is disabled:
IAP High Boundary = 0x3FFF
IAP Low Boundary = 0x3FFF – IAP Size + 1
Figure 28-1. CMT2380F17 Flash Flash Memory Configuration
Note:
In default, the MG82F6D17 that Megawin shipped had configured the flash memory for 1.5K ISP, 1K IAP and
Lock enabled. The 1.5K ISP region is inserted Megawin proprietary COMBO ISP code to perform
In-System-Programming through Megawin 1-Line ISP protocol and COM port ISP. The 1K IAP size can be
re-configured by software for application required.
28.2 CMT2380F17 Flash Access in ISP/IAP
There are 3 flash access modes are provided in CMT2380F17 for ISP and IAP application: page erase
mode, byte program mode and read mode. MCU software uses these three modes to update new data into
flash storage and get flash content. This section shows the flow chart and demo code for the various flash
modes.
0x0000
Application Code
IAP Low Boundary
IAPLB = 0x36 (default)
IAP start 0x3600
IAP High Boundary
ISP Start Address
ISP start 0x3A00 (default)
ISP Code
0x3FFF
Rev0.1 | 298/347
CMT2380F17
AP-memory
IAP Data
IAP-memory
ISP-memory
www.cmostek.com
Flash Memory
Total: 16KB
Need help?
Do you have a question about the CMT2380F17 and is the answer not in the manual?
Questions and answers