VRS51C1000
T
ABLE
10:IAP F
LASH
C
ONTROL
R
EGISTER
- SFR F7
H
7
6
5
4
3
2
IAPFCTRL[15:8]
1
0
IAP_PROG: MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
IAPFDATA,#55H
IAPFDATA,#0AAH
IAPFDATA,#55H
SYSCON,#04H
IAPFADHI, FADRSH
IAPFADLO,FADRSL
IAPFDATA,FDATA
IAPFCTRL,#80H
;Sequence to Enable Writing
; the IAPSTART bit
;ENABLE IAP FUNCTION
;Set MSB of address to program
;Set LSB of address to program
;Set Data to Program
;Set the IAP Start bit
Bit
7
6
5
4
3
2
1
0
Mnemonic
IAPSTART
Unused
Unused
Unused
Unused
Unused
IAPFCT[1:0]
Description
IAP Selected operation Start sequence
-
-
-
-
-
Flash Memory IAP Function
;**The program Counter will stop until the IAP function is completed
IAP Page Erase Function
By using the IAP feature, it is possible to perform a
Page erase of the VRS51C1000 Flash memory (note
that the memory area occupied by the ISP boot
program cannot be page erased). Each page is 512
Bytes in size.
To perform a flash page erase, the page address is
specified by the XY (hex) value written into the
IAPFADHI register (The value 00h must be written into
the IAPFADLO registers)
If the “Y” portion of the IAPFADHI register represents
an even number, the page that will be erased
corresponds to the range XY00h to X(Y+1)FFh
If the “Y” portion of the IAPFADHI register represents
an odd number, the page that will be erased
corresponds to the range X(Y-1)00h to XYFFh
The following program example erases the page
corresponding to the address B000h-CFFFh
;** Erase Flash page located at address B000h to CFFFh.
PageErase: MOV
IAPFDATA,#55H
;Sequence to Enable Writing
MOV
IAPFDATA,#0AAH
; the IAPSTART bit
MOV
IAPFDATA,#55H
MOV
MOV
MOV
MOV
SYSCON,#04H
IAPFADHI, #0B0h
IAPFADLO,#00h
IAPFCTRL,#82H
;ENABLE IAP FUNCTION
;Set MSB of Page address to erase
;Set LSB of address = 00
;SET THE IAP START BIT
The IAP sub-system handles four different functions.
The IAP function performed is controlled by the
IAPFCT bits as follows:
T
ABLE
11:IAP F
UNCTIONS
IAPFCT[1:0] Bits value
00
01
10
11
IAP Function
Flash Byte Program
Flash Erase Protect
Flash Page Erase
Flash Erase
It is important to note that for security reasons, the
IAPSTART bit of the IAPFCTRL register is configured
as read-only by default.
In order to set the IAPSTART bit to 1, the following
operation sequence must be performed first:
MOV
MOV
MOV
IAPFDATA,#55h
IAPFDATA,#AAh
IAPFDATA,#55h
The IAPSTART bit can be set to 1.
Once the start bit is set to 1, the IAP sub-system will
read the contents of the IAP Flash Address and Data
registers and hold the VRS51C1000 program counter
at its current value until the IAP operation is
completed. When the IAP operation is complete, the
IAPSTART bit is cleared and the program will continue
executing.
IAP Byte Program Function
The IAP byte program function is used to program a
byte into the specified Flash memory location under
the control of the IAP feature. See the following
program example:
IAP Chip Erase Function
The IAP chip erase function will erase the entire flash
memory contents with the exception of the ISP boot
program area. Running this function will also
automatically unprotect the Flash memory.
IAP Chip Protect Function
When the chip protect function is enabled, values read
back from Flash memory will be 00h.
______________________________________________________________________________________________
www.ramtron.com
page 8 of 48