Philips UM10109 User Manual

Page of 133
 
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
User manual
Rev. 02 — 23 May 2005 
111 of 133
Philips Semiconductors
UM10109
P89LPC932A1 User manual
 
Write the address of the next byte to be programmed to FMADRL, if desired. (Not 
needed for contiguous bytes since FMADRL is auto-incremented). All bytes to be 
programmed must be within the same page.
Write the data for the next byte to be programmed to FMDATA.
Repeat writing of FMADRL and/or FMDATA until all desired bytes have been loaded 
into the page register.
Write the page address in user code memory to FMADRH and FMADRL[7:6], if not 
previously included when writing the page register address to FMADRL[5:0].
Write the erase-program command (68H) to FMCON, starting the erase-program 
cycle.
Read FMCON to check status. If aborted, repeat starting with the LOAD command.
An assembly language routine to load the page register and perform an erase/program 
operation is shown below.
;**************************************************
;*  pgm user code   *
;**************************************************
;*   
*
;* Inputs:  
*
;* R3 = number of bytes to program (byte)  
*
;* R4 = page address MSB(byte)   
*
Table 94:
Flash Memory Control register (FMCON - address E4h) bit allocation
Bit
7
6
5
4
3
2
1
0
Symbol  (R)
-
-
-
-
HVA
HVE
SV
OI
Symbol (W) FMCMD.7
FMCMD.6
FMCMD.5
FMCMD.4
FMCMD.3
FMCMD.2
FMCMD.1
FMCMD.0
Reset
0
0
0
0
0
0
0
0
Table 95:
Flash Memory Control register (FMCON - address E4h) bit description
Bit  Symbol
Access
Description
0
OI
R
Operation interrupted. Set when cycle aborted due to an interrupt or reset.
FMCMD.0
W
Command byte bit 0.
1
SV
R
Security violation. Set when an attempt is made to program, erase, or CRC a secured sector or 
page.
FMCMD.1
W
Command byte bit 1
2
HVE
R
High voltage error. Set when an error occurs in the high voltage generator. 
FMCMD.2
W
Command byte bit 2.
3
HVA
R
High voltage abort. Set if either an interrupt or a brown-out is detected during a program or 
erase cycle. Also set if the brown-out detector is disabled at the start of a program or erase 
cycle.
FMCMD.3
W
Command byte bit 3.
4:7
-
R
reserved
4:7
FMCMD.4
W
Command byte bit 4.
4:7
FMCMD.5
W
Command byte bit 5.
4:7
FMCMD.6
W
Command byte bit 6.
4:7
FMCMD.7
W
Command byte bit 7.