s29ns01gs Meet Spansion Inc., s29ns01gs Datasheet - Page 37

no-image

s29ns01gs

Manufacturer Part Number
s29ns01gs
Description
S29ns01gs 1024 Megabit 128 Megabyte 16-bit Data Width, Burst Access, Simultaneous Read/write, 1.8 Volt-only Flash Memory In 65 Nm Mirrorbit Technology
Manufacturer
Meet Spansion Inc.
Datasheet
April 20, 2009 S29NS-S_00_02
7.8.1.4
Software Functions and Sample Code
Notes:
1. Last = Last cycle of write buffer program operation; depending on number of words written, the total number of cycles may be from 4 to
2. For maximum efficiency, it is recommended that the write buffer be loaded with the highest number of words (N words) possible.
3. LLD Functions Used = lld_WriteToBufferCmd, lld_ProgramBufferToFlashCmd.
The following is a C source code example of using the write buffer program function. Refer to the Spansion
Low Level Driver User’s Guide (available on www.spansion.com) for general information on Spansion Flash
memory software development guidelines.
Bit-Field Programming Command
The Bit-Field Programming command follows the same format as Page programming but is limited to
programming only locations in the write buffer with word address bit A3=0 (system byte address bit a4=0).
Locations with A3=1 are reserved and must be programmed only with FFFFh. Programming an A3=1 location
with a bit pattern other than FFFFh will result in the program operation failing.
Only Zeros in the data are programmed. Ones are ignored. Programming within a CL that has been
previously programmed will result in the logical AND of the prior CL data and the data being programmed. Bit-
field programming may be done in a page that was previously programmed by the page programming
command and will convert that page to a bit-field programmed page in which future bit-field programming
operations are allowed. However, if the earlier page programming command caused bits in the reserved area
to be programmed to zero, the bit-field programming command may fail. The reserved area is programmed in
a special way by the bit-field programming command. If the reserved area has already had bits set to zero in
3 to 258
Cycle
Last
259.
/* Example: Write Buffer Programming Command
/* NOTES: page programming limited to 256 words. */
/* All addresses to be written to the flash in
/* one operation must be within the same flash
/* page. A flash page begins at addresses
/* evenly divisible by 0x200.
UINT16 *src = source_of_data;
UINT16 *dst = destination_of_data; /* flash destination address */
UINT16 wc = words_to_program;
UINT16 *CAP1 = ((UINT16 *) sector_address + 0x555); /* Define CAP1 */
UINT16 *CAP2 = ((UINT16 *) sector_address + 0xAAA); /* Define CAP2 */
*CAP1 = 0x0025; /* write write buffer load command */
*CAP2 = wc - 1; /* write word count (minus 1)
do
{
} while (wc != 0); /* loop until all words are moved */
*CAP1 = 0x0029; /* write confirm command */
/* poll for completion */
1
2
*dst = *src;
dst++;
src++;
wc--;
Write Buffer to flash Command to CAP1
Write Buffer Load Command to CAP1
D a t a
Write Word Count to CAP2
Description
S h e e t
S29NS-S MirrorBit
/* write all source data to destination */
/* ALL dst MUST BE SAME PAGE
/* increment destination pointer
/* increment source pointer
/* decrement word count
Number of words (N) loaded into the write buffer can be from 1 to 256
( P r e l i m i n a r y )
Table 7.15 Page Program
®
Operation
Eclipse
Write
Write
Write
/* address of source data */
/* word count */
Sector Address + AAAh
Sector Address + 1554h Sector Address + AAAh
Sector Address + AAAh
Flash Family
Byte Address
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Sector Address + 555h
Sector Address + 555h
Word Address
Word Count (N-1)
0025h
0029h
Data
37

Related parts for s29ns01gs