Philips UM10109 Microscope & Magnifier User Manual


 
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
User manual Rev. 02 — 23 May 2005 119 of 133
Philips Semiconductors
UM10109
P89LPC932A1 User manual
IAP functions which write or erase code memory require an authorization key be set by
the calling routine prior to performing the IAP function call. This authorization key is set by
writing 96H to RAM location FFH. The following example was written using the Keil C
compiler. The methods used to access a specific physical address in memory may vary
with other compilers.
#include <ABSACC.H> /* enable absolute memory access */
#define key DBYTE[0xFF] /* force key to be at address 0xFF */
short (*pgm_mtp) (void) = 0xFF00; /* set pointer to IAP entry point */;
key = 0x96; /* set the authorization key */
pgm_mtp (); /* execute the IAP function call */
After the function call is processed by the IAP routine, the authorization key will be
cleared. Thus it is necessary for the authorization key to be set prior to EACH call to
PGM_MTP that requires a key. If an IAP routine that requires an authorization key is
called without a valid authorization key present, the MCU will perform a reset.
18.14 Flash write enable
(This feature was not present in the original P89LPC932).
This device has hardware write enable protection. This protection applies to both ISP and
IAP modes and applies to both the user code memory space and the user configuration
bytes (UCFG1, BOOTVEC, and BOOTSTAT). This protection does not apply to ICP or
parallel programmer modes. If the Activate Write Enable (AWE) bit in BOOTSTAT.7 is a
logic 0, an internal Write Enable (WE) flag is forced set and writes to the flash memory
and configuration bytes are enabled. If the Active Write Enable (AWE) bit is a logic 1, then
the state of the internal WE flag can be controlled by the user.
The WE flag is SET by writing the Set Write Enable (08H) command to FMCON followed
by a key value (96H) to FMDATA:
FMCON = 0x08;
FMDATA = 0x96;
The WE flag is CLEARED by writing the Clear Write Enable (0BH) command to FMCON
followed by a key value (96H) to FMDATA, or by a reset:
FMCON = 0x0B;
FMDATA = 0x96;
The ISP function in this device sets the WE flag prior to calling the IAP routines. The IAP
function in this device executes a Clear Write Enable command following any write
operation. If the Write Enable function is active, user code which calls IAP routines will
need to set the Write Enable flag prior to each IAP write function call.
18.15 Configuration byte protection
(This feature was not present in the original P89LPC932).
In addition to the hardware write enable protection, described above, the ‘configuration
bytes’ may be separately write protected. These configuration bytes include UCFG1,
BOOTVEC, and BOOTSTAT. This protection applies to both ISP and IAP modes and does
not apply to ICP or parallel programmer modes.