VRS51C1000
IAP_PROG: MOV
IAPFDATA,#55H
IAPFDATA,#0AAH
IAPFDATA,#55H
;Sequence to Enable Writing
; the IAPSTART bit
TABLE 10:IAP FLASH CONTROL REGISTER - SFR F7H
MOV
MOV
7
6
5
4
3
2
1
0
IAPFCTRL[15:8]
MOV
MOV
MOV
MOV
MOV
SYSCON,#04H
;ENABLE IAP FUNCTION
;Set MSB of address to program
;Set LSB of address to program
;Set Data to Program
IAPFADHI, FADRSH
IAPFADLO,FADRSL
IAPFDATA,FDATA
IAPFCTRL,#80H
Bit
Mnemonic Description
IAPSTART IAP Selected operation Start sequence
;Set the IAP Start bit
7
6
5
4
3
2
1
0
Unused
Unused
Unused
Unused
Unused
-
-
-
-
-
;**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.
IAPFCT[1:0]
Flash Memory IAP Function
The IAP sub-system handles four different functions.
The IAP function performed is controlled by the
IAPFCT bits as follows:
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)
TABLE 11:IAP FUNCTIONS
IAPFCT[1:0] Bits value
IAP Function
Flash Byte Program
Flash Erase Protect
Flash Page Erase
Flash Erase
00
01
10
11
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
It is important to note that for security reasons, the
IAPSTART bit of the IAPFCTRL register is configured
as read-only by default.
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
In order to set the IAPSTART bit to 1, the following
operation sequence must be performed first:
The following program example erases the page
corresponding to the address B000h-CFFFh
;** Erase Flash page located at address B000h to CFFFh.
MOV IAPFDATA,#55h
MOV IAPFDATA,#AAh
MOV IAPFDATA,#55h
PageErase: MOV
IAPFDATA,#55H
IAPFDATA,#0AAH
IAPFDATA,#55H
;Sequence to Enable Writing
; the IAPSTART bit
MOV
MOV
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
The IAPSTART bit can be set to 1.
;SET THE IAP START BIT
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 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 Byte Program Function
IAP Chip Protect 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:
When the chip protect function is enabled, values read
back from Flash memory will be 00h.
______________________________________________________________________________________________
www.ramtron.com page 8 of 48