Switching from ISP program to AP program
The device permits the user normally start running own AP program as soon as the ISP
program has finished updating the flash content. Just program an instruction at the tail of ISP
program as
ISPCR ← x01xxxxxB
/* set SWBS=0 to boot from AP entrance.
set SWRST=1 to trigger software reset*/
which disables flash-writing authority, set SWBS 0, and trigger a software reset. After that, the
system will be reset (not powered-up), and the system will refer to SWBS so to startup from
AP program entrance. For power-up procedure, the HWBS will be referred to decide the
program entrance, but for software reset, SWBS will be referred to.
Switch to the ISP program from AP program
The device also permits the user program switches directly to the ISP program. Just program
an instruction in the AP program as
ISPCR ← x11xxxxxB
/* set SWBS=1 to boot from ISP entrance.
set SWRST=1 to trigger software reset*/
which sets SWBS 1 to direct the device boot from AP program, and trigger a software reset.
After that, the system will be reset (not powered-up), and the system will refer to SWBS so to
startup from ISP program entrance.
In-Application Program (IAP)
The In-Application Program feature is designed for user to Read/Write nonvolatile data flash.
It may bring great help to store parameters those should be independent of power-up and
power-done action. In other words, the user can restore data in data flash memory. After
shutting down and rebooting the MCU, user still can get the original value which previously
had stored in.
The user can program the data flash according to the same way as ISP program, and gets
deeper understanding related to SFR IFD, IFADRL, IFADRH, IFMT, SCMD, and ISPCR.
The data flash can be programmed by the AP program as well as the ISP program.
The ISP program may program the AP memory and data flash. Whereas the AP program may
program the data flash but not the ISP memory. If the AP program desires to change the ISP
memory associated with specific address space, the hardware will ignore it.
MEGAWIN
MPC82x54A Data Sheet
63