mpc82g516a Megawin Technology, mpc82g516a Datasheet - Page 107

no-image

mpc82g516a

Manufacturer Part Number
mpc82g516a
Description
8-bit Microcontroller
Manufacturer
Megawin Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mpc82g516aE
Manufacturer:
MEGAWIN
Quantity:
1 200
Part Number:
mpc82g516aF
Manufacturer:
MEGAWIN
Quantity:
20 000
20.3 IAP Operation
The way to program the IAP-memory is called the ‘In-Application Programming’ (IAP), which is all the same as
the ISP except the following differences:
(1) The IAP can only program the
(2) The program code to execute IAP is located in the
All the ISP modes (see
there must exist an IAP-memory. For the MPC82G516A, the user can configure an IAP-memory by a Universal
Programmer, the “Megawin 8051 Writer” or the “Megawin 8051 ICP Programmer” (see
20.3.1 Update the Data in the IAP-memory
Because the Flash can only perform page erasing, and only the 0xFF byte can be programmed into a non-0xFF
byte. So, if some bytes (in the same page) to be changed are not 0xFF, the user should comply with the following
steps:
Here the user might question: Where is the page_buffer? The page_buffer may exist in the traditional 256 bytes
of scratchpad RAM or the on-chip eXpanded RAM (i.e., XRAM, accessed by the ‘MOVX’ instruction).
Normally, the page_buffer size should be equal to the Flash page size (i.e., 512 bytes). However, sometimes it is
impossible to meet it due to the limited available space of RAM or XRAM. Here is an example that shows how to
solve it. Suppose 280 bytes of non-volatile storage are wanted, but only 128 bytes of RAM are available for the
page_buffer. In this case, we may use 3 pages to offer the 280 bytes of non-volatile storage: the 1st page offers
128 bytes, the 2nd page offers 128 bytes and the 3rd page offers 24 bytes, as shown in the Figure 20-10. Note
that we have no choice but to take this usage!
Figure 20-10. Usage of IAP-memory when the page buffer is less than 512 bytes
107
Step1) Read all the data in that page and save them in a page_buffer.
Step2) Erase that page.
Step3) Update the wanted bytes in the page_buffer.
Step4) Re-program that page with all the data out of the updated page_buffer.
located in the ISP-memory.
Total 280 bytes
Section
IAP lower boundary
20.2.2) can also be applied to the IAP operation. Prior to using the IAP function,
IAP-memory
MPC82G516A Data Sheet
while the ISP can program both the
Only 128 bytes used
Only 128 bytes used
Only 24 bytes used
.
.
.
AP-memory
The 1st page,
512 bytes
The 2nd page,
512 bytes
The 3rd page,
512 bytes
while the program code to execute ISP is
IAP-memory
AP-memory
Section
20.4.1).
and IAP-memory.
MEGAWIN

Related parts for mpc82g516a