AN1477
APPLICATION NOTE
EMULATED DATA EEPRO M WITH XFLASH MEMORY
by CMG/MCD Applicatio n Laborato ry
INTRODU CT I ON
When the dat a EEPR OM is not av ailab le in a ST 7 d evice, i t can be emulated by th e XFlas h
memory with some re strictions. This App lication Note descri bes how to emulate thi s feature
with a ST72F264 device and the restrictions this emulation implies.
Data EEPROM can be emulated in all XFlash devices (all Lite, ST72F344, ....).
For more information concerning ST7 programming, including a .zip file with the complete
corresponding code for the ST72F264, visit our web site at www.st.com.
AN1477/1201 1/5
1
EMULATED DATA EEPROM WITH XFLASH MEMOR Y
1 RESTRICTIONS
1 To guarantee that the XFlash program memory is write protected when programming the
Emulated Data EEPROM, the whole program memory MUST be located in sector 0 (refer
to the datasheet). This implies that:
– The maximum program m emory size is 4 Kbytes (sector 0 set by option byte to the
maximum size which allows sector 1 availability).
– IAP is not available for program memory.
2 During emulated data EEPROM programming, the XFlash can not be executed. This
implies that:
– The software which programs the emulated data E EPROM must be located i n RAM.
This software needs at least 16 bytes of RAM as shown in following program example.
– The interrupts cannot be served during programming so they have to be masked.
2 PROCEDURE
To prog ram 1 by te in the em ulate d dat a EEP ROM (locat ed in s ector 1) th e foll owing s tep s
have to be done:
1 Enter the XFlash RASS key to unlock the access to the FCSR register (only once, after
reset for example).
2 Download the programming driver into RAM (from 0083h to 008Fh for example).
3 Write the data and address to be programmed in a RAM buffer (at RAM address 0080h
to 0082h for example).
4 Call the downloaded RAM driver to program the emulated data EEPROM.
3 ASSEMBLER PRO GRAM EXAMPLE
The following program example describes a driver routine to be called to emulate data
EEPROM wi th an X Fla sh ST 7 devi ce. Th is ex am ple ass ume s th at a ll res tric tions ar e t ak en
into account.
In this example, the program memory size is 4 Kbytes and the data EEPROM is also 4 Kbytes,
but these sizes can be adjusted through option bytes depending on the needs.
st7/
;***************************************************************************
; TITLE: XdataE2Emul.asm
; AUTHOR: CMG_MCD Application Team
; DESCRIPTION: Data EEPROM emulation with XFlash memory (ST72F264 example)
;***************************************************************************
TITLE "XdataE2Emul.asm"
BYTES
2/5
2