mg84fl54 Megawin Technology, mg84fl54 Datasheet - Page 103

no-image

mg84fl54

Manufacturer Part Number
mg84fl54
Description
Full-speed Usb Micro-controller
Manufacturer
Megawin Technology
Datasheet
20.3. In-Application-Programming (IAP)
The device is 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-memory, while the range for IAP
operating is located within the configured IAP-memory.
Note:
20.3.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.
If ISP-memory is not specified, the range of the IAP-memory is determined by the following formula.
For example, if ISP-memory is 2K, so that ISP start address is 0x3800, and IAP-memory is 1K, then the IAP-
memory range is located at 0x3400 ~ 0x37FF.
20.3.2. Update data in IAP-memory
The special function registers are related to ISP/IAP would be shown in
Because the IAP-memory is a part of Flash memory, only
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 data in the whole page (with 512 bytes) which contains the data to be updated into a buffer.
Step 2: Erase this page
Step 3: Update the wanted byte(s) in the buffer.
Step 4: Program the updated data out of the buffer into this page
To read the data in the IAP-memory, users can use either the
mode of
MEGAWIN
(1) Before using the IAP feature, the user should configure an IAP-memory space by using a universal
(2) The program code to execute IAP is located in the AP-memory and
Writer/Programmer or Megawin proprietary Writer.
not
IAP higher boundary = ISP start address –1.
IAP lower boundary = ISP start address - IAP.
IAP higher boundary = 0x3FFF.
IAP lower boundary = 0x4000 - IAP.
ISP.
ISP-memory.
(using Page Erase mode of
MG84FL54B Data sheet
ISP).
Page Erase, no Byte
“MOVC A,@A+DPTR”
(using Byte Program mode of
20.2.1 ISP/IAP Register
just only
Erase, is provided for Flash
program IAP-memory
instruction or the
.
ISP).
Read
103

Related parts for mg84fl54