CMT2380F17
Rev0.1 | 306/347
www.cmostek.com
28.4
In-Application-Programming (IAP)
The CMT2380F17 has built a function as In Application Programmable (IAP), which allows some region
in the Flash memory to be used as non-volatile data storage while the application program is running. This
useful feature can be applied to the application where the data must be kept after power off. Thus, there is no
need to use an external serial EEPROM (such as 93C46, 24C01, .., and so on) for saving the non-volatile
data.
In fact, the operating of IAP is the same as that of ISP except the Flash range to be programmed is
different. The programmable Flash range for ISP operating is located within the AP and IAP memory, while the
range for IAP operating is only located within the configured IAP-memory.
Note:
(1) For CMT2380F17 IAP feature, the software should specify an IAP-memory space by writing IAPLB
in IFMT defined. The IAP-memory space can be also configured by a universal Writer/Programmer or
Megawin proprietary Writer/Programmer which configuration is corresponding to IAPLB initial value.
(2) The program code to execute IAP is located in the AP-memory and just only program IAP-memory
not ISP-memory.
28.4.1
IAP-memory Boundary/Range
If ISP-memory is specified, the range of the IAP-memory is determined by IAP and the ISP starts address
as listed below.
IAP high boundary = ISP start address
–1.
IAP low boundary = ISP start address - IAP.
If ISP-memory is not specified, the range of the IAP-memory is determined by the following formula.
IAP high boundary = 0x3FFF.
IAP low boundary = 0x3FFF
– IAP + 1.
For example, if ISP-memory is 1K, so that ISP start address is 0x3C00, and IAP-memory is 1K, then the
IAP-memory range is located at 0x3800 ~ 0x3BFF. The IAP low boundary in MG82F6D17 is defined by IAPLB
register which can be modified by software to adjust the IAP size in user’s AP program.
28.4.2
Update data in IAP-memory
The special funct
ion registers are related to ISP/IAP would be shown in Section “28.5 ISP/IAP Register“.
Because the IAP-memory is a part of Flash memory, only Page Erase, no Byte Erase, is provided for
Flash erasing. To update “one byte” in the IAP-memory, users can not directly program the new datum into
that byte. The following steps show the proper procedure:
Step 1: Save the whole page flash data (with 512 bytes) into XRAM buffer which contains the data to be
updated. Step 2: Erase this page (using ISP/IAP Flash Page Erase mode).
Step 3: Modify the new data on the byte(s) in the XRAM buffer.
Step 4: Program the updated data out of the XRAM buffer into this page (using ISP/IAP Flash Program
mode). To read the data in the IAP-memory, users can use the ISP/IAP Flash Read mode to get the targeted
data.
Summary of Contents for CMT2380F17
Page 27: ...CMT2380F17 Rev0 1 27 347 www cmostek com 1 25 Phase Noise...
Page 177: ...CMT2380F17 Rev0 1 177 347 www cmostek com Figure 17 3 PCA Interrupt System...
Page 246: ...CMT2380F17 Rev0 1 246 347 www cmostek com SnMIPS S0MI S1MI 1 P3 3 P4 7...