36
S29PL-N MirrorBit
Flash Family
S29PL-N_00_A5 June 6, 2007
D a t a
S h e e t
( P r e l i m i n a r y )
Software Functions and Sample Code
The following are C source code examples of using the unlock bypass entry, program, and exit functions.
Refer to the
Spansion Low Level Driver User’s Guide
(available soon on
www.spansion.com
) for general
information on Spansion Flash memory software development guidelines.
/* Example: Unlock Bypass Entry Command */
*((UINT16 *)bank_addr + 0x555) = 0x00AA; /* write unlock cycle 1 */
*((UINT16 *)bank_addr + 0x2AA) = 0x0055; /* write unlock cycle 2 */
*((UINT16 *)bank_addr + 0x555) = 0x0020; /* write unlock bypass command */
/* At this point, programming only takes two write cycles. */
/* Once you enter Unlock Bypass Mode, do a series of like */
/* operations (programming or sector erase) and then exit */
/* Unlock Bypass Mode before beginning a different type of */
/* operations. */
Table 7.16
Unlock Bypass Program
(LLD Function = lld_UnlockBypassProgramCmd)
/* Example: Unlock Bypass Program Command */
/* Do while in Unlock Bypass Entry Mode! */
*((UINT16 *)bank_addr + 0x555) = 0x00A0; /* write program setup command */
*((UINT16 *)pa) = data; /* write data to be programmed */
/* Poll until done or error. */
/* If done and more to program, */
/* do above two cycles again. */
/* Example: Unlock Bypass Exit Command */
*( (UINT16 *)base_addr + 0x000 ) = 0x0090;
*( (UINT16 *)base_addr + 0x000 ) = 0x0000;
Table 7.15
Unlock Bypass Entry
(LLD Function = lld_UnlockBypassEntryCmd)
Cycle
Description
Operation
Word Address
Data
1
Unlock
Write
Base + 555h
00AAh
2
Unlock
Write
Base + 2AAh
0055h
3
Entry Command
Write
Base + 555h
0020h
Cycle
Description
Operation
Word Address
Data
1
Program Setup Command
Write
Base +xxxh
00A0h
2
Program Command
Write
Program Address
Program Data
Table 7.17
Unlock Bypass Reset
(LLD Function = lld_UnlockBypassResetCmd)
Cycle
Description
Operation
Word Address
Data
1
Reset Cycle 1
Write
Base +xxxh
0090h
2
Reset Cycle 2
Write
Base +xxxh
0000h